diff options
author | Jeff Sharkey <jsharkey@android.com> | 2015-06-16 04:47:16 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-16 04:47:21 +0000 |
commit | a65a1582f5a04b15b53ebdec337ac611ccb78a07 (patch) | |
tree | 03d2cfba40268f510b4c121194cf75c7ab1e266b /packages | |
parent | 892850396c21db891df784c0e1bb78115feee908 (diff) | |
parent | b521feaed410b6862baca9b42d5fd7c398e07b2f (diff) | |
download | frameworks_base-a65a1582f5a04b15b53ebdec337ac611ccb78a07.zip frameworks_base-a65a1582f5a04b15b53ebdec337ac611ccb78a07.tar.gz frameworks_base-a65a1582f5a04b15b53ebdec337ac611ccb78a07.tar.bz2 |
Merge "Update file size formatting." into mnc-dev
Diffstat (limited to 'packages')
-rw-r--r-- | packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java index 73a723d..4143e15 100644 --- a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java +++ b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java @@ -120,13 +120,20 @@ public class ExternalStorageProvider extends DocumentsProvider { if (!volume.isMountedReadable()) continue; final String rootId; - if (VolumeInfo.ID_EMULATED_INTERNAL.equals(volume.getId())) { + final String title; + if (volume.getType() == VolumeInfo.TYPE_EMULATED) { + // We currently only support a single emulated volume mounted at + // a time, and it's always considered the primary rootId = ROOT_ID_PRIMARY_EMULATED; - } else if (volume.getType() == VolumeInfo.TYPE_EMULATED) { - final VolumeInfo privateVol = mStorageManager.findPrivateForEmulated(volume); - rootId = privateVol.getFsUuid(); + if (VolumeInfo.ID_EMULATED_INTERNAL.equals(volume.getId())) { + title = getContext().getString(R.string.root_internal_storage); + } else { + final VolumeInfo privateVol = mStorageManager.findPrivateForEmulated(volume); + title = mStorageManager.getBestVolumeDescription(privateVol); + } } else if (volume.getType() == VolumeInfo.TYPE_PUBLIC) { rootId = volume.getFsUuid(); + title = mStorageManager.getBestVolumeDescription(volume); } else { // Unsupported volume; ignore continue; @@ -148,11 +155,7 @@ public class ExternalStorageProvider extends DocumentsProvider { root.rootId = rootId; root.flags = Root.FLAG_SUPPORTS_CREATE | Root.FLAG_LOCAL_ONLY | Root.FLAG_ADVANCED | Root.FLAG_SUPPORTS_SEARCH | Root.FLAG_SUPPORTS_IS_CHILD; - if (ROOT_ID_PRIMARY_EMULATED.equals(rootId)) { - root.title = getContext().getString(R.string.root_internal_storage); - } else { - root.title = mStorageManager.getBestVolumeDescription(volume); - } + root.title = title; if (volume.getType() == VolumeInfo.TYPE_PUBLIC) { root.flags |= Root.FLAG_HAS_SETTINGS; } |