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

Commit dbf4481c authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Adjustment bundles are defusable.

Bug: 28168811
Change-Id: I1699e6bfd03a5f117cc89585c03e235fe6a99456
parent e767e1bc
Loading
Loading
Loading
Loading
+54 −49
Original line number Diff line number Diff line
@@ -2186,8 +2186,9 @@ public class NotificationManagerService extends SystemService {

    // Clears the 'fake' auto-bunding summary.
    private void maybeClearAutobundleSummaryLocked(Adjustment adjustment) {
        if (adjustment.getSignals() != null
                && adjustment.getSignals().containsKey(Adjustment.NEEDS_AUTOGROUPING_KEY)
        if (adjustment.getSignals() != null) {
            Bundle.setDefusable(adjustment.getSignals(), true);
            if (adjustment.getSignals().containsKey(Adjustment.NEEDS_AUTOGROUPING_KEY)
                && !adjustment.getSignals().getBoolean(Adjustment.NEEDS_AUTOGROUPING_KEY, false)) {
                if (mAutobundledSummaries.containsKey(adjustment.getPackage())) {
                    // Clear summary.
@@ -2200,11 +2201,13 @@ public class NotificationManagerService extends SystemService {
                }
            }
        }
    }

    // Posts a 'fake' summary for a package that has exceeded the solo-notification limit.
    private void maybeAddAutobundleSummary(Adjustment adjustment) {
        if (adjustment.getSignals() != null
                && adjustment.getSignals().getBoolean(Adjustment.NEEDS_AUTOGROUPING_KEY, false)) {
        if (adjustment.getSignals() != null) {
            Bundle.setDefusable(adjustment.getSignals(), true);
            if (adjustment.getSignals().getBoolean(Adjustment.NEEDS_AUTOGROUPING_KEY, false)) {
                final String newAutoBundleKey =
                        adjustment.getSignals().getString(Adjustment.GROUP_KEY_OVERRIDE_KEY, null);
                int userId = -1;
@@ -2235,7 +2238,8 @@ public class NotificationManagerService extends SystemService {
                                        adjustedSbn.getOpPkg(),
                                        Integer.MAX_VALUE, Adjustment.GROUP_KEY_OVERRIDE_KEY,
                                        adjustedSbn.getUid(), adjustedSbn.getInitialPid(),
                                    summaryNotification, adjustedSbn.getUser(), newAutoBundleKey,
                                        summaryNotification, adjustedSbn.getUser(),
                                        newAutoBundleKey,
                                        System.currentTimeMillis());
                        summaryRecord = new NotificationRecord(getContext(), summarySbn);
                        mAutobundledSummaries.put(adjustment.getPackage(), summarySbn.getKey());
@@ -2247,6 +2251,7 @@ public class NotificationManagerService extends SystemService {
                }
            }
        }
    }

    private String disableNotificationEffects(NotificationRecord record) {
        if (mDisableNotificationEffects) {