Add null checks on filters.
Bug: 27496323
Change-Id: If8883279af11218042f420509c3a8e7b168c815f
diff --git a/src/com/android/settings/applications/AppStateNotificationBridge.java b/src/com/android/settings/applications/AppStateNotificationBridge.java
index e8db2aa..b936351 100644
--- a/src/com/android/settings/applications/AppStateNotificationBridge.java
+++ b/src/com/android/settings/applications/AppStateNotificationBridge.java
@@ -70,6 +70,9 @@
@Override
public boolean filterApp(AppEntry info) {
+ if (info == null || info.extraInfo == null) {
+ return false;
+ }
if (info.extraInfo instanceof AppRow) {
AppRow row = (AppRow) info.extraInfo;
return row.banned;
@@ -85,7 +88,7 @@
@Override
public boolean filterApp(AppEntry info) {
- if (info == null) {
+ if (info == null || info.extraInfo == null) {
return false;
}
AppRow row = (AppRow) info.extraInfo;
@@ -101,7 +104,10 @@
@Override
public boolean filterApp(AppEntry info) {
- return info.extraInfo != null && ((AppRow) info.extraInfo).appBypassDnd;
+ if (info == null || info.extraInfo == null) {
+ return false;
+ }
+ return ((AppRow) info.extraInfo).appBypassDnd;
}
};
@@ -112,7 +118,10 @@
@Override
public boolean filterApp(AppEntry info) {
- return info.extraInfo != null && ((AppRow) info.extraInfo).lockScreenSecure
+ if (info == null || info.extraInfo == null) {
+ return false;
+ }
+ return ((AppRow) info.extraInfo).lockScreenSecure
&& ((AppRow) info.extraInfo).appVisOverride == Notification.VISIBILITY_PRIVATE;
}
};
@@ -124,7 +133,10 @@
@Override
public boolean filterApp(AppEntry info) {
- return info.extraInfo != null && ((AppRow) info.extraInfo).lockScreenSecure
+ if (info == null || info.extraInfo == null) {
+ return false;
+ }
+ return ((AppRow) info.extraInfo).lockScreenSecure
&& ((AppRow) info.extraInfo).appVisOverride == Notification.VISIBILITY_SECRET;
}
};