diff options
author | Daniel Hillenbrand <codeworkx@cyanogenmod.com> | 2012-06-24 21:42:48 +0400 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.cyanogenmod.com> | 2012-06-24 21:42:48 +0400 |
commit | 88f88a71a933349ceb96dfe9eba398a31d62b4c4 (patch) | |
tree | 47355f70cf4fb763f306d37367f193b4ffbe8bc8 | |
parent | 90d35f4ff0e8fee126e89fd23aff91f00a5ee83a (diff) | |
parent | ec93c0e204688a2d9f4d43e6861f20f1e8aea916 (diff) | |
download | frameworks_base-88f88a71a933349ceb96dfe9eba398a31d62b4c4.zip frameworks_base-88f88a71a933349ceb96dfe9eba398a31d62b4c4.tar.gz frameworks_base-88f88a71a933349ceb96dfe9eba398a31d62b4c4.tar.bz2 |
Merge "framework: customizable kill app via back key timeout" into ics
-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); } } } |