summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Pablo Gamito <pablogamito@google.com> 2022-03-22 11:10:28 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-03-22 11:10:28 +0000
commitc6c53dbf396dac484bbc3d0ccefc0b5bfdf4481a (patch)
tree918267894a56bb8eee0e4d6451cee7c2fd1ead1e
parent4f310078e9244feb45d694408ce4638893c3cd16 (diff)
parent6a1d698ace1a10f97242ce4478a32dbd24e2b1b2 (diff)
Merge "Don't increment colorLayerCounter on surface migration" into sc-v2-dev
-rw-r--r--services/core/java/com/android/server/wm/TaskDisplayArea.java14
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 db6d3ce69cc8..15a294ee7484 100644
--- a/services/core/java/com/android/server/wm/TaskDisplayArea.java
+++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java
@@ -971,9 +971,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
@@ -1002,7 +1012,7 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
super.migrateToNewSurfaceControl(t);
if (mColorLayerCounter > 0) {
- setBackgroundColor(mBackgroundColor);
+ setBackgroundColor(mBackgroundColor, true /* restore */);
}
// As TaskDisplayArea is getting a new surface, reparent and reorder the child surfaces.