summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
author Risan <risan@google.com> 2018-11-13 12:12:23 -0800
committer android-build-merger <android-build-merger@google.com> 2018-11-13 12:12:23 -0800
commitf8771d362c0058d90f6c32a35cb15aa0b86f11f4 (patch)
treeeb7541dfb7f5e0f7c8e9880a0209ac762c879dce /services
parentf84f1fd2d9bcb7af7b777d237cf36e9185499e83 (diff)
parentee32e0d473a28437d214a577bcf2199059b9d98d (diff)
Merge "Introducing StubVolume in StorageManager" am: b499af866c am: eb871cc916
am: ee32e0d473 Change-Id: I4098132df9833b7cbac0db9bdadac297d324a822
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/StorageManagerService.java11
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: