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

Commit 1e1cafe7 authored by Massimo Carli's avatar Massimo Carli Committed by Android (Google) Code Review
Browse files

Merge "Fix exit from DW for Transparent activities" into main

parents 8a8eaeb3 afe5ffb4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -761,6 +761,11 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
            released = true;
        }

        if (mTaskSurface != null) {
            t.unsetColor(mTaskSurface);
            released = true;
        }

        if (released) {
            t.apply();
        }
+2 −7
Original line number Diff line number Diff line
@@ -473,20 +473,15 @@ abstract class WindowDecoration2<T>(
    /** Releases all window decoration views. */
    private fun releaseViews(wct: WindowContainerTransaction) {
        val t = surfaceControlTransactionSupplier()
        var released = false

        decorationContainerSurface?.let {
            t.remove(it)
            decorationContainerSurface = null
            released = true
        }

        released = released or (captionController?.releaseViews(wct, t) == true)

        if (released) {
        t.unsetColor(taskSurface)
        t.apply()
    }
    }

    override fun close() = traceSection(
        traceTag = Trace.TRACE_TAG_WINDOW_MANAGER,
+3 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@@ -1314,7 +1315,8 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {

        spyWindowDecor.relayout(taskInfo, true /* hasGlobalFocus */, mExclusionRegion);

        verify(mMockTransaction).apply();
        // Apply is also invoked when the color of the Task Surface is reset.
        verify(mMockTransaction, times(2)).apply();
        verify(mMockRootSurfaceControl, never()).applyTransactionOnDraw(any());
    }

+3 −1
Original line number Diff line number Diff line
@@ -398,7 +398,9 @@ public class WindowDecorationTests extends ShellTestCase {
        windowDecor.relayout(taskInfo, true /* hasGlobalFocus */);

        verify(mMockWindowDecorViewHost, never()).release(any());
        verify(t, never()).apply();
        // Apply is invoked because a task surfaces needs to be always reset with unsetColor.
        verify(t).unsetColor(any());
        verify(t).apply();
        verify(mMockWindowContainerTransaction, never())
                .removeInsetsSource(eq(taskInfo.token), any(), anyInt(), anyInt());