Merge "Check for PIPable activities after moving task to back." into rvc-dev
This commit is contained in:
@@ -4620,7 +4620,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
// the current contract for "auto-Pip" is that the app should enter it before onPause
|
// the current contract for "auto-Pip" is that the app should enter it before onPause
|
||||||
// returns. Just need to confirm this reasoning makes sense.
|
// returns. Just need to confirm this reasoning makes sense.
|
||||||
final boolean deferHidingClient = canEnterPictureInPicture
|
final boolean deferHidingClient = canEnterPictureInPicture
|
||||||
&& !isState(STOPPING, STOPPED, PAUSED);
|
&& !isState(STARTED, STOPPING, STOPPED, PAUSED);
|
||||||
setDeferHidingClient(deferHidingClient);
|
setDeferHidingClient(deferHidingClient);
|
||||||
setVisibility(false);
|
setVisibility(false);
|
||||||
|
|
||||||
@@ -4631,9 +4631,16 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
// activity is hidden
|
// activity is hidden
|
||||||
supportsEnterPipOnTaskSwitch = false;
|
supportsEnterPipOnTaskSwitch = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INITIALIZING:
|
|
||||||
case RESUMED:
|
case RESUMED:
|
||||||
|
// If the app is capable of entering PIP, we should try pausing it now
|
||||||
|
// so it can PIP correctly.
|
||||||
|
if (deferHidingClient) {
|
||||||
|
getRootTask().startPausingLocked(
|
||||||
|
mStackSupervisor.mUserLeaving /* userLeaving */,
|
||||||
|
false /* uiSleeping */, null /* resuming */);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case INITIALIZING:
|
||||||
case PAUSING:
|
case PAUSING:
|
||||||
case PAUSED:
|
case PAUSED:
|
||||||
case STARTED:
|
case STARTED:
|
||||||
|
|||||||
@@ -2676,9 +2676,9 @@ class ActivityStack extends Task {
|
|||||||
mRootWindowContainer.ensureVisibilityAndConfig(null /* starting */,
|
mRootWindowContainer.ensureVisibilityAndConfig(null /* starting */,
|
||||||
getDisplay().mDisplayId, false /* markFrozenIfConfigChanged */,
|
getDisplay().mDisplayId, false /* markFrozenIfConfigChanged */,
|
||||||
false /* deferResume */);
|
false /* deferResume */);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
mRootWindowContainer.resumeFocusedStacksTopActivities();
|
mRootWindowContainer.resumeFocusedStacksTopActivities();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user