diff options
author | Oleg Drokin <green@linuxhacker.ru> | 2013-05-27 23:07:08 -0400 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-07-03 13:29:55 -0700 |
commit | cca622eedca3a40b80695b0e6cf570d41394e69d (patch) | |
tree | 702f3b36f78145a1ea8e7681d62462cf8382da8c /services | |
parent | 37a9afbc47903cd01e6cefe9512c03641c9fbfad (diff) | |
download | frameworks_base-cca622eedca3a40b80695b0e6cf570d41394e69d.zip frameworks_base-cca622eedca3a40b80695b0e6cf570d41394e69d.tar.gz frameworks_base-cca622eedca3a40b80695b0e6cf570d41394e69d.tar.bz2 |
Allow multiple emulated storages at the same time.
Only do multiuser mapping for primary emulated storage as per google docs.
Allow all non-primary emulated storage to have id other than 0 so that
it could be distinguished from the primary volume.
Change-Id: I7b70b9067fd6211055fb9074710f48107d7b0e8e
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/MountService.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java index dfe0c2c..5fb8385 100644 --- a/services/java/com/android/server/MountService.java +++ b/services/java/com/android/server/MountService.java @@ -1192,9 +1192,9 @@ class MountService extends IMountService.Stub " allowMassStorage: " + allowMassStorage + " maxFileSize: " + maxFileSize); - if (emulated) { - // For devices with emulated storage, we create separate - // volumes for each known user. + if (emulated && primary) { + // For devices with emulated primary storage, + // we create separate volumes for each known user. mEmulatedTemplate = new StorageVolume(null, descriptionId, true, false, true, mtpReserve, false, maxFileSize, null); @@ -1222,11 +1222,11 @@ class MountService extends IMountService.Stub } catch (IOException e) { throw new RuntimeException(e); } finally { - // Compute storage ID for each physical volume; emulated storage is - // always 0 when defined. + // Compute storage ID for each physical volume; + // Primary emulated storage is always 0 when defined. int index = isExternalStorageEmulated() ? 1 : 0; for (StorageVolume volume : mVolumes) { - if (!volume.isEmulated()) { + if (!(volume.isEmulated() && volume.isPrimary())) { volume.setStorageId(index++); } } |