diff options
author | nebkat <nebkat@teamhacksung.org> | 2012-06-14 18:07:34 +0200 |
---|---|---|
committer | nebkat <nebkat@teamhacksung.org> | 2012-06-14 18:07:34 +0200 |
commit | f273de53b2c5a8ca8fa992c956246671209a0b28 (patch) | |
tree | 624fa2673a522f04b5c677b420f272ea1735ed7e /policy | |
parent | 8e5a6d0ba382c6ab265fe7a4b61596f00d1da6ce (diff) | |
download | frameworks_base-f273de53b2c5a8ca8fa992c956246671209a0b28.zip frameworks_base-f273de53b2c5a8ca8fa992c956246671209a0b28.tar.gz frameworks_base-f273de53b2c5a8ca8fa992c956246671209a0b28.tar.bz2 |
Long-press back kill app cleanup
Change-Id: Ida791dca1fbfdc2beccf6ff727b67df56f1956a4
Diffstat (limited to 'policy')
-rwxr-xr-x | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 12 |
1 files changed, 6 insertions, 6 deletions
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); } } } |