Merge "Fix NPE when querying for already uninstalled package." into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
54dbca30ed
@@ -3584,6 +3584,10 @@ class StorageManagerService extends IStorageManager.Stub
|
||||
}
|
||||
|
||||
final String[] packagesForUid = mIPackageManager.getPackagesForUid(uid);
|
||||
if (ArrayUtils.isEmpty(packagesForUid)) {
|
||||
// It's possible the package got uninstalled already, so just ignore.
|
||||
return Zygote.MOUNT_EXTERNAL_NONE;
|
||||
}
|
||||
if (packageName == null) {
|
||||
packageName = packagesForUid[0];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user