Don't crash in Music Storage Settings.

This crash occurs because the music files entry is active, but does
not have an AppEntry (because it is not an app.) ManageApplications
assumes all active elements have an AppEntry, which causes an NPE.

By adding in a null check, we can avoid this.

Bug: 34888282
Test: Manual -- because ManageApplications needs refactoring badly.
Change-Id: Ief0c202f6176d90e492e62e5930b940e5a28b95c
This commit is contained in:
Daniel Nishi
2017-02-01 14:19:28 -08:00
parent d1172942ee
commit 58543f1dd4

View File

@@ -1139,6 +1139,9 @@ public class ManageApplications extends InstrumentedPreferenceFragment
public void onPackageSizeChanged(String packageName) { public void onPackageSizeChanged(String packageName) {
for (int i = 0; i < mActive.size(); i++) { for (int i = 0; i < mActive.size(); i++) {
AppViewHolder holder = (AppViewHolder) mActive.get(i).getTag(); AppViewHolder holder = (AppViewHolder) mActive.get(i).getTag();
if (holder == null) {
continue;
}
ApplicationInfo info = holder.entry.info; ApplicationInfo info = holder.entry.info;
if (info == null) { if (info == null) {
continue; continue;