I have a good news: I think that now I am on the right track, but I need a little suggestions about how to proceed:
IF I touch the screen (my device has a touch-screen driver working fine with ANDROID) when ANDROID system is resuming due to the pressure of the "on/off" physical-hardware button (that is my wakeup source), then the ANDROID system stays ON, so it doesn't go back to suspend. So how can I produce the same behavior by software? My resume code, that is my_platform_pm_enter_sleep routine statically linked to the kernel, is able to recognize that the wakeup source is the "on/off" hardware button, so what kind of notification should I send to Android PowerManagerService in order to make it write 'on' to the /sys/power/state file? Marco On Apr 11, 6:35 pm, Ventanas <guerreromarc...@gmail.com> wrote: > I have found a way to trace from libhardware_legacy/power.c, sorry, it > was simpler than what I thought, I'm using logcat through serial port. > > And now I can see that power.c is able to write to /sys/power/state, > but again the problem is that when resuming it doesn't write "on" to > "state". > > M > > On Apr 11, 5:56 pm, Ventanas <guerreromarc...@gmail.com> wrote: > > > > > > > > > I've checked one more time the power.c code, and the fact that /sys/ > > android_power doesn't exist should not be a problem as it is the old > > device driver for android power management in the linux kernel, while > > the newer is named /sys/power > > > but I have an idea: as libhardware_legacy.so is not able to open/write > > to /dev/kmsg, maybe it is also not able to open/write to /sys/power/ > > state, maybe is this the root cause? > > > On Apr 11, 5:28 pm, Ventanas <guerreromarc...@gmail.com> wrote: > > > > another problem: power.c wants to write to this file: /sys/ > > > android_power/auto_off_timeout > > > > I don't see the android_power directory in the sysfs, ? > > > > what is missing??? > > > > On Apr 11, 4:59 pm, Manjeet Pawar <mpchapmanj...@gmail.com> wrote: > > > > > Y dont u use procfs or ioctl...to check whats goin on inside... > > > > > On Wed, Apr 11, 2012 at 8:17 PM, Ventanas <guerreromarc...@gmail.com> > > > > wrote: > > > > > found that errno is always 13, that is EACCES, so access no Permission > > > > > denied, so what can I do? > > > > > M > > > > > > On Apr 11, 4:36 pm, Ventanas <guerreromarc...@gmail.com> wrote: > > > > > > ok, I am trying to debug the libhardware_legacy.so library that > > > > > > contains the power.c 'C'-code module that interacts with the linux- > > > > > > kernel power manager, but I have this problem: > > > > > > > I want to open the /dev/kmsg file and write to it, but I get always > > > > > > -1, do you know why I cannot open("/dev/kmsg", O_WRONLY); from this > > > > > > module? > > > > > > > while I can from a classic 'C' main-program in user mode. > > > > > > > Marco > > > > > > -- > > > > > unsubscribe: android-kernel+unsubscr...@googlegroups.com > > > > > website:http://groups.google.com/group/android-kernel -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel