Merge "Hide content on all displays when the device is locked."

This commit is contained in:
TreeHugger Robot
2019-01-25 03:59:27 +00:00
committed by Android (Google) Code Review
3 changed files with 13 additions and 18 deletions

View File

@@ -2286,7 +2286,7 @@ class ActivityStack extends ConfigurationContainer {
* Check if the display to which this stack is attached has
* {@link Display#FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD} applied.
*/
private boolean canShowWithInsecureKeyguard() {
boolean canShowWithInsecureKeyguard() {
final ActivityDisplay activityDisplay = getDisplay();
if (activityDisplay == null) {
throw new IllegalStateException("Stack is not attached to any display, stackId="

View File

@@ -91,9 +91,7 @@ class KeyguardController {
*/
boolean isKeyguardOrAodShowing(int displayId) {
return (mKeyguardShowing || mAodShowing) && !mKeyguardGoingAway
&& (displayId == DEFAULT_DISPLAY
? !isDisplayOccluded(DEFAULT_DISPLAY)
: isShowingOnSecondaryDisplay(displayId));
&& !isDisplayOccluded(displayId);
}
/**
@@ -101,10 +99,7 @@ class KeyguardController {
* display, false otherwise
*/
boolean isKeyguardShowing(int displayId) {
return mKeyguardShowing && !mKeyguardGoingAway
&& (displayId == DEFAULT_DISPLAY
? !isDisplayOccluded(DEFAULT_DISPLAY)
: isShowingOnSecondaryDisplay(displayId));
return mKeyguardShowing && !mKeyguardGoingAway && !isDisplayOccluded(displayId);
}
/**
@@ -152,14 +147,6 @@ class KeyguardController {
updateKeyguardSleepToken();
}
private boolean isShowingOnSecondaryDisplay(int displayId) {
if (mSecondaryDisplayIdsShowing == null) return false;
for (int showingId : mSecondaryDisplayIdsShowing) {
if (displayId == showingId) return true;
}
return false;
}
/**
* Called when Keyguard is going away.
*
@@ -473,8 +460,16 @@ class KeyguardController {
if (stack.getTopDismissingKeyguardActivity() != null) {
mDismissingKeyguardActivity = stack.getTopDismissingKeyguardActivity();
}
// FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD only apply for secondary display.
if (mDisplayId != DEFAULT_DISPLAY) {
mOccluded |= stack.canShowWithInsecureKeyguard()
&& controller.canDismissKeyguard();
}
}
// TODO(b/123372519): isShowingDream can only works on default display.
if (mDisplayId == DEFAULT_DISPLAY) {
mOccluded |= controller.mWindowManager.isShowingDream();
}
mOccluded |= controller.mWindowManager.isShowingDream();
// TODO(b/113840485): Handle app transition for individual display, and apply occluded
// state change to secondary displays.

View File

@@ -2817,7 +2817,7 @@ public class WindowManagerService extends IWindowManager.Stub
public boolean isShowingDream() {
synchronized (mGlobalLock) {
// TODO: fix this when dream can be shown on non-default display.
// TODO(b/123372519): Fix this when dream can be shown on non-default display.
return getDefaultDisplayContentLocked().getDisplayPolicy().isShowingDreamLw();
}
}