diff options
| author | 2022-03-18 22:01:49 +0000 | |
|---|---|---|
| committer | 2022-03-18 22:01:49 +0000 | |
| commit | c6c57cdef8b692f6585de7d75d6adaddb4a6dfba (patch) | |
| tree | eda542f5739c7f5d476077b56e0069f0beb8ccb5 | |
| parent | 09f324157e1bb337c6b092d111b98ecee3056fd7 (diff) | |
| parent | 5bf81c054ceb2d10f9da5af9e80c3ad92726676e (diff) | |
Merge "Don't increment colorLayerCounter on surface migration" into tm-dev
| -rw-r--r-- | services/core/java/com/android/server/wm/TaskDisplayArea.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java index 2f50b14968d5..7bb7870cea80 100644 --- a/services/core/java/com/android/server/wm/TaskDisplayArea.java +++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java @@ -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) { |