Loading libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SnapshotWindowCreator.java +7 −5 Original line number Diff line number Diff line Loading @@ -35,13 +35,14 @@ class SnapshotWindowCreator { void makeTaskSnapshotWindow(StartingWindowInfo startingWindowInfo, TaskSnapshot snapshot) { final int taskId = startingWindowInfo.taskInfo.taskId; // Remove any existing starting window for this task before adding. mStartingWindowRecordManager.removeWindow(taskId, true); mStartingWindowRecordManager.removeWindow(taskId); final TaskSnapshotWindow surface = TaskSnapshotWindow.create(startingWindowInfo, startingWindowInfo.appToken, snapshot, mMainExecutor, () -> mStartingWindowRecordManager.removeWindow(taskId, true)); () -> mStartingWindowRecordManager.removeWindow(taskId)); if (surface != null) { final SnapshotWindowRecord tView = new SnapshotWindowRecord(surface, startingWindowInfo.taskInfo.topActivityType, mMainExecutor); startingWindowInfo.taskInfo.topActivityType, mMainExecutor, taskId, mStartingWindowRecordManager); mStartingWindowRecordManager.addRecord(taskId, tView); } } Loading @@ -50,8 +51,9 @@ class SnapshotWindowCreator { private final TaskSnapshotWindow mTaskSnapshotWindow; SnapshotWindowRecord(TaskSnapshotWindow taskSnapshotWindow, int activityType, ShellExecutor removeExecutor) { super(activityType, removeExecutor); int activityType, ShellExecutor removeExecutor, int id, StartingSurfaceDrawer.StartingWindowRecordManager recordManager) { super(activityType, removeExecutor, id, recordManager); mTaskSnapshotWindow = taskSnapshotWindow; mBGColor = mTaskSnapshotWindow.getBackgroundColor(); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenWindowCreator.java +1 −1 Original line number Diff line number Diff line Loading @@ -358,7 +358,7 @@ class SplashscreenWindowCreator extends AbsSplashWindowCreator { } } if (shouldSaveView) { mStartingWindowRecordManager.removeWindow(taskId, true); mStartingWindowRecordManager.removeWindow(taskId); saveSplashScreenRecord(appToken, taskId, view, suggestType); } return shouldSaveView; Loading libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java +15 −5 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ public class StartingSurfaceDrawer { final SnapshotRecord record = sRecord instanceof SnapshotRecord ? (SnapshotRecord) sRecord : null; if (record != null && record.hasImeSurface()) { records.removeWindow(taskId, true); records.removeWindow(taskId); } } Loading Loading @@ -256,10 +256,15 @@ public class StartingSurfaceDrawer { @WindowConfiguration.ActivityType protected final int mActivityType; protected final ShellExecutor mRemoveExecutor; private final int mTaskId; private final StartingWindowRecordManager mRecordManager; SnapshotRecord(int activityType, ShellExecutor removeExecutor) { SnapshotRecord(int activityType, ShellExecutor removeExecutor, int taskId, StartingWindowRecordManager recordManager) { mActivityType = activityType; mRemoveExecutor = removeExecutor; mTaskId = taskId; mRecordManager = recordManager; } @Override Loading Loading @@ -301,6 +306,7 @@ public class StartingSurfaceDrawer { @CallSuper protected void removeImmediately() { mRemoveExecutor.removeCallbacks(mScheduledRunnable); mRecordManager.onRecordRemoved(mTaskId); } } Loading @@ -316,7 +322,7 @@ public class StartingSurfaceDrawer { taskIds[i] = mStartingWindowRecords.keyAt(i); } for (int i = taskSize - 1; i >= 0; --i) { removeWindow(taskIds[i], true); removeWindow(taskIds[i]); } } Loading @@ -335,9 +341,13 @@ public class StartingSurfaceDrawer { } } void removeWindow(int taskId, boolean immediately) { void removeWindow(int taskId) { mTmpRemovalInfo.taskId = taskId; removeWindow(mTmpRemovalInfo, immediately); removeWindow(mTmpRemovalInfo, true/* immediately */); } void onRecordRemoved(int taskId) { mStartingWindowRecords.remove(taskId); } StartingWindowRecord getRecord(int taskId) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/WindowlessSnapshotWindowCreator.java +5 −3 Original line number Diff line number Diff line Loading @@ -92,7 +92,8 @@ class WindowlessSnapshotWindowCreator { final SnapshotWindowRecord record = new SnapshotWindowRecord(mViewHost, wlw.mChildSurface, taskDescription.getBackgroundColor(), snapshot.hasImeSurface(), runningTaskInfo.topActivityType, removeExecutor); runningTaskInfo.topActivityType, removeExecutor, taskId, mStartingWindowRecordManager); mStartingWindowRecordManager.addRecord(taskId, record); info.notifyAddComplete(wlw.mChildSurface); } Loading @@ -104,8 +105,9 @@ class WindowlessSnapshotWindowCreator { SnapshotWindowRecord(SurfaceControlViewHost viewHost, SurfaceControl childSurface, int bgColor, boolean hasImeSurface, int activityType, ShellExecutor removeExecutor) { super(activityType, removeExecutor); ShellExecutor removeExecutor, int id, StartingSurfaceDrawer.StartingWindowRecordManager recordManager) { super(activityType, removeExecutor, id, recordManager); mViewHost = viewHost; mChildSurface = childSurface; mBGColor = bgColor; Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SnapshotWindowCreator.java +7 −5 Original line number Diff line number Diff line Loading @@ -35,13 +35,14 @@ class SnapshotWindowCreator { void makeTaskSnapshotWindow(StartingWindowInfo startingWindowInfo, TaskSnapshot snapshot) { final int taskId = startingWindowInfo.taskInfo.taskId; // Remove any existing starting window for this task before adding. mStartingWindowRecordManager.removeWindow(taskId, true); mStartingWindowRecordManager.removeWindow(taskId); final TaskSnapshotWindow surface = TaskSnapshotWindow.create(startingWindowInfo, startingWindowInfo.appToken, snapshot, mMainExecutor, () -> mStartingWindowRecordManager.removeWindow(taskId, true)); () -> mStartingWindowRecordManager.removeWindow(taskId)); if (surface != null) { final SnapshotWindowRecord tView = new SnapshotWindowRecord(surface, startingWindowInfo.taskInfo.topActivityType, mMainExecutor); startingWindowInfo.taskInfo.topActivityType, mMainExecutor, taskId, mStartingWindowRecordManager); mStartingWindowRecordManager.addRecord(taskId, tView); } } Loading @@ -50,8 +51,9 @@ class SnapshotWindowCreator { private final TaskSnapshotWindow mTaskSnapshotWindow; SnapshotWindowRecord(TaskSnapshotWindow taskSnapshotWindow, int activityType, ShellExecutor removeExecutor) { super(activityType, removeExecutor); int activityType, ShellExecutor removeExecutor, int id, StartingSurfaceDrawer.StartingWindowRecordManager recordManager) { super(activityType, removeExecutor, id, recordManager); mTaskSnapshotWindow = taskSnapshotWindow; mBGColor = mTaskSnapshotWindow.getBackgroundColor(); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenWindowCreator.java +1 −1 Original line number Diff line number Diff line Loading @@ -358,7 +358,7 @@ class SplashscreenWindowCreator extends AbsSplashWindowCreator { } } if (shouldSaveView) { mStartingWindowRecordManager.removeWindow(taskId, true); mStartingWindowRecordManager.removeWindow(taskId); saveSplashScreenRecord(appToken, taskId, view, suggestType); } return shouldSaveView; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java +15 −5 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ public class StartingSurfaceDrawer { final SnapshotRecord record = sRecord instanceof SnapshotRecord ? (SnapshotRecord) sRecord : null; if (record != null && record.hasImeSurface()) { records.removeWindow(taskId, true); records.removeWindow(taskId); } } Loading Loading @@ -256,10 +256,15 @@ public class StartingSurfaceDrawer { @WindowConfiguration.ActivityType protected final int mActivityType; protected final ShellExecutor mRemoveExecutor; private final int mTaskId; private final StartingWindowRecordManager mRecordManager; SnapshotRecord(int activityType, ShellExecutor removeExecutor) { SnapshotRecord(int activityType, ShellExecutor removeExecutor, int taskId, StartingWindowRecordManager recordManager) { mActivityType = activityType; mRemoveExecutor = removeExecutor; mTaskId = taskId; mRecordManager = recordManager; } @Override Loading Loading @@ -301,6 +306,7 @@ public class StartingSurfaceDrawer { @CallSuper protected void removeImmediately() { mRemoveExecutor.removeCallbacks(mScheduledRunnable); mRecordManager.onRecordRemoved(mTaskId); } } Loading @@ -316,7 +322,7 @@ public class StartingSurfaceDrawer { taskIds[i] = mStartingWindowRecords.keyAt(i); } for (int i = taskSize - 1; i >= 0; --i) { removeWindow(taskIds[i], true); removeWindow(taskIds[i]); } } Loading @@ -335,9 +341,13 @@ public class StartingSurfaceDrawer { } } void removeWindow(int taskId, boolean immediately) { void removeWindow(int taskId) { mTmpRemovalInfo.taskId = taskId; removeWindow(mTmpRemovalInfo, immediately); removeWindow(mTmpRemovalInfo, true/* immediately */); } void onRecordRemoved(int taskId) { mStartingWindowRecords.remove(taskId); } StartingWindowRecord getRecord(int taskId) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/WindowlessSnapshotWindowCreator.java +5 −3 Original line number Diff line number Diff line Loading @@ -92,7 +92,8 @@ class WindowlessSnapshotWindowCreator { final SnapshotWindowRecord record = new SnapshotWindowRecord(mViewHost, wlw.mChildSurface, taskDescription.getBackgroundColor(), snapshot.hasImeSurface(), runningTaskInfo.topActivityType, removeExecutor); runningTaskInfo.topActivityType, removeExecutor, taskId, mStartingWindowRecordManager); mStartingWindowRecordManager.addRecord(taskId, record); info.notifyAddComplete(wlw.mChildSurface); } Loading @@ -104,8 +105,9 @@ class WindowlessSnapshotWindowCreator { SnapshotWindowRecord(SurfaceControlViewHost viewHost, SurfaceControl childSurface, int bgColor, boolean hasImeSurface, int activityType, ShellExecutor removeExecutor) { super(activityType, removeExecutor); ShellExecutor removeExecutor, int id, StartingSurfaceDrawer.StartingWindowRecordManager recordManager) { super(activityType, removeExecutor, id, recordManager); mViewHost = viewHost; mChildSurface = childSurface; mBGColor = bgColor; Loading