Fix unlock failure when app is in reverse portrait orientation.

When the screen is rotated, AppTransition clears app transition requests
to cancel the app transition animation, since screen rotation animation
is played. If this happens,AppTransition calls AppTransitionListener,
which ends up with IKeyguardService.startKeyguardGoingAway binder call.

This code path should be kept working when remote animation is enabled.

Bug: 196358471
Test: manual
  1. enable auto-rotate, register fingerprint, set secure lock method.
  2. run an app which supports reverse portrait mode.
  3. put the device upside down.
  4. go to lock screen
  5. unlock the device using the fingerprint sensor.
Change-Id: I7d079431d369dc7ba7d737234af6b8285111bf8d
This commit is contained in:
Issei Suzuki
2021-09-21 19:39:59 +02:00
parent c87aa1a23e
commit 0f3abd3603
3 changed files with 14 additions and 6 deletions

View File

@@ -1817,7 +1817,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
@Override
public int onAppTransitionStartingLocked(boolean keyguardGoingAway, long duration,
long statusBarAnimationStartTime, long statusBarAnimationDuration) {
return handleStartTransitionForKeyguardLw(keyguardGoingAway, duration);
// When remote animation is enabled for KEYGUARD_GOING_AWAY transition, SysUI
// receives IRemoteAnimationRunner#onAnimationStart to start animation, so we don't
// need to call IKeyguardService#keyguardGoingAway here.
return handleStartTransitionForKeyguardLw(keyguardGoingAway
&& !WindowManagerService.sEnableRemoteKeyguardGoingAwayAnimation, duration);
}
@Override
@@ -3065,7 +3069,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
private int handleStartTransitionForKeyguardLw(boolean keyguardGoingAway, long duration) {
final int res = applyKeyguardOcclusionChange();
if (res != 0) return res;
if (!WindowManagerService.sEnableRemoteKeyguardGoingAwayAnimation && keyguardGoingAway) {
if (keyguardGoingAway) {
if (DEBUG_KEYGUARD) Slog.d(TAG, "Starting keyguard exit animation");
startKeyguardExitAnimation(SystemClock.uptimeMillis(), duration);
}

View File

@@ -406,8 +406,7 @@ public class KeyguardServiceDelegate {
}
public void startKeyguardExitAnimation(long startTime, long fadeoutDuration) {
if (!WindowManagerService.sEnableRemoteKeyguardGoingAwayAnimation
&& mKeyguardService != null) {
if (mKeyguardService != null) {
mKeyguardService.startKeyguardExitAnimation(startTime, fadeoutDuration);
}
}

View File

@@ -745,8 +745,13 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
(flags & TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER) != 0,
(flags & TRANSIT_FLAG_KEYGUARD_GOING_AWAY_TO_SHADE) != 0,
(flags & TRANSIT_FLAG_KEYGUARD_GOING_AWAY_SUBTLE_ANIMATION) != 0);
mController.mAtm.mWindowManager.mPolicy.startKeyguardExitAnimation(
SystemClock.uptimeMillis(), 0 /* duration */);
if (!WindowManagerService.sEnableRemoteKeyguardGoingAwayAnimation) {
// When remote animation is enabled for KEYGUARD_GOING_AWAY transition, SysUI
// receives IRemoteAnimationRunner#onAnimationStart to start animation, so we don't
// need to call IKeyguardService#keyguardGoingAway here.
mController.mAtm.mWindowManager.mPolicy.startKeyguardExitAnimation(
SystemClock.uptimeMillis(), 0 /* duration */);
}
}
if ((flags & TRANSIT_FLAG_KEYGUARD_LOCKED) != 0) {
mController.mAtm.mWindowManager.mPolicy.applyKeyguardOcclusionChange();