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

Commit 4b1415ca authored by Svetoslav's avatar Svetoslav Committed by The Android Automerger
Browse files

Clear binder id when determining external storage state

bug:22472435

Change-Id: I5badd51cb9fb2244395880eb1bbff8f4aa0abb8c
parent 0a98d5b5
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -2602,8 +2602,15 @@ class MountService extends IMountService.Stub
        boolean foundPrimary = false;

        final int userId = UserHandle.getUserId(uid);
        final boolean reportUnmounted = !mMountServiceInternal.hasExternalStorage(
        final boolean reportUnmounted;

        final long identity = Binder.clearCallingIdentity();
        try {
            reportUnmounted = !mMountServiceInternal.hasExternalStorage(
                    uid, packageName);
        } finally {
            Binder.restoreCallingIdentity(identity);
        }

        synchronized (mLock) {
            for (int i = 0; i < mVolumes.size(); i++) {