diff options
author | Winson Chung <winsonc@google.com> | 2022-01-13 01:42:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-01-13 01:42:19 +0000 |
commit | a76e46ee0309c13e6872df294524231d08c8b86f (patch) | |
tree | 166b305abd776491d830b8f2e1396841df9102d1 /libs | |
parent | d0f8b5e99d5bcec8c47e458d57331ddb51141f02 (diff) | |
parent | d0823fc830f184790d2301da1ab6551bea1c0569 (diff) |
Merge "Return non-null empty list if the controller is already invalidated" into sc-v2-dev
Diffstat (limited to 'libs')
-rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java index 7decb54d16bb..338c944f7eec 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java @@ -292,7 +292,6 @@ public class RecentTasksController implements TaskStackListenerCallback, * Invalidates this instance, preventing future calls from updating the controller. */ void invalidate() { - Slog.d("b/206648922", "invalidating controller: " + mController); mController = null; } @@ -313,13 +312,16 @@ public class RecentTasksController implements TaskStackListenerCallback, @Override public GroupedRecentTaskInfo[] getRecentTasks(int maxNum, int flags, int userId) throws RemoteException { + if (mController == null) { + // The controller is already invalidated -- just return an empty task list for now + return new GroupedRecentTaskInfo[0]; + } + final GroupedRecentTaskInfo[][] out = new GroupedRecentTaskInfo[][]{null}; executeRemoteCallWithTaskPermission(mController, "getRecentTasks", (controller) -> out[0] = controller.getRecentTasks(maxNum, flags, userId) .toArray(new GroupedRecentTaskInfo[0]), true /* blocking */); - Slog.d("b/206648922", "getRecentTasks(" + maxNum + "): " + out[0] - + " mController=" + mController); return out[0]; } } |