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

Commit c4e6f318 authored by Tiger's avatar Tiger
Browse files

Don't let PIP window control system bars

Fix: 267413713
Test: 1. Watch a YouTube video on Chrome.
      2. Enter fullscreen mode.
      3. Swipe to show navigation bar and go to home screen.
      4. Open Calculator while PIP is playing the video.
      See if system bars are transiently hidden while opening
      Calculator.
Change-Id: I918f35435d125c80d986d6f1c715f0129142edae
parent 0a19aaae
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -5115,6 +5115,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        return mDeferHidingClient;
        return mDeferHidingClient;
    }
    }


    boolean canAffectSystemUiFlags() {
        return task != null && task.canAffectSystemUiFlags() && isVisible()
                && !inPinnedWindowingMode();
    }

    @Override
    @Override
    boolean isVisible() {
    boolean isVisible() {
        // If the activity isn't hidden then it is considered visible and there is no need to check
        // If the activity isn't hidden then it is considered visible and there is no need to check
+3 −5
Original line number Original line Diff line number Diff line
@@ -2067,9 +2067,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            final boolean exiting = mAnimatingExit || mDestroying;
            final boolean exiting = mAnimatingExit || mDestroying;
            return shown && !exiting;
            return shown && !exiting;
        } else {
        } else {
            final Task task = getTask();
            return mActivityRecord.canAffectSystemUiFlags()
            final boolean canFromTask = task != null && task.canAffectSystemUiFlags();
            return canFromTask && mActivityRecord.isVisible()
                    // Do not let snapshot window control the bar
                    // Do not let snapshot window control the bar
                    && (mAttrs.type != TYPE_APPLICATION_STARTING
                    && (mAttrs.type != TYPE_APPLICATION_STARTING
                            || !(mStartingData instanceof SnapshotStartingData));
                            || !(mStartingData instanceof SnapshotStartingData));