OSDN Git Service

CMFileManager: Fix CMFileManager display "sdcard1" and the content is null after...
authorkai.cao <kai.cao@ck-telecom.com>
Tue, 14 Apr 2015 08:42:27 +0000 (16:42 +0800)
committerGerrit Code Review <gerrit@cyanogenmod.org>
Fri, 17 Apr 2015 11:03:22 +0000 (11:03 +0000)
step:
- new user or guest in Settings
- Go to CMFileManager and check

Change-Id: Id6da696b8173f0544a022bc5e3d64d94b7123526

src/com/cyanogenmod/filemanager/activities/NavigationActivity.java [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 454e8f0..8733689
@@ -1577,6 +1577,14 @@ public class NavigationActivity extends Activity
                         StorageHelper.getStorageVolumes(this, false);
                 if (volumes != null && volumes.length > 0) {
                     initialDir = volumes[0].getPath();
+                    int count = volumes.length;
+                    for (int i = 0; i < count; i++) {
+                        StorageVolume volume = volumes[i];
+                        if (Environment.MEDIA_MOUNTED.equalsIgnoreCase(volume.getState())) {
+                            initialDir = volume.getPath();
+                            break;
+                        }
+                    }
                     //Ensure that initial directory is an absolute directory
                     initialDir = FileHelper.getAbsPath(initialDir);
                 } else {