Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b436d6b authored by Jorge Gil's avatar Jorge Gil Committed by Automerger Merge Worker
Browse files

Merge "Check for PIPable activities after moving task to back." into rvc-dev...

Merge "Check for PIPable activities after moving task to back." into rvc-dev am: 144ba122 am: a683ab36 am: fab06c08

Change-Id: I9376948a6c50b2c9bfbf1d923f6bc3339f760555
parents 9de65c73 fab06c08
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -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
            // returns. Just need to confirm this reasoning makes sense.
            final boolean deferHidingClient = canEnterPictureInPicture
                    && !isState(STOPPING, STOPPED, PAUSED);
                    && !isState(STARTED, STOPPING, STOPPED, PAUSED);
            setDeferHidingClient(deferHidingClient);
            setVisibility(false);

@@ -4631,9 +4631,16 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                    // activity is hidden
                    supportsEnterPipOnTaskSwitch = false;
                    break;

                case INITIALIZING:
                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 PAUSED:
                case STARTED:
+2 −2
Original line number Diff line number Diff line
@@ -2676,9 +2676,9 @@ class ActivityStack extends Task {
            mRootWindowContainer.ensureVisibilityAndConfig(null /* starting */,
                    getDisplay().mDisplayId, false /* markFrozenIfConfigChanged */,
                    false /* deferResume */);
        }

        } else {
            mRootWindowContainer.resumeFocusedStacksTopActivities();
        }
        return true;
    }