resume from suspend

3,486 views
Skip to first unread message

fuzzy7k

unread,
Dec 23, 2011, 4:41:45 PM12/23/11
to Android-x86
I am trying to get a workaround in place for the sleep, resume, auto-
sleep issue, so that is will just wake up on one button press. If I
hold down a WAKE button it will wake up so I figured if I could add my
own lock during the resume sequence it would stay on. This was an
incorrect assumption. I managed to add a wake lock during resume, but
it does not prevent the system from going back to sleep. This same
wake lock will prevent the system from going to sleep in the first
place, so this tells me that holding a WAKE key does not work because
it creates a wake lock, but because it is continuously triggering
something else.

I also found that pressing a WAKE button and feeling the screen works
in most cases. Usually, on repeated failed attempts to wake up is when
it doesn't work.

So, it seems that the device needs constant attention or it refuses to
wake up and we need some way to spoof this.



Below is some of the code that I've tried adding. I've also tried
changing the timeouts in policy/src/com/android/internal/policy/impl/
PatternUnlockScreen.java to no avail.

diff --git a/policy/src/com/android/internal/policy/impl/
PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/
PhoneWindowManager.java
index ca3d864..d90ce5c 100755
--- a/policy/src/com/android/internal/policy/impl/
PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/
PhoneWindowManager.java
@@ -2266,6 +2266,8 @@ public class PhoneWindowManager implements
WindowManagerPolicy {
final boolean isWakeKey = (policyFlags
& (WindowManagerPolicy.FLAG_WAKE |
WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0;
if (down && isWakeKey) {
+ mKeyguardMediator.pokeWakelock(30000);
+ mPowerManager.userActivity(SystemClock.uptimeMillis(),
false, LocalPowerManager.BUTTON_EVENT);
+ android.os.SystemProperties.set("sys.power.state",
"waking");
if (keyguardActive) {
// If the keyguard is showing, let it decide what
to do with the wake key.

mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(keyCode);

fuzzy7k

unread,
Dec 26, 2011, 10:36:08 AM12/26/11
to Android-x86
Ok, I discovered a workaround for this bug over on the android-porting
forum.

http://groups.google.com/group/android-porting/browse_thread/thread/f85e79e292e8ce55/945ce5ebe668fcd5?

On Dec 23, 4:41 pm, fuzzy7k <kvan...@gmail.com> wrote:
> I am trying to get a workaround in place for the sleep,resume, auto-
> sleep issue, so that is will just wake up on one button press. If I
> hold down a WAKE button it will wake up so I figured if I could add my
> own lock during theresumesequence it would stay on. This was an
> incorrect assumption. I managed to add a wake lock duringresume, but

Christopher Hrabia

unread,
Dec 27, 2011, 5:55:22 AM12/27/11
to andro...@googlegroups.com
Hello fuzzy7k,
do you have integrated that workaround? Is it working? Could you give further detail how you did it?

2011/12/26 fuzzy7k <kva...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-x86...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.




--
Mit freundlichen Grüßen
Christopher Hrabia

fuzzy7k

unread,
Dec 27, 2011, 11:14:21 AM12/27/11
to Android-x86
Yeah, it works. The kernel needs patched with the three lines in the
link before building the image. So, it will only benefit future
releases.

On Dec 27, 5:55 am, Christopher Hrabia <c.hra...@gmail.com> wrote:
> Hello fuzzy7k,
> do you have integrated that workaround? Is it working? Could you give
> further detail how you did it?
>
> 2011/12/26 fuzzy7k <kvan...@gmail.com>
>
>
>
> > Ok, I discovered a workaround for this bug over on the android-porting
> > forum.
>
> >http://groups.google.com/group/android-porting/browse_thread/thread/f...
> > ?
> (c.hra...@gmail.com)

Christopher Hrabia

unread,
Dec 27, 2011, 7:16:01 PM12/27/11
to andro...@googlegroups.com
Hello fuzzy,
I patched my kernel with the three lines from the link above for my custom build and have following results:
- I could wakeup from suspend by clicking onetime a key <<Good
- But I could not pass the lock-screen from honeycomb by touchscreen or mouse because no response from both devices <<Not good

Any ideas or advices?


2011/12/27 fuzzy7k <kva...@gmail.com>

fuzzy7k

unread,
Dec 27, 2011, 7:44:10 PM12/27/11
to Android-x86
Sort of sounds like your device drivers do not play well with suspend.
Try switching to the terminal and modprobe the drivers for your
devices.

On Dec 27, 7:16 pm, Christopher Hrabia <c.hra...@gmail.com> wrote:
> Hello fuzzy,
> I patched my kernel with the three lines from the link above for my custom
> build and have following results:
> - I could wakeup from suspend by clicking onetime a key <<Good
> - But I could not pass the lock-screen from honeycomb by touchscreen or
> mouse because no response from both devices <<Not good
>
> Any ideas or advices?
>
> 2011/12/27 fuzzy7k <kvan...@gmail.com>
> (c.hra...@gmail.com)

Christopher Hrabia

unread,
Dec 28, 2011, 7:16:26 AM12/28/11
to andro...@googlegroups.com
Mmh I think my description was not good. After resuming at least the mouse seems to work because I could move the pointer, but I could not move the icon on the unlock screen.

Which target and kernel are you using? 

Best regards
Christopher

2011/12/28 fuzzy7k <kva...@gmail.com>

fuzzy7k

unread,
Dec 28, 2011, 8:11:33 AM12/28/11
to Android-x86
hm, you are right, I hadn't noticed because it works for me upon the
second tap. It seems part of the original bug is still causing grief.
I say this because taping the screen once or pressing a key after the
initial wakeup key is pressed then allows me to slide the unlock.


On Dec 28, 7:16 am, Christopher Hrabia <c.hra...@gmail.com> wrote:
> Mmh I think my description was not good. After resuming at least the mouse
> seems to work because I could move the pointer, but I could not move the
> icon on the unlock screen.
>
> Which target and kernel are you using?
>
> Best regards
> Christopher
>
> 2011/12/28 fuzzy7k <kvan...@gmail.com>
> (c.hra...@gmail.com)

beyounn

unread,
Jan 4, 2012, 3:06:24 AM1/4/12
to Android-x86
It does not work for me at all. I tested tegav2 with the latest code,
my device does not get into sleep. It tried to sleep, but just hang
with a shell prompt. Need to dig more on this, it is still more like a
kernel issue.
Reply all
Reply to author
Forward
0 new messages