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

Commit 88f88a71 authored by Daniel Hillenbrand's avatar Daniel Hillenbrand Committed by Gerrit Code Review
Browse files

Merge "framework: customizable kill app via back key timeout" into ics

parents 90d35f4f ec93c0e2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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>
+4 −1
Original line number Diff line number Diff line
@@ -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);
                }
            }
        }