Merge "Track current user without calling into AMS." into nyc-dev

am: 90f4ca78ee

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

Change-Id: Iccc662940ab9e77182f06b1156aa090df63796e1
This commit is contained in:
Jeff Sharkey
2016-05-05 18:09:41 +00:00
committed by android-build-merger

View File

@@ -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) {