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

Commit 5d21f6dc authored by Alison Cichowlas's avatar Alison Cichowlas Committed by Automerger Merge Worker
Browse files

Merge "Revert "Volume: Hide dialog when motion cancelled, as well as when...

Merge "Revert "Volume: Hide dialog when motion cancelled, as well as when finished."" into tm-qpr-dev am: f05f8790

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21985928



Change-Id: Ia9c3af6f09a1804eecc128ff418a16917fab6bde
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 74718c6f f05f8790
Loading
Loading
Loading
Loading
+7 −18
Original line number Diff line number Diff line
@@ -1400,11 +1400,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
            @Override
            public void onAnimationCancel(@NonNull Animator animation) {
                mInteractionJankMonitor.cancel(CUJ_VOLUME_CONTROL);
                Log.i(TAG, "onAnimationCancel");

                // We can only have one animation listener for cancel, so the jank listener should
                // also call for cleanup.
                finishDismiss();
                Log.d(TAG, "onAnimationCancel");
            }

            @Override
@@ -1496,7 +1492,12 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
                .setDuration(mDialogHideAnimationDurationMs)
                .setInterpolator(new SystemUIInterpolators.LogAccelerateInterpolator())
                .withEndAction(() -> mHandler.postDelayed(() -> {
                    finishDismiss();
                    mController.notifyVisible(false);
                    mDialog.dismiss();
                    tryToRemoveCaptionsTooltip();
                    mIsAnimatingDismiss = false;

                    hideRingerDrawer();
                }, 50));
        if (!shouldSlideInVolumeTray()) animator.translationX(mDialogView.getWidth() / 2.0f);
        animator.setListener(getJankListener(getDialogView(), TYPE_DISMISS,
@@ -1511,18 +1512,6 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
        Trace.endSection();
    }

    /**
     * Clean up and hide volume dialog. Called when animation is finished/cancelled.
     */
    private void finishDismiss() {
        mController.notifyVisible(false);
        mDialog.dismiss();
        tryToRemoveCaptionsTooltip();
        mIsAnimatingDismiss = false;

        hideRingerDrawer();
    }

    private boolean showActiveStreamOnly() {
        return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)
                || mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEVISION);