Lines Matching refs:volume
122 * Internal vold volume state constants
517 // Snapshot current volume states since it's not safe to call into vold
537 * the volume is shared (runtime restart while ums enabled)
546 for (StorageVolume volume : mVolumes) {
547 if (volume.isEmulated()) {
548 updatePublicVolumeState(volume, Environment.MEDIA_MOUNTED);
579 for (StorageVolume volume : mVolumes) {
580 if (user.equals(volume.getOwner())) {
581 toRemove.add(volume);
584 for (StorageVolume volume : toRemove) {
585 removeVolumeLocked(volume);
625 mConnector.execute("volume", enable ? "share" : "unshare", path, method);
631 private void updatePublicVolumeState(StorageVolume volume, String state) {
632 final String path = volume.getPath();
644 Slog.d(TAG, "volume state changed for " + path + " (" + oldState + " -> " + state + ")");
646 // Tell PackageManager about changes to primary volume state, but only
648 if (volume.isPrimary() && !volume.isEmulated()) {
653 * Some OBBs might have been unmounted when this volume was
695 mConnector.executeForList("volume", "list"),
703 final StorageVolume volume;
705 volume = mVolumesByPath.get(path);
725 updatePublicVolumeState(volume, state);
729 Slog.e(TAG, "Error processing initial volume state", e);
799 final StorageVolume volume;
802 volume = mVolumesByPath.get(path);
829 updatePublicVolumeState(volume, Environment.MEDIA_UNMOUNTED);
830 sendStorageIntent(Environment.MEDIA_UNMOUNTED, volume, UserHandle.ALL);
833 updatePublicVolumeState(volume, Environment.MEDIA_REMOVED);
838 updatePublicVolumeState(volume, Environment.MEDIA_UNMOUNTED);
842 updatePublicVolumeState(volume, Environment.MEDIA_BAD_REMOVAL);
849 sendStorageIntent(action, volume, UserHandle.ALL);
859 final StorageVolume volume;
862 volume = mVolumesByPath.get(path);
872 sendStorageIntent(Intent.ACTION_MEDIA_UNSHARED, volume, UserHandle.ALL);
887 if (DEBUG_EVENTS) Slog.i(TAG, "updating volume state for media bad removal nofs and unmountable");
888 updatePublicVolumeState(volume, Environment.MEDIA_UNMOUNTED);
893 if (DEBUG_EVENTS) Slog.i(TAG, "updating volume state checking");
894 updatePublicVolumeState(volume, Environment.MEDIA_CHECKING);
897 if (DEBUG_EVENTS) Slog.i(TAG, "updating volume state mounted");
898 updatePublicVolumeState(volume, Environment.MEDIA_MOUNTED);
904 if (DEBUG_EVENTS) Slog.i(TAG, "Updating volume state media mounted");
906 updatePublicVolumeState(volume, Environment.MEDIA_UNMOUNTED);
907 sendStorageIntent(Intent.ACTION_MEDIA_UNMOUNTED, volume, UserHandle.ALL);
910 updatePublicVolumeState(volume, Environment.MEDIA_SHARED);
921 sendStorageIntent(action, volume, UserHandle.ALL);
928 final StorageVolume volume;
930 volume = mVolumesByPath.get(path);
935 mConnector.execute("volume", "mount", path);
948 if (DEBUG_EVENTS) Slog.i(TAG, " updating volume state :: media nofs");
952 updatePublicVolumeState(volume, Environment.MEDIA_NOFS);
956 if (DEBUG_EVENTS) Slog.i(TAG, "updating volume state media corrupt");
960 updatePublicVolumeState(volume, Environment.MEDIA_UNMOUNTABLE);
971 sendStorageIntent(action, volume, UserHandle.ALL);
980 * processes holding references to the volume about to be unmounted.
982 * killed via the ActivityManager before actually unmounting the volume.
987 * mapping set on the volume when unmounting.
1005 final Command cmd = new Command("volume", "unmount", path);
1012 // We unmounted the volume. None of the asec containers are available now.
1033 mConnector.execute("volume", "format", path);
1050 event = mConnector.execute("volume", "shared", path, method);
1052 Slog.e(TAG, "Failed to read response to volume shared " + path + " " + method);
1112 private void sendStorageIntent(String action, StorageVolume volume, UserHandle user) {
1113 final Intent intent = new Intent(action, Uri.parse("file://" + volume.getPath()));
1114 intent.putExtra(StorageVolume.EXTRA_STORAGE_VOLUME, volume);
1198 final StorageVolume volume = new StorageVolume(new File(path),
1201 addVolumeLocked(volume);
1213 // Compute storage ID for each physical volume; emulated storage is
1216 for (StorageVolume volume : mVolumes) {
1217 if (!volume.isEmulated()) {
1218 volume.setStorageId(index++);
1231 throw new IllegalStateException("Missing emulated volume multi-user template");
1236 final StorageVolume volume = StorageVolume.fromTemplate(mEmulatedTemplate, path, user);
1237 volume.setStorageId(0);
1238 addVolumeLocked(volume);
1241 updatePublicVolumeState(volume, Environment.MEDIA_MOUNTED);
1244 mVolumeStates.put(volume.getPath(), Environment.MEDIA_MOUNTED);
1248 private void addVolumeLocked(StorageVolume volume) {
1249 Slog.d(TAG, "addVolumeLocked() " + volume);
1250 mVolumes.add(volume);
1251 final StorageVolume existing = mVolumesByPath.put(volume.getPath(), volume);
1254 "Volume at " + volume.getPath() + " already exists: " + existing);
1258 private void removeVolumeLocked(StorageVolume volume) {
1259 Slog.d(TAG, "removeVolumeLocked() " + volume);
1260 mVolumes.remove(volume);
1261 mVolumesByPath.remove(volume.getPath());
1262 mVolumeStates.remove(volume.getPath());
1267 for (StorageVolume volume : mVolumes) {
1268 if (volume.isPrimary() && !volume.isEmulated()) {
1269 return volume;
1301 // Watch for USB changes on primary volume
1451 * If the volume is mounted and we're enabling then unmount it
1465 * If we disabled UMS then mount the volume
1493 * @return state of the volume at the specified mount point
1499 Slog.w(TAG, "getVolumeState(" + mountPoint + "): Unknown volume");
2106 for (StorageVolume volume : mVolumes) {
2107 final UserHandle owner = volume.getOwner();
2110 filtered.add(volume);
2278 * If this entry's source file is in the volume path