Merge "Ensure some taskbar states are initialized correctly" into sc-v2-dev

This commit is contained in:
TreeHugger Robot 2021-12-14 22:49:50 +00:00 committed by Android (Google) Code Review
commit 9b3b2b9c7e
2 changed files with 11 additions and 2 deletions

View File

@ -111,6 +111,11 @@ import java.util.function.Supplier;
onIconAlignmentRatioChangedForAppAndHomeTransition();
mLauncher.getStateManager().addStateListener(mStateListener);
// Initialize to the current launcher state
updateStateForFlag(FLAG_RESUMED, launcher.hasBeenResumed());
mLauncherState = launcher.getStateManager().getState();
applyState(0);
}
public void onDestroy() {

View File

@ -171,9 +171,13 @@ public class TaskbarStashController {
boolean isManuallyStashedInApp = supportsManualStashing()
&& mPrefs.getBoolean(SHARED_PREFS_STASHED_KEY, DEFAULT_STASHED_PREF);
boolean isInSetup = !mActivity.isUserSetupComplete() || sharedState.setupUIVisible;
updateStateForFlag(FLAG_STASHED_IN_APP_MANUAL, isManuallyStashedInApp);
updateStateForFlag(FLAG_STASHED_IN_APP_SETUP,
!mActivity.isUserSetupComplete() || sharedState.setupUIVisible);
updateStateForFlag(FLAG_STASHED_IN_APP_SETUP, isInSetup);
if (isInSetup) {
// Update the in-app state to ensure isStashed() reflects right state during SUW
updateStateForFlag(FLAG_IN_APP, true);
}
applyState();
notifyStashChange(/* visible */ false, /* stashed */ isStashedInApp());