Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d789bf9b authored by Pablo Gamito's avatar Pablo Gamito Committed by Presubmit Automerger Backend
Browse files

[automerge] Don't increment colorLayerCounter on surface migration 2p: 6a1d698a

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

Bug: 221775939
Change-Id: Ifc31a3707edd59071526da5e756583c296f51613
Merged-In: Ifc93d5482bad9591e942e4be91e0039daae743b1
parents 0fa758c3 6a1d698a
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -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);

        // 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.