Merge "Synchronize block in onNotificationPosted" into qt-dev
am: 376830178b
Change-Id: I074da77675a278ce34148d9ded1b923da5cdf759
This commit is contained in:
@@ -301,13 +301,17 @@ public class Assistant extends NotificationAssistantService {
|
||||
sbn, ranking.getChannel(), mSmsHelper);
|
||||
String key = getKey(
|
||||
sbn.getPackageName(), sbn.getUserId(), ranking.getChannel().getId());
|
||||
ChannelImpressions ci = mkeyToImpressions.getOrDefault(key,
|
||||
createChannelImpressionsWithThresholds());
|
||||
if (ranking.getImportance() > IMPORTANCE_MIN && ci.shouldTriggerBlock()) {
|
||||
boolean shouldTriggerBlock;
|
||||
synchronized (mkeyToImpressions) {
|
||||
ChannelImpressions ci = mkeyToImpressions.getOrDefault(key,
|
||||
createChannelImpressionsWithThresholds());
|
||||
mkeyToImpressions.put(key, ci);
|
||||
shouldTriggerBlock = ci.shouldTriggerBlock();
|
||||
}
|
||||
if (ranking.getImportance() > IMPORTANCE_MIN && shouldTriggerBlock) {
|
||||
adjustNotification(createNegativeAdjustment(
|
||||
sbn.getPackageName(), sbn.getKey(), sbn.getUserId()));
|
||||
}
|
||||
mkeyToImpressions.put(key, ci);
|
||||
mLiveNotifications.put(sbn.getKey(), entry);
|
||||
mAgingHelper.onNotificationPosted(entry);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user