From ec93c0e204688a2d9f4d43e6861f20f1e8aea916 Mon Sep 17 00:00:00 2001 From: Daniel Bateman Date: Tue, 19 Jun 2012 20:53:23 -0500 Subject: 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 --- core/res/res/values/config.xml | 4 ++++ policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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. --> 15 + + 2000 + 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); } } } -- cgit v1.1