Merge "Keep keyguard visible if we're launching an occluding activity over a going-away keyguard." into tm-qpr-dev am: b33fcbb84b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21090271

Change-Id: Ie19671291425a7e046c63efc67d2cfec8b711292
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Josh Tsuji
2023-03-16 22:34:12 +00:00
committed by Automerger Merge Worker
5 changed files with 45 additions and 3 deletions

View File

@@ -2732,6 +2732,7 @@ public final class NotificationPanelViewController implements Dumpable {
public void setIsLaunchAnimationRunning(boolean running) { public void setIsLaunchAnimationRunning(boolean running) {
boolean wasRunning = mIsLaunchAnimationRunning; boolean wasRunning = mIsLaunchAnimationRunning;
mIsLaunchAnimationRunning = running; mIsLaunchAnimationRunning = running;
mCentralSurfaces.updateIsKeyguard();
if (wasRunning != mIsLaunchAnimationRunning) { if (wasRunning != mIsLaunchAnimationRunning) {
mShadeExpansionStateManager.notifyLaunchingActivityChanged(running); mShadeExpansionStateManager.notifyLaunchingActivityChanged(running);
} }
@@ -3789,6 +3790,10 @@ public final class NotificationPanelViewController implements Dumpable {
return mClosing || mIsLaunchAnimationRunning; return mClosing || mIsLaunchAnimationRunning;
} }
public boolean isLaunchAnimationRunning() {
return mIsLaunchAnimationRunning;
}
public boolean isTracking() { public boolean isTracking() {
return mTracking; return mTracking;
} }

View File

@@ -301,9 +301,11 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
} }
private void applyKeyguardFlags(NotificationShadeWindowState state) { private void applyKeyguardFlags(NotificationShadeWindowState state) {
final boolean keyguardOrAod = state.keyguardShowing // Keyguard is visible if it's showing or if it's fading away (in which case we're animating
// it out, but the wallpaper should remain visible as a backdrop for the animation);
final boolean keyguardOrAodVisible = (state.keyguardShowing || state.keyguardFadingAway)
|| (state.dozing && mDozeParameters.getAlwaysOn()); || (state.dozing && mDozeParameters.getAlwaysOn());
if ((keyguardOrAod && !state.mediaBackdropShowing && !state.lightRevealScrimOpaque) if ((keyguardOrAodVisible && !state.mediaBackdropShowing && !state.lightRevealScrimOpaque)
|| mKeyguardViewMediator.isAnimatingBetweenKeyguardAndSurfaceBehind()) { || mKeyguardViewMediator.isAnimatingBetweenKeyguardAndSurfaceBehind()) {
// Show the wallpaper if we're on keyguard/AOD and the wallpaper is not occluded by a // Show the wallpaper if we're on keyguard/AOD and the wallpaper is not occluded by a
// solid backdrop. Also, show it if we are currently animating between the // solid backdrop. Also, show it if we are currently animating between the

View File

@@ -1007,6 +1007,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
// The light reveal scrim should always be fully revealed by the time the keyguard // The light reveal scrim should always be fully revealed by the time the keyguard
// is done going away. Double check that this is true. // is done going away. Double check that this is true.
if (!mKeyguardStateController.isKeyguardGoingAway()) { if (!mKeyguardStateController.isKeyguardGoingAway()) {
updateIsKeyguard();
if (mLightRevealScrim.getRevealAmount() != 1f) { if (mLightRevealScrim.getRevealAmount() != 1f) {
Log.e(TAG, "Keyguard is done going away, but someone left the light reveal " Log.e(TAG, "Keyguard is done going away, but someone left the light reveal "
+ "scrim at reveal amount: " + mLightRevealScrim.getRevealAmount()); + "scrim at reveal amount: " + mLightRevealScrim.getRevealAmount());
@@ -2893,6 +2895,10 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
showKeyguardImpl(); showKeyguardImpl();
} }
} else { } else {
final boolean isLaunchingOrGoingAway =
mNotificationPanelViewController.isLaunchAnimationRunning()
|| mKeyguardStateController.isKeyguardGoingAway();
// During folding a foldable device this might be called as a result of // During folding a foldable device this might be called as a result of
// 'onScreenTurnedOff' call for the inner display. // 'onScreenTurnedOff' call for the inner display.
// In this case: // In this case:
@@ -2904,7 +2910,14 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
if (!mScreenOffAnimationController.isKeyguardHideDelayed() if (!mScreenOffAnimationController.isKeyguardHideDelayed()
// If we're animating occluded, there's an activity launching over the keyguard // If we're animating occluded, there's an activity launching over the keyguard
// UI. Wait to hide it until after the animation concludes. // UI. Wait to hide it until after the animation concludes.
&& !mKeyguardViewMediator.isOccludeAnimationPlaying()) { && !mKeyguardViewMediator.isOccludeAnimationPlaying()
// If we're occluded, but playing an animation (launch or going away animations)
// the keyguard is visible behind the animation.
&& !(mKeyguardStateController.isOccluded() && isLaunchingOrGoingAway)) {
// If we're going away and occluded, it means we are launching over the
// unsecured keyguard, which will subsequently go away. Wait to hide it until
// after the animation concludes to avoid the lockscreen UI changing into the
// shade UI behind the launch animation.
return hideKeyguardImpl(forceStateChange); return hideKeyguardImpl(forceStateChange);
} }
} }

View File

@@ -222,6 +222,16 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
assertThat((mLayoutParameters.getValue().flags & FLAG_SHOW_WALLPAPER) != 0).isTrue(); assertThat((mLayoutParameters.getValue().flags & FLAG_SHOW_WALLPAPER) != 0).isTrue();
} }
@Test
public void attach_fadingAway_wallpaperVisible() {
clearInvocations(mWindowManager);
mNotificationShadeWindowController.attach();
mNotificationShadeWindowController.setKeyguardFadingAway(true);
verify(mWindowManager).updateViewLayout(any(), mLayoutParameters.capture());
assertThat((mLayoutParameters.getValue().flags & FLAG_SHOW_WALLPAPER) != 0).isTrue();
}
@Test @Test
public void setBackgroundBlurRadius_expandedWithBlurs() { public void setBackgroundBlurRadius_expandedWithBlurs() {
mNotificationShadeWindowController.setBackgroundBlurRadius(10); mNotificationShadeWindowController.setBackgroundBlurRadius(10);

View File

@@ -1286,6 +1286,18 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
verify(mPowerManagerService, never()).wakeUp(anyLong(), anyInt(), anyString(), anyString()); verify(mPowerManagerService, never()).wakeUp(anyLong(), anyInt(), anyString(), anyString());
} }
@Test
public void keyguard_notHidden_ifGoingAwayAndOccluded() {
setKeyguardShowingAndOccluded(true /* showing */, false /* occluded */);
when(mKeyguardStateController.isKeyguardGoingAway()).thenReturn(true);
when(mKeyguardStateController.isOccluded()).thenReturn(true);
mCentralSurfaces.updateIsKeyguard(false);
verify(mStatusBarStateController, never()).setState(eq(SHADE), anyBoolean());
}
@Test @Test
public void frpLockedDevice_shadeDisabled() { public void frpLockedDevice_shadeDisabled() {
when(mDeviceProvisionedController.isFrpActive()).thenReturn(true); when(mDeviceProvisionedController.isFrpActive()).thenReturn(true);