diff options
author | Daniel Hillenbrand <codeworkx@cyanogenmod.com> | 2012-06-19 10:58:09 +0400 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.cyanogenmod.com> | 2012-06-19 10:58:09 +0400 |
commit | 3347c890ee8c1a4b66e8782ad8509040189a4951 (patch) | |
tree | fcf15067c6e4c70f88a491fe6dac6c9f91afa2e7 | |
parent | e9f9caf8ea1dd122096d5430b9e2baa4f8485287 (diff) | |
parent | f273de53b2c5a8ca8fa992c956246671209a0b28 (diff) | |
download | frameworks_base-3347c890ee8c1a4b66e8782ad8509040189a4951.zip frameworks_base-3347c890ee8c1a4b66e8782ad8509040189a4951.tar.gz frameworks_base-3347c890ee8c1a4b66e8782ad8509040189a4951.tar.bz2 |
Merge "Long-press back kill app cleanup" into ics
-rwxr-xr-x | core/res/res/values/strings.xml | 2 | ||||
-rwxr-xr-x | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 7a49539..087aeb3 100755 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -3441,7 +3441,7 @@ <!-- STK setup Call --> <string name="SetupCallDefault">Accept Call?</string> - <!--Application killed toast --> + <!-- Long-press back kill application --> <string name="app_killed_message">Application killed</string> <!-- Lock screen Weather - Weather codes --> diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index cf06fbb..9094f85 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -796,8 +796,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { public void run() { try { performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false); - IActivityManager mgr = ActivityManagerNative.getDefault(); - List<RunningAppProcessInfo> apps = mgr.getRunningAppProcesses(); + IActivityManager am = ActivityManagerNative.getDefault(); + List<RunningAppProcessInfo> apps = am.getRunningAppProcesses(); for (RunningAppProcessInfo appInfo : apps) { int uid = appInfo.uid; // Make sure it's a foreground user application (not system, @@ -806,9 +806,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { && appInfo.importance == RunningAppProcessInfo.IMPORTANCE_FOREGROUND) { Toast.makeText(mContext, R.string.app_killed_message, Toast.LENGTH_SHORT).show(); // Kill the entire pid - if (appInfo.pkgList!=null && (apps.size() > 0)){ - mgr.forceStopPackage(appInfo.pkgList[0]); - }else{ + if (appInfo.pkgList != null && (apps.size() > 0)) { + am.forceStopPackage(appInfo.pkgList[0]); + } else { Process.killProcess(appInfo.pid); } break; @@ -1894,7 +1894,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, ViewConfiguration.getGlobalActionKeyTimeout()); + mHandler.postDelayed(mBackLongPress, 2000); } } } |