diff options
| author | 2021-11-24 11:01:59 +0000 | |
|---|---|---|
| committer | 2021-11-24 11:01:59 +0000 | |
| commit | 08d2e4f5df87a14c2d65200c1a8d1a34852af56c (patch) | |
| tree | 082f9d0e5aadd1af55f105d2163017615d91ac68 | |
| parent | 92395b487e170bd2b81c3d76dac88164b968bfcb (diff) | |
| parent | 24bd03796dad67a2c36797b66e122a4c29c6f8f4 (diff) | |
Merge "Made usages of animate().setListener() call safer" into sc-v2-dev am: fdbed18c79 am: 24bd03796d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16149044
Change-Id: I27ede8f4d92941c847bd2f58c562b57487961dd0
6 files changed, 22 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java index 2f7c8bae384d..fa3ad4ed1d76 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java @@ -2371,7 +2371,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene message.animate() .alpha(0f) .setDuration(TOAST_FADE_TIME) - .setStartDelay(visibleTime); + .setStartDelay(visibleTime) + .setListener(null); } }); } diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java index 868193b44704..54e40f1429be 100644 --- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java +++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java @@ -289,6 +289,9 @@ public abstract class MediaOutputBaseAdapter extends public void onAnimationEnd(Animator animation) { to.requireViewById(R.id.volume_indeterminate_progress).setVisibility( View.VISIBLE); + // Unset the listener, otherwise this may persist for another view + // property animation + toTitleText.animate().setListener(null); } }); // Animation for seek bar @@ -312,8 +315,14 @@ public abstract class MediaOutputBaseAdapter extends public void onAnimationEnd(Animator animation) { mIsAnimating = false; notifyDataSetChanged(); + // Unset the listener, otherwise this may persist for + // another view property animation + fromTitleText.animate().setListener(null); } }); + // Unset the listener, otherwise this may persist for another view + // property animation + fromSeekBar.animate().setListener(null); } }); } diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java index e42c47b1d3be..ee59ae6ab6d7 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java @@ -770,6 +770,8 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca public void onAnimationEnd(Animator animation) { mHeaderAnimating = false; updateQsState(); + // Unset the listener, otherwise this may persist for another view property animation + getView().animate().setListener(null); } }; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java index 190c773ef422..f23a7cac7d2a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java @@ -717,6 +717,9 @@ public class KeyguardIndicationController { textView.setTranslationY(BOUNCE_ANIMATION_FINAL_Y); ViewClippingUtil.setClippingDeactivated(textView, false, mClippingParams); + // Unset the listener, otherwise this may persist for + // another view property animation + textView.animate().setListener(null); } }); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightsOutNotifController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightsOutNotifController.java index 3f3328172e12..68ab07798520 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightsOutNotifController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightsOutNotifController.java @@ -124,6 +124,9 @@ public class LightsOutNotifController { public void onAnimationEnd(Animator a) { mLightsOutNotifView.setAlpha(showDot ? 1 : 0); mLightsOutNotifView.setVisibility(showDot ? View.VISIBLE : View.GONE); + // Unset the listener, otherwise this may persist for + // another view property animation + mLightsOutNotifView.animate().setListener(null); } }) .start(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsButton.java index 9cefded72365..bf5467716910 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsButton.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsButton.java @@ -120,6 +120,9 @@ public class SettingsButton extends AlphaOptimizedImageButton { setAlpha(1f); setTranslationX(0); cancelLongClick(); + // Unset the listener, otherwise this may persist for + // another view property animation + animate().setListener(null); } @Override |