From 9bdfa459baa940efb2f74e9d612210179ce85263 Mon Sep 17 00:00:00 2001 From: Alison Cichowlas Date: Mon, 13 Mar 2023 20:29:57 +0000 Subject: [PATCH] Revert "Volume: Hide dialog when motion cancelled, as well as when finished." This reverts commit 3f8dd35901707ee6e0c36b41be413a52b9e1c66a. Reason for revert: b/273157752 (long press flicker) Bug: 273157752, 232606092 Change-Id: Iafd7dce156fea867d16bb3709700e01a19c043b4 --- .../systemui/volume/VolumeDialogImpl.java | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java index 2892ee3c7643e..1cfcf8cbbdcb5 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java @@ -1398,11 +1398,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 @@ -1494,7 +1490,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, @@ -1509,18 +1510,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);