diff options
Diffstat (limited to 'services/core')
-rw-r--r-- | services/core/java/com/android/server/StorageManagerService.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java index 5b3ab85e6107..78e82b6f7821 100644 --- a/services/core/java/com/android/server/StorageManagerService.java +++ b/services/core/java/com/android/server/StorageManagerService.java @@ -1235,6 +1235,9 @@ class StorageManagerService extends IStorageManager.Stub } else if (vol.type == VolumeInfo.TYPE_PRIVATE) { mHandler.obtainMessage(H_VOLUME_MOUNT, vol).sendToTarget(); + } else if (vol.type == VolumeInfo.TYPE_STUB) { + vol.mountUserId = mCurrentUserId; + mHandler.obtainMessage(H_VOLUME_MOUNT, vol).sendToTarget(); } else { Slog.d(TAG, "Skipping automatic mounting of " + vol); } @@ -1245,6 +1248,7 @@ class StorageManagerService extends IStorageManager.Stub case VolumeInfo.TYPE_PRIVATE: case VolumeInfo.TYPE_PUBLIC: case VolumeInfo.TYPE_EMULATED: + case VolumeInfo.TYPE_STUB: break; default: return false; @@ -1321,7 +1325,8 @@ class StorageManagerService extends IStorageManager.Stub } } - if (vol.type == VolumeInfo.TYPE_PUBLIC && vol.state == VolumeInfo.STATE_EJECTING) { + if ((vol.type == VolumeInfo.TYPE_PUBLIC || vol.type == VolumeInfo.TYPE_STUB) + && vol.state == VolumeInfo.STATE_EJECTING) { // TODO: this should eventually be handled by new ObbVolume state changes /* * Some OBBs might have been unmounted when this volume was @@ -1403,7 +1408,8 @@ class StorageManagerService extends IStorageManager.Stub } boolean isTypeRestricted = false; - if (vol.type == VolumeInfo.TYPE_PUBLIC || vol.type == VolumeInfo.TYPE_PRIVATE) { + if (vol.type == VolumeInfo.TYPE_PUBLIC || vol.type == VolumeInfo.TYPE_PRIVATE + || vol.type == VolumeInfo.TYPE_STUB) { isTypeRestricted = userManager .hasUserRestriction(UserManager.DISALLOW_MOUNT_PHYSICAL_MEDIA, Binder.getCallingUserHandle()); @@ -2834,6 +2840,7 @@ class StorageManagerService extends IStorageManager.Stub final VolumeInfo vol = mVolumes.valueAt(i); switch (vol.getType()) { case VolumeInfo.TYPE_PUBLIC: + case VolumeInfo.TYPE_STUB: case VolumeInfo.TYPE_EMULATED: break; default: |