Catch bubbles exception in PeopleTiles

Change-Id: I9f13217f6b0a75c53c953e2cceeda41e62a989d9
Test: manual
Bug: 190822282
This commit is contained in:
Flavio Fiszman
2021-06-11 16:46:11 +01:00
parent 271c600617
commit 2fb271bd3c

View File

@@ -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<Bubbles> 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;
}
}