I would like to change the behavior of my Android system when user clicks the power button.
The default behavior is to turn the screen off and on. I need to make this button act as an Android HOME button (going to Home).
Has anyone already modified the behavior of this button? Which .c file should I edit in the BSP source code to achieve my needs?
Im using Adeneo's Android BSP v4.1 (last Gingerbread version).
Any hints would be much appreciated!
I have found some interesting files inside Android file system:
Contains some .kl files which describes keys and actions. Where should I edit in my BSP source code to change this files after recompiling BSP? The /system is a read-only file system, so I cannot edit it through adb.
Thanks for your help.
Here’s what I’ve tried up to now:
- Look at the src/kernel_imx/arch/arm/mach_mx5/mx53_loco.c file
- Look at the src/kernel_imx/drivers/input/keyboard/mxc_pwrkey.c file
- Look at the src/kernel_imx/drivers/input/input.c file
Where is the callback function (the final one, because I could see this event is being thrown to many handlers and none of them actually handles it, just pass it to a next handler) for those events? Please, help me finding and implementing what I need.
Thank you for your reply.
I will try remounting, but its not a good solution. A good solution would be to modify BSP source code and rebuild Android image.
I have already checked the schematics. I know power button is controlled by GPIO_8, but I cannot find where its actions are defined in the source code.
You can edit /system through adb. You should remount this partition with rw rights.
mount -o rw,remount /dev/block/mmcblk0p2 /system
"/dev/block/mmcblk0p2" you should check this partition if had it. type mount , and you will see current mounting points.
Check shematics of imx53 board , track lane of this button, may be it will lead you to some conclusions