OSDN Git Service

Disable no-channel exception, notifications will silently fail
authorGeoffrey Pitsch <gpitsch@google.com>
Thu, 23 Mar 2017 21:57:12 +0000 (17:57 -0400)
committerGeoffrey Pitsch <gpitsch@google.com>
Thu, 23 Mar 2017 21:57:12 +0000 (17:57 -0400)
Logs instead in the meantime.

Bug: 36516812
Test: runtest systemui-notification
Change-Id: I03dd46b7357e443c7810cecda9a8ba13c9755f30

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

index 3727a5b..07dad6b 100644 (file)
@@ -3121,8 +3121,19 @@ public class NotificationManagerService extends SystemService {
                         + " - notification=" + notification);
                 return;
             }
-            throw new IllegalArgumentException("No Channel found for channelId=" + channelId
-                    + ", notification=" + notification);
+            final String noChannelStr = "No Channel found for "
+                    + "pkg=" + pkg
+                    + ", channelId=" + channelId
+                    + ", opPkg=" + opPkg
+                    + ", callingUid=" + callingUid
+                    + ", userId=" + userId
+                    + ", incomingUserId=" + incomingUserId
+                    + ", notificationUid=" + notificationUid
+                    + ", notification=" + notification;
+            // STOPSHIP TODO: should throw instead of logging.
+            // throw new IllegalArgumentException(noChannelStr);
+            Log.e(TAG, noChannelStr);
+            return;
         }
         final StatusBarNotification n = new StatusBarNotification(
                 pkg, opPkg, id, tag, notificationUid, callingPid, notification,