Include user identifier in external storage paths.

When building external storage paths, always include user in path
to enable cross-user paths and aid debugging.

Mostly changes so Storage doesn't crash; will take another UI
iteration pass soon.

Bug: 7131382
Change-Id: If7ec807f12a36eb8ed02a0fb94e8a0b3a6694f16
This commit is contained in:
Jeff Sharkey
2012-09-11 15:45:19 -07:00
parent cfc1bec2e6
commit fc76a78c45
3 changed files with 41 additions and 30 deletions

View File

@@ -100,6 +100,7 @@ public class Memory extends SettingsPreferenceFragment {
}
private void addCategoryForVolume(StorageVolume volume) {
// TODO: Cluster multi-user emulated volumes into single category
final StorageVolumePreferenceCategory category = new StorageVolumePreferenceCategory(
getActivity(), volume);
mCategories.add(category);
@@ -108,9 +109,10 @@ public class Memory extends SettingsPreferenceFragment {
}
private boolean isMassStorageEnabled() {
// mass storage is enabled if primary volume supports it
final StorageVolume[] storageVolumes = mStorageManager.getVolumeList();
return (storageVolumes.length > 0 && storageVolumes[0].allowMassStorage());
// Mass storage is enabled if primary volume supports it
final StorageVolume[] volumes = mStorageManager.getVolumeList();
final StorageVolume primary = StorageManager.getPrimaryVolume(volumes);
return primary != null && primary.allowMassStorage();
}
@Override