From 833514376e6b715954477d038f18bd4b447b804f Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Tue, 19 Jan 2021 14:48:52 -0500 Subject: [PATCH] Fix null handling Test: cts verifier, notification listener Fixes: 177202279 Change-Id: Ib25915b0b5a60e9c39986d3ba3af3073e9d2b822 --- .../android/settings/notification/NotificationBackend.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/notification/NotificationBackend.java b/src/com/android/settings/notification/NotificationBackend.java index 43d170070fc..f4377eaae41 100644 --- a/src/com/android/settings/notification/NotificationBackend.java +++ b/src/com/android/settings/notification/NotificationBackend.java @@ -595,12 +595,13 @@ public class NotificationBackend { } public NotificationListenerFilter getListenerFilter(ComponentName cn, int userId) { + NotificationListenerFilter nlf = null; try { - return sINM.getListenerFilter(cn, userId); + nlf = sINM.getListenerFilter(cn, userId); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); } - return new NotificationListenerFilter(); + return nlf != null ? nlf : new NotificationListenerFilter(); } public void setListenerFilter(ComponentName cn, int userId, NotificationListenerFilter nlf) {