diff options
author | Jim Miller <jaggies@google.com> | 2013-06-25 18:31:56 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2013-06-27 15:58:29 -0700 |
commit | e51cf7aeb6157017801a802b4c1d74cbf51b7a01 (patch) | |
tree | 6ea2731697eb9e31bac00b1f35445cf62e48c472 /policy/src | |
parent | 5729b81ab56379e3b8736a2c716421e185756460 (diff) | |
download | frameworks_base-e51cf7aeb6157017801a802b4c1d74cbf51b7a01.zip frameworks_base-e51cf7aeb6157017801a802b4c1d74cbf51b7a01.tar.gz frameworks_base-e51cf7aeb6157017801a802b4c1d74cbf51b7a01.tar.bz2 |
Simplify wake management code in keyguard.
Removes onWakeKey/Motion handling from keyguard since it's no longer used.
The legacy code was originally intended to have keyguard filter wake events
which is now done in PhoneWindowManager. Ultimately it just needs to call
PowerManager.wakeUp() since keyguard no longer filters these keys.
Change-Id: I5b8ef9b422abf850a85b57f21944e5eb09fbedc2
Diffstat (limited to 'policy/src')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 22 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java | 14 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceWrapper.java (renamed from policy/src/com/android/internal/policy/impl/KeyguardServiceWrapper.java) | 18 |
3 files changed, 5 insertions, 49 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 56d0ec0..0b8b028 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -3523,11 +3523,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { updateRotation(true); if (lidOpen) { - if (keyguardIsShowingTq()) { - mKeyguardDelegate.onWakeKeyWhenKeyguardShowingTq(KeyEvent.KEYCODE_POWER); - } else { - mPowerManager.wakeUp(SystemClock.uptimeMillis()); - } + mPowerManager.wakeUp(SystemClock.uptimeMillis()); } else if (!mLidControlsSleep) { mPowerManager.userActivity(SystemClock.uptimeMillis(), false); } @@ -3745,13 +3741,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // to wake the device but don't pass the key to the application. result = 0; if (down && isWakeKey && isWakeKeyWhenScreenOff(keyCode)) { - if (keyguardActive) { - // If the keyguard is showing, let it wake the device when ready. - mKeyguardDelegate.onWakeKeyWhenKeyguardShowingTq(keyCode); - } else { - // Otherwise, wake the device ourselves. - result |= ACTION_WAKE_UP; - } + result |= ACTION_WAKE_UP; } } @@ -4017,13 +4007,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { final boolean isWakeMotion = (policyFlags & (WindowManagerPolicy.FLAG_WAKE | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0; if (isWakeMotion) { - if (mKeyguardDelegate != null && mKeyguardDelegate.isShowing()) { - // If the keyguard is showing, let it decide what to do with the wake motion. - mKeyguardDelegate.onWakeMotionWhenKeyguardShowing(); - } else { - // Otherwise, wake the device ourselves. - result |= ACTION_WAKE_UP; - } + result |= ACTION_WAKE_UP; } return result; } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java index 2bb94be..874076a 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceDelegate.java @@ -12,6 +12,7 @@ import android.os.RemoteException; import android.os.UserHandle; import android.util.Log; import android.util.Slog; +import android.view.KeyEvent; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; @@ -21,7 +22,6 @@ import com.android.internal.policy.IKeyguardExitCallback; import com.android.internal.policy.IKeyguardShowCallback; import com.android.internal.policy.IKeyguardService; import com.android.internal.widget.LockPatternUtils; -import com.android.internal.policy.impl.KeyguardServiceWrapper; /** * A local class that keeps a cache of keyguard state that can be restored in the event @@ -178,18 +178,6 @@ public class KeyguardServiceDelegate { return mKeyguardState.secure; } - public void onWakeKeyWhenKeyguardShowingTq(int keycodePower) { - if (mKeyguardService != null) { - mKeyguardService.onWakeKeyWhenKeyguardShowing(keycodePower); - } - } - - public void onWakeMotionWhenKeyguardShowing() { - if (mKeyguardService != null) { - mKeyguardService.onWakeMotionWhenKeyguardShowing(); - } - } - public void onDreamingStarted() { if (mKeyguardService != null) { mKeyguardService.onDreamingStarted(); diff --git a/policy/src/com/android/internal/policy/impl/KeyguardServiceWrapper.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceWrapper.java index e649125..6b9c7df 100644 --- a/policy/src/com/android/internal/policy/impl/KeyguardServiceWrapper.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardServiceWrapper.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.internal.policy.impl; +package com.android.internal.policy.impl.keyguard; import android.os.Bundle; import android.os.IBinder; @@ -115,22 +115,6 @@ public class KeyguardServiceWrapper implements IKeyguardService { } } - public void onWakeKeyWhenKeyguardShowing(int keyCode) { - try { - mService.onWakeKeyWhenKeyguardShowing(keyCode); - } catch (RemoteException e) { - Slog.w(TAG , "Remote Exception", e); - } - } - - public void onWakeMotionWhenKeyguardShowing() { - try { - mService.onWakeMotionWhenKeyguardShowing(); - } catch (RemoteException e) { - Slog.w(TAG , "Remote Exception", e); - } - } - public void onDreamingStarted() { try { mService.onDreamingStarted(); |