summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2013-05-31 17:59:11 -0700
committerJeff Brown <jeffbrown@google.com>2013-05-31 17:59:11 -0700
commitf71343ddf0f10db762f1b4ad5717f04742f83b66 (patch)
treed0915ce4b0eeb58e085b173c43c66c0a64d691bf /policy
parent636af7a1cb90bb2f422bc85356d30f5b4e9342e6 (diff)
downloadframeworks_base-f71343ddf0f10db762f1b4ad5717f04742f83b66.zip
frameworks_base-f71343ddf0f10db762f1b4ad5717f04742f83b66.tar.gz
frameworks_base-f71343ddf0f10db762f1b4ad5717f04742f83b66.tar.bz2
Fix regression in long-press home behavior on tablets.
Some config.xml resources have values that vary based on the configuration. A previous change caused initialization to occur at a time when the configuration is was not yet available. This change fixes the problem. Bug: 8891502 Change-Id: Ia768dc2308cc6ae5f11812c6bce6a6e116cfd759
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java37
1 files changed, 23 insertions, 14 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index a4275a3..b0cd11ae 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -885,20 +885,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
com.android.internal.R.integer.config_lidNavigationAccessibility);
mLidControlsSleep = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_lidControlsSleep);
-
- mLongPressOnHomeBehavior = mContext.getResources().getInteger(
- com.android.internal.R.integer.config_longPressOnHomeBehavior);
- if (mLongPressOnHomeBehavior < LONG_PRESS_HOME_NOTHING ||
- mLongPressOnHomeBehavior > LONG_PRESS_HOME_ASSIST) {
- mLongPressOnHomeBehavior = LONG_PRESS_HOME_NOTHING;
- }
-
- mDoubleTapOnHomeBehavior = mContext.getResources().getInteger(
- com.android.internal.R.integer.config_doubleTapOnHomeBehavior);
- if (mDoubleTapOnHomeBehavior < DOUBLE_TAP_HOME_NOTHING ||
- mDoubleTapOnHomeBehavior > DOUBLE_TAP_HOME_RECENT_SYSTEM_UI) {
- mDoubleTapOnHomeBehavior = LONG_PRESS_HOME_NOTHING;
- }
+ readConfigurationDependentBehaviors();
// register for dock events
IntentFilter filter = new IntentFilter();
@@ -952,6 +939,27 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
}
+ /**
+ * Read values from config.xml that may be overridden depending on
+ * the configuration of the device.
+ * eg. Disable long press on home goes to recents on sw600dp.
+ */
+ private void readConfigurationDependentBehaviors() {
+ mLongPressOnHomeBehavior = mContext.getResources().getInteger(
+ com.android.internal.R.integer.config_longPressOnHomeBehavior);
+ if (mLongPressOnHomeBehavior < LONG_PRESS_HOME_NOTHING ||
+ mLongPressOnHomeBehavior > LONG_PRESS_HOME_ASSIST) {
+ mLongPressOnHomeBehavior = LONG_PRESS_HOME_NOTHING;
+ }
+
+ mDoubleTapOnHomeBehavior = mContext.getResources().getInteger(
+ com.android.internal.R.integer.config_doubleTapOnHomeBehavior);
+ if (mDoubleTapOnHomeBehavior < DOUBLE_TAP_HOME_NOTHING ||
+ mDoubleTapOnHomeBehavior > DOUBLE_TAP_HOME_RECENT_SYSTEM_UI) {
+ mDoubleTapOnHomeBehavior = LONG_PRESS_HOME_NOTHING;
+ }
+ }
+
@Override
public void setInitialDisplaySize(Display display, int width, int height, int density) {
if (display.getDisplayId() != Display.DEFAULT_DISPLAY) {
@@ -1332,6 +1340,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
int navigationPresence) {
mHaveBuiltInKeyboard = (keyboardPresence & PRESENCE_INTERNAL) != 0;
+ readConfigurationDependentBehaviors();
readLidState();
applyLidSwitchState();