diff options
author | Daniel Bateman <jetison.24@gmail.com> | 2012-06-19 20:53:23 -0500 |
---|---|---|
committer | Daniel Bateman <jetison.24@gmail.com> | 2012-06-23 19:41:06 -0500 |
commit | ec93c0e204688a2d9f4d43e6861f20f1e8aea916 (patch) | |
tree | 6a184e41416c3062382583b27b913b8a99ea9ead | |
parent | 740a737b8e9d64a6749c3786ad741be12453bdcf (diff) | |
download | frameworks_base-ec93c0e204688a2d9f4d43e6861f20f1e8aea916.zip frameworks_base-ec93c0e204688a2d9f4d43e6861f20f1e8aea916.tar.gz frameworks_base-ec93c0e204688a2d9f4d43e6861f20f1e8aea916.tar.bz2 |
framework: customizable kill app via back key timeout
Allows the time it takes for the back key to kill an app
to be customized via overlay.
Change-Id: Iaa43f81ee448ae7a7663254a830011a0bca5e60f
-rwxr-xr-x | core/res/res/values/config.xml | 4 | ||||
-rwxr-xr-x | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 479f81a..4185659 100755 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -828,4 +828,8 @@ config to 7. --> <integer name="config_deviceHardwareKeys">15</integer> + <!-- Timeout in MS for how long you have to long-press the back key to + kill the foreground app. --> + <integer name="config_backKillTimeout">2000</integer> + </resources> diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 9094f85..933a3a3 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -367,6 +367,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { static final int DEFAULT_ACCELEROMETER_ROTATION = 0; int mAccelerometerDefault = DEFAULT_ACCELEROMETER_ROTATION; boolean mHasSoftInput = false; + int mBackKillTimeout; int mPointerLocationMode = 0; PointerLocationView mPointerLocationView = null; @@ -993,6 +994,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { com.android.internal.R.integer.config_lidKeyboardAccessibility); mLidNavigationAccessibility = mContext.getResources().getInteger( com.android.internal.R.integer.config_lidNavigationAccessibility); + mBackKillTimeout = mContext.getResources().getInteger( + com.android.internal.R.integer.config_backKillTimeout); // register for dock events IntentFilter filter = new IntentFilter(); filter.addAction(UiModeManager.ACTION_ENTER_CAR_MODE); @@ -1894,7 +1897,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.KILL_APP_LONGPRESS_BACK, 0) == 1) { if (down && repeatCount == 0) { - mHandler.postDelayed(mBackLongPress, 2000); + mHandler.postDelayed(mBackLongPress, mBackKillTimeout); } } } |