Guard against NPE am: 663cc934d9
am: f704b4eb6d
Change-Id: I8f144190fadded2ddb645b8741596e660f6ff720
This commit is contained in:
@@ -31,6 +31,7 @@ import android.text.TextUtils;
|
|||||||
import android.util.ArrayMap;
|
import android.util.ArrayMap;
|
||||||
import android.util.ArraySet;
|
import android.util.ArraySet;
|
||||||
import android.util.IconDrawableFactory;
|
import android.util.IconDrawableFactory;
|
||||||
|
import android.util.Slog;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.Utils;
|
import com.android.settings.Utils;
|
||||||
@@ -294,15 +295,19 @@ public class RecentNotifyingAppsPreferenceController extends AbstractPreferenceC
|
|||||||
List<NotifyingApp> displayableApps = new ArrayList<>(SHOW_RECENT_APP_COUNT);
|
List<NotifyingApp> displayableApps = new ArrayList<>(SHOW_RECENT_APP_COUNT);
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (NotifyingApp app : mApps) {
|
for (NotifyingApp app : mApps) {
|
||||||
final ApplicationsState.AppEntry appEntry = mApplicationsState.getEntry(
|
try {
|
||||||
app.getPackage(), app.getUserId());
|
final ApplicationsState.AppEntry appEntry = mApplicationsState.getEntry(
|
||||||
if (appEntry == null) {
|
app.getPackage(), app.getUserId());
|
||||||
continue;
|
if (appEntry == null) {
|
||||||
}
|
continue;
|
||||||
displayableApps.add(app);
|
}
|
||||||
count++;
|
displayableApps.add(app);
|
||||||
if (count >= SHOW_RECENT_APP_COUNT) {
|
count++;
|
||||||
break;
|
if (count >= SHOW_RECENT_APP_COUNT) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Slog.e(TAG, "Failed to find app " + app.getPackage() + "/" + app.getUserId(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return displayableApps;
|
return displayableApps;
|
||||||
|
Reference in New Issue
Block a user