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

Commit 4c824f61 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Don't preemptively release task leashes w/ transitions" into tm-qpr-dev...

Merge "Don't preemptively release task leashes w/ transitions" into tm-qpr-dev am: f9257ef0 am: dadeca25

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



Change-Id: Id7b4e37b83a035023f4deeb5ac61098e825dc8d7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3111dcd5 dadeca25
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;

import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_TASK_ORG;
import static com.android.wm.shell.transition.Transitions.ENABLE_SHELL_TRANSITIONS;

import android.annotation.IntDef;
import android.annotation.NonNull;
@@ -542,7 +543,8 @@ public class ShellTaskOrganizer extends TaskOrganizer implements
            // Notify the recent tasks that a task has been removed
            mRecentTasks.ifPresent(recentTasks -> recentTasks.onTaskRemoved(taskInfo));

            if (appearedInfo.getLeash() != null) {
            if (!ENABLE_SHELL_TRANSITIONS && (appearedInfo.getLeash() != null)) {
                // Preemptively clean up the leash only if shell transitions are not enabled
                appearedInfo.getLeash().release();
            }
        }
+3 −0
Original line number Diff line number Diff line
@@ -26,11 +26,13 @@ import static com.android.dx.mockito.inline.extended.ExtendedMockito.spy;
import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_FULLSCREEN;
import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_MULTI_WINDOW;
import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_PIP;
import static com.android.wm.shell.transition.Transitions.ENABLE_SHELL_TRANSITIONS;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeFalse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.mock;
@@ -146,6 +148,7 @@ public class ShellTaskOrganizerTests extends ShellTestCase {

    @Test
    public void testTaskLeashReleasedAfterVanished() throws RemoteException {
        assumeFalse(ENABLE_SHELL_TRANSITIONS);
        RunningTaskInfo taskInfo = createTaskInfo(1, WINDOWING_MODE_MULTI_WINDOW);
        SurfaceControl taskLeash = new SurfaceControl.Builder(new SurfaceSession())
                .setName("task").build();