Loading services/core/java/com/android/server/notification/NotificationManagerService.java +6 −5 Original line number Diff line number Diff line Loading @@ -2720,9 +2720,9 @@ public class NotificationManagerService extends SystemService { protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { if (!DumpUtils.checkDumpAndUsageStatsPermission(getContext(), TAG, pw)) return; final DumpFilter filter = DumpFilter.parseFromArguments(args); if (filter != null && filter.stats) { if (filter.stats) { dumpJson(pw, filter); } else if (filter != null && filter.proto) { } else if (filter.proto) { dumpProto(fd, filter); } else { dumpImpl(pw, filter); Loading Loading @@ -3235,7 +3235,7 @@ public class NotificationManagerService extends SystemService { return null; }; private void dumpJson(PrintWriter pw, DumpFilter filter) { private void dumpJson(PrintWriter pw, @NonNull DumpFilter filter) { JSONObject dump = new JSONObject(); try { dump.put("service", "Notification Manager"); Loading @@ -3249,7 +3249,7 @@ public class NotificationManagerService extends SystemService { pw.println(dump); } private void dumpProto(FileDescriptor fd, DumpFilter filter) { private void dumpProto(FileDescriptor fd, @NonNull DumpFilter filter) { final ProtoOutputStream proto = new ProtoOutputStream(fd); synchronized (mNotificationLock) { long records = proto.start(NotificationServiceDumpProto.RECORDS); Loading Loading @@ -3331,7 +3331,7 @@ public class NotificationManagerService extends SystemService { proto.flush(); } void dumpImpl(PrintWriter pw, DumpFilter filter) { void dumpImpl(PrintWriter pw, @NonNull DumpFilter filter) { pw.print("Current Notification Manager state"); if (filter.filtered) { pw.print(" (filtered to "); pw.print(filter); pw.print(")"); Loading Loading @@ -5900,6 +5900,7 @@ public class NotificationManagerService extends SystemService { public boolean redact = true; public boolean proto = false; @NonNull public static DumpFilter parseFromArguments(String[] args) { final DumpFilter filter = new DumpFilter(); for (int ai = 0; ai < args.length; ai++) { Loading services/core/java/com/android/server/notification/RankingHelper.java +22 −18 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.internal.logging.nano.MetricsProto; import com.android.internal.util.Preconditions; import com.android.internal.util.XmlUtils; import android.annotation.NonNull; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationChannelGroup; Loading Loading @@ -915,8 +916,8 @@ public class RankingHelper implements RankingConfig { } } public void dump(PrintWriter pw, String prefix, NotificationManagerService.DumpFilter filter) { if (filter == null) { public void dump(PrintWriter pw, String prefix, @NonNull NotificationManagerService.DumpFilter filter) { final int N = mSignalExtractors.length; pw.print(prefix); pw.print("mSignalExtractors.length = "); Loading @@ -924,12 +925,12 @@ public class RankingHelper implements RankingConfig { for (int i = 0; i < N; i++) { pw.print(prefix); pw.print(" "); pw.println(mSignalExtractors[i]); pw.println(mSignalExtractors[i].getClass().getSimpleName()); } pw.print(prefix); pw.println("per-package config:"); } pw.println("Records:"); synchronized (mRecords) { dumpRecords(pw, prefix, filter, mRecords); Loading @@ -938,7 +939,8 @@ public class RankingHelper implements RankingConfig { dumpRecords(pw, prefix, filter, mRestoredWithoutUids); } public void dump(ProtoOutputStream proto, NotificationManagerService.DumpFilter filter) { public void dump(ProtoOutputStream proto, @NonNull NotificationManagerService.DumpFilter filter) { final int N = mSignalExtractors.length; for (int i = 0; i < N; i++) { proto.write(RankingHelperProto.NOTIFICATION_SIGNAL_EXTRACTORS, Loading @@ -952,12 +954,13 @@ public class RankingHelper implements RankingConfig { } private static void dumpRecords(ProtoOutputStream proto, long fieldId, NotificationManagerService.DumpFilter filter, ArrayMap<String, Record> records) { @NonNull NotificationManagerService.DumpFilter filter, ArrayMap<String, Record> records) { final int N = records.size(); long fToken; for (int i = 0; i < N; i++) { final Record r = records.valueAt(i); if (filter == null || filter.matches(r.pkg)) { if (filter.matches(r.pkg)) { fToken = proto.start(fieldId); proto.write(RecordProto.PACKAGE, r.pkg); Loading Loading @@ -985,11 +988,12 @@ public class RankingHelper implements RankingConfig { } private static void dumpRecords(PrintWriter pw, String prefix, NotificationManagerService.DumpFilter filter, ArrayMap<String, Record> records) { @NonNull NotificationManagerService.DumpFilter filter, ArrayMap<String, Record> records) { final int N = records.size(); for (int i = 0; i < N; i++) { final Record r = records.valueAt(i); if (filter == null || filter.matches(r.pkg)) { if (filter.matches(r.pkg)) { pw.print(prefix); pw.print(" AppSettings: "); pw.print(r.pkg); Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +6 −5 Original line number Diff line number Diff line Loading @@ -2720,9 +2720,9 @@ public class NotificationManagerService extends SystemService { protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { if (!DumpUtils.checkDumpAndUsageStatsPermission(getContext(), TAG, pw)) return; final DumpFilter filter = DumpFilter.parseFromArguments(args); if (filter != null && filter.stats) { if (filter.stats) { dumpJson(pw, filter); } else if (filter != null && filter.proto) { } else if (filter.proto) { dumpProto(fd, filter); } else { dumpImpl(pw, filter); Loading Loading @@ -3235,7 +3235,7 @@ public class NotificationManagerService extends SystemService { return null; }; private void dumpJson(PrintWriter pw, DumpFilter filter) { private void dumpJson(PrintWriter pw, @NonNull DumpFilter filter) { JSONObject dump = new JSONObject(); try { dump.put("service", "Notification Manager"); Loading @@ -3249,7 +3249,7 @@ public class NotificationManagerService extends SystemService { pw.println(dump); } private void dumpProto(FileDescriptor fd, DumpFilter filter) { private void dumpProto(FileDescriptor fd, @NonNull DumpFilter filter) { final ProtoOutputStream proto = new ProtoOutputStream(fd); synchronized (mNotificationLock) { long records = proto.start(NotificationServiceDumpProto.RECORDS); Loading Loading @@ -3331,7 +3331,7 @@ public class NotificationManagerService extends SystemService { proto.flush(); } void dumpImpl(PrintWriter pw, DumpFilter filter) { void dumpImpl(PrintWriter pw, @NonNull DumpFilter filter) { pw.print("Current Notification Manager state"); if (filter.filtered) { pw.print(" (filtered to "); pw.print(filter); pw.print(")"); Loading Loading @@ -5900,6 +5900,7 @@ public class NotificationManagerService extends SystemService { public boolean redact = true; public boolean proto = false; @NonNull public static DumpFilter parseFromArguments(String[] args) { final DumpFilter filter = new DumpFilter(); for (int ai = 0; ai < args.length; ai++) { Loading
services/core/java/com/android/server/notification/RankingHelper.java +22 −18 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.internal.logging.nano.MetricsProto; import com.android.internal.util.Preconditions; import com.android.internal.util.XmlUtils; import android.annotation.NonNull; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationChannelGroup; Loading Loading @@ -915,8 +916,8 @@ public class RankingHelper implements RankingConfig { } } public void dump(PrintWriter pw, String prefix, NotificationManagerService.DumpFilter filter) { if (filter == null) { public void dump(PrintWriter pw, String prefix, @NonNull NotificationManagerService.DumpFilter filter) { final int N = mSignalExtractors.length; pw.print(prefix); pw.print("mSignalExtractors.length = "); Loading @@ -924,12 +925,12 @@ public class RankingHelper implements RankingConfig { for (int i = 0; i < N; i++) { pw.print(prefix); pw.print(" "); pw.println(mSignalExtractors[i]); pw.println(mSignalExtractors[i].getClass().getSimpleName()); } pw.print(prefix); pw.println("per-package config:"); } pw.println("Records:"); synchronized (mRecords) { dumpRecords(pw, prefix, filter, mRecords); Loading @@ -938,7 +939,8 @@ public class RankingHelper implements RankingConfig { dumpRecords(pw, prefix, filter, mRestoredWithoutUids); } public void dump(ProtoOutputStream proto, NotificationManagerService.DumpFilter filter) { public void dump(ProtoOutputStream proto, @NonNull NotificationManagerService.DumpFilter filter) { final int N = mSignalExtractors.length; for (int i = 0; i < N; i++) { proto.write(RankingHelperProto.NOTIFICATION_SIGNAL_EXTRACTORS, Loading @@ -952,12 +954,13 @@ public class RankingHelper implements RankingConfig { } private static void dumpRecords(ProtoOutputStream proto, long fieldId, NotificationManagerService.DumpFilter filter, ArrayMap<String, Record> records) { @NonNull NotificationManagerService.DumpFilter filter, ArrayMap<String, Record> records) { final int N = records.size(); long fToken; for (int i = 0; i < N; i++) { final Record r = records.valueAt(i); if (filter == null || filter.matches(r.pkg)) { if (filter.matches(r.pkg)) { fToken = proto.start(fieldId); proto.write(RecordProto.PACKAGE, r.pkg); Loading Loading @@ -985,11 +988,12 @@ public class RankingHelper implements RankingConfig { } private static void dumpRecords(PrintWriter pw, String prefix, NotificationManagerService.DumpFilter filter, ArrayMap<String, Record> records) { @NonNull NotificationManagerService.DumpFilter filter, ArrayMap<String, Record> records) { final int N = records.size(); for (int i = 0; i < N; i++) { final Record r = records.valueAt(i); if (filter == null || filter.matches(r.pkg)) { if (filter.matches(r.pkg)) { pw.print(prefix); pw.print(" AppSettings: "); pw.print(r.pkg); Loading