Loading services/core/java/com/android/server/wm/ActivityRecord.java +13 −4 Original line number Diff line number Diff line Loading @@ -4890,8 +4890,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A * @param visible {@code true} if this {@link ActivityRecord} should become visible, otherwise * this should become invisible. * @param performLayout if {@code true}, perform surface placement after committing visibility. * @param fromTransition {@code true} if this is part of finishing a transition. */ void commitVisibility(boolean visible, boolean performLayout) { void commitVisibility(boolean visible, boolean performLayout, boolean fromTransition) { // Reset the state of mVisibleSetFromTransferredStartingWindow since visibility is actually // been set by the app now. mVisibleSetFromTransferredStartingWindow = false; Loading Loading @@ -4941,7 +4942,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A displayContent.getInputMonitor().updateInputWindowsLw(false /*force*/); mUseTransferredAnimation = false; postApplyAnimation(visible); postApplyAnimation(visible, fromTransition); } void commitVisibility(boolean visible, boolean performLayout) { commitVisibility(visible, performLayout, false /* fromTransition */); } /** Loading @@ -4952,8 +4957,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A * * @param visible {@code true} if this {@link ActivityRecord} has become visible, otherwise * this has become invisible. * @param fromTransition {@code true} if this call is part of finishing a transition. This is * needed because the shell transition is no-longer active by the time * commitVisibility is called. */ private void postApplyAnimation(boolean visible) { private void postApplyAnimation(boolean visible, boolean fromTransition) { final boolean usingShellTransitions = mTransitionController.isShellTransitionsEnabled(); final boolean delayed = isAnimating(TRANSITION | PARENTS | CHILDREN, ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_WINDOW_ANIMATION Loading Loading @@ -4994,7 +5002,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A final DisplayContent displayContent = getDisplayContent(); if (!displayContent.mClosingApps.contains(this) && !displayContent.mOpeningApps.contains(this)) { && !displayContent.mOpeningApps.contains(this) && !fromTransition) { // Take the screenshot before possibly hiding the WSA, otherwise the screenshot // will not be taken. mWmService.mTaskSnapshotController.notifyAppVisibilityChanged(this, visible); Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +1 −0 Original line number Diff line number Diff line Loading @@ -991,6 +991,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { synchronized (mGlobalLock) { mWindowManager = wm; mRootWindowContainer = wm.mRoot; mWindowOrganizerController.setWindowManager(wm); mTempConfig.setToDefaults(); mTempConfig.setLocales(LocaleList.getDefault()); mConfigurationSeq = mTempConfig.seq = 1; Loading services/core/java/com/android/server/wm/TaskSnapshotController.java +37 −34 Original line number Diff line number Diff line Loading @@ -178,9 +178,7 @@ class TaskSnapshotController { snapshotTasks(tasks, false /* allowSnapshotHome */); } private void snapshotTasks(ArraySet<Task> tasks, boolean allowSnapshotHome) { for (int i = tasks.size() - 1; i >= 0; i--) { final Task task = tasks.valueAt(i); void recordTaskSnapshot(Task task, boolean allowSnapshotHome) { final TaskSnapshot snapshot; final boolean snapshotHome = allowSnapshotHome && task.isActivityTypeHome(); if (snapshotHome) { Loading @@ -188,7 +186,7 @@ class TaskSnapshotController { } else { switch (getSnapshotMode(task)) { case SNAPSHOT_MODE_NONE: continue; return; case SNAPSHOT_MODE_APP_THEME: snapshot = drawAppThemeSnapshot(task); break; Loading Loading @@ -216,6 +214,11 @@ class TaskSnapshotController { } } } private void snapshotTasks(ArraySet<Task> tasks, boolean allowSnapshotHome) { for (int i = tasks.size() - 1; i >= 0; i--) { recordTaskSnapshot(tasks.valueAt(i), allowSnapshotHome); } } /** Loading services/core/java/com/android/server/wm/Transition.java +23 −1 Original line number Diff line number Diff line Loading @@ -415,7 +415,16 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe if (commitVisibility) { ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS, " Commit activity becoming invisible: %s", ar); ar.commitVisibility(false /* visible */, false /* performLayout */); final Task task = ar.getTask(); if (task != null && !task.isVisibleRequested() && mTransientLaunches != null) { // If transition is transient, then snapshots are taken at end of // transition. mController.mTaskSnapshotController.recordTaskSnapshot( task, false /* allowSnapshotHome */); } ar.commitVisibility(false /* visible */, false /* performLayout */, true /* fromTransition */); activitiesWentInvisible = true; } } Loading Loading @@ -558,6 +567,19 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe mVisibleAtTransitionEndTokens.add(wc.asWindowToken()); } // Take task snapshots before the animation so that we can capture IME before it gets // transferred. If transition is transient, IME won't be moved during the transition and // the tasks are still live, so we take the snapshot at the end of the transition instead. if (mTransientLaunches == null) { for (int i = mParticipants.size() - 1; i >= 0; --i) { final ActivityRecord ar = mParticipants.valueAt(i).asActivityRecord(); if (ar == null || ar.isVisibleRequested() || ar.getTask() == null || ar.getTask().isVisibleRequested()) continue; mController.mTaskSnapshotController.recordTaskSnapshot( ar.getTask(), false /* allowSnapshotHome */); } } mStartTransaction = transaction; mFinishTransaction = mController.mAtm.mWindowManager.mTransactionFactory.get(); buildFinishTransaction(mFinishTransaction, info.getRootLeash()); Loading services/core/java/com/android/server/wm/TransitionController.java +4 −1 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ class TransitionController { private ITransitionPlayer mTransitionPlayer; final ActivityTaskManagerService mAtm; final TaskSnapshotController mTaskSnapshotController; private final ArrayList<WindowManagerInternal.AppTransitionListener> mLegacyListeners = new ArrayList<>(); Loading @@ -79,9 +80,11 @@ class TransitionController { // TODO(b/188595497): remove when not needed. final StatusBarManagerInternal mStatusBar; TransitionController(ActivityTaskManagerService atm) { TransitionController(ActivityTaskManagerService atm, TaskSnapshotController taskSnapshotController) { mAtm = atm; mStatusBar = LocalServices.getService(StatusBarManagerInternal.class); mTaskSnapshotController = taskSnapshotController; mTransitionPlayerDeath = () -> { synchronized (mAtm.mGlobalLock) { // Clean-up/finish any playing transitions. Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +13 −4 Original line number Diff line number Diff line Loading @@ -4890,8 +4890,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A * @param visible {@code true} if this {@link ActivityRecord} should become visible, otherwise * this should become invisible. * @param performLayout if {@code true}, perform surface placement after committing visibility. * @param fromTransition {@code true} if this is part of finishing a transition. */ void commitVisibility(boolean visible, boolean performLayout) { void commitVisibility(boolean visible, boolean performLayout, boolean fromTransition) { // Reset the state of mVisibleSetFromTransferredStartingWindow since visibility is actually // been set by the app now. mVisibleSetFromTransferredStartingWindow = false; Loading Loading @@ -4941,7 +4942,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A displayContent.getInputMonitor().updateInputWindowsLw(false /*force*/); mUseTransferredAnimation = false; postApplyAnimation(visible); postApplyAnimation(visible, fromTransition); } void commitVisibility(boolean visible, boolean performLayout) { commitVisibility(visible, performLayout, false /* fromTransition */); } /** Loading @@ -4952,8 +4957,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A * * @param visible {@code true} if this {@link ActivityRecord} has become visible, otherwise * this has become invisible. * @param fromTransition {@code true} if this call is part of finishing a transition. This is * needed because the shell transition is no-longer active by the time * commitVisibility is called. */ private void postApplyAnimation(boolean visible) { private void postApplyAnimation(boolean visible, boolean fromTransition) { final boolean usingShellTransitions = mTransitionController.isShellTransitionsEnabled(); final boolean delayed = isAnimating(TRANSITION | PARENTS | CHILDREN, ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_WINDOW_ANIMATION Loading Loading @@ -4994,7 +5002,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A final DisplayContent displayContent = getDisplayContent(); if (!displayContent.mClosingApps.contains(this) && !displayContent.mOpeningApps.contains(this)) { && !displayContent.mOpeningApps.contains(this) && !fromTransition) { // Take the screenshot before possibly hiding the WSA, otherwise the screenshot // will not be taken. mWmService.mTaskSnapshotController.notifyAppVisibilityChanged(this, visible); Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +1 −0 Original line number Diff line number Diff line Loading @@ -991,6 +991,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { synchronized (mGlobalLock) { mWindowManager = wm; mRootWindowContainer = wm.mRoot; mWindowOrganizerController.setWindowManager(wm); mTempConfig.setToDefaults(); mTempConfig.setLocales(LocaleList.getDefault()); mConfigurationSeq = mTempConfig.seq = 1; Loading
services/core/java/com/android/server/wm/TaskSnapshotController.java +37 −34 Original line number Diff line number Diff line Loading @@ -178,9 +178,7 @@ class TaskSnapshotController { snapshotTasks(tasks, false /* allowSnapshotHome */); } private void snapshotTasks(ArraySet<Task> tasks, boolean allowSnapshotHome) { for (int i = tasks.size() - 1; i >= 0; i--) { final Task task = tasks.valueAt(i); void recordTaskSnapshot(Task task, boolean allowSnapshotHome) { final TaskSnapshot snapshot; final boolean snapshotHome = allowSnapshotHome && task.isActivityTypeHome(); if (snapshotHome) { Loading @@ -188,7 +186,7 @@ class TaskSnapshotController { } else { switch (getSnapshotMode(task)) { case SNAPSHOT_MODE_NONE: continue; return; case SNAPSHOT_MODE_APP_THEME: snapshot = drawAppThemeSnapshot(task); break; Loading Loading @@ -216,6 +214,11 @@ class TaskSnapshotController { } } } private void snapshotTasks(ArraySet<Task> tasks, boolean allowSnapshotHome) { for (int i = tasks.size() - 1; i >= 0; i--) { recordTaskSnapshot(tasks.valueAt(i), allowSnapshotHome); } } /** Loading
services/core/java/com/android/server/wm/Transition.java +23 −1 Original line number Diff line number Diff line Loading @@ -415,7 +415,16 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe if (commitVisibility) { ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS, " Commit activity becoming invisible: %s", ar); ar.commitVisibility(false /* visible */, false /* performLayout */); final Task task = ar.getTask(); if (task != null && !task.isVisibleRequested() && mTransientLaunches != null) { // If transition is transient, then snapshots are taken at end of // transition. mController.mTaskSnapshotController.recordTaskSnapshot( task, false /* allowSnapshotHome */); } ar.commitVisibility(false /* visible */, false /* performLayout */, true /* fromTransition */); activitiesWentInvisible = true; } } Loading Loading @@ -558,6 +567,19 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe mVisibleAtTransitionEndTokens.add(wc.asWindowToken()); } // Take task snapshots before the animation so that we can capture IME before it gets // transferred. If transition is transient, IME won't be moved during the transition and // the tasks are still live, so we take the snapshot at the end of the transition instead. if (mTransientLaunches == null) { for (int i = mParticipants.size() - 1; i >= 0; --i) { final ActivityRecord ar = mParticipants.valueAt(i).asActivityRecord(); if (ar == null || ar.isVisibleRequested() || ar.getTask() == null || ar.getTask().isVisibleRequested()) continue; mController.mTaskSnapshotController.recordTaskSnapshot( ar.getTask(), false /* allowSnapshotHome */); } } mStartTransaction = transaction; mFinishTransaction = mController.mAtm.mWindowManager.mTransactionFactory.get(); buildFinishTransaction(mFinishTransaction, info.getRootLeash()); Loading
services/core/java/com/android/server/wm/TransitionController.java +4 −1 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ class TransitionController { private ITransitionPlayer mTransitionPlayer; final ActivityTaskManagerService mAtm; final TaskSnapshotController mTaskSnapshotController; private final ArrayList<WindowManagerInternal.AppTransitionListener> mLegacyListeners = new ArrayList<>(); Loading @@ -79,9 +80,11 @@ class TransitionController { // TODO(b/188595497): remove when not needed. final StatusBarManagerInternal mStatusBar; TransitionController(ActivityTaskManagerService atm) { TransitionController(ActivityTaskManagerService atm, TaskSnapshotController taskSnapshotController) { mAtm = atm; mStatusBar = LocalServices.getService(StatusBarManagerInternal.class); mTaskSnapshotController = taskSnapshotController; mTransitionPlayerDeath = () -> { synchronized (mAtm.mGlobalLock) { // Clean-up/finish any playing transitions. Loading