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

Commit 83d5beb2 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

am: 09adc8f7

Change-Id: I81c425ae5f45a58cad21bec786c96fca471634e2
parents fabcd32c 09adc8f7
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);
            }