Add waiting screen before PS setup completion

At the end of PS setup just before showing the final sucess screen this
change adds a new screen with loading layout which enables profile quiet
mode.
After enabling quiet mode checks if user is stopped before removing the
loading layout screen. Until user is stopped loading screen will be
shown.

Bug: 329042236
Bug: 328393532
Test: Manual verify new delay screen is shown
Change-Id: Iac3fd2f0f5c75a64719fbce32ff4dbfb533322d5
This commit is contained in:
josephpv
2024-03-14 21:53:02 +00:00
parent 4230ad4b07
commit 7b0b26ec92
8 changed files with 188 additions and 14 deletions

View File

@@ -59,7 +59,7 @@ public class AutoAdvanceSetupFragment extends InstrumentedFragment {
private static final int ANIMATION_DURATION_MILLIS = 500;
private static final int HEADER_TEXT_MAX_LINES = 4;
private GlifLayout mRootView;
private Handler mHandler;
private static final Handler sHandler = new Handler(Looper.getMainLooper());
private int mScreenTitleIndex;
private static final List<Pair<Integer, Integer>> HEADER_ILLUSTRATION_PAIRS =
ImmutableList.of(
@@ -77,7 +77,7 @@ public class AutoAdvanceSetupFragment extends InstrumentedFragment {
if (getActivity() != null) {
if (++mScreenTitleIndex < HEADER_ILLUSTRATION_PAIRS.size()) {
startFadeOutAnimation();
mHandler.postDelayed(mUpdateScreenResources, DELAY_BETWEEN_SCREENS);
sHandler.postDelayed(mUpdateScreenResources, DELAY_BETWEEN_SCREENS);
} else if (PrivateSpaceMaintainer.getInstance(getActivity())
.doesPrivateSpaceExist()) {
mMetricsFeatureProvider.action(
@@ -131,8 +131,6 @@ public class AutoAdvanceSetupFragment extends InstrumentedFragment {
mRootView.getHeaderTextView().setMaxLines(HEADER_TEXT_MAX_LINES);
mRootView.getHeaderTextView().setBreakStrategy(BREAK_STRATEGY_SIMPLE);
updateHeaderAndIllustration();
mHandler = new Handler(Looper.getMainLooper());
mHandler.postDelayed(mUpdateScreenResources, DELAY_BETWEEN_SCREENS);
OnBackPressedCallback callback =
new OnBackPressedCallback(true /* enabled by default */) {
@Override
@@ -153,12 +151,16 @@ public class AutoAdvanceSetupFragment extends InstrumentedFragment {
@Override
public void onDestroy() {
if (mHandler != null) {
mHandler.removeCallbacks(mUpdateScreenResources);
}
sHandler.removeCallbacks(mUpdateScreenResources);
super.onDestroy();
}
@Override
public void onResume() {
sHandler.postDelayed(mUpdateScreenResources, DELAY_BETWEEN_SCREENS);
super.onResume();
}
@Override
public int getMetricsCategory() {
return SettingsEnums.PRIVATE_SPACE_SETUP_SPACE_CREATION;