Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7efb0521 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android Git Automerger
Browse files

am 1578357d: Merge "Check user state after clearing identity." into mnc-dev

* commit '1578357d':
  Check user state after clearing identity.
parents d5b0f69a 1578357d
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -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
        // 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.
        if ((READ_EXTERNAL_STORAGE.equals(name)
                || WRITE_EXTERNAL_STORAGE.equals(name))
                && sUserManager.isInitialized(userId)) {
        if (READ_EXTERNAL_STORAGE.equals(name)
                || WRITE_EXTERNAL_STORAGE.equals(name)) {
            final long token = Binder.clearCallingIdentity();
            try {
                if (sUserManager.isInitialized(userId)) {
                    final StorageManager storage = mContext.getSystemService(StorageManager.class);
                    storage.remountUid(uid);
                }
            } finally {
                Binder.restoreCallingIdentity(token);
            }