Merge "Ensure onStop before onPictureInPictureModeChanged" into udc-qpr-dev am: 1ace020b79
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24029259 Change-Id: Iaa07b98d2550d790e9d487bd28c742cb5b224085 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -2186,7 +2186,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
|
|||||||
* Processes the activities to be stopped or destroyed. This should be called when the resumed
|
* Processes the activities to be stopped or destroyed. This should be called when the resumed
|
||||||
* activities are idle or drawn.
|
* activities are idle or drawn.
|
||||||
*/
|
*/
|
||||||
private void processStoppingAndFinishingActivities(ActivityRecord launchedActivity,
|
void processStoppingAndFinishingActivities(ActivityRecord launchedActivity,
|
||||||
boolean processPausingActivities, String reason) {
|
boolean processPausingActivities, String reason) {
|
||||||
// Stop any activities that are scheduled to do so but have been waiting for the transition
|
// Stop any activities that are scheduled to do so but have been waiting for the transition
|
||||||
// animation to finish.
|
// animation to finish.
|
||||||
@@ -2194,7 +2194,10 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
|
|||||||
ArrayList<ActivityRecord> readyToStopActivities = null;
|
ArrayList<ActivityRecord> readyToStopActivities = null;
|
||||||
for (int i = 0; i < mStoppingActivities.size(); i++) {
|
for (int i = 0; i < mStoppingActivities.size(); i++) {
|
||||||
final ActivityRecord s = mStoppingActivities.get(i);
|
final ActivityRecord s = mStoppingActivities.get(i);
|
||||||
final boolean animating = s.isInTransition();
|
// Activity in a force hidden task should not be counted as animating, i.e., we want to
|
||||||
|
// send onStop before any configuration change when removing pip transition is ongoing.
|
||||||
|
final boolean animating = s.isInTransition()
|
||||||
|
&& s.getTask() != null && !s.getTask().isForceHidden();
|
||||||
displaySwapping |= s.isDisplaySleepingAndSwapping();
|
displaySwapping |= s.isDisplaySleepingAndSwapping();
|
||||||
ProtoLog.v(WM_DEBUG_STATES, "Stopping %s: nowVisible=%b animating=%b "
|
ProtoLog.v(WM_DEBUG_STATES, "Stopping %s: nowVisible=%b animating=%b "
|
||||||
+ "finishing=%s", s, s.nowVisible, animating, s.finishing);
|
+ "finishing=%s", s, s.nowVisible, animating, s.finishing);
|
||||||
|
|||||||
@@ -569,6 +569,13 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
|
|||||||
}
|
}
|
||||||
if (forceHiddenForPip) {
|
if (forceHiddenForPip) {
|
||||||
wc.asTask().setForceHidden(FLAG_FORCE_HIDDEN_FOR_PINNED_TASK, true /* set */);
|
wc.asTask().setForceHidden(FLAG_FORCE_HIDDEN_FOR_PINNED_TASK, true /* set */);
|
||||||
|
// When removing pip, make sure that onStop is sent to the app ahead of
|
||||||
|
// onPictureInPictureModeChanged.
|
||||||
|
// See also PinnedStackTests#testStopBeforeMultiWindowCallbacksOnDismiss
|
||||||
|
wc.asTask().ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS);
|
||||||
|
wc.asTask().mTaskSupervisor.processStoppingAndFinishingActivities(
|
||||||
|
null /* launchedActivity */, false /* processPausingActivities */,
|
||||||
|
"force-stop-on-removing-pip");
|
||||||
}
|
}
|
||||||
|
|
||||||
int containerEffect = applyWindowContainerChange(wc, entry.getValue(),
|
int containerEffect = applyWindowContainerChange(wc, entry.getValue(),
|
||||||
|
|||||||
Reference in New Issue
Block a user