summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-12-11 15:49:07 -0800
committerAndreas Gampe <agampe@google.com>2015-12-11 15:49:07 -0800
commit1ed71f3722830271602d2d3b2bbd1ba692f75835 (patch)
treec438f58e26ae705955e6f062c4efa3a7be494049 /core/java
parentb052aad297bd1d0e36c290eb20e262aea5d670c4 (diff)
Frameworks/base: Fix Notification code
Avoid a NullPointerException in NotificationListenerService when a corrupt notification is found. Fix not using the return of trim() in NotificationManagerService. Bug: 19797138 Change-Id: I84dc15eba7b4052a774eb69d36591d100105f169
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/service/notification/NotificationListenerService.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java
index 76c63b958046..232d4fe4e979 100644
--- a/core/java/android/service/notification/NotificationListenerService.java
+++ b/core/java/android/service/notification/NotificationListenerService.java
@@ -713,10 +713,10 @@ public abstract class NotificationListenerService extends Service {
createLegacyIconExtras(sbn.getNotification());
maybePopulateRemoteViews(sbn.getNotification());
} catch (IllegalArgumentException e) {
- // drop corrupt notification
- sbn = null;
+ // warn and drop corrupt notification
Log.w(TAG, "onNotificationPosted: can't rebuild notification from " +
sbn.getPackageName());
+ sbn = null;
}
// protect subclass from concurrent modifications of (@link mNotificationKeys}.