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

Commit 1273c953 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Put safeguard in dismissPip

Not able to reproduce the crash but in general, dismissPip should not
happen when not in PiP mode.

Bug: 155024023
Test: N/A
Change-Id: Iea19ffc632ca8ca411b25d8b08ee4e91b2dd7360
parent b8ad491e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -238,6 +238,11 @@ public class PipTaskOrganizer extends TaskOrganizer {
     * @param animationDurationMs duration in millisecond for the exiting PiP transition
     */
    public void dismissPip(int animationDurationMs) {
        if (!mInPip || mToken == null) {
            Log.wtf(TAG, "Not allowed to dismissPip in current state"
                    + " mInPip=" + mInPip + " mToken=" + mToken);
            return;
        }
        final WindowContainerTransaction wct = new WindowContainerTransaction();
        wct.setActivityWindowingMode(mToken, WINDOWING_MODE_UNDEFINED);
        WindowOrganizer.applyTransaction(wct);