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

Commit cadb5dc5 authored by Geoffrey Pitsch's avatar Geoffrey Pitsch
Browse files

Toast whenever a notification fails to post

Help developers find their missing notifications.
Incremental change to move towards an all-channel world.

Bug: 35378789
Test: runtest systemui-notification
Change-Id: Ie3f3e307ff1f6450f5fc8eb9e34e5f566614c1f9
parent c922c482
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -3067,9 +3067,17 @@ public class NotificationManagerService extends SystemService {
                    + ", 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(