Merge "Don't increment colorLayerCounter on surface migration" into tm-dev am: c6c57cdef8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17256643

Change-Id: I0e846a469ae819b93ed1911ce5cafba5d9d41ae9
This commit is contained in:
Pablo Gamito
2022-03-19 00:24:04 +00:00
committed by Automerger Merge Worker

View File

@@ -824,9 +824,19 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
}
void setBackgroundColor(@ColorInt int colorInt) {
setBackgroundColor(colorInt, false /* restore */);
}
void setBackgroundColor(@ColorInt int colorInt, boolean restore) {
mBackgroundColor = colorInt;
Color color = Color.valueOf(colorInt);
mColorLayerCounter++;
// We don't want to increment the mColorLayerCounter if we are restoring the background
// color after a surface migration because in that case the mColorLayerCounter already
// accounts for setting that background color.
if (!restore) {
mColorLayerCounter++;
}
// Only apply the background color if the TDA is actually attached and has a valid surface
// to set the background color on. We still want to keep track of the background color state
@@ -855,7 +865,7 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
super.migrateToNewSurfaceControl(t);
if (mColorLayerCounter > 0) {
setBackgroundColor(mBackgroundColor);
setBackgroundColor(mBackgroundColor, true /* restore */);
}
if (mSplitScreenDividerAnchor == null) {