OSDN Git Service

Fix channels --stats dump
authorJulia Reynolds <juliacr@google.com>
Thu, 19 Apr 2018 19:50:31 +0000 (15:50 -0400)
committerJulia Reynolds <juliacr@google.com>
Thu, 19 Apr 2018 19:50:31 +0000 (15:50 -0400)
Test: manual inspection
Bug: 78292990
Change-Id: Iab75627494213870184e503bc2585cc8644ca1dd

services/core/java/com/android/server/notification/RankingHelper.java

index 89bd660..bcfd88f 100644 (file)
@@ -1225,12 +1225,16 @@ public class RankingHelper implements RankingConfig {
                         if (r.showBadge != DEFAULT_SHOW_BADGE) {
                             record.put("showBadge", Boolean.valueOf(r.showBadge));
                         }
+                        JSONArray channels = new JSONArray();
                         for (NotificationChannel channel : r.channels.values()) {
-                            record.put("channel", channel.toJson());
+                            channels.put(channel.toJson());
                         }
+                        record.put("channels", channels);
+                        JSONArray groups = new JSONArray();
                         for (NotificationChannelGroup group : r.groups.values()) {
-                            record.put("group", group.toJson());
+                            groups.put(group.toJson());
                         }
+                        record.put("groups", groups);
                     } catch (JSONException e) {
                         // pass
                     }