From a5b8f3f49b309b473f65fcc4a2362524494a430b Mon Sep 17 00:00:00 2001 From: PaulK Date: Thu, 19 Apr 2012 13:03:11 +0200 Subject: Added home on longpress back option Change-Id: Ibb5f4a6e8756b393f9d4f5ef5060aaf60bcaeade --- core/java/android/provider/CmSystem.java | 6 ++++++ core/res/res/values/config.xml | 5 +++++ policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/core/java/android/provider/CmSystem.java b/core/java/android/provider/CmSystem.java index 5644a8b..6e98f15 100644 --- a/core/java/android/provider/CmSystem.java +++ b/core/java/android/provider/CmSystem.java @@ -61,6 +61,8 @@ public final class CmSystem { public static final int CM_DEFAULT_REMAPPED_BOTH_VOL_INDEX=20; public static final int CM_DEFAULT_REMAPPED_LONG_BOTH_VOL_INDEX=21; + public static final int CM_DEFAULT_HOME_ON_LONGPRESS_BACK=22; + // not a keycode, so negative value can never be considered keycode - user -1, -2, -3... // used in PhoneWindowManager public static final int VOLUME_ACTION_LONG_HOME = -1; @@ -309,6 +311,10 @@ public final class CmSystem { resId=R.bool.cm_default_reverse_volume_behavior; break; + case CM_DEFAULT_HOME_ON_LONGPRESS_BACK: + resId=R.bool.cm_default_home_on_longpress_back; + break; + // integer values case CM_DEFAULT_UNHIDE_BUTTON_INDEX: resId=R.integer.cm_default_unhide_button_index; diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 07de23c..d2156ee 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -544,6 +544,11 @@ combinations will need this too. --> false + + false + false diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 6ee08a7..b0a306d 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -576,7 +576,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { public void run() { if (Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.KILL_APP_LONGPRESS_BACK, 0) == 0) { - // Bail out unless the user has elected to turn this on. + + if(CmSystem.getDefaultBool(mContext, CmSystem.CM_DEFAULT_HOME_ON_LONGPRESS_BACK) == true) { + goHome(); + } + return; } try { -- cgit v1.1