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

Commit 582e0dd1 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Track current user without calling into AMS." into nyc-dev am: 90f4ca78

am: e43fb2e5

* commit 'e43fb2e5':
  Track current user without calling into AMS.

Change-Id: I81dfb4771b9b78d1e7934efa073ceef1affaa94e
parents 6db0d3d2 e43fb2e5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -177,6 +177,11 @@ class MountService extends IMountService.Stub
            }
        }

        @Override
        public void onSwitchUser(int userHandle) {
            mMountService.mCurrentUserId = userHandle;
        }

        @Override
        public void onUnlockUser(int userHandle) {
            mMountService.onUnlockUser(userHandle);
@@ -320,6 +325,8 @@ class MountService extends IMountService.Stub
    @GuardedBy("mLock")
    private String mMoveTargetUuid;

    private volatile int mCurrentUserId = UserHandle.USER_SYSTEM;

    private VolumeInfo findVolumeByIdOrThrow(String id) {
        synchronized (mLock) {
            final VolumeInfo vol = mVolumes.get(id);
@@ -1285,7 +1292,7 @@ class MountService extends IMountService.Stub
                vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;
            }

            vol.mountUserId = ActivityManager.getCurrentUser();
            vol.mountUserId = mCurrentUserId;
            mHandler.obtainMessage(H_VOLUME_MOUNT, vol).sendToTarget();

        } else if (vol.type == VolumeInfo.TYPE_PRIVATE) {