Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09adc8f7 authored by Beth Thibodeau's avatar Beth Thibodeau Committed by android-build-merger
Browse files

Merge "Synchronize block in onNotificationPosted" into qt-dev

am: 37683017

Change-Id: I10a6fb454faa9b4ba39679c2df01ed39289e11df
parents 05082a03 37683017
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -301,13 +301,17 @@ public class Assistant extends NotificationAssistantService {
                        sbn, ranking.getChannel(), mSmsHelper);
                String key = getKey(
                        sbn.getPackageName(), sbn.getUserId(), ranking.getChannel().getId());
                boolean shouldTriggerBlock;
                synchronized (mkeyToImpressions) {
                    ChannelImpressions ci = mkeyToImpressions.getOrDefault(key,
                            createChannelImpressionsWithThresholds());
                if (ranking.getImportance() > IMPORTANCE_MIN && ci.shouldTriggerBlock()) {
                    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);
            }