Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3347c890 authored by Daniel Hillenbrand's avatar Daniel Hillenbrand Committed by Gerrit Code Review
Browse files

Merge "Long-press back kill app cleanup" into ics

parents e9f9caf8 f273de53
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 -->
+6 −6
Original line number Diff line number Diff line
@@ -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,
@@ -807,7 +807,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                        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]);
                            am.forceStopPackage(appInfo.pkgList[0]);
                        } else {
                            Process.killProcess(appInfo.pid);
                        }
@@ -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);
                }
            }
        }