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

Commit 244e4854 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Fixing regression in PiP TV." into oc-dev

parents 57132a15 d62acec3
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ public class PipManager implements BasePipManager {
    private IWindowManager mWindowManager;
    private MediaSessionManager mMediaSessionManager;
    private int mState = STATE_NO_PIP;
    private int mResumeResizePinnedStackRunnable = STATE_NO_PIP;
    private final Handler mHandler = new Handler();
    private List<Listener> mListeners = new ArrayList<>();
    private List<MediaListener> mMediaListeners = new ArrayList<>();
@@ -133,7 +134,7 @@ public class PipManager implements BasePipManager {
    private final Runnable mResizePinnedStackRunnable = new Runnable() {
        @Override
        public void run() {
            resizePinnedStack(mState);
            resizePinnedStack(mResumeResizePinnedStackRunnable);
        }
    };
    private final Runnable mClosePipRunnable = new Runnable() {
@@ -364,16 +365,17 @@ public class PipManager implements BasePipManager {
    void resizePinnedStack(int state) {
        if (DEBUG) Log.d(TAG, "resizePinnedStack() state=" + state);
        boolean wasStateNoPip = (mState == STATE_NO_PIP);
        mState = state;
        mResumeResizePinnedStackRunnable = state;
        for (int i = mListeners.size() - 1; i >= 0; --i) {
            mListeners.get(i).onPipResizeAboutToStart();
        }
        if (mSuspendPipResizingReason != 0) {
            if (DEBUG) Log.d(TAG,
                    "resizePinnedStack() deferring mSuspendPipResizingReason=" +
                            mSuspendPipResizingReason);
            if (DEBUG) Log.d(TAG, "resizePinnedStack() deferring"
                    + " mSuspendPipResizingReason=" + mSuspendPipResizingReason
                    + " mResumeResizePinnedStackRunnable=" + mResumeResizePinnedStackRunnable);
            return;
        }
        mState = state;
        switch (mState) {
            case STATE_NO_PIP:
                mCurrentPipBounds = null;
+2 −3
Original line number Diff line number Diff line
@@ -2506,9 +2506,8 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
                        fullscreenStack.getStackVisibilityLocked(null) == STACK_VISIBLE;
                for (int i = 0; i < tasks.size(); i++) {
                    // Insert the task either at the top of the fullscreen stack if it is hidden,
                    // or just under the top task if it is currently visible
                    final int insertPosition = isFullscreenStackVisible
                            ? Math.max(0, fullscreenStack.getChildCount() - 1)
                    // or to the bottom if it is currently visible
                    final int insertPosition = isFullscreenStackVisible ? 0
                            : fullscreenStack.getChildCount();
                    final TaskRecord task = tasks.get(i);
                    // Defer resume until we remove all the tasks