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

Commit c6c57cde authored by Pablo Gamito's avatar Pablo Gamito Committed by Android (Google) Code Review
Browse files

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

parents 09f32415 5bf81c05
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -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);

        // 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) {