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

Commit 8e3144d7 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 am: 5d21f6dc am: 3514aa37

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



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

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


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

                    hideRingerDrawer();
                }, 50));
                }, 50));
        if (!shouldSlideInVolumeTray()) {
        if (!shouldSlideInVolumeTray()) {
            animator.translationX(
            animator.translationX(
@@ -1547,18 +1548,6 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
        Trace.endSection();
        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() {
    private boolean showActiveStreamOnly() {
        return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)
        return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)
                || mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEVISION);
                || mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEVISION);