Keyguard: fix possible divergent state

Fixes an issue where the state in SystemUI and AM/WM could
get out of sync: If the keyguardGoingAway transition is
started and then later canceled by SystemUI, it never
tells AM that it canceled it.
This causes SystemUI to show itself in keyguard mode,
meanwhile AM/WM do not hide the underlying app because
the status bar is in the going away transition as far
as it is concerned.

Change-Id: I5966f0655fd694ae599a83dda7a9f6463088632b
Fixes: 76367931
Test: delay keyguard going away callback, unlock phone, during the delay, remove SIM; verify it does not end up in bad state
This commit is contained in:
Adrian Roos
2018-04-25 14:01:11 +02:00
parent bbfe498aef
commit 6ec76b7288
2 changed files with 4 additions and 0 deletions

View File

@@ -1857,6 +1857,8 @@ public class KeyguardViewMediator extends SystemUI {
synchronized (KeyguardViewMediator.this) {
if (!mHiding) {
// Tell ActivityManager that we canceled the keyguardExitAnimation.
setShowingLocked(mShowing, mAodShowing, mSecondaryDisplayShowing, true /* force */);
return;
}
mHiding = false;

View File

@@ -121,6 +121,8 @@ class KeyguardController {
void setKeyguardShown(boolean keyguardShowing, boolean aodShowing,
int secondaryDisplayShowing) {
boolean showingChanged = keyguardShowing != mKeyguardShowing || aodShowing != mAodShowing;
// If keyguard is going away, but SystemUI aborted the transition, need to reset state.
showingChanged |= mKeyguardGoingAway && keyguardShowing;
if (!showingChanged && secondaryDisplayShowing == mSecondaryDisplayShowing) {
return;
}