Merge "Prevent crash in recent app list"

This commit is contained in:
TreeHugger Robot
2018-01-25 17:23:42 +00:00
committed by Android (Google) Code Review
3 changed files with 29 additions and 2 deletions

View File

@@ -325,7 +325,7 @@ public class RecentAppsPreferenceController extends AbstractPreferenceController
// Not visible on launcher -> likely not a user visible app, skip if non-instant.
final ApplicationsState.AppEntry appEntry =
mApplicationsState.getEntry(pkgName, mUserId);
if (!AppUtils.isInstant(appEntry.info)) {
if (appEntry == null || appEntry.info == null || !AppUtils.isInstant(appEntry.info)) {
Log.d(TAG, "Not a user visible or instant app, skipping " + pkgName);
return false;
}

View File

@@ -283,7 +283,7 @@ public class RecentNotifyingAppsPreferenceController extends AbstractPreferenceC
// Not visible on launcher -> likely not a user visible app, skip if non-instant.
final ApplicationsState.AppEntry appEntry =
mApplicationsState.getEntry(pkgName, mUserId);
if (!AppUtils.isInstant(appEntry.info)) {
if (appEntry == null || appEntry.info == null || !AppUtils.isInstant(appEntry.info)) {
Log.d(TAG, "Not a user visible or instant app, skipping " + pkgName);
return false;
}