Loading services/core/java/com/android/server/wm/ActivityRecord.java +10 −1 Original line number Diff line number Diff line Loading @@ -1434,7 +1434,7 @@ final class ActivityRecord extends WindowToken { // precede the configuration change from the resize.) mLastReportedPictureInPictureMode = inPictureInPictureMode; mLastReportedMultiWindowMode = inPictureInPictureMode; if (!isPip2ExperimentEnabled()) { if (forceUpdate || !isPip2ExperimentEnabled()) { // PiP2 should handle sending out the configuration as a part of Shell Transitions. ensureActivityConfiguration(true /* ignoreVisibility */); } Loading Loading @@ -6367,6 +6367,15 @@ final class ActivityRecord extends WindowToken { isSuccessful = false; } if (isSuccessful) { final int lastReportedWinMode = mLastReportedConfiguration.getMergedConfiguration() .windowConfiguration.getWindowingMode(); if (isPip2ExperimentEnabled() && lastReportedWinMode == WINDOWING_MODE_PINNED && !inPinnedWindowingMode()) { // If an activity that was previously reported as pinned has a different windowing // mode, then send the latest activity configuration even if this activity is // stopping. This ensures that app gets onPictureInPictureModeChanged after onStop. updatePictureInPictureMode(null /* targetRootTaskBounds */, true /* forceUpdate */); } mAtmService.mH.postDelayed(mStopTimeoutRunnable, STOP_TIMEOUT); } else { // Just in case, assume it to be stopped. Loading services/core/java/com/android/server/wm/ActivityTaskSupervisor.java +8 −3 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLAS import static com.android.server.wm.ActivityTaskManagerService.ANIMATE; import static com.android.server.wm.ActivityTaskManagerService.H.FIRST_SUPERVISOR_TASK_MSG; import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_NONE; import static com.android.server.wm.ActivityTaskManagerService.isPip2ExperimentEnabled; import static com.android.server.wm.ClientLifecycleManager.shouldDispatchLaunchActivityItemIndependently; import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_ALLOWLISTED; import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_LAUNCHABLE; Loading Loading @@ -1687,9 +1688,13 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks { */ rootTask.cancelAnimation(); rootTask.setForceHidden(FLAG_FORCE_HIDDEN_FOR_PINNED_TASK, true /* set */); if (!isPip2ExperimentEnabled()) { // In PiP2, as the transition finishes the lifecycle updates will be sent to the app // along with the configuration changes as a part of the transition lifecycle. rootTask.ensureActivitiesVisible(null /* starting */); activityIdleInternal(null /* idleActivity */, false /* fromTimeout */, true /* processPausingActivities */, null /* configuration */); } if (rootTask.getParent() == null) { // The activities in the task may already be finishing. Then the task could be removed Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +10 −1 Original line number Diff line number Diff line Loading @@ -1434,7 +1434,7 @@ final class ActivityRecord extends WindowToken { // precede the configuration change from the resize.) mLastReportedPictureInPictureMode = inPictureInPictureMode; mLastReportedMultiWindowMode = inPictureInPictureMode; if (!isPip2ExperimentEnabled()) { if (forceUpdate || !isPip2ExperimentEnabled()) { // PiP2 should handle sending out the configuration as a part of Shell Transitions. ensureActivityConfiguration(true /* ignoreVisibility */); } Loading Loading @@ -6367,6 +6367,15 @@ final class ActivityRecord extends WindowToken { isSuccessful = false; } if (isSuccessful) { final int lastReportedWinMode = mLastReportedConfiguration.getMergedConfiguration() .windowConfiguration.getWindowingMode(); if (isPip2ExperimentEnabled() && lastReportedWinMode == WINDOWING_MODE_PINNED && !inPinnedWindowingMode()) { // If an activity that was previously reported as pinned has a different windowing // mode, then send the latest activity configuration even if this activity is // stopping. This ensures that app gets onPictureInPictureModeChanged after onStop. updatePictureInPictureMode(null /* targetRootTaskBounds */, true /* forceUpdate */); } mAtmService.mH.postDelayed(mStopTimeoutRunnable, STOP_TIMEOUT); } else { // Just in case, assume it to be stopped. Loading
services/core/java/com/android/server/wm/ActivityTaskSupervisor.java +8 −3 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLAS import static com.android.server.wm.ActivityTaskManagerService.ANIMATE; import static com.android.server.wm.ActivityTaskManagerService.H.FIRST_SUPERVISOR_TASK_MSG; import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_NONE; import static com.android.server.wm.ActivityTaskManagerService.isPip2ExperimentEnabled; import static com.android.server.wm.ClientLifecycleManager.shouldDispatchLaunchActivityItemIndependently; import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_ALLOWLISTED; import static com.android.server.wm.LockTaskController.LOCK_TASK_AUTH_LAUNCHABLE; Loading Loading @@ -1687,9 +1688,13 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks { */ rootTask.cancelAnimation(); rootTask.setForceHidden(FLAG_FORCE_HIDDEN_FOR_PINNED_TASK, true /* set */); if (!isPip2ExperimentEnabled()) { // In PiP2, as the transition finishes the lifecycle updates will be sent to the app // along with the configuration changes as a part of the transition lifecycle. rootTask.ensureActivitiesVisible(null /* starting */); activityIdleInternal(null /* idleActivity */, false /* fromTimeout */, true /* processPausingActivities */, null /* configuration */); } if (rootTask.getParent() == null) { // The activities in the task may already be finishing. Then the task could be removed Loading