turning off android power management

1,767 views
Skip to first unread message

pavan savoy

unread,
Feb 19, 2009, 4:33:25 AM2/19/09
to android...@googlegroups.com
Earlier android kernel code, had a .config option of ANDROID_PM, what has it been replaced with ?

What should I do, if I don't want the "Freezing user space processes...", "Syncing file systems..." kind of power management suspend states?
[apart from disabling PM on kernel itself...]


Also I have an console based application which would like itself to be run for a while, however I see that some Power manager [activity manager or something... I am not too familiar with java/c++ of android...] is causing the suspend state which causes my application to freeze as well...

Any ideas ?

regards,
Pavan

aow

unread,
Feb 20, 2009, 2:05:39 AM2/20/09
to android-porting
A simple way to turn off android power management:
edited kernel\drivers\android\power.c
static void android_power_suspend(struct work_struct *work)
{
int entry_event_num;
int ret;
int wait = 0;
android_early_suspend_t *pos;
int print_locks;
unsigned long irqflags;
return;/*add this,then android will not enter in sleep state,just do
this,try it in your code*/
while(g_user_suspend_state != USER_AWAKE) {
......

pavan savoy

unread,
Feb 20, 2009, 2:13:25 AM2/20/09
to android...@googlegroups.com
humn, thanks...

but tell me .. what if I disable the kernel PM itself... that will surely do .. it. ..
but yeah... anyway can't change the kernel.. uImage.. given to me.. have to make it work without changing it..

So was looking for sysfs entries/ proc entries or ways of killing suspend or something...

neo.d...@gmail.com

unread,
Feb 21, 2009, 12:24:23 AM2/21/09
to android...@googlegroups.com
Just do following on ur debug terminal 

echo WAKE_LOCK_SUSPEND > /sys/power/wake_lock


This will disable system wide suspend ..

-Girish

Yu, Max A

unread,
Feb 22, 2009, 4:48:09 AM2/22/09
to android...@googlegroups.com
Setting the "Screen off time" to "never" in "Settings->Sound and Display" also works.


From: android...@googlegroups.com [mailto:android...@googlegroups.com] On Behalf Of neo.d...@gmail.com
Sent: 2009年2月21日 13:24
To: android...@googlegroups.com
Subject: [android-porting] Re: turning off android power management

pavan savoy

unread,
Feb 23, 2009, 5:02:06 AM2/23/09
to android...@googlegroups.com
So,

echo WAKE_LOCK_SUSPEND > /sys/power/wake_lock

how do I undo this ?
echo WAKE_LOCK_SUSPEND > /sys/power/wake_unlock should work ?

regards,
Pavan

pavan savoy

unread,
Feb 23, 2009, 5:21:51 AM2/23/09
to android...@googlegroups.com
ok ...

something like

echo my_lock > /sys/power/wake_lock
will prevent suspend state.....

and
echo my_lock > /sys/power/wake_unlock

will enable it back....thereby "resumes the suspend"

regards,
Pavan

girish

unread,
Feb 23, 2009, 11:19:33 AM2/23/09
to android...@googlegroups.com
Yes, you got it right ..
Reply all
Reply to author
Forward
0 new messages