diff options
author | John Spurlock <jspurlock@google.com> | 2013-06-10 15:16:22 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2013-06-10 15:16:22 -0400 |
commit | c133ab8258f8e976f402d57456b1f06d11a78b03 (patch) | |
tree | 5af688ba301300e9addcee68bd573950fe94e64f /core/java/android/service | |
parent | 5133dcb83821ed1362efbc83b3c5131ea6374d3f (diff) | |
download | frameworks_base-c133ab8258f8e976f402d57456b1f06d11a78b03.zip frameworks_base-c133ab8258f8e976f402d57456b1f06d11a78b03.tar.gz frameworks_base-c133ab8258f8e976f402d57456b1f06d11a78b03.tar.bz2 |
Log errors found in notification listener callbacks.
Otherwise, exceptions thrown inside listener callbacks are
not logged at all.
Change-Id: Iaef28e06abc4d6caf66051725e14a17ac954173e
Diffstat (limited to 'core/java/android/service')
-rw-r--r-- | core/java/android/service/notification/NotificationListenerService.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java index bfea9ca..2e0e59b 100644 --- a/core/java/android/service/notification/NotificationListenerService.java +++ b/core/java/android/service/notification/NotificationListenerService.java @@ -164,11 +164,19 @@ public abstract class NotificationListenerService extends Service { private class INotificationListenerWrapper extends INotificationListener.Stub { @Override public void onNotificationPosted(StatusBarNotification sbn) { - NotificationListenerService.this.onNotificationPosted(sbn); + try { + NotificationListenerService.this.onNotificationPosted(sbn); + } catch (Throwable t) { + Log.w(TAG, "Error running onNotificationPosted", t); + } } @Override public void onNotificationRemoved(StatusBarNotification sbn) { - NotificationListenerService.this.onNotificationRemoved(sbn); + try { + NotificationListenerService.this.onNotificationRemoved(sbn); + } catch (Throwable t) { + Log.w(TAG, "Error running onNotificationRemoved", t); + } } } } |