Loading libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskView.java +2 −2 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, * Moves the current task in taskview out of the view and back to fullscreen. */ public void moveToFullscreen() { mTaskViewTaskController.moveToFullscreen(); mTaskViewTransitions.moveTaskViewToFullscreen(mTaskViewTaskController); } @Override Loading Loading @@ -234,7 +234,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, * Call to remove the task from window manager. This task will not appear in recents. */ public void removeTask() { mTaskViewTaskController.removeTask(); mTaskViewTransitions.removeTaskView(mTaskViewTaskController, null /* token */); } /** Loading libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java +10 −57 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.wm.shell.taskview; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityManager; Loading @@ -27,14 +25,12 @@ import android.graphics.Rect; import android.gui.TrustedOverlay; import android.os.Binder; import android.util.CloseGuard; import android.util.Slog; import android.view.SurfaceControl; import android.view.WindowInsets; import android.window.WindowContainerToken; import android.window.WindowContainerTransaction; import com.android.internal.annotations.VisibleForTesting; import com.android.wm.shell.Flags; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.common.SyncTransactionQueue; Loading Loading @@ -93,7 +89,7 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { mTaskViewTransitions = taskViewTransitions; mShellExecutor.execute(() -> { if (mTaskViewTransitions != null) { mTaskViewTransitions.addTaskView(this); mTaskViewTransitions.registerTaskView(this); } }); mGuard.open("release"); Loading Loading @@ -151,24 +147,6 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { mListenerExecutor = executor; } /** * Moves the current task in TaskView out of the view and back to fullscreen. */ public void moveToFullscreen() { if (mTaskToken == null) return; mShellExecutor.execute(() -> { WindowContainerTransaction wct = new WindowContainerTransaction(); wct.setWindowingMode(mTaskToken, WINDOWING_MODE_UNDEFINED); wct.setAlwaysOnTop(mTaskToken, false); mTaskOrganizer.setInterceptBackPressedOnTaskRoot(mTaskToken, false); mTaskViewTransitions.moveTaskViewToFullscreen(wct, this); if (mListener != null) { // Task is being "removed" from the clients perspective mListener.onTaskRemovalStarted(mTaskInfo.taskId); } }); } /** * Release this container if it is initialized. */ Loading @@ -191,7 +169,7 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { private void performRelease() { mShellExecutor.execute(() -> { if (mTaskViewTransitions != null) { mTaskViewTransitions.removeTaskView(this); mTaskViewTransitions.unregisterTaskView(this); } mTaskOrganizer.removeListener(this); resetTaskInfo(); Loading Loading @@ -377,30 +355,6 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { }); } /** * Call to remove the task from window manager. This task will not appear in recents. */ void removeTask() { if (mTaskToken == null) { if (Flags.enableTaskViewControllerCleanup()) { // We don't have a task yet. Only clean up the controller mTaskViewTransitions.removeTaskView(this); } else { // Call to remove task before we have one, do nothing Slog.w(TAG, "Trying to remove a task that was never added? (no taskToken)"); } return; } // Cache it to avoid NPE and make sure to remove it from recents history. // mTaskToken can be cleared in onTaskVanished() when the task is removed. final WindowContainerToken taskToken = mTaskToken; mShellExecutor.execute(() -> { WindowContainerTransaction wct = new WindowContainerTransaction(); wct.removeTask(taskToken); mTaskViewTransitions.closeTaskView(wct, this); }); } /** * Sets a region of the task to inset to allow for a caption bar. * Loading Loading @@ -459,15 +413,16 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { } } void notifyTaskRemovalStarted(@NonNull ActivityManager.RunningTaskInfo taskInfo) { if (mListener == null) return; final int taskId = taskInfo.taskId; mListenerExecutor.execute(() -> mListener.onTaskRemovalStarted(taskId)); } /** Notifies listeners of a task being removed and stops intercepting back presses on it. */ private void handleAndNotifyTaskRemoval(ActivityManager.RunningTaskInfo taskInfo) { if (taskInfo != null) { if (mListener != null) { final int taskId = taskInfo.taskId; mListenerExecutor.execute(() -> { mListener.onTaskRemovalStarted(taskId); }); } notifyTaskRemovalStarted(taskInfo); mTaskViewBase.onTaskVanished(taskInfo); } } Loading Loading @@ -506,9 +461,7 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { handleAndNotifyTaskRemoval(pendingInfo); // Make sure the task is removed WindowContainerTransaction wct = new WindowContainerTransaction(); wct.removeTask(pendingInfo.token); mTaskViewTransitions.closeTaskView(wct, this); mTaskViewTransitions.removeTaskView(this, pendingInfo.token); } resetTaskInfo(); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTransitions.java +42 −10 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.taskview; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.view.WindowManager.TRANSIT_CHANGE; import static android.view.WindowManager.TRANSIT_CLOSE; import static android.view.WindowManager.TRANSIT_OPEN; Loading @@ -41,6 +42,7 @@ import android.view.SurfaceControl; import android.view.WindowManager; import android.window.TransitionInfo; import android.window.TransitionRequestInfo; import android.window.WindowContainerToken; import android.window.WindowContainerTransaction; import androidx.annotation.VisibleForTesting; Loading Loading @@ -155,7 +157,7 @@ public class TaskViewTransitions implements Transitions.TransitionHandler { return mTaskViewRepo; } void addTaskView(TaskViewTaskController tv) { void registerTaskView(TaskViewTaskController tv) { synchronized (mRegistered) { if (!mRegistered[0]) { mRegistered[0] = true; Loading @@ -169,7 +171,7 @@ public class TaskViewTransitions implements Transitions.TransitionHandler { } } void removeTaskView(TaskViewTaskController tv) { void unregisterTaskView(TaskViewTaskController tv) { if (useRepo()) { mTaskViewRepo.remove(tv); } else { Loading Loading @@ -397,17 +399,47 @@ public class TaskViewTransitions implements Transitions.TransitionHandler { startNextTransition(); } void closeTaskView(@NonNull WindowContainerTransaction wct, @NonNull TaskViewTaskController taskView) { /** * Removes a taskview and also removes it's task from window manager. This task will not appear * in recents. */ public void removeTaskView(@NonNull TaskViewTaskController taskView, @Nullable WindowContainerToken taskToken) { final WindowContainerToken token = taskToken != null ? taskToken : taskView.getTaskToken(); if (token == null) { // We don't have a task yet, so just clean up records if (!Flags.enableTaskViewControllerCleanup()) { // Call to remove task before we have one, do nothing Slog.w(TAG, "Trying to remove a task that was never added? (no taskToken)"); return; } unregisterTaskView(taskView); return; } final WindowContainerTransaction wct = new WindowContainerTransaction(); wct.removeTask(token); updateVisibilityState(taskView, false /* visible */); mShellExecutor.execute(() -> { mPending.add(new PendingTransition(TRANSIT_CLOSE, wct, taskView, null /* cookie */)); startNextTransition(); }); } void moveTaskViewToFullscreen(@NonNull WindowContainerTransaction wct, @NonNull TaskViewTaskController taskView) { /** * Moves the current task in TaskView out of the view and back to fullscreen. */ public void moveTaskViewToFullscreen(@NonNull TaskViewTaskController taskView) { final WindowContainerToken taskToken = taskView.getTaskToken(); if (taskToken == null) return; final WindowContainerTransaction wct = new WindowContainerTransaction(); wct.setWindowingMode(taskToken, WINDOWING_MODE_UNDEFINED); wct.setAlwaysOnTop(taskToken, false); mShellExecutor.execute(() -> { mTaskOrganizer.setInterceptBackPressedOnTaskRoot(taskToken, false); mPending.add(new PendingTransition(TRANSIT_CHANGE, wct, taskView, null /* cookie */)); startNextTransition(); taskView.notifyTaskRemovalStarted(taskView.getTaskInfo()); }); } /** Starts a new transition to make the given {@code taskView} visible. */ Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTest.java +6 −6 Original line number Diff line number Diff line Loading @@ -424,7 +424,7 @@ public class TaskViewTest extends ShellTestCase { verify(mOrganizer).removeListener(eq(mTaskViewTaskController)); verify(mViewListener).onReleased(); assertThat(mTaskView.isInitialized()).isFalse(); verify(mTaskViewTransitions).removeTaskView(eq(mTaskViewTaskController)); verify(mTaskViewTransitions).unregisterTaskView(eq(mTaskViewTaskController)); } @Test Loading Loading @@ -620,7 +620,7 @@ public class TaskViewTest extends ShellTestCase { assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); mTaskView.removeTask(); verify(mTaskViewTransitions, never()).closeTaskView(any(), any()); assertFalse(mTaskViewTransitions.hasPending()); } @Test Loading @@ -636,7 +636,7 @@ public class TaskViewTest extends ShellTestCase { verify(mViewListener).onTaskCreated(eq(mTaskInfo.taskId), any()); mTaskView.removeTask(); verify(mTaskViewTransitions).closeTaskView(any(), eq(mTaskViewTaskController)); verify(mTaskViewTransitions).removeTaskView(eq(mTaskViewTaskController), any()); } @Test Loading @@ -647,7 +647,7 @@ public class TaskViewTest extends ShellTestCase { mTaskViewTaskController.onTaskAppeared(mTaskInfo, mLeash); assertNull(mTaskViewTaskController.getTaskInfo()); verify(mTaskViewTransitions).closeTaskView(any(), eq(mTaskViewTaskController)); verify(mTaskViewTransitions).removeTaskView(eq(mTaskViewTaskController), any()); } @Test Loading @@ -656,7 +656,7 @@ public class TaskViewTest extends ShellTestCase { mTaskViewTaskController.onTaskAppeared(mTaskInfo, mLeash); assertEquals(mTaskInfo, mTaskViewTaskController.getPendingInfo()); verify(mTaskViewTransitions, never()).closeTaskView(any(), any()); verify(mTaskViewTransitions, never()).removeTaskView(any(), any()); } @Test Loading Loading @@ -778,7 +778,7 @@ public class TaskViewTest extends ShellTestCase { new SurfaceControl.Transaction(), new SurfaceControl.Transaction(), mTaskInfo, mLeash, wct); mTaskView.surfaceCreated(mock(SurfaceHolder.class)); mTaskViewTaskController.moveToFullscreen(); mTaskViewTransitions.moveTaskViewToFullscreen(mTaskViewTaskController); verify(mViewListener).onTaskRemovalStarted(eq(mTaskInfo.taskId)); } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTransitionsTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ public class TaskViewTransitionsTest extends ShellTestCase { when(mOrganizer.getExecutor()).thenReturn(mExecutor); mTaskViewTransitions = spy(new TaskViewTransitions(mTransitions, mTaskViewRepository, mOrganizer, mSyncQueue)); mTaskViewTransitions.addTaskView(mTaskViewTaskController); mTaskViewTransitions.registerTaskView(mTaskViewTaskController); when(mTaskViewTaskController.getTaskInfo()).thenReturn(mTaskInfo); when(mTaskViewTaskController.getTaskToken()).thenReturn(mToken); } Loading Loading @@ -224,7 +224,7 @@ public class TaskViewTransitionsTest extends ShellTestCase { @Test public void testSetTaskVisibility_taskRemoved_noNPE() { mTaskViewTransitions.removeTaskView(mTaskViewTaskController); mTaskViewTransitions.unregisterTaskView(mTaskViewTaskController); assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); Loading @@ -233,7 +233,7 @@ public class TaskViewTransitionsTest extends ShellTestCase { @Test public void testSetTaskBounds_taskRemoved_noNPE() { mTaskViewTransitions.removeTaskView(mTaskViewTaskController); mTaskViewTransitions.unregisterTaskView(mTaskViewTaskController); assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskView.java +2 −2 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, * Moves the current task in taskview out of the view and back to fullscreen. */ public void moveToFullscreen() { mTaskViewTaskController.moveToFullscreen(); mTaskViewTransitions.moveTaskViewToFullscreen(mTaskViewTaskController); } @Override Loading Loading @@ -234,7 +234,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, * Call to remove the task from window manager. This task will not appear in recents. */ public void removeTask() { mTaskViewTaskController.removeTask(); mTaskViewTransitions.removeTaskView(mTaskViewTaskController, null /* token */); } /** Loading
libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java +10 −57 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.wm.shell.taskview; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityManager; Loading @@ -27,14 +25,12 @@ import android.graphics.Rect; import android.gui.TrustedOverlay; import android.os.Binder; import android.util.CloseGuard; import android.util.Slog; import android.view.SurfaceControl; import android.view.WindowInsets; import android.window.WindowContainerToken; import android.window.WindowContainerTransaction; import com.android.internal.annotations.VisibleForTesting; import com.android.wm.shell.Flags; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.common.SyncTransactionQueue; Loading Loading @@ -93,7 +89,7 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { mTaskViewTransitions = taskViewTransitions; mShellExecutor.execute(() -> { if (mTaskViewTransitions != null) { mTaskViewTransitions.addTaskView(this); mTaskViewTransitions.registerTaskView(this); } }); mGuard.open("release"); Loading Loading @@ -151,24 +147,6 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { mListenerExecutor = executor; } /** * Moves the current task in TaskView out of the view and back to fullscreen. */ public void moveToFullscreen() { if (mTaskToken == null) return; mShellExecutor.execute(() -> { WindowContainerTransaction wct = new WindowContainerTransaction(); wct.setWindowingMode(mTaskToken, WINDOWING_MODE_UNDEFINED); wct.setAlwaysOnTop(mTaskToken, false); mTaskOrganizer.setInterceptBackPressedOnTaskRoot(mTaskToken, false); mTaskViewTransitions.moveTaskViewToFullscreen(wct, this); if (mListener != null) { // Task is being "removed" from the clients perspective mListener.onTaskRemovalStarted(mTaskInfo.taskId); } }); } /** * Release this container if it is initialized. */ Loading @@ -191,7 +169,7 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { private void performRelease() { mShellExecutor.execute(() -> { if (mTaskViewTransitions != null) { mTaskViewTransitions.removeTaskView(this); mTaskViewTransitions.unregisterTaskView(this); } mTaskOrganizer.removeListener(this); resetTaskInfo(); Loading Loading @@ -377,30 +355,6 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { }); } /** * Call to remove the task from window manager. This task will not appear in recents. */ void removeTask() { if (mTaskToken == null) { if (Flags.enableTaskViewControllerCleanup()) { // We don't have a task yet. Only clean up the controller mTaskViewTransitions.removeTaskView(this); } else { // Call to remove task before we have one, do nothing Slog.w(TAG, "Trying to remove a task that was never added? (no taskToken)"); } return; } // Cache it to avoid NPE and make sure to remove it from recents history. // mTaskToken can be cleared in onTaskVanished() when the task is removed. final WindowContainerToken taskToken = mTaskToken; mShellExecutor.execute(() -> { WindowContainerTransaction wct = new WindowContainerTransaction(); wct.removeTask(taskToken); mTaskViewTransitions.closeTaskView(wct, this); }); } /** * Sets a region of the task to inset to allow for a caption bar. * Loading Loading @@ -459,15 +413,16 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { } } void notifyTaskRemovalStarted(@NonNull ActivityManager.RunningTaskInfo taskInfo) { if (mListener == null) return; final int taskId = taskInfo.taskId; mListenerExecutor.execute(() -> mListener.onTaskRemovalStarted(taskId)); } /** Notifies listeners of a task being removed and stops intercepting back presses on it. */ private void handleAndNotifyTaskRemoval(ActivityManager.RunningTaskInfo taskInfo) { if (taskInfo != null) { if (mListener != null) { final int taskId = taskInfo.taskId; mListenerExecutor.execute(() -> { mListener.onTaskRemovalStarted(taskId); }); } notifyTaskRemovalStarted(taskInfo); mTaskViewBase.onTaskVanished(taskInfo); } } Loading Loading @@ -506,9 +461,7 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { handleAndNotifyTaskRemoval(pendingInfo); // Make sure the task is removed WindowContainerTransaction wct = new WindowContainerTransaction(); wct.removeTask(pendingInfo.token); mTaskViewTransitions.closeTaskView(wct, this); mTaskViewTransitions.removeTaskView(this, pendingInfo.token); } resetTaskInfo(); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTransitions.java +42 −10 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.taskview; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.view.WindowManager.TRANSIT_CHANGE; import static android.view.WindowManager.TRANSIT_CLOSE; import static android.view.WindowManager.TRANSIT_OPEN; Loading @@ -41,6 +42,7 @@ import android.view.SurfaceControl; import android.view.WindowManager; import android.window.TransitionInfo; import android.window.TransitionRequestInfo; import android.window.WindowContainerToken; import android.window.WindowContainerTransaction; import androidx.annotation.VisibleForTesting; Loading Loading @@ -155,7 +157,7 @@ public class TaskViewTransitions implements Transitions.TransitionHandler { return mTaskViewRepo; } void addTaskView(TaskViewTaskController tv) { void registerTaskView(TaskViewTaskController tv) { synchronized (mRegistered) { if (!mRegistered[0]) { mRegistered[0] = true; Loading @@ -169,7 +171,7 @@ public class TaskViewTransitions implements Transitions.TransitionHandler { } } void removeTaskView(TaskViewTaskController tv) { void unregisterTaskView(TaskViewTaskController tv) { if (useRepo()) { mTaskViewRepo.remove(tv); } else { Loading Loading @@ -397,17 +399,47 @@ public class TaskViewTransitions implements Transitions.TransitionHandler { startNextTransition(); } void closeTaskView(@NonNull WindowContainerTransaction wct, @NonNull TaskViewTaskController taskView) { /** * Removes a taskview and also removes it's task from window manager. This task will not appear * in recents. */ public void removeTaskView(@NonNull TaskViewTaskController taskView, @Nullable WindowContainerToken taskToken) { final WindowContainerToken token = taskToken != null ? taskToken : taskView.getTaskToken(); if (token == null) { // We don't have a task yet, so just clean up records if (!Flags.enableTaskViewControllerCleanup()) { // Call to remove task before we have one, do nothing Slog.w(TAG, "Trying to remove a task that was never added? (no taskToken)"); return; } unregisterTaskView(taskView); return; } final WindowContainerTransaction wct = new WindowContainerTransaction(); wct.removeTask(token); updateVisibilityState(taskView, false /* visible */); mShellExecutor.execute(() -> { mPending.add(new PendingTransition(TRANSIT_CLOSE, wct, taskView, null /* cookie */)); startNextTransition(); }); } void moveTaskViewToFullscreen(@NonNull WindowContainerTransaction wct, @NonNull TaskViewTaskController taskView) { /** * Moves the current task in TaskView out of the view and back to fullscreen. */ public void moveTaskViewToFullscreen(@NonNull TaskViewTaskController taskView) { final WindowContainerToken taskToken = taskView.getTaskToken(); if (taskToken == null) return; final WindowContainerTransaction wct = new WindowContainerTransaction(); wct.setWindowingMode(taskToken, WINDOWING_MODE_UNDEFINED); wct.setAlwaysOnTop(taskToken, false); mShellExecutor.execute(() -> { mTaskOrganizer.setInterceptBackPressedOnTaskRoot(taskToken, false); mPending.add(new PendingTransition(TRANSIT_CHANGE, wct, taskView, null /* cookie */)); startNextTransition(); taskView.notifyTaskRemovalStarted(taskView.getTaskInfo()); }); } /** Starts a new transition to make the given {@code taskView} visible. */ Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTest.java +6 −6 Original line number Diff line number Diff line Loading @@ -424,7 +424,7 @@ public class TaskViewTest extends ShellTestCase { verify(mOrganizer).removeListener(eq(mTaskViewTaskController)); verify(mViewListener).onReleased(); assertThat(mTaskView.isInitialized()).isFalse(); verify(mTaskViewTransitions).removeTaskView(eq(mTaskViewTaskController)); verify(mTaskViewTransitions).unregisterTaskView(eq(mTaskViewTaskController)); } @Test Loading Loading @@ -620,7 +620,7 @@ public class TaskViewTest extends ShellTestCase { assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); mTaskView.removeTask(); verify(mTaskViewTransitions, never()).closeTaskView(any(), any()); assertFalse(mTaskViewTransitions.hasPending()); } @Test Loading @@ -636,7 +636,7 @@ public class TaskViewTest extends ShellTestCase { verify(mViewListener).onTaskCreated(eq(mTaskInfo.taskId), any()); mTaskView.removeTask(); verify(mTaskViewTransitions).closeTaskView(any(), eq(mTaskViewTaskController)); verify(mTaskViewTransitions).removeTaskView(eq(mTaskViewTaskController), any()); } @Test Loading @@ -647,7 +647,7 @@ public class TaskViewTest extends ShellTestCase { mTaskViewTaskController.onTaskAppeared(mTaskInfo, mLeash); assertNull(mTaskViewTaskController.getTaskInfo()); verify(mTaskViewTransitions).closeTaskView(any(), eq(mTaskViewTaskController)); verify(mTaskViewTransitions).removeTaskView(eq(mTaskViewTaskController), any()); } @Test Loading @@ -656,7 +656,7 @@ public class TaskViewTest extends ShellTestCase { mTaskViewTaskController.onTaskAppeared(mTaskInfo, mLeash); assertEquals(mTaskInfo, mTaskViewTaskController.getPendingInfo()); verify(mTaskViewTransitions, never()).closeTaskView(any(), any()); verify(mTaskViewTransitions, never()).removeTaskView(any(), any()); } @Test Loading Loading @@ -778,7 +778,7 @@ public class TaskViewTest extends ShellTestCase { new SurfaceControl.Transaction(), new SurfaceControl.Transaction(), mTaskInfo, mLeash, wct); mTaskView.surfaceCreated(mock(SurfaceHolder.class)); mTaskViewTaskController.moveToFullscreen(); mTaskViewTransitions.moveTaskViewToFullscreen(mTaskViewTaskController); verify(mViewListener).onTaskRemovalStarted(eq(mTaskInfo.taskId)); } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTransitionsTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ public class TaskViewTransitionsTest extends ShellTestCase { when(mOrganizer.getExecutor()).thenReturn(mExecutor); mTaskViewTransitions = spy(new TaskViewTransitions(mTransitions, mTaskViewRepository, mOrganizer, mSyncQueue)); mTaskViewTransitions.addTaskView(mTaskViewTaskController); mTaskViewTransitions.registerTaskView(mTaskViewTaskController); when(mTaskViewTaskController.getTaskInfo()).thenReturn(mTaskInfo); when(mTaskViewTaskController.getTaskToken()).thenReturn(mToken); } Loading Loading @@ -224,7 +224,7 @@ public class TaskViewTransitionsTest extends ShellTestCase { @Test public void testSetTaskVisibility_taskRemoved_noNPE() { mTaskViewTransitions.removeTaskView(mTaskViewTaskController); mTaskViewTransitions.unregisterTaskView(mTaskViewTaskController); assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); Loading @@ -233,7 +233,7 @@ public class TaskViewTransitionsTest extends ShellTestCase { @Test public void testSetTaskBounds_taskRemoved_noNPE() { mTaskViewTransitions.removeTaskView(mTaskViewTaskController); mTaskViewTransitions.unregisterTaskView(mTaskViewTaskController); assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); Loading