Merge "Merge "Toast whenever a notification fails to post" into oc-dev am: b287e9907a am: 15417d0f9d"
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index c1ffce3..d6e8231 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -3074,9 +3074,17 @@
+ ", incomingUserId=" + incomingUserId
+ ", notificationUid=" + notificationUid
+ ", notification=" + notification;
- // STOPSHIP TODO: should throw instead of logging.
+ // STOPSHIP TODO: should throw instead of logging or toasting.
// throw new IllegalArgumentException(noChannelStr);
Log.e(TAG, noChannelStr);
+
+ final String noChannelToastStr =
+ "Developer warning for package \"" + pkg + "\"\n" +
+ "Failed to post notification on channel \"" + channelId + "\"\n" +
+ "See log for more details";
+ Toast noChannelToast =
+ Toast.makeText(getContext(), noChannelToastStr, Toast.LENGTH_LONG);
+ noChannelToast.show();
return;
}
final StatusBarNotification n = new StatusBarNotification(