Merge "Prevent showing windows while animating to avoid color mode switch" into pi-dev
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.server.wm;
|
|||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
|
||||||
|
import static android.content.pm.ActivityInfo.COLOR_MODE_DEFAULT;
|
||||||
import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION;
|
import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION;
|
||||||
import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE;
|
import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE;
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
|
||||||
@@ -1377,7 +1378,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
|
|||||||
setAppLayoutChanges(FINISH_LAYOUT_REDO_ANIM, "checkAppWindowsReadyToShow");
|
setAppLayoutChanges(FINISH_LAYOUT_REDO_ANIM, "checkAppWindowsReadyToShow");
|
||||||
|
|
||||||
// We can now show all of the drawn windows!
|
// We can now show all of the drawn windows!
|
||||||
if (!mService.mOpeningApps.contains(this)) {
|
if (!mService.mOpeningApps.contains(this) && canShowWindows()) {
|
||||||
showAllWindowsLocked();
|
showAllWindowsLocked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2270,4 +2271,21 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
|
|||||||
boolean isClosingOrEnteringPip() {
|
boolean isClosingOrEnteringPip() {
|
||||||
return (isAnimating() && hiddenRequested) || mWillCloseOrEnterPip;
|
return (isAnimating() && hiddenRequested) || mWillCloseOrEnterPip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Whether we are allowed to show non-starting windows at the moment. We disallow
|
||||||
|
* showing windows during transitions in case we have windows that have wide-color-gamut
|
||||||
|
* color mode set to avoid jank in the middle of the transition.
|
||||||
|
*/
|
||||||
|
boolean canShowWindows() {
|
||||||
|
return allDrawn && !(isReallyAnimating() && hasNonDefaultColorWindow());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if we have a window that has a non-default color mode set; false otherwise.
|
||||||
|
*/
|
||||||
|
private boolean hasNonDefaultColorWindow() {
|
||||||
|
return forAllWindows(ws -> ws.mAttrs.getColorMode() != COLOR_MODE_DEFAULT,
|
||||||
|
true /* topToBottom */);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
|
|||||||
WindowStateAnimator winAnimator = w.mWinAnimator;
|
WindowStateAnimator winAnimator = w.mWinAnimator;
|
||||||
final AppWindowToken atoken = w.mAppToken;
|
final AppWindowToken atoken = w.mAppToken;
|
||||||
if (winAnimator.mDrawState == READY_TO_SHOW) {
|
if (winAnimator.mDrawState == READY_TO_SHOW) {
|
||||||
if (atoken == null || atoken.allDrawn) {
|
if (atoken == null || atoken.canShowWindows()) {
|
||||||
if (w.performShowLocked()) {
|
if (w.performShowLocked()) {
|
||||||
pendingLayoutChanges |= FINISH_LAYOUT_REDO_ANIM;
|
pendingLayoutChanges |= FINISH_LAYOUT_REDO_ANIM;
|
||||||
if (DEBUG_LAYOUT_REPEATS) {
|
if (DEBUG_LAYOUT_REPEATS) {
|
||||||
|
|||||||
@@ -41,11 +41,11 @@ import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME
|
|||||||
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
|
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
|
||||||
import static com.android.server.wm.WindowManagerService.TYPE_LAYER_MULTIPLIER;
|
import static com.android.server.wm.WindowManagerService.TYPE_LAYER_MULTIPLIER;
|
||||||
import static com.android.server.wm.WindowManagerService.logWithStack;
|
import static com.android.server.wm.WindowManagerService.logWithStack;
|
||||||
import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE;
|
|
||||||
import static com.android.server.wm.WindowStateAnimatorProto.DRAW_STATE;
|
import static com.android.server.wm.WindowStateAnimatorProto.DRAW_STATE;
|
||||||
import static com.android.server.wm.WindowStateAnimatorProto.LAST_CLIP_RECT;
|
import static com.android.server.wm.WindowStateAnimatorProto.LAST_CLIP_RECT;
|
||||||
import static com.android.server.wm.WindowStateAnimatorProto.SURFACE;
|
import static com.android.server.wm.WindowStateAnimatorProto.SURFACE;
|
||||||
import static com.android.server.wm.WindowStateAnimatorProto.SYSTEM_DECOR_RECT;
|
import static com.android.server.wm.WindowStateAnimatorProto.SYSTEM_DECOR_RECT;
|
||||||
|
import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE;
|
||||||
import static com.android.server.wm.utils.CoordinateTransforms.transformToRotation;
|
import static com.android.server.wm.utils.CoordinateTransforms.transformToRotation;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -366,7 +366,8 @@ class WindowStateAnimator {
|
|||||||
mDrawState = READY_TO_SHOW;
|
mDrawState = READY_TO_SHOW;
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
final AppWindowToken atoken = mWin.mAppToken;
|
final AppWindowToken atoken = mWin.mAppToken;
|
||||||
if (atoken == null || atoken.allDrawn || mWin.mAttrs.type == TYPE_APPLICATION_STARTING) {
|
if (atoken == null || atoken.canShowWindows()
|
||||||
|
|| mWin.mAttrs.type == TYPE_APPLICATION_STARTING) {
|
||||||
result = mWin.performShowLocked();
|
result = mWin.performShowLocked();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user