Merge "Fix flicker when device is unlocked from AOD." into sc-dev am: aaba1884bb am: 47428d13eb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15736949 Change-Id: I11ed0bf0bf25be63d8f30d932a1a225d93e3ec8c
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