Merge "Hide content on all displays when the device is locked."
This commit is contained in:
committed by
Android (Google) Code Review
commit
dd70dff996
@@ -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="
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user