Remove back button and enable back gesture on SUW

According to new spec, for devices that have a different theme, Setup Wizard
should no longer have the back button, and instead should use the back
gesture in between screens.

Fix: 349495243
Flag: EXEMPT bugfix
Test: Set the System property for setup wizard device theme to be expressive. Rerun setup wizard and ensure the back button doesn't show up and the back gesture works. For the existing theme, the behavior should remain unchanged.

Change-Id: I6b8e95f4eeecdf7422c9f1c099b30a4fc2d2fd12
This commit is contained in:
Saumya Prakash committed 2025-02-06 22:17:46 +00:00
1 parent c22fd54f27
commit f6496357e2
2 files changed
+21 -7

No files matched your search

@@ -73,6 +73,7 @@ import android.graphics.drawable.PaintDrawable;
import android.graphics.drawable.RotateDrawable;
import android.inputmethodservice.InputMethodService;
import android.os.Handler;
import android.os.SystemProperties;
import android.util.Property;
import android.view.Gravity;
import android.view.HapticFeedbackConstants;
@@ -181,6 +182,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
private final int mDarkIconColorOnWorkspace;
/** Color to use for navbar buttons, if they are on on a Taskbar surface background. */
private final int mOnBackgroundIconColor;
private final boolean mIsExpressiveThemeEnabled;
private @Nullable Animator mNavBarLocationAnimator;
private @Nullable BubbleBarLocation mBubbleBarTargetLocation;
@@ -262,6 +264,9 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
if (mContext.isPhoneMode()) {
mTaskbarTransitions = new TaskbarTransitions(mContext, mNavButtonsView);
}
String SUWTheme = SystemProperties.get("setupwizard.theme", "");
mIsExpressiveThemeEnabled = SUWTheme.equals("glif_expressive")
|| SUWTheme.equals("glif_expressive_light");
}
/**
@@ -324,10 +329,10 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
// Start at 1 because relevant flags are unset at init.
mOnBackgroundNavButtonColorOverrideMultiplier.value = 1;
// Force nav buttons (specifically back button) to be visible during setup wizard.
boolean isInSetup = !mContext.isUserSetupComplete();
// Potentially force the back button to be visible during setup wizard.
boolean shouldShowInSetup = !mContext.isUserSetupComplete() && !mIsExpressiveThemeEnabled;
boolean isInKidsMode = mContext.isNavBarKidsModeActive();
boolean alwaysShowButtons = isThreeButtonNav || isInSetup;
boolean alwaysShowButtons = isThreeButtonNav || shouldShowInSetup;
// Make sure to remove nav bar buttons translation when any of the following occur:
// - Notification shade is expanded
@@ -917,6 +922,10 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
}
private void handleSetupUi() {
// Setup wizard handles the UI when the expressive theme is enabled.
if (mIsExpressiveThemeEnabled) {
return;
}
// Since setup wizard only has back button enabled, it looks strange to be
// end-aligned, so start-align instead.
FrameLayout.LayoutParams navButtonsLayoutParams = (FrameLayout.LayoutParams)