Merge "Track current user without calling into AMS." into nyc-dev
This commit is contained in:
@@ -177,6 +177,11 @@ class MountService extends IMountService.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSwitchUser(int userHandle) {
|
||||||
|
mMountService.mCurrentUserId = userHandle;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUnlockUser(int userHandle) {
|
public void onUnlockUser(int userHandle) {
|
||||||
mMountService.onUnlockUser(userHandle);
|
mMountService.onUnlockUser(userHandle);
|
||||||
@@ -320,6 +325,8 @@ class MountService extends IMountService.Stub
|
|||||||
@GuardedBy("mLock")
|
@GuardedBy("mLock")
|
||||||
private String mMoveTargetUuid;
|
private String mMoveTargetUuid;
|
||||||
|
|
||||||
|
private volatile int mCurrentUserId = UserHandle.USER_SYSTEM;
|
||||||
|
|
||||||
private VolumeInfo findVolumeByIdOrThrow(String id) {
|
private VolumeInfo findVolumeByIdOrThrow(String id) {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
final VolumeInfo vol = mVolumes.get(id);
|
final VolumeInfo vol = mVolumes.get(id);
|
||||||
@@ -1285,7 +1292,7 @@ class MountService extends IMountService.Stub
|
|||||||
vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;
|
vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
vol.mountUserId = ActivityManager.getCurrentUser();
|
vol.mountUserId = mCurrentUserId;
|
||||||
mHandler.obtainMessage(H_VOLUME_MOUNT, vol).sendToTarget();
|
mHandler.obtainMessage(H_VOLUME_MOUNT, vol).sendToTarget();
|
||||||
|
|
||||||
} else if (vol.type == VolumeInfo.TYPE_PRIVATE) {
|
} else if (vol.type == VolumeInfo.TYPE_PRIVATE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user