Merge "Check user state after clearing identity." into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1578357df7
@ -3461,13 +3461,14 @@ public class PackageManagerService extends IPackageManager.Stub {
|
|||||||
// Only need to do this if user is initialized. Otherwise it's a new user
|
// Only need to do this if user is initialized. Otherwise it's a new user
|
||||||
// and there are no processes running as the user yet and there's no need
|
// and there are no processes running as the user yet and there's no need
|
||||||
// to make an expensive call to remount processes for the changed permissions.
|
// to make an expensive call to remount processes for the changed permissions.
|
||||||
if ((READ_EXTERNAL_STORAGE.equals(name)
|
if (READ_EXTERNAL_STORAGE.equals(name)
|
||||||
|| WRITE_EXTERNAL_STORAGE.equals(name))
|
|| WRITE_EXTERNAL_STORAGE.equals(name)) {
|
||||||
&& sUserManager.isInitialized(userId)) {
|
|
||||||
final long token = Binder.clearCallingIdentity();
|
final long token = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
|
if (sUserManager.isInitialized(userId)) {
|
||||||
final StorageManager storage = mContext.getSystemService(StorageManager.class);
|
final StorageManager storage = mContext.getSystemService(StorageManager.class);
|
||||||
storage.remountUid(uid);
|
storage.remountUid(uid);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
Binder.restoreCallingIdentity(token);
|
Binder.restoreCallingIdentity(token);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user