Merge changes from topic "revert-17073604-presubmit-am-787ed0a55f5040968a8a9c14764ddd01-HJDYCJUYCZ" into tm-dev

* changes:
  Revert "Scrim was flickering on FPS unlock"
  Revert "Remove temp user creation activity"
This commit is contained in:
TreeHugger Robot
2022-03-05 04:45:53 +00:00
committed by Android (Google) Code Review
3 changed files with 13 additions and 6 deletions

View File

@@ -663,6 +663,7 @@ public class CentralSurfaces extends CoreStartable implements
protected final BatteryController mBatteryController; protected final BatteryController mBatteryController;
protected boolean mPanelExpanded; protected boolean mPanelExpanded;
private UiModeManager mUiModeManager; private UiModeManager mUiModeManager;
protected boolean mIsKeyguard;
private LogMaker mStatusBarStateLog; private LogMaker mStatusBarStateLog;
protected final NotificationIconAreaController mNotificationIconAreaController; protected final NotificationIconAreaController mNotificationIconAreaController;
@Nullable private View mAmbientIndicationContainer; @Nullable private View mAmbientIndicationContainer;
@@ -1141,7 +1142,7 @@ public class CentralSurfaces extends CoreStartable implements
} }
if (leaveOpen) { if (leaveOpen) {
mStatusBarStateController.setLeaveOpenOnKeyguardHide(true); mStatusBarStateController.setLeaveOpenOnKeyguardHide(true);
if (mKeyguardStateController.isShowing()) { if (mIsKeyguard) {
// When device state changes on keyguard we don't want to keep the state of // When device state changes on keyguard we don't want to keep the state of
// the shade and instead we open clean state of keyguard with shade closed. // the shade and instead we open clean state of keyguard with shade closed.
// Normally some parts of QS state (like expanded/collapsed) are persisted and // Normally some parts of QS state (like expanded/collapsed) are persisted and
@@ -2889,8 +2890,7 @@ public class CentralSurfaces extends CoreStartable implements
// late in the transition, so we also allow the device to start dozing once the screen has // late in the transition, so we also allow the device to start dozing once the screen has
// turned off fully. // turned off fully.
boolean keyguardForDozing = mDozeServiceHost.getDozingRequested() boolean keyguardForDozing = mDozeServiceHost.getDozingRequested()
&& (!mDeviceInteractive || (isGoingToSleep() && (!mDeviceInteractive || isGoingToSleep() && (isScreenFullyOff() || mIsKeyguard));
&& (isScreenFullyOff() || mKeyguardStateController.isShowing())));
boolean isWakingAndOccluded = isOccluded() && isWaking(); boolean isWakingAndOccluded = isOccluded() && isWaking();
boolean shouldBeKeyguard = (mStatusBarStateController.isKeyguardRequested() boolean shouldBeKeyguard = (mStatusBarStateController.isKeyguardRequested()
|| keyguardForDozing) && !wakeAndUnlocking && !isWakingAndOccluded; || keyguardForDozing) && !wakeAndUnlocking && !isWakingAndOccluded;
@@ -2923,6 +2923,7 @@ public class CentralSurfaces extends CoreStartable implements
public void showKeyguardImpl() { public void showKeyguardImpl() {
Trace.beginSection("CentralSurfaces#showKeyguard"); Trace.beginSection("CentralSurfaces#showKeyguard");
mIsKeyguard = true;
// In case we're locking while a smartspace transition is in progress, reset it. // In case we're locking while a smartspace transition is in progress, reset it.
mKeyguardUnlockAnimationController.resetSmartspaceTransition(); mKeyguardUnlockAnimationController.resetSmartspaceTransition();
if (mKeyguardStateController.isLaunchTransitionFadingAway()) { if (mKeyguardStateController.isLaunchTransitionFadingAway()) {
@@ -3043,6 +3044,7 @@ public class CentralSurfaces extends CoreStartable implements
* @return true if we would like to stay in the shade, false if it should go away entirely * @return true if we would like to stay in the shade, false if it should go away entirely
*/ */
public boolean hideKeyguardImpl(boolean forceStateChange) { public boolean hideKeyguardImpl(boolean forceStateChange) {
mIsKeyguard = false;
Trace.beginSection("CentralSurfaces#hideKeyguard"); Trace.beginSection("CentralSurfaces#hideKeyguard");
boolean staying = mStatusBarStateController.leaveOpenOnKeyguardHide(); boolean staying = mStatusBarStateController.leaveOpenOnKeyguardHide();
int previousState = mStatusBarStateController.getState(); int previousState = mStatusBarStateController.getState();
@@ -3769,7 +3771,7 @@ public class CentralSurfaces extends CoreStartable implements
}); });
} else if (mDozing && !unlocking) { } else if (mDozing && !unlocking) {
mScrimController.transitionTo(ScrimState.AOD); mScrimController.transitionTo(ScrimState.AOD);
} else if (mKeyguardStateController.isShowing() && !unlocking) { } else if (mIsKeyguard && !unlocking) {
mScrimController.transitionTo(ScrimState.KEYGUARD); mScrimController.transitionTo(ScrimState.KEYGUARD);
} else { } else {
mScrimController.transitionTo(ScrimState.UNLOCKED, mUnlockScrimCallback); mScrimController.transitionTo(ScrimState.UNLOCKED, mUnlockScrimCallback);

View File

@@ -584,6 +584,13 @@ public class UserSwitcherController implements Dumpable {
.setPackage(mCreateSupervisedUserPackage) .setPackage(mCreateSupervisedUserPackage)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// TODO(b/209659998): [to-be-removed] fallback activity for supervised user creation.
if (mContext.getPackageManager().resolveActivity(intent, 0) == null) {
intent.setPackage(null)
.setClassName("com.android.settings",
"com.android.settings.users.AddSupervisedUserActivity");
}
mContext.startActivity(intent); mContext.startActivity(intent);
} }

View File

@@ -846,7 +846,6 @@ public class CentralSurfacesTest extends SysuiTestCase {
@Test @Test
public void testTransitionLaunch_noPreview_doesntGoUnlocked() { public void testTransitionLaunch_noPreview_doesntGoUnlocked() {
mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD); mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD);
when(mKeyguardStateController.isShowing()).thenReturn(true);
mCentralSurfaces.showKeyguardImpl(); mCentralSurfaces.showKeyguardImpl();
// Starting a pulse should change the scrim controller to the pulsing state // Starting a pulse should change the scrim controller to the pulsing state
@@ -869,7 +868,6 @@ public class CentralSurfacesTest extends SysuiTestCase {
@Test @Test
public void testPulseWhileDozing_updatesScrimController() { public void testPulseWhileDozing_updatesScrimController() {
mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD); mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD);
when(mKeyguardStateController.isShowing()).thenReturn(true);
mCentralSurfaces.showKeyguardImpl(); mCentralSurfaces.showKeyguardImpl();
// Starting a pulse should change the scrim controller to the pulsing state // Starting a pulse should change the scrim controller to the pulsing state