summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulK <contact@paulk.fr>2012-04-19 13:03:11 +0200
committerPaul Kocialkowski <contact@paulk.fr>2012-07-09 12:58:21 +0200
commita5b8f3f49b309b473f65fcc4a2362524494a430b (patch)
tree19c82d6f9672bc3cbac228f294f463173c20155a
parent878f3e43a6fc0de01a0bfa251c363a6a94f9f242 (diff)
downloadframeworks_base-replicant-2.3.zip
frameworks_base-replicant-2.3.tar.gz
frameworks_base-replicant-2.3.tar.bz2
Added home on longpress back optionreplicant-2.3
Change-Id: Ibb5f4a6e8756b393f9d4f5ef5060aaf60bcaeade
-rw-r--r--core/java/android/provider/CmSystem.java6
-rw-r--r--core/res/res/values/config.xml5
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java6
3 files changed, 16 insertions, 1 deletions
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. -->
<bool name="cm_default_recentapps_tablet_workaround">false</bool>
+ <!-- toggles behavior of longpress on back button. default (false) triggers
+ nothing (or kills the current app). enabling (true) this options triggers
+ home screen. -->
+ <bool name="cm_default_home_on_longpress_back">false</bool>
+
<!-- Set this to true to get data working on some Motorola phones -->
<bool name="config_rilNeedsNullPath">false</bool>
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 {