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

Commit 02b4a975 authored by Valentin Iftime's avatar Valentin Iftime
Browse files

Notification API hardening: forced auto-grouping

 NotificationManagerService will post a group summary on the app's behalf
 and group notifications based on several scenarios:

  1. Groups without summary
  2. Summaries without child notifications
  3. Singleton groups (summaries with single or low number of children)

Flag: android.service.notification.notification_force_grouping
Flag: com.android.server.notification.notification_force_group_singletons

Test: atest GroupHelperTest NotificationManagerServiceTest

Bug: 336488844
Change-Id: Ie1c0727c5de5e3dc55ca2a1c177d9b4660ad588d
parent 46de7bfc
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -4122,6 +4122,17 @@ public class Notification implements Parcelable
        return mGroupAlertBehavior;
    }
    /**
     * Sets which type of notifications in a group are responsible for audibly alerting the
     * user. See {@link #GROUP_ALERT_ALL}, {@link #GROUP_ALERT_CHILDREN},
     * {@link #GROUP_ALERT_SUMMARY}.
     * @param groupAlertBehavior
     * @hide
     */
    public void setGroupAlertBehavior(@GroupAlertBehavior int groupAlertBehavior) {
        mGroupAlertBehavior = groupAlertBehavior;
    }
    /**
     * Returns the bubble metadata that will be used to display app content in a floating window
     * over the existing foreground activity.
+5 −1
Original line number Diff line number Diff line
@@ -176,8 +176,12 @@ public class StatusBarNotification implements Parcelable {

    private String groupKey() {
        if (overrideGroupKey != null) {
            if (Flags.notificationForceGrouping()) {
                return overrideGroupKey;
            } else {
                return user.getIdentifier() + "|" + pkg + "|" + "g:" + overrideGroupKey;
            }
        }
        final String group = getNotification().getGroup();
        final String sortKey = getNotification().getSortKey();
        if (group == null && sortKey == null) {
+14 −0
Original line number Diff line number Diff line
@@ -44,3 +44,17 @@ flag {
    description: "Allows the NAS to classify notifications"
    bug: "343988084"
}

flag {
  name: "notification_force_grouping"
  namespace: "systemui"
  description: "This flag controls the forced auto-grouping feature"
  bug: "336488844"
}

flag {
  name: "notification_silent_flag"
  namespace: "systemui"
  description: "Guards the new FLAG_SILENT Notification flag"
  bug: "336488844"
}
 No newline at end of file
+1007 −46

File changed.

Preview size limit exceeded, changes collapsed.

+363 −88

File changed.

Preview size limit exceeded, changes collapsed.

Loading