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

Commit 704284b8 authored by Alison Cichowlas's avatar Alison Cichowlas Committed by Automerger Merge Worker
Browse files

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

Merge "Volume: Hide dialog when motion cancelled, as well as when finished." into tm-qpr-dev am: f597a6c3 am: fb968542 am: 1567e77c

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



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

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

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

                    hideRingerDrawer();
                    finishDismiss();
                }, 50));
        if (!shouldSlideInVolumeTray()) {
            animator.translationX(
@@ -1548,6 +1547,18 @@ 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);