From fc975d634348ed4e802556063e74362b780eff06 Mon Sep 17 00:00:00 2001 From: "dongwan0605.kim" Date: Thu, 5 Jan 2017 10:01:11 +0900 Subject: [PATCH] Fix guts not expanding when QSPanel is expanded When exposing notification guts, we notified height changed event without expandable view(row). Then, when QSPanel is expanded, NotificationPanelView did not update its height and guts was not expanded properly due to lack of height. So fix it by notifying height changed event with expandable view when expose notification guts. Also, do not request animation when panel is collapsed. Test: Expand QSPanel > Long press on the collapsed notification > Verify guts expanded properly Change-Id: Id7abd858800036fd6ff11c003c079c84c7ea54ef --- .../systemui/statusbar/BaseStatusBar.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) 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;