diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 53c7edace9c20..702dc74f77480 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -8044,17 +8044,6 @@ public final class Settings { private static final Validator CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; - /** - * Whether the swipe up gesture to switch apps should be enabled. - * - * @hide - */ - public static final String SWIPE_UP_TO_SWITCH_APPS_ENABLED = - "swipe_up_to_switch_apps_enabled"; - - private static final Validator SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR = - BOOLEAN_VALIDATOR; - /** * Whether or not the smart camera lift trigger that launches the camera when the user moves * the phone into a position for taking photos should be enabled. @@ -8739,7 +8728,6 @@ public final class Settings { DISPLAY_WHITE_BALANCE_ENABLED, SYNC_PARENT_SOUNDS, CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, - SWIPE_UP_TO_SWITCH_APPS_ENABLED, CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, SYSTEM_NAVIGATION_KEYS_ENABLED, QS_TILES, @@ -8902,8 +8890,6 @@ public final class Settings { VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR); VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR); - VALIDATORS.put(SWIPE_UP_TO_SWITCH_APPS_ENABLED, - SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR); VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR); VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED, diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 9db75f2827a08..dc0ec03ca7a23 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -3760,9 +3760,6 @@ com.android.managedprovisioning - - false - false diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 7ec5b5b5a4b9a..ae54a6aa41107 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -3515,7 +3515,6 @@ - diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java index de7202cc63f94..e374db310737f 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java @@ -2410,12 +2410,6 @@ class SettingsProtoDumpUtil { Settings.Secure.WAKE_GESTURE_ENABLED, SecureSettingsProto.WAKE_GESTURE_ENABLED); - final long launcherToken = p.start(SecureSettingsProto.LAUNCHER); - dumpSetting(s, p, - Settings.Secure.SWIPE_UP_TO_SWITCH_APPS_ENABLED, - SecureSettingsProto.Launcher.SWIPE_UP_TO_SWITCH_APPS_ENABLED); - p.end(launcherToken); - final long zenToken = p.start(SecureSettingsProto.ZEN); dumpSetting(s, p, Settings.Secure.ZEN_DURATION, diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index e8d726ed715a6..4b342b37ac20e 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -4329,7 +4329,7 @@ public class SettingsProvider extends ContentProvider { // Migrate the swipe up setting only if it is set final SettingsState secureSettings = getSecureSettingsLocked(userId); final Setting swipeUpSetting = secureSettings.getSettingLocked( - Secure.SWIPE_UP_TO_SWITCH_APPS_ENABLED); + "swipe_up_to_switch_apps_enabled"); if (swipeUpSetting != null && !swipeUpSetting.isNull()) { navBarMode = swipeUpSetting.getValue().equals("1") ? NAV_BAR_MODE_2BUTTON diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/NavigationBarCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/NavigationBarCompat.java index b363b4a242e1d..8d6f830c6d8ed 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/NavigationBarCompat.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/NavigationBarCompat.java @@ -21,12 +21,8 @@ import android.annotation.IntDef; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -/** - * TODO: Remove this class - */ public class NavigationBarCompat extends QuickStepContract { - @Retention(RetentionPolicy.SOURCE) @IntDef({HIT_TARGET_NONE, HIT_TARGET_BACK, HIT_TARGET_HOME, HIT_TARGET_OVERVIEW}) public @interface HitTarget{} @@ -59,4 +55,6 @@ public class NavigationBarCompat extends QuickStepContract { * Interaction type: show/hide the overview button while this service is connected to launcher */ public static final int FLAG_SHOW_OVERVIEW_BUTTON = 0x4; + + } diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java index 6d7abd0898619..46f4c8689196e 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java @@ -16,7 +16,13 @@ package com.android.systemui.shared.system; +import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_2BUTTON; +import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON; +import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; + +import android.content.Context; import android.content.res.Resources; +import android.view.WindowManagerPolicyConstants; /** * Various shared constants between Launcher and SysUI as part of quickstep @@ -28,6 +34,13 @@ public class QuickStepContract { public static final String KEY_EXTRA_WINDOW_CORNER_RADIUS = "extra_window_corner_radius"; public static final String KEY_EXTRA_SUPPORTS_WINDOW_CORNERS = "extra_supports_window_corners"; + public static final String NAV_BAR_MODE_2BUTTON_OVERLAY = + WindowManagerPolicyConstants.NAV_BAR_MODE_2BUTTON_OVERLAY; + public static final String NAV_BAR_MODE_3BUTTON_OVERLAY = + WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY; + public static final String NAV_BAR_MODE_GESTURAL_OVERLAY = + WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY; + /** * Touch slopes and thresholds for quick step operations. Drag slop is the point where the * home button press/long press over are ignored and will start to drag when exceeded and the @@ -49,4 +62,54 @@ public class QuickStepContract { private static int convertDpToPixel(float dp) { return (int) (dp * Resources.getSystem().getDisplayMetrics().density); } + + /** + * @return whether this nav bar mode is edge to edge + */ + public static boolean isGesturalMode(int mode) { + return mode == NAV_BAR_MODE_GESTURAL; + } + + /** + * @return whether the current nav bar mode is gestural + */ + public static boolean isGesturalMode(Context context) { + return isGesturalMode(getCurrentInteractionMode(context)); + } + + /** + * @return whether this nav bar mode is swipe up + */ + public static boolean isSwipeUpMode(int mode) { + return mode == NAV_BAR_MODE_2BUTTON; + } + + /** + * @return whether the current nav bar mode is swipe up + */ + public static boolean isSwipeUpMode(Context context) { + return isSwipeUpMode(getCurrentInteractionMode(context)); + } + + /** + * @return whether this nav bar mode is 3 button + */ + public static boolean isLegacyMode(int mode) { + return mode == NAV_BAR_MODE_3BUTTON; + } + + /** + * @return whether this nav bar mode is 3 button + */ + public static boolean isLegacyMode(Context context) { + return isLegacyMode(getCurrentInteractionMode(context)); + } + + /** + * @return the current nav bar interaction mode + */ + public static int getCurrentInteractionMode(Context context) { + return context.getResources().getInteger( + com.android.internal.R.integer.config_navBarInteractionMode); + } } diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/SettingsCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/SettingsCompat.java deleted file mode 100644 index c16cf92a5e8f8..0000000000000 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/SettingsCompat.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ - -package com.android.systemui.shared.system; - -import android.provider.Settings; - -public class SettingsCompat { - - public static final String SWIPE_UP_SETTING_NAME - = Settings.Secure.SWIPE_UP_TO_SWITCH_APPS_ENABLED; -} diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java index 92195942ca06a..494e6cde5a1c3 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java @@ -46,7 +46,6 @@ import android.os.Looper; import android.os.PatternMatcher; import android.os.RemoteException; import android.os.UserHandle; -import android.provider.Settings; import android.util.Log; import android.view.InputChannel; import android.view.MotionEvent; @@ -60,6 +59,7 @@ import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.InputChannelCompat.InputEventDispatcher; +import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.stackdivider.Divider; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.CallbackController; @@ -589,11 +589,9 @@ public class OverviewProxyService implements CallbackController + + + + 16dp + + 16dp + + 48dp + + 48dp + \ No newline at end of file