Merge "Add null check before PackageManager operations" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
3177febb4f
@@ -324,9 +324,11 @@ public class AppStorageSettings extends AppInfoWithHeader
|
||||
private void initMoveDialog() {
|
||||
final Context context = getActivity();
|
||||
final StorageManager storage = context.getSystemService(StorageManager.class);
|
||||
|
||||
final List<VolumeInfo> candidates = context.getPackageManager()
|
||||
.getPackageCandidateVolumes(mAppEntry.info);
|
||||
final PackageManager pm = context.getPackageManager();
|
||||
final List<VolumeInfo> candidates =
|
||||
mAppEntry != null && pm != null
|
||||
? pm.getPackageCandidateVolumes(mAppEntry.info)
|
||||
: Collections.emptyList();
|
||||
if (candidates.size() > 1) {
|
||||
Collections.sort(candidates, VolumeInfo.getDescriptionComparator());
|
||||
|
||||
|
Reference in New Issue
Block a user