Merge "Keeping notifications around that show guts" into oc-dr1-dev am: ea2cbdecca

am: b42d05d64f

Change-Id: I854163e35e826f52cc908327b1f5650cf8264ef5
This commit is contained in:
Adrian Roos
2017-07-07 11:35:41 +00:00
committed by android-build-merger

View File

@@ -737,6 +737,7 @@ public class StatusBar extends SystemUI implements DemoMode,
private HashMap<String, Entry> mPendingNotifications = new HashMap<>();
private boolean mClearAllEnabled;
@Nullable private View mAmbientIndicationContainer;
private String mKeyToRemoveOnGutsClosed;
private SysuiColorExtractor mColorExtractor;
private ForegroundServiceController mForegroundServiceController;
@@ -1791,6 +1792,13 @@ public class StatusBar extends SystemUI implements DemoMode,
mRemoteInputEntriesToRemoveOnCollapse.add(entry);
return;
}
if (entry != null && mNotificationGutsExposed != null
&& mNotificationGutsExposed == entry.row.getGuts()) {
Log.w(TAG, "Keeping notification because it's showing guts. " + key);
mLatestRankingMap = ranking;
mKeyToRemoveOnGutsClosed = key;
return;
}
if (entry != null) {
mForegroundServiceController.removeNotification(entry.notification);
@@ -3476,6 +3484,8 @@ public class StatusBar extends SystemUI implements DemoMode,
pw.println(Settings.Global.zenModeToString(mZenMode));
pw.print(" mUseHeadsUp=");
pw.println(mUseHeadsUp);
pw.print(" mKeyToRemoveOnGutsClosed=");
pw.println(mKeyToRemoveOnGutsClosed);
if (mStatusBarView != null) {
dumpBarTransitions(pw, "mStatusBarView", mStatusBarView.getBarTransitions());
}
@@ -6141,6 +6151,11 @@ public class StatusBar extends SystemUI implements DemoMode,
mNotificationGutsExposed = null;
mGutsMenuItem = null;
}
String key = sbn.getKey();
if (key.equals(mKeyToRemoveOnGutsClosed)) {
mKeyToRemoveOnGutsClosed = null;
removeNotification(key, mLatestRankingMap);
}
});
View gutsView = item.getGutsView();
@@ -7100,9 +7115,12 @@ public class StatusBar extends SystemUI implements DemoMode,
Entry entry = mNotificationData.get(key);
if (entry == null) {
return;
} else {
mHeadsUpEntriesToRemoveOnSwitch.remove(entry);
mRemoteInputEntriesToRemoveOnCollapse.remove(entry);
}
mHeadsUpEntriesToRemoveOnSwitch.remove(entry);
mRemoteInputEntriesToRemoveOnCollapse.remove(entry);
if (key.equals(mKeyToRemoveOnGutsClosed)) {
mKeyToRemoveOnGutsClosed = null;
Log.w(TAG, "Notification that was kept for guts was updated. " + key);
}
Notification n = notification.getNotification();