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

Commit c133ab82 authored by John Spurlock's avatar John Spurlock
Browse files

Log errors found in notification listener callbacks.

Otherwise, exceptions thrown inside listener callbacks are
not logged at all.

Change-Id: Iaef28e06abc4d6caf66051725e14a17ac954173e
parent 5133dcb8
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -164,11 +164,19 @@ public abstract class NotificationListenerService extends Service {
    private class INotificationListenerWrapper extends INotificationListener.Stub {
        @Override
        public void onNotificationPosted(StatusBarNotification sbn) {
            try {
                NotificationListenerService.this.onNotificationPosted(sbn);
            } catch (Throwable t) {
                Log.w(TAG, "Error running onNotificationPosted", t);
            }
        }
        @Override
        public void onNotificationRemoved(StatusBarNotification sbn) {
            try {
                NotificationListenerService.this.onNotificationRemoved(sbn);
            } catch (Throwable t) {
                Log.w(TAG, "Error running onNotificationRemoved", t);
            }
        }
    }
}