Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipInteractionHandler.java +4 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,8 @@ import java.lang.annotation.RetentionPolicy; public class PipInteractionHandler { @IntDef(prefix = {"INTERACTION_"}, value = { INTERACTION_EXIT_PIP, INTERACTION_EXIT_PIP_TO_SPLIT INTERACTION_EXIT_PIP_TO_SPLIT, INTERACTION_ENTER_PIP }) @Retention(RetentionPolicy.SOURCE) Loading @@ -42,6 +43,7 @@ public class PipInteractionHandler { public static final int INTERACTION_EXIT_PIP = 0; public static final int INTERACTION_EXIT_PIP_TO_SPLIT = 1; public static final int INTERACTION_ENTER_PIP = 2; private final Context mContext; private final Handler mHandler; Loading Loading @@ -82,6 +84,7 @@ public class PipInteractionHandler { return switch (interaction) { case INTERACTION_EXIT_PIP -> "EXIT_PIP"; case INTERACTION_EXIT_PIP_TO_SPLIT -> "EXIT_PIP_TO_SPLIT"; case INTERACTION_ENTER_PIP -> "ENTER_PIP"; default -> ""; }; } Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java +5 −0 Original line number Diff line number Diff line Loading @@ -1178,6 +1178,11 @@ public class PipTransition extends PipTransitionController implements Preconditions.checkState(hasValidTokenAndLeash, "Unexpected bundle for " + mPipTransitionState); mPipInteractionHandler.begin(mPipTransitionState.getPinnedTaskLeash(), PipInteractionHandler.INTERACTION_ENTER_PIP); break; case PipTransitionState.ENTERED_PIP: mPipInteractionHandler.end(); break; case PipTransitionState.EXITED_PIP: mPipTransitionState.setPinnedTaskLeash(null); Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip2/phone/PipInteractionHandlerTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.pip2.phone; import static com.android.internal.jank.Cuj.CUJ_PIP_TRANSITION; import static com.android.wm.shell.pip2.phone.PipInteractionHandler.INTERACTION_ENTER_PIP; import static com.android.wm.shell.pip2.phone.PipInteractionHandler.INTERACTION_EXIT_PIP; import static com.android.wm.shell.pip2.phone.PipInteractionHandler.INTERACTION_EXIT_PIP_TO_SPLIT; Loading Loading @@ -86,6 +87,15 @@ public class PipInteractionHandlerTest { eq(PipInteractionHandler.pipInteractionToString(INTERACTION_EXIT_PIP_TO_SPLIT))); } @Test public void begin_enter_startsTracking() { mPipInteractionHandler.begin(mTestLeash, INTERACTION_ENTER_PIP); verify(mMockInteractionJankMonitor, times(1)).begin(eq(mTestLeash), eq(mMockContext), eq(mMockHandler), eq(CUJ_PIP_TRANSITION), eq(PipInteractionHandler.pipInteractionToString(INTERACTION_ENTER_PIP))); } @Test public void end_stopsTracking() { mPipInteractionHandler.end(); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipInteractionHandler.java +4 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,8 @@ import java.lang.annotation.RetentionPolicy; public class PipInteractionHandler { @IntDef(prefix = {"INTERACTION_"}, value = { INTERACTION_EXIT_PIP, INTERACTION_EXIT_PIP_TO_SPLIT INTERACTION_EXIT_PIP_TO_SPLIT, INTERACTION_ENTER_PIP }) @Retention(RetentionPolicy.SOURCE) Loading @@ -42,6 +43,7 @@ public class PipInteractionHandler { public static final int INTERACTION_EXIT_PIP = 0; public static final int INTERACTION_EXIT_PIP_TO_SPLIT = 1; public static final int INTERACTION_ENTER_PIP = 2; private final Context mContext; private final Handler mHandler; Loading Loading @@ -82,6 +84,7 @@ public class PipInteractionHandler { return switch (interaction) { case INTERACTION_EXIT_PIP -> "EXIT_PIP"; case INTERACTION_EXIT_PIP_TO_SPLIT -> "EXIT_PIP_TO_SPLIT"; case INTERACTION_ENTER_PIP -> "ENTER_PIP"; default -> ""; }; } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java +5 −0 Original line number Diff line number Diff line Loading @@ -1178,6 +1178,11 @@ public class PipTransition extends PipTransitionController implements Preconditions.checkState(hasValidTokenAndLeash, "Unexpected bundle for " + mPipTransitionState); mPipInteractionHandler.begin(mPipTransitionState.getPinnedTaskLeash(), PipInteractionHandler.INTERACTION_ENTER_PIP); break; case PipTransitionState.ENTERED_PIP: mPipInteractionHandler.end(); break; case PipTransitionState.EXITED_PIP: mPipTransitionState.setPinnedTaskLeash(null); Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip2/phone/PipInteractionHandlerTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.pip2.phone; import static com.android.internal.jank.Cuj.CUJ_PIP_TRANSITION; import static com.android.wm.shell.pip2.phone.PipInteractionHandler.INTERACTION_ENTER_PIP; import static com.android.wm.shell.pip2.phone.PipInteractionHandler.INTERACTION_EXIT_PIP; import static com.android.wm.shell.pip2.phone.PipInteractionHandler.INTERACTION_EXIT_PIP_TO_SPLIT; Loading Loading @@ -86,6 +87,15 @@ public class PipInteractionHandlerTest { eq(PipInteractionHandler.pipInteractionToString(INTERACTION_EXIT_PIP_TO_SPLIT))); } @Test public void begin_enter_startsTracking() { mPipInteractionHandler.begin(mTestLeash, INTERACTION_ENTER_PIP); verify(mMockInteractionJankMonitor, times(1)).begin(eq(mTestLeash), eq(mMockContext), eq(mMockHandler), eq(CUJ_PIP_TRANSITION), eq(PipInteractionHandler.pipInteractionToString(INTERACTION_ENTER_PIP))); } @Test public void end_stopsTracking() { mPipInteractionHandler.end(); Loading