Skip finishing menu activity when dismissing PiP
- The finishing activity triggers a race in which the next layout may relayout the PiP window in fullscreen. As a workaround, this just skips finishing the menu activity, which also reverts to the O dismiss animation (as in there is none). Bug: 77730018 Test: Open PiP, dismiss it Change-Id: I9c9ccf69e50fac516339bf497cfed4bf6dc26467
This commit is contained in:
@@ -342,7 +342,7 @@ public class PipMenuActivity extends Activity {
|
||||
mHandler.post(() -> {
|
||||
event.getAnimationTrigger().decrement();
|
||||
});
|
||||
}, true /* notifyMenuVisibility */);
|
||||
}, true /* notifyMenuVisibility */, false /* isDismissing */);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,10 +396,12 @@ public class PipMenuActivity extends Activity {
|
||||
}
|
||||
|
||||
private void hideMenu() {
|
||||
hideMenu(null /* animationFinishedRunnable */, true /* notifyMenuVisibility */);
|
||||
hideMenu(null /* animationFinishedRunnable */, true /* notifyMenuVisibility */,
|
||||
false /* isDismissing */);
|
||||
}
|
||||
|
||||
private void hideMenu(final Runnable animationFinishedRunnable, boolean notifyMenuVisibility) {
|
||||
private void hideMenu(final Runnable animationFinishedRunnable, boolean notifyMenuVisibility,
|
||||
boolean isDismissing) {
|
||||
if (mMenuState != MENU_STATE_NONE) {
|
||||
cancelDelayedFinish();
|
||||
if (notifyMenuVisibility) {
|
||||
@@ -422,7 +424,12 @@ public class PipMenuActivity extends Activity {
|
||||
if (animationFinishedRunnable != null) {
|
||||
animationFinishedRunnable.run();
|
||||
}
|
||||
finish();
|
||||
|
||||
if (!isDismissing) {
|
||||
// If we are dismissing the PiP, then don't try to pre-emptively finish the
|
||||
// menu activity
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
mMenuContainerAnimator.start();
|
||||
@@ -583,7 +590,7 @@ public class PipMenuActivity extends Activity {
|
||||
hideMenu(() -> {
|
||||
sendEmptyMessage(PipMenuActivityController.MESSAGE_EXPAND_PIP,
|
||||
"Could not notify controller to expand PIP");
|
||||
}, false /* notifyMenuVisibility */);
|
||||
}, false /* notifyMenuVisibility */, false /* isDismissing */);
|
||||
}
|
||||
|
||||
private void minimizePip() {
|
||||
@@ -597,7 +604,7 @@ public class PipMenuActivity extends Activity {
|
||||
hideMenu(() -> {
|
||||
sendEmptyMessage(PipMenuActivityController.MESSAGE_DISMISS_PIP,
|
||||
"Could not notify controller to dismiss PIP");
|
||||
}, false /* notifyMenuVisibility */);
|
||||
}, false /* notifyMenuVisibility */, true /* isDismissing */);
|
||||
}
|
||||
|
||||
private void showPipMenu() {
|
||||
|
||||
Reference in New Issue
Block a user