fuzzy7k
unread,Dec 23, 2011, 4:41:45 PM12/23/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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);