Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54c751ae authored by Diogo Ferreira's avatar Diogo Ferreira
Browse files

ExternalStorageProvider: Use the UUID as title when the label is empty

When the label is empty the UI will show a blank space. Most operating
systems will show it as the uuid, that's what this patch does as well.

Change-Id: I8dc41ea70c96229cb0fccc1e19b525fbc4be1808
parent 3378bb4e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import android.provider.DocumentsContract;
import android.provider.DocumentsContract.Document;
import android.provider.DocumentsContract.Root;
import android.provider.DocumentsProvider;
import android.text.TextUtils;
import android.util.Log;
import android.webkit.MimeTypeMap;

@@ -148,6 +149,9 @@ public class ExternalStorageProvider extends DocumentsProvider {
                    root.title = getContext().getString(R.string.root_internal_storage);
                } else {
                    root.title = volume.getUserLabel();
                    if (TextUtils.isEmpty(root.title)) {
                        root.title = volume.getUuid();
                    }
                }
                root.docId = getDocIdForFile(path);
                mRoots.add(root);