Use default volume description when missing label.

Some mounted storage volumes may not have a user-defined label.  In
those cases, use the default description for the volume.

Bug: 17781505
Change-Id: I8558ba2615c2ff2647a5d44afaec83249df466ab
This commit is contained in:
Jeff Sharkey
2014-10-24 13:57:28 -07:00
parent e41d967c5c
commit c99d00be67

View File

@@ -154,7 +154,12 @@ public class ExternalStorageProvider extends DocumentsProvider {
if (ROOT_ID_PRIMARY_EMULATED.equals(rootId)) {
root.title = getContext().getString(R.string.root_internal_storage);
} else {
root.title = volume.getUserLabel();
final String userLabel = volume.getUserLabel();
if (!TextUtils.isEmpty(userLabel)) {
root.title = userLabel;
} else {
root.title = volume.getDescription(getContext());
}
}
root.docId = getDocIdForFile(path);
mRoots.add(root);