From 6514025cecdb0e07cb92d1c4c5d8620ea15c13fc Mon Sep 17 00:00:00 2001 From: Peter Kalauskas Date: Tue, 14 Jun 2022 00:26:13 +0000 Subject: [PATCH] Only notify listeners when actual height changes In ExpandableView, only update clipping and notify listeners when actual height changes. Test: atest com.android.systemui.statusbar.notification.row Bug: 231054525 Change-Id: I6a27411738281b3f8ae61f78a000c4bd8e03f3bb --- .../statusbar/notification/row/ExpandableView.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java index e042e9cb2a191..8f73b802271d5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java @@ -186,10 +186,12 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable { * @param notifyListeners Whether the listener should be informed about the change. */ public void setActualHeight(int actualHeight, boolean notifyListeners) { - mActualHeight = actualHeight; - updateClipping(); - if (notifyListeners) { - notifyHeightChanged(false /* needsAnimation */); + if (mActualHeight != actualHeight) { + mActualHeight = actualHeight; + updateClipping(); + if (notifyListeners) { + notifyHeightChanged(false /* needsAnimation */); + } } }