Merge "Avoid a deadlock between PMS and AppOpsService" into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b3e407609f
@@ -3431,6 +3431,11 @@ class MountService extends IMountService.Stub
|
||||
}
|
||||
|
||||
public boolean hasExternalStorage(int uid, String packageName) {
|
||||
// No need to check for system uid. This avoids a deadlock between
|
||||
// PackageManagerService and AppOpsService.
|
||||
if (uid == Process.SYSTEM_UID) {
|
||||
return true;
|
||||
}
|
||||
// No locking - CopyOnWriteArrayList
|
||||
for (ExternalStorageMountPolicy policy : mPolicies) {
|
||||
final boolean policyHasStorage = policy.hasExternalStorage(uid, packageName);
|
||||
|
||||
Reference in New Issue
Block a user