Merge "Revert "Add waiting screen before PS setup completion"" into main

This commit is contained in:
Priyanka Advani
2024-03-29 21:43:30 +00:00
committed by Android (Google) Code Review
8 changed files with 14 additions and 188 deletions

View File

@@ -60,7 +60,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 static final Handler sHandler = new Handler(Looper.getMainLooper());
private Handler mHandler;
private int mScreenTitleIndex;
private static final List<Pair<Integer, Integer>> HEADER_ILLUSTRATION_PAIRS =
ImmutableList.of(
@@ -78,7 +78,7 @@ public class AutoAdvanceSetupFragment extends InstrumentedFragment {
if (getActivity() != null) {
if (++mScreenTitleIndex < HEADER_ILLUSTRATION_PAIRS.size()) {
startFadeOutAnimation();
sHandler.postDelayed(mUpdateScreenResources, DELAY_BETWEEN_SCREENS);
mHandler.postDelayed(mUpdateScreenResources, DELAY_BETWEEN_SCREENS);
} else if (PrivateSpaceMaintainer.getInstance(getActivity())
.doesPrivateSpaceExist()) {
mMetricsFeatureProvider.action(
@@ -133,6 +133,8 @@ public class AutoAdvanceSetupFragment extends InstrumentedFragment {
mRootView.getHeaderTextView().setBreakStrategy(BREAK_STRATEGY_SIMPLE);
mRootView.getHeaderTextView().setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_POLITE);
updateHeaderAndIllustration();
mHandler = new Handler(Looper.getMainLooper());
mHandler.postDelayed(mUpdateScreenResources, DELAY_BETWEEN_SCREENS);
OnBackPressedCallback callback =
new OnBackPressedCallback(true /* enabled by default */) {
@Override
@@ -153,16 +155,12 @@ public class AutoAdvanceSetupFragment extends InstrumentedFragment {
@Override
public void onDestroy() {
sHandler.removeCallbacks(mUpdateScreenResources);
if (mHandler != null) {
mHandler.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;