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

Commit 84d868de authored by Graciela Wissen Putri's avatar Graciela Wissen Putri
Browse files

Use black only for desktop tasks background

Use black instead of taskDescription backgroundColor for temporary
workaround so exit from DW for transparent activites with light theme
don't have white background. This should be re-added when
WindowDecoration2 refactor is completed.

Flag: EXEMPT bug fix
Bug: 432347028
Test: jank CUJ test in b/432976351
Change-Id: I676e42226de7a3f67eee288ca610ebb3d299cbc9
parent 48827157
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -527,8 +527,7 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
        }

        if (params.mShouldSetBackground) {
            final int backgroundColorInt = mTaskInfo.taskDescription != null
                    ? mTaskInfo.taskDescription.getBackgroundColor() : Color.BLACK;
            final int backgroundColorInt = Color.BLACK;
            mTmpColor[0] = (float) Color.red(backgroundColorInt) / 255.f;
            mTmpColor[1] = (float) Color.green(backgroundColorInt) / 255.f;
            mTmpColor[2] = (float) Color.blue(backgroundColorInt) / 255.f;
+2 −1
Original line number Diff line number Diff line
@@ -294,7 +294,8 @@ abstract class WindowDecoration2<T>(
        }

        if (params.shouldSetBackground) {
            val backgroundColorInt = taskInfo.taskDescription?.backgroundColor ?: Color.BLACK
            // TODO: b/437011322 - Use taskDescription backgroundColor for free resizing
            val backgroundColorInt = Color.BLACK
            val tmpColor =
                floatArrayOf(
                    Color.red(backgroundColorInt).toFloat() / 255f,
+1 −6
Original line number Diff line number Diff line
@@ -697,13 +697,8 @@ public class WindowDecorationTests extends ShellTestCase {
                createMockSurfaceControlBuilder(captionContainerSurface);
        mMockSurfaceControlBuilders.add(captionContainerSurfaceBuilder);

        final ActivityManager.TaskDescription.Builder taskDescriptionBuilder =
                new ActivityManager.TaskDescription.Builder()
                        .setBackgroundColor(Color.YELLOW);

        final ActivityManager.RunningTaskInfo taskInfo = new TestRunningTaskInfoBuilder()
                .setDisplayId(Display.DEFAULT_DISPLAY)
                .setTaskDescriptionBuilder(taskDescriptionBuilder)
                .setVisible(true)
                .setWindowingMode(WINDOWING_MODE_FREEFORM)
                .build();
@@ -712,7 +707,7 @@ public class WindowDecorationTests extends ShellTestCase {
        mRelayoutParams.mShouldSetBackground = true;
        windowDecor.relayout(taskInfo, true /* hasGlobalFocus */);

        verify(mMockSurfaceControlStartT).setColor(mMockTaskSurface, new float[]{1.f, 1.f, 0.f});
        verify(mMockSurfaceControlStartT).setColor(mMockTaskSurface, new float[]{0.f, 0.f, 0.f});
    }

    @Test