Loading cmds/sm/src/com/android/commands/sm/Sm.java +3 −1 Original line number Diff line number Diff line Loading @@ -125,6 +125,8 @@ public final class Sm { filterType = VolumeInfo.TYPE_PRIVATE; } else if ("emulated".equals(filter)) { filterType = VolumeInfo.TYPE_EMULATED; } else if ("stub".equals(filter)) { filterType = VolumeInfo.TYPE_STUB; } else { filterType = -1; } Loading Loading @@ -298,7 +300,7 @@ public final class Sm { private static int showUsage() { System.err.println("usage: sm list-disks [adoptable]"); System.err.println(" sm list-volumes [public|private|emulated|all]"); System.err.println(" sm list-volumes [public|private|emulated|stub|all]"); System.err.println(" sm has-adoptable"); System.err.println(" sm get-primary-storage-uuid"); System.err.println(" sm set-force-adoptable [on|off|default]"); Loading core/java/android/os/storage/StorageManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -774,7 +774,7 @@ public class StorageManager { try { for (VolumeInfo vol : mStorageManager.getVolumes(0)) { if (vol.path != null && FileUtils.contains(vol.path, pathString) && vol.type != VolumeInfo.TYPE_PUBLIC) { && vol.type != VolumeInfo.TYPE_PUBLIC && vol.type != VolumeInfo.TYPE_STUB) { // TODO: verify that emulated adopted devices have UUID of // underlying volume try { Loading core/java/android/os/storage/VolumeInfo.java +7 −5 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ public class VolumeInfo implements Parcelable { public static final int TYPE_EMULATED = IVold.VOLUME_TYPE_EMULATED; public static final int TYPE_ASEC = IVold.VOLUME_TYPE_ASEC; public static final int TYPE_OBB = IVold.VOLUME_TYPE_OBB; public static final int TYPE_STUB = IVold.VOLUME_TYPE_STUB; public static final int STATE_UNMOUNTED = IVold.VOLUME_STATE_UNMOUNTED; public static final int STATE_CHECKING = IVold.VOLUME_STATE_CHECKING; Loading Loading @@ -295,7 +296,7 @@ public class VolumeInfo implements Parcelable { } public boolean isVisibleForUser(int userId) { if (type == TYPE_PUBLIC && mountUserId == userId) { if ((type == TYPE_PUBLIC || type == TYPE_STUB) && mountUserId == userId) { return isVisible(); } else if (type == TYPE_EMULATED) { return isVisible(); Loading Loading @@ -327,7 +328,7 @@ public class VolumeInfo implements Parcelable { public File getPathForUser(int userId) { if (path == null) { return null; } else if (type == TYPE_PUBLIC) { } else if (type == TYPE_PUBLIC || type == TYPE_STUB) { return new File(path); } else if (type == TYPE_EMULATED) { return new File(path, Integer.toString(userId)); Loading @@ -344,7 +345,7 @@ public class VolumeInfo implements Parcelable { public File getInternalPathForUser(int userId) { if (path == null) { return null; } else if (type == TYPE_PUBLIC) { } else if (type == TYPE_PUBLIC || type == TYPE_STUB) { // TODO: plumb through cleaner path from vold return new File(path.replace("/storage/", "/mnt/media_rw/")); } else { Loading Loading @@ -390,7 +391,7 @@ public class VolumeInfo implements Parcelable { removable = true; } } else if (type == TYPE_PUBLIC) { } else if (type == TYPE_PUBLIC || type == TYPE_STUB) { emulated = false; removable = true; Loading Loading @@ -447,7 +448,8 @@ public class VolumeInfo implements Parcelable { public @Nullable Intent buildBrowseIntentForUser(int userId) { final Uri uri; if (type == VolumeInfo.TYPE_PUBLIC && mountUserId == userId) { if ((type == VolumeInfo.TYPE_PUBLIC || type == VolumeInfo.TYPE_STUB) && mountUserId == userId) { uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY, fsUuid); } else if (type == VolumeInfo.TYPE_EMULATED && isPrimary()) { uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY, Loading packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java +2 −1 Original line number Diff line number Diff line Loading @@ -184,7 +184,8 @@ public class ExternalStorageProvider extends FileSystemProvider { title = mStorageManager.getBestVolumeDescription(privateVol); storageUuid = StorageManager.convert(privateVol.fsUuid); } } else if (volume.getType() == VolumeInfo.TYPE_PUBLIC } else if ((volume.getType() == VolumeInfo.TYPE_PUBLIC || volume.getType() == VolumeInfo.TYPE_STUB) && volume.getMountUserId() == userId) { rootId = volume.getFsUuid(); title = mStorageManager.getBestVolumeDescription(volume); Loading packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java +2 −1 Original line number Diff line number Diff line Loading @@ -152,7 +152,8 @@ public class StorageMeasurement { final MeasurementDetails details = new MeasurementDetails(); if (mVolume == null) return details; if (mVolume.getType() == VolumeInfo.TYPE_PUBLIC) { if (mVolume.getType() == VolumeInfo.TYPE_PUBLIC || mVolume.getType() == VolumeInfo.TYPE_STUB) { details.totalSize = mVolume.getPath().getTotalSpace(); details.availSize = mVolume.getPath().getUsableSpace(); return details; Loading Loading
cmds/sm/src/com/android/commands/sm/Sm.java +3 −1 Original line number Diff line number Diff line Loading @@ -125,6 +125,8 @@ public final class Sm { filterType = VolumeInfo.TYPE_PRIVATE; } else if ("emulated".equals(filter)) { filterType = VolumeInfo.TYPE_EMULATED; } else if ("stub".equals(filter)) { filterType = VolumeInfo.TYPE_STUB; } else { filterType = -1; } Loading Loading @@ -298,7 +300,7 @@ public final class Sm { private static int showUsage() { System.err.println("usage: sm list-disks [adoptable]"); System.err.println(" sm list-volumes [public|private|emulated|all]"); System.err.println(" sm list-volumes [public|private|emulated|stub|all]"); System.err.println(" sm has-adoptable"); System.err.println(" sm get-primary-storage-uuid"); System.err.println(" sm set-force-adoptable [on|off|default]"); Loading
core/java/android/os/storage/StorageManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -774,7 +774,7 @@ public class StorageManager { try { for (VolumeInfo vol : mStorageManager.getVolumes(0)) { if (vol.path != null && FileUtils.contains(vol.path, pathString) && vol.type != VolumeInfo.TYPE_PUBLIC) { && vol.type != VolumeInfo.TYPE_PUBLIC && vol.type != VolumeInfo.TYPE_STUB) { // TODO: verify that emulated adopted devices have UUID of // underlying volume try { Loading
core/java/android/os/storage/VolumeInfo.java +7 −5 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ public class VolumeInfo implements Parcelable { public static final int TYPE_EMULATED = IVold.VOLUME_TYPE_EMULATED; public static final int TYPE_ASEC = IVold.VOLUME_TYPE_ASEC; public static final int TYPE_OBB = IVold.VOLUME_TYPE_OBB; public static final int TYPE_STUB = IVold.VOLUME_TYPE_STUB; public static final int STATE_UNMOUNTED = IVold.VOLUME_STATE_UNMOUNTED; public static final int STATE_CHECKING = IVold.VOLUME_STATE_CHECKING; Loading Loading @@ -295,7 +296,7 @@ public class VolumeInfo implements Parcelable { } public boolean isVisibleForUser(int userId) { if (type == TYPE_PUBLIC && mountUserId == userId) { if ((type == TYPE_PUBLIC || type == TYPE_STUB) && mountUserId == userId) { return isVisible(); } else if (type == TYPE_EMULATED) { return isVisible(); Loading Loading @@ -327,7 +328,7 @@ public class VolumeInfo implements Parcelable { public File getPathForUser(int userId) { if (path == null) { return null; } else if (type == TYPE_PUBLIC) { } else if (type == TYPE_PUBLIC || type == TYPE_STUB) { return new File(path); } else if (type == TYPE_EMULATED) { return new File(path, Integer.toString(userId)); Loading @@ -344,7 +345,7 @@ public class VolumeInfo implements Parcelable { public File getInternalPathForUser(int userId) { if (path == null) { return null; } else if (type == TYPE_PUBLIC) { } else if (type == TYPE_PUBLIC || type == TYPE_STUB) { // TODO: plumb through cleaner path from vold return new File(path.replace("/storage/", "/mnt/media_rw/")); } else { Loading Loading @@ -390,7 +391,7 @@ public class VolumeInfo implements Parcelable { removable = true; } } else if (type == TYPE_PUBLIC) { } else if (type == TYPE_PUBLIC || type == TYPE_STUB) { emulated = false; removable = true; Loading Loading @@ -447,7 +448,8 @@ public class VolumeInfo implements Parcelable { public @Nullable Intent buildBrowseIntentForUser(int userId) { final Uri uri; if (type == VolumeInfo.TYPE_PUBLIC && mountUserId == userId) { if ((type == VolumeInfo.TYPE_PUBLIC || type == VolumeInfo.TYPE_STUB) && mountUserId == userId) { uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY, fsUuid); } else if (type == VolumeInfo.TYPE_EMULATED && isPrimary()) { uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY, Loading
packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java +2 −1 Original line number Diff line number Diff line Loading @@ -184,7 +184,8 @@ public class ExternalStorageProvider extends FileSystemProvider { title = mStorageManager.getBestVolumeDescription(privateVol); storageUuid = StorageManager.convert(privateVol.fsUuid); } } else if (volume.getType() == VolumeInfo.TYPE_PUBLIC } else if ((volume.getType() == VolumeInfo.TYPE_PUBLIC || volume.getType() == VolumeInfo.TYPE_STUB) && volume.getMountUserId() == userId) { rootId = volume.getFsUuid(); title = mStorageManager.getBestVolumeDescription(volume); Loading
packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java +2 −1 Original line number Diff line number Diff line Loading @@ -152,7 +152,8 @@ public class StorageMeasurement { final MeasurementDetails details = new MeasurementDetails(); if (mVolume == null) return details; if (mVolume.getType() == VolumeInfo.TYPE_PUBLIC) { if (mVolume.getType() == VolumeInfo.TYPE_PUBLIC || mVolume.getType() == VolumeInfo.TYPE_STUB) { details.totalSize = mVolume.getPath().getTotalSpace(); details.availSize = mVolume.getPath().getUsableSpace(); return details; Loading