Merge "Allow a drawn reported activity to keep screen brightness"
This commit is contained in:
@@ -1046,31 +1046,28 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
|||||||
* manager may choose to mirror or blank the display.
|
* manager may choose to mirror or blank the display.
|
||||||
*/
|
*/
|
||||||
boolean handleNotObscuredLocked(WindowState w, boolean obscured, boolean syswin) {
|
boolean handleNotObscuredLocked(WindowState w, boolean obscured, boolean syswin) {
|
||||||
final WindowManager.LayoutParams attrs = w.mAttrs;
|
|
||||||
final int attrFlags = attrs.flags;
|
|
||||||
final boolean onScreen = w.isOnScreen();
|
final boolean onScreen = w.isOnScreen();
|
||||||
final boolean canBeSeen = w.isDisplayed();
|
|
||||||
final int privateflags = attrs.privateFlags;
|
|
||||||
boolean displayHasContent = false;
|
boolean displayHasContent = false;
|
||||||
|
|
||||||
ProtoLog.d(WM_DEBUG_KEEP_SCREEN_ON,
|
ProtoLog.d(WM_DEBUG_KEEP_SCREEN_ON,
|
||||||
"handleNotObscuredLocked w: %s, w.mHasSurface: %b, w.isOnScreen(): %b, w"
|
"handleNotObscuredLocked w: %s, w.mHasSurface: %b, w.isOnScreen(): %b, w"
|
||||||
+ ".isDisplayedLw(): %b, w.mAttrs.userActivityTimeout: %d",
|
+ ".isDisplayedLw(): %b, w.mAttrs.userActivityTimeout: %d",
|
||||||
w, w.mHasSurface, onScreen, w.isDisplayed(), w.mAttrs.userActivityTimeout);
|
w, w.mHasSurface, onScreen, w.isDisplayed(), w.mAttrs.userActivityTimeout);
|
||||||
if (w.mHasSurface && onScreen) {
|
if (!onScreen) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!syswin && w.mAttrs.userActivityTimeout >= 0 && mUserActivityTimeout < 0) {
|
if (!syswin && w.mAttrs.userActivityTimeout >= 0 && mUserActivityTimeout < 0) {
|
||||||
mUserActivityTimeout = w.mAttrs.userActivityTimeout;
|
mUserActivityTimeout = w.mAttrs.userActivityTimeout;
|
||||||
ProtoLog.d(WM_DEBUG_KEEP_SCREEN_ON, "mUserActivityTimeout set to %d",
|
ProtoLog.d(WM_DEBUG_KEEP_SCREEN_ON, "mUserActivityTimeout set to %d",
|
||||||
mUserActivityTimeout);
|
mUserActivityTimeout);
|
||||||
}
|
}
|
||||||
}
|
if (w.isDrawn() || (w.mActivityRecord != null && w.mActivityRecord.firstWindowDrawn
|
||||||
if (w.mHasSurface && canBeSeen) {
|
&& w.mActivityRecord.isVisibleRequested())) {
|
||||||
if (!syswin && w.mAttrs.screenBrightness >= 0
|
if (!syswin && w.mAttrs.screenBrightness >= 0
|
||||||
&& Float.isNaN(mScreenBrightnessOverride)) {
|
&& Float.isNaN(mScreenBrightnessOverride)) {
|
||||||
mScreenBrightnessOverride = w.mAttrs.screenBrightness;
|
mScreenBrightnessOverride = w.mAttrs.screenBrightness;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int type = attrs.type;
|
|
||||||
// This function assumes that the contents of the default display are processed first
|
// This function assumes that the contents of the default display are processed first
|
||||||
// before secondary displays.
|
// before secondary displays.
|
||||||
final DisplayContent displayContent = w.getDisplayContent();
|
final DisplayContent displayContent = w.getDisplayContent();
|
||||||
@@ -1084,11 +1081,11 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
|||||||
displayHasContent = true;
|
displayHasContent = true;
|
||||||
} else if (displayContent != null &&
|
} else if (displayContent != null &&
|
||||||
(!mObscureApplicationContentOnSecondaryDisplays
|
(!mObscureApplicationContentOnSecondaryDisplays
|
||||||
|| (obscured && type == TYPE_KEYGUARD_DIALOG))) {
|
|| (obscured && w.mAttrs.type == TYPE_KEYGUARD_DIALOG))) {
|
||||||
// Allow full screen keyguard presentation dialogs to be seen.
|
// Allow full screen keyguard presentation dialogs to be seen.
|
||||||
displayHasContent = true;
|
displayHasContent = true;
|
||||||
}
|
}
|
||||||
if ((privateflags & PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE) != 0) {
|
if ((w.mAttrs.privateFlags & PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE) != 0) {
|
||||||
mSustainedPerformanceModeCurrent = true;
|
mSustainedPerformanceModeCurrent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user