diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index db099bc15472f..b0979ad87cf2f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -122,7 +122,7 @@ import java.util.Stack; public abstract class BaseStatusBar extends SystemUI implements CommandQueue.Callbacks, ActivatableNotificationView.OnActivatedListener, ExpandableNotificationRow.ExpansionLogger, NotificationData.Environment, - ExpandableNotificationRow.OnExpandClickListener, OnGutsClosedListener { + ExpandableNotificationRow.OnExpandClickListener { public static final String TAG = "StatusBar"; public static final boolean DEBUG = false; public static final boolean MULTIUSER_DEBUG = false; @@ -1058,7 +1058,12 @@ public abstract class BaseStatusBar extends SystemUI implements PackageManager pmUser = getPackageManagerForUser(mContext, sbn.getUser().getIdentifier()); row.setTag(sbn.getPackageName()); final NotificationGuts guts = row.getGuts(); - guts.setClosedListener(this); + guts.setClosedListener((NotificationGuts g) -> { + if (!row.isRemoved()) { + mStackScroller.onHeightChanged(row, !isPanelFullyCollapsed() /* needsAnimation */); + } + mNotificationGutsExposed = null; + }); final INotificationManager iNotificationManager = INotificationManager.Stub.asInterface( ServiceManager.getService(Context.NOTIFICATION_SERVICE)); @@ -1166,7 +1171,7 @@ public abstract class BaseStatusBar extends SystemUI implements guts.setExposed(true /* exposed */, mState == StatusBarState.KEYGUARD /* needsFalsingProtection */); row.closeRemoteInput(); - mStackScroller.onHeightChanged(null, true /* needsAnimation */); + mStackScroller.onHeightChanged(row, true /* needsAnimation */); mNotificationGutsExposed = guts; } }); @@ -1199,12 +1204,6 @@ public abstract class BaseStatusBar extends SystemUI implements } } - @Override - public void onGutsClosed(NotificationGuts guts) { - mStackScroller.onHeightChanged(null, true /* needsAnimation */); - mNotificationGutsExposed = null; - } - @Override public void showRecentApps(boolean triggeredFromAltTab, boolean fromHome) { int msg = MSG_SHOW_RECENT_APPS;