From 4139b5505c1e07c56900aa72dd91a01e6b740f5f Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Thu, 7 Oct 2010 18:01:32 -0700 Subject: [PATCH] Fix 3061025: Extend wave lockscreen timeout while grabbed. This fix extends the lockscreen timeout to 30s while the handle is being held. As a precaution, it will still timeout after 30s of not completing the lock. Once the handle is released, the screen will go dark after 5s, which gives it enough time to finish pending animations. Change-Id: Ie89449b6b09de06ca8a88702cc85085b2556903c --- .../com/android/internal/policy/impl/LockScreen.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/policy/src/com/android/internal/policy/impl/LockScreen.java b/policy/src/com/android/internal/policy/impl/LockScreen.java index 3583ab9f261e3..1383354b97f1f 100644 --- a/policy/src/com/android/internal/policy/impl/LockScreen.java +++ b/policy/src/com/android/internal/policy/impl/LockScreen.java @@ -214,6 +214,9 @@ class LockScreen extends LinearLayout implements KeyguardScreen, } class WaveViewMethods implements WaveView.OnTriggerListener { + private static final int WAIT_FOR_ANIMATION_TIMEOUT = 500; + private static final int STAY_ON_WHILE_GRABBED_TIMEOUT = 30000; + /** {@inheritDoc} */ public void onTrigger(View v, int whichHandle) { if (whichHandle == WaveView.OnTriggerListener.CENTER_HANDLE) { @@ -222,13 +225,17 @@ class LockScreen extends LinearLayout implements KeyguardScreen, public void run() { mCallback.goToUnlockScreen(); } - }, 500); + }, WAIT_FOR_ANIMATION_TIMEOUT); } } /** {@inheritDoc} */ public void onGrabbedStateChange(View v, int grabbedState) { - mCallback.pokeWakelock(); + if (grabbedState == WaveView.OnTriggerListener.CENTER_HANDLE) { + mCallback.pokeWakelock(STAY_ON_WHILE_GRABBED_TIMEOUT); + } else { + mCallback.pokeWakelock(); + } } }