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();
}
}
+ /**
+ * 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) {
int navigationPresence) {
mHaveBuiltInKeyboard = (keyboardPresence & PRESENCE_INTERNAL) != 0;
+ readConfigurationDependentBehaviors();
readLidState();
applyLidSwitchState();