From 2fb271bd3c4d0c3377cad1bdbd1c6a612701a1e1 Mon Sep 17 00:00:00 2001 From: Flavio Fiszman Date: Fri, 11 Jun 2021 16:46:11 +0100 Subject: [PATCH] Catch bubbles exception in PeopleTiles Change-Id: I9f13217f6b0a75c53c953e2cceeda41e62a989d9 Test: manual Bug: 190822282 --- .../android/systemui/people/NotificationHelper.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/people/NotificationHelper.java b/packages/SystemUI/src/com/android/systemui/people/NotificationHelper.java index b5ac90828fceb..d863dcce4fc76 100644 --- a/packages/SystemUI/src/com/android/systemui/people/NotificationHelper.java +++ b/packages/SystemUI/src/com/android/systemui/people/NotificationHelper.java @@ -240,9 +240,16 @@ public class NotificationHelper { /** Returns whether {@code entry} is suppressed from shade, meaning we should not show it. */ public static boolean shouldFilterOut( Optional bubblesOptional, NotificationEntry entry) { - return bubblesOptional.isPresent() - && bubblesOptional.get().isBubbleNotificationSuppressedFromShade( - entry.getKey(), entry.getSbn().getGroupKey()); + boolean isSuppressed = false; + //TODO(b/190822282): Investigate what is causing the NullPointerException + try { + isSuppressed = bubblesOptional.isPresent() + && bubblesOptional.get().isBubbleNotificationSuppressedFromShade( + entry.getKey(), entry.getSbn().getGroupKey()); + } catch (Exception e) { + Log.e(TAG, "Exception checking if notification is suppressed: " + e); + } + return isSuppressed; } }