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

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

Merge "Skip finishing menu activity when dismissing PiP" into pi-dev

parents 9f1885de 21004d51
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -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,8 +424,13 @@ public class PipMenuActivity extends Activity {
                    if (animationFinishedRunnable != null) {
                        animationFinishedRunnable.run();
                    }

                    if (!isDismissing) {
                        // If we are dismissing the PiP, then don't try to pre-emptively finish the
                        // menu activity
                        finish();
                    }
                }
            });
            mMenuContainerAnimator.start();
        } else {
@@ -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() {