summaryrefslogtreecommitdiffstats
path: root/packages/ExternalStorageProvider
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2015-06-16 05:01:43 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-06-16 05:01:43 +0000
commit7f39beb28e2f20c54529848cbee3429d17ae76ec (patch)
tree78ecde573466d05058d16ea8d8c734044c042c75 /packages/ExternalStorageProvider
parentb4d9e24f0644f3946d4b20e0c9d22bf6e0e69ace (diff)
parenta65a1582f5a04b15b53ebdec337ac611ccb78a07 (diff)
downloadframeworks_base-7f39beb28e2f20c54529848cbee3429d17ae76ec.zip
frameworks_base-7f39beb28e2f20c54529848cbee3429d17ae76ec.tar.gz
frameworks_base-7f39beb28e2f20c54529848cbee3429d17ae76ec.tar.bz2
am a65a1582: Merge "Update file size formatting." into mnc-dev
* commit 'a65a1582f5a04b15b53ebdec337ac611ccb78a07': Update file size formatting.
Diffstat (limited to 'packages/ExternalStorageProvider')
-rw-r--r--packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java21
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;
}