Fix flicker when device is unlocked from AOD.
When IActivityTaskManager.keyguardGoingAway is called, keyguard sleep token should be removed to get relevant activities involved for the keyguard going away app transition animation. The old logic assumed that keyguard goes away only from the lock screen, but it's also possible to do it from AOD screen. Bug: 197113783 Test: atest DisplayContentTests Change-Id: I5d6ab0170a6b2c92e0655bad85ca22ba322e7b31
This commit is contained in:
@@ -106,13 +106,13 @@ class KeyguardController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} for default display when AOD is showing. Otherwise, same as
|
||||
* {@link #isKeyguardOrAodShowing(int)}
|
||||
* @return {@code true} for default display when AOD is showing, not going away. Otherwise, same
|
||||
* as {@link #isKeyguardOrAodShowing(int)}
|
||||
* TODO(b/125198167): Replace isKeyguardOrAodShowing() by this logic.
|
||||
*/
|
||||
boolean isKeyguardUnoccludedOrAodShowing(int displayId) {
|
||||
if (displayId == DEFAULT_DISPLAY && mAodShowing) {
|
||||
return true;
|
||||
return !mKeyguardGoingAway;
|
||||
}
|
||||
return isKeyguardOrAodShowing(displayId);
|
||||
}
|
||||
@@ -477,7 +477,7 @@ class KeyguardController {
|
||||
final KeyguardDisplayState state = getDisplayState(displayId);
|
||||
if (isKeyguardUnoccludedOrAodShowing(displayId)) {
|
||||
state.mSleepTokenAcquirer.acquire(displayId);
|
||||
} else if (!isKeyguardUnoccludedOrAodShowing(displayId)) {
|
||||
} else {
|
||||
state.mSleepTokenAcquirer.release(displayId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2165,6 +2165,21 @@ public class DisplayContentTests extends WindowTestsBase {
|
||||
assertEquals(top, display.topRunningActivity(true /* considerKeyguardState */));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testKeyguardGoingAwayWhileAodShown() {
|
||||
mDisplayContent.getDisplayPolicy().setAwake(true);
|
||||
|
||||
final WindowState appWin = createWindow(null, TYPE_APPLICATION, mDisplayContent, "appWin");
|
||||
final ActivityRecord activity = appWin.mActivityRecord;
|
||||
|
||||
mAtm.mKeyguardController.setKeyguardShown(true /* keyguardShowing */,
|
||||
true /* aodShowing */);
|
||||
assertFalse(activity.isVisibleRequested());
|
||||
|
||||
mAtm.mKeyguardController.keyguardGoingAway(0 /* flags */);
|
||||
assertTrue(activity.isVisibleRequested());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRemoveRootTaskInWindowingModes() {
|
||||
removeRootTaskTests(() -> mRootWindowContainer.removeRootTasksInWindowingModes(
|
||||
|
||||
Reference in New Issue
Block a user