From fa654851095890a092471af658dbbd4dbb751419 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Tue, 31 Oct 2023 22:23:41 +0000 Subject: [PATCH 1/2] Fix 3 button mode issues in AllSetActivity - Set system bars appearance to light/dark depending on device theme to ensure visibility - Also fix issue where taskbar icons would appear partially offscreen and prevent pressing nav buttons if you rotated Fixes: 293438087 Test: adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.SetupWizardTestActivity - Skip to the end (AllSetActivity), and ensure 3 buttons are visible - Rotate device and ensure 3 buttons are still visible and functional - Will also flash / wipe to the build once it's created Flag: None (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:286fc215e632280fe0b401bfd713621104861288) Merged-In: Ie2d9bf1e1d95a6ccbd1f9c592adb51390b21ad85 Change-Id: Ie2d9bf1e1d95a6ccbd1f9c592adb51390b21ad85 --- .../quickstep/interaction/AllSetActivity.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java index 49814df57b..6e06f386b6 100644 --- a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java +++ b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java @@ -15,6 +15,9 @@ */ package com.android.quickstep.interaction; +import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; +import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; + import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.Utilities.mapBoundToRange; @@ -47,6 +50,8 @@ import android.text.TextUtils; import android.util.Log; import android.view.View; import android.view.View.AccessibilityDelegate; +import android.view.Window; +import android.view.WindowInsetsController; import android.view.accessibility.AccessibilityNodeInfo; import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction; import android.widget.ImageView; @@ -121,6 +126,17 @@ public class AllSetActivity extends Activity { Resources resources = getResources(); int mode = resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; boolean isDarkTheme = mode == Configuration.UI_MODE_NIGHT_YES; + + int systemBarsMask = APPEARANCE_LIGHT_STATUS_BARS | APPEARANCE_LIGHT_NAVIGATION_BARS; + int systemBarsAppearance = isDarkTheme ? 0 : systemBarsMask; + Window window = getWindow(); + WindowInsetsController insetsController = window == null + ? null + : window.getInsetsController(); + if (insetsController != null) { + insetsController.setSystemBarsAppearance(systemBarsAppearance, systemBarsMask); + } + Intent intent = getIntent(); int accentColor = intent.getIntExtra( isDarkTheme ? EXTRA_ACCENT_COLOR_DARK_MODE : EXTRA_ACCENT_COLOR_LIGHT_MODE, @@ -299,7 +315,9 @@ public class AllSetActivity extends Activity { if (mBackgroundAnimatorListener != null) { mAnimatedBackground.removeAnimatorListener(mBackgroundAnimatorListener); } - dispatchLauncherAnimStartEnd(); + if (!isChangingConfigurations()) { + dispatchLauncherAnimStartEnd(); + } } private AnimatedFloat createSwipeUpProxy(GestureState state) { From e4de57a662b58748a25238942d629490073c6e00 Mon Sep 17 00:00:00 2001 From: Anushree Ganjam Date: Tue, 7 Nov 2023 15:36:26 -0800 Subject: [PATCH 2/2] [DO NOT MERGE] Change the LPNH flag to read from server flag "ENABLE_LONG_PRESS_NAV_HANDLE_MPR". Flag: ENABLE_LONG_PRESS_NAV_HANDLE_MPR Test: Manual Bug: 309689303 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:75183ceed565aca0174e4e9707d6cb59dea2fce5) Merged-In: Ib695b3d6ac3f40ee53b6b64bb6b121e7b34d4b07 Change-Id: Ib695b3d6ac3f40ee53b6b64bb6b121e7b34d4b07 --- src/com/android/launcher3/config/FeatureFlags.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index 77bd898c97..5155d529b4 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -248,7 +248,7 @@ public final class FeatureFlags { "Inject fallback app corpus result when AiAi fails to return it."); public static final BooleanFlag ENABLE_LONG_PRESS_NAV_HANDLE = - getReleaseFlag(282993230, "ENABLE_LONG_PRESS_NAV_HANDLE", TEAMFOOD, + getReleaseFlag(282993230, "ENABLE_LONG_PRESS_NAV_HANDLE_MPR", TEAMFOOD, "Enables long pressing on the bottom bar nav handle to trigger events."); // TODO(Block 17): Clean up flags