Fix null handling

Test: cts verifier, notification listener
Fixes: 177202279
Change-Id: Ib25915b0b5a60e9c39986d3ba3af3073e9d2b822
This commit is contained in:
Julia Reynolds
2021-01-19 14:48:52 -05:00
parent 119bbbd308
commit 833514376e

View File

@@ -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) {