summaryrefslogtreecommitdiff
path: root/libs/WindowManager/Shell
diff options
context:
space:
mode:
author Robert Horvath <robhor@google.com> 2022-02-17 14:51:10 +0100
committer Robert Horvath <robhor@google.com> 2022-02-18 13:46:54 +0100
commitea6cf56eccbc45677e8c8736a8333f14f1cfa466 (patch)
tree6ff79b3293b4cb6996b83954b16e237c733a85d2 /libs/WindowManager/Shell
parent4d897c6ad0f07d78765c67424c61f9521be4f28a (diff)
Set TvPipController's state only when PiP finished appearing
When asking PipTaskOrganizer to animate the PiP to a different position while it's still in the appearing transition, the PiP could get stuck in a bad state where the PiP contents and menu items weren't drawn. This change avoids this by only calling #scheduleAnimateResizePip once the PiP has finished appearing. Test: manual Bug: 220110011 Change-Id: Ie62adea6f2cb5a4abdd6c4b8f9ff23c040077046
Diffstat (limited to 'libs/WindowManager/Shell')
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipController.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipController.java
index 5996acd269d2..50691803e8f9 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipController.java
@@ -43,6 +43,7 @@ import com.android.wm.shell.common.TaskStackListenerCallback;
import com.android.wm.shell.common.TaskStackListenerImpl;
import com.android.wm.shell.pip.PinnedStackListenerForwarder;
import com.android.wm.shell.pip.Pip;
+import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipTaskOrganizer;
import com.android.wm.shell.pip.PipTransitionController;
@@ -289,7 +290,6 @@ public class TvPipController implements PipTransitionController.PipTransitionCal
if (DEBUG) Log.d(TAG, "checkIfPinnedTaskAppeared(), task=" + pinnedTask);
if (pinnedTask == null || pinnedTask.topActivity == null) return;
mPinnedTaskId = pinnedTask.taskId;
- setState(STATE_PIP);
mPipMediaController.onActivityPinned();
mPipNotificationController.show(pinnedTask.topActivity.getPackageName());
@@ -326,6 +326,9 @@ public class TvPipController implements PipTransitionController.PipTransitionCal
@Override
public void onPipTransitionFinished(int direction) {
+ if (PipAnimationController.isInPipDirection(direction) && mState == STATE_NO_PIP) {
+ setState(STATE_PIP);
+ }
if (DEBUG) Log.d(TAG, "onPipTransition_Finished(), state=" + stateToName(mState));
}