Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +19 −17 Original line number Diff line number Diff line Loading @@ -850,7 +850,9 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, mBgExecutor.execute(() -> { final ArrayList<Pair<Integer, TaskSnapshot>> snapshotList = getTaskSnapshots(decor.mTaskInfo); if (!snapshotList.isEmpty()) { mMainExecutor.execute(() -> decor.createManageWindowsMenu(snapshotList)); } }); } Loading Loading @@ -915,17 +917,17 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, ActivityManager.RECENT_WITH_EXCLUDED, activityManager.getCurrentUser().id); } catch (RemoteException e) { throw new RuntimeException(e); ProtoLog.e(WM_SHELL_DESKTOP_MODE, "%s: Error getting recent tasks: %s", TAG, e); return new ArrayList<>(); } final String callerPackageName = callerTaskInfo.baseActivity.getPackageName(); for (ActivityManager.RecentTaskInfo info : recentTasks) { if (info.taskId == callerTaskInfo.taskId || info.baseActivity == null) continue; if (info.baseActivity == null) continue; final String infoPackageName = info.baseActivity.getPackageName(); if (!infoPackageName.equals(callerPackageName)) { continue; } if (info.baseActivity != null) { if (callerPackageName.equals(infoPackageName)) { // TODO(b/337903443): Fix this returning null for freeform tasks. try { TaskSnapshot screenshot = activityTaskManagerService Loading @@ -936,9 +938,9 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, } snapshotList.add(new Pair(info.taskId, screenshot)); } catch (RemoteException e) { throw new RuntimeException(e); } } ProtoLog.e(WM_SHELL_DESKTOP_MODE, "%s: Error getting task snapshot for task %d: %s", TAG, info.taskId, e); return new ArrayList<>(); } } return snapshotList; Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +3 −1 Original line number Diff line number Diff line Loading @@ -1530,7 +1530,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin void createManageWindowsMenu(@NonNull List<Pair<Integer, TaskSnapshot>> snapshotList) { final Function1<Integer, Unit> onOpenInstanceListener = (requestedTaskId) -> { closeManageWindowsMenu(); if (mTaskInfo.taskId != requestedTaskId) { mWindowDecorationActions.onOpenInstance(mTaskInfo, requestedTaskId); } return Unit.INSTANCE; }; if (mTaskInfo.isFreeform()) { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +19 −17 Original line number Diff line number Diff line Loading @@ -850,7 +850,9 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, mBgExecutor.execute(() -> { final ArrayList<Pair<Integer, TaskSnapshot>> snapshotList = getTaskSnapshots(decor.mTaskInfo); if (!snapshotList.isEmpty()) { mMainExecutor.execute(() -> decor.createManageWindowsMenu(snapshotList)); } }); } Loading Loading @@ -915,17 +917,17 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, ActivityManager.RECENT_WITH_EXCLUDED, activityManager.getCurrentUser().id); } catch (RemoteException e) { throw new RuntimeException(e); ProtoLog.e(WM_SHELL_DESKTOP_MODE, "%s: Error getting recent tasks: %s", TAG, e); return new ArrayList<>(); } final String callerPackageName = callerTaskInfo.baseActivity.getPackageName(); for (ActivityManager.RecentTaskInfo info : recentTasks) { if (info.taskId == callerTaskInfo.taskId || info.baseActivity == null) continue; if (info.baseActivity == null) continue; final String infoPackageName = info.baseActivity.getPackageName(); if (!infoPackageName.equals(callerPackageName)) { continue; } if (info.baseActivity != null) { if (callerPackageName.equals(infoPackageName)) { // TODO(b/337903443): Fix this returning null for freeform tasks. try { TaskSnapshot screenshot = activityTaskManagerService Loading @@ -936,9 +938,9 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, } snapshotList.add(new Pair(info.taskId, screenshot)); } catch (RemoteException e) { throw new RuntimeException(e); } } ProtoLog.e(WM_SHELL_DESKTOP_MODE, "%s: Error getting task snapshot for task %d: %s", TAG, info.taskId, e); return new ArrayList<>(); } } return snapshotList; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +3 −1 Original line number Diff line number Diff line Loading @@ -1530,7 +1530,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin void createManageWindowsMenu(@NonNull List<Pair<Integer, TaskSnapshot>> snapshotList) { final Function1<Integer, Unit> onOpenInstanceListener = (requestedTaskId) -> { closeManageWindowsMenu(); if (mTaskInfo.taskId != requestedTaskId) { mWindowDecorationActions.onOpenInstance(mTaskInfo, requestedTaskId); } return Unit.INSTANCE; }; if (mTaskInfo.isFreeform()) { Loading