summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2013-06-10 15:16:22 -0400
committerJohn Spurlock <jspurlock@google.com>2013-06-10 15:16:22 -0400
commitc133ab8258f8e976f402d57456b1f06d11a78b03 (patch)
tree5af688ba301300e9addcee68bd573950fe94e64f /core
parent5133dcb83821ed1362efbc83b3c5131ea6374d3f (diff)
downloadframeworks_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')
-rw-r--r--core/java/android/service/notification/NotificationListenerService.java12
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);
+ }
}
}
}