diff options
author | Bryce Lee <brycelee@google.com> | 2015-03-09 15:49:13 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-03-09 15:49:13 +0000 |
commit | d3b28408d1b9d36c27e4d1cfafe8c3097579961b (patch) | |
tree | d3fc194f24da4472da6cf93e56b43d2fd1f798a0 /services | |
parent | 6dc6876eedde69376be64774e94928f1113858b6 (diff) | |
parent | 168d0ade0cb5a733c83d7dcfdf0a0efa3250cb16 (diff) | |
download | frameworks_base-d3b28408d1b9d36c27e4d1cfafe8c3097579961b.zip frameworks_base-d3b28408d1b9d36c27e4d1cfafe8c3097579961b.tar.gz frameworks_base-d3b28408d1b9d36c27e4d1cfafe8c3097579961b.tar.bz2 |
am 168d0ade: am 1e53b98c: Merge "Allow press and hold from non-interactive." into lmp-mr1-modular-dev
* commit '168d0ade0cb5a733c83d7dcfdf0a0efa3250cb16':
Allow press and hold from non-interactive.
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/policy/PhoneWindowManager.java | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 1e64017..62e7af4 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -539,6 +539,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { private boolean mAllowTheaterModeWakeFromLidSwitch; private boolean mAllowTheaterModeWakeFromWakeGesture; + // Whether to support long press from power button in non-interactive mode + private boolean mSupportLongPressPowerWhenNonInteractive; + // Whether to go to sleep entering theater mode from power button private boolean mGoToSleepOnButtonPressTheaterMode; @@ -885,12 +888,21 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } else { wakeUpFromPowerKey(event.getDownTime()); - final int maxCount = getMaxMultiPressPowerCount(); - if (maxCount <= 1) { - mPowerKeyHandled = true; - } else { + if (mSupportLongPressPowerWhenNonInteractive && hasLongPressOnPowerBehavior()) { + Message msg = mHandler.obtainMessage(MSG_POWER_LONG_PRESS); + msg.setAsynchronous(true); + mHandler.sendMessageDelayed(msg, + ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout()); mBeganFromNonInteractive = true; + } else { + final int maxCount = getMaxMultiPressPowerCount(); + + if (maxCount <= 1) { + mPowerKeyHandled = true; + } else { + mBeganFromNonInteractive = true; + } } } } @@ -1259,6 +1271,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { mGoToSleepOnButtonPressTheaterMode = mContext.getResources().getBoolean( com.android.internal.R.bool.config_goToSleepOnButtonPressTheaterMode); + mSupportLongPressPowerWhenNonInteractive = mContext.getResources().getBoolean( + com.android.internal.R.bool.config_supportLongPressPowerWhenNonInteractive); + mShortPressOnPowerBehavior = mContext.getResources().getInteger( com.android.internal.R.integer.config_shortPressOnPowerBehavior); mLongPressOnPowerBehavior = mContext.getResources().getInteger( |