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

Commit ef15f97f authored by Kazuki Takise's avatar Kazuki Takise
Browse files

Don't kill PiP with obsolete call to updatePictureInPictureMode

updatePictureInPictureMode() can be called for an activity that's
not on top of the PiP task, and can kill PiP unexpectedly

Bug: 323209868
Test: atest PinnedStackTests#testLaunchTaskByAffinityMatchSingleTask
Change-Id: Iece6ddd7e108986879bd86973f8ec6da82339906
parent 94b8a44d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1531,11 +1531,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            // Picture-in-picture mode changes also trigger a multi-window mode change as well, so
            // update that here in order. Set the last reported MW state to the same as the PiP
            // state since we haven't yet actually resized the task (these callbacks need to
            // precede the configuration change from the resize.
            // precede the configuration change from the resize.)
            mLastReportedPictureInPictureMode = inPictureInPictureMode;
            mLastReportedMultiWindowMode = inPictureInPictureMode;
            ensureActivityConfiguration(true /* ignoreVisibility */);
            if (inPictureInPictureMode && findMainWindow() == null) {
            if (inPictureInPictureMode && findMainWindow() == null
                    && task.topRunningActivity() == this) {
                // Prevent malicious app entering PiP without valid WindowState, which can in turn
                // result a non-touchable PiP window since the InputConsumer for PiP requires it.
                EventLog.writeEvent(0x534e4554, "265293293", -1, "");