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

Commit 1ed71f37 authored by Andreas Gampe's avatar Andreas Gampe
Browse files

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
parent b052aad2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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}.
+1 −1
Original line number Diff line number Diff line
@@ -3683,7 +3683,7 @@ public class NotificationManagerService extends SystemService {
                    for (int i = 0; i < tokens.length; i++) {
                        String token = tokens[i];
                        if (token != null) {
                            token.trim();
                            token = token.trim();
                        }
                        if (TextUtils.isEmpty(token)) {
                            continue;