Show back button in SUW

- Listen for USER_SETUP_COMPLETE
- Recreate taskbar, forcing nav buttons to be visible

Test: Run setup wizard and ensure back button is present, then is replaced with taskbar when setup is complete
adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.SetupWizardTestActivity

Fixes: 191846922
Change-Id: I789186dcc23a2db7cc4637b1cb0486f0d2add784
This commit is contained in:
Tony Wickham
2021-08-26 14:35:52 -07:00
parent b862d2c30f
commit 14cba5e009
2 changed files with 19 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.Region.Op;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.provider.Settings;
import android.util.Property;
import android.view.View;
import android.view.View.OnClickListener;
@@ -54,6 +55,7 @@ import com.android.launcher3.taskbar.TaskbarNavButtonController.TaskbarButton;
import com.android.launcher3.taskbar.contextual.RotationButton;
import com.android.launcher3.taskbar.contextual.RotationButtonController;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.launcher3.util.SettingsCache;
import com.android.quickstep.AnimatedFloat;
import java.util.ArrayList;
@@ -145,7 +147,10 @@ public class NavbarButtonsViewController {
.getKeyguardBgTaskbar(),
flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0, AnimatedFloat.VALUE, 1, 0));
if (mContext.isThreeButtonNav()) {
// Force nav buttons (specifically back button) to be visible during setup wizard.
boolean areButtonsForcedVisible = !SettingsCache.INSTANCE.get(mContext).getValue(
Settings.Secure.getUriFor(Settings.Secure.USER_SETUP_COMPLETE), 0);
if (mContext.isThreeButtonNav() || areButtonsForcedVisible) {
initButtons(mNavButtonContainer, mEndContextualContainer,
mControllers.navButtonController);