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

Commit ed729703 authored by Merissa Mitchell's avatar Merissa Mitchell Committed by Android (Google) Code Review
Browse files

Merge changes from topic "pip-reloadrecents" into main

* changes:
  [Pip2] Skip merge for REMOVE_PIP in mid-Recents.
  [Pip2] Add a new interface method to IPipAnimationListener
parents 163c2dc2 97322ad0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -38,4 +38,9 @@ oneway interface IPipAnimationListener {
     * Notifies the listener that user leaves PiP by tapping on the expand button.
     */
    void onExpandPip();

    /**
     * Notifies the listener that the PiP has exited.
     */
    void onExitPip();
}
+10 −0
Original line number Diff line number Diff line
@@ -238,6 +238,11 @@ public class PipController implements PipTransitionController.PipTransitionCallb
         * Notifies the listener that user leaves PiP by tapping on the expand button.
         */
        void onExpandPip();

        /**
         * Notifies the listener that the PiP has exited.
         */
        void onExitPip();
    }

    /**
@@ -1305,6 +1310,11 @@ public class PipController implements PipTransitionController.PipTransitionCallb
            public void onExpandPip() {
                mListener.call(l -> l.onExpandPip());
            }

            @Override
            public void onExitPip() {
                mListener.call(l -> l.onExitPip());
            }
        };

        IPipImpl(PipController controller) {
+13 −0
Original line number Diff line number Diff line
@@ -150,6 +150,11 @@ public class PipController implements ConfigurationChangeListener,
         * Notifies the listener that user leaves PiP by tapping on the expand button.
         */
        void onExpandPip();

        /**
         * Notifies the listener that the PiP has exited.
         */
        void onExitPip();
    }

    private PipController(Context context,
@@ -622,6 +627,9 @@ public class PipController implements ConfigurationChangeListener,
                for (Consumer<Boolean> listener : mOnIsInPipStateChangedListeners) {
                    listener.accept(false /* inPip */);
                }
                if (mPipRecentsAnimationListener != null) {
                    mPipRecentsAnimationListener.onExitPip();
                }
                break;
            case PipTransitionState.SCHEDULED_BOUNDS_CHANGE:
                mWaitingToPlayDisplayChangeBoundsUpdate =
@@ -774,6 +782,11 @@ public class PipController implements ConfigurationChangeListener,
            public void onExpandPip() {
                mListener.call(l -> l.onExpandPip());
            }

            @Override
            public void onExitPip() {
                mListener.call(l -> l.onExitPip());
            }
        };

        IPipImpl(PipController controller) {
+11 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import static com.android.wm.shell.recents.RecentsTransitionStateListener.TRANSI
import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_CAN_HAND_OFF_ANIMATION;
import static com.android.wm.shell.shared.split.SplitBounds.KEY_EXTRA_SPLIT_BOUNDS;
import static com.android.wm.shell.transition.Transitions.TRANSIT_END_RECENTS_TRANSITION;
import static com.android.wm.shell.transition.Transitions.TRANSIT_REMOVE_PIP;
import static com.android.wm.shell.transition.Transitions.TRANSIT_START_RECENTS_TRANSITION;

import android.annotation.Nullable;
@@ -987,6 +988,16 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
                cancel("transit_sleep");
                return;
            }

            if (info.getType() == TRANSIT_REMOVE_PIP && PipFlags.isPip2ExperimentEnabled()) {
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION,
                        "[%d] RecentsController.merge: transit_remove_pip", mInstanceId);
                // Cancel the merge if transition is removing PiP; PiP is on top of everything else.
                cancel(mWillFinishToHome /* toHome */, mWillFinishToHome /* withScreenshots */,
                        "transit_remove_pip");
                return;
            }

            if (mKeyguardLocked || (info.getFlags() & KEYGUARD_VISIBILITY_TRANSIT_FLAGS) != 0) {
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION,
                        "[%d] RecentsController.merge: keyguard is locked", mInstanceId);
+2 −0
Original line number Diff line number Diff line
@@ -207,6 +207,8 @@ public class PipControllerTest extends ShellTestCase {
            public void onPipResourceDimensionsChanged(int cornerRadius, int shadowRadius) {}
            @Override
            public void onExpandPip() {}
            @Override
            public void onExitPip() {}
        });
        assertTrue(mPipController.hasPinnedStackAnimationListener());
        // Create initial interface