OSDN Git Service

Fix FileSystemInfo's ImageView shows incorrect picture in BreadcrumbView .
authorkai.cao <kai.cao@ck-telecom.com>
Fri, 7 Aug 2015 01:35:34 +0000 (09:35 +0800)
committerAbhisek Devkota <ciwrl@cyanogenmod.com>
Thu, 13 Aug 2015 20:14:19 +0000 (13:14 -0700)
When we get MountPoint Information in FilesystemAsyncTask,
It will return null.So,the FileSystemInfo's ImageView
will setTag null,and then it will set picture filesystem_warning_drawable.

Change-Id: Ia624312468935cc86956665a3da4824c19728afc

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

old mode 100644 (file)
new mode 100755 (executable)
index d1141be..65c9181
@@ -91,12 +91,10 @@ public final class MountPointHelper {
     public static boolean refreshMountPoints(Console console) {
         synchronized(sMountPoints) {
             try {
-                if (FileManagerApplication.hasShellCommands()) {
-                    sMountPoints.clear();
-                    sMountPoints.addAll(CommandHelper.getMountPoints(null, null));
-                    sLastCachedTime = System.currentTimeMillis();
-                    return true;
-                }
+                sMountPoints.clear();
+                sMountPoints.addAll(CommandHelper.getMountPoints(null, null));
+                sLastCachedTime = System.currentTimeMillis();
+                return true;
             } catch (Exception e) {
                 Log.e(TAG, "Failed to update the mount point information", e); //$NON-NLS-1$
             }
@@ -119,7 +117,7 @@ public final class MountPointHelper {
             // Refresh mount points after some time (5 minutes should be enough)
             long now = System.currentTimeMillis();
             synchronized(sMountPoints) {
-                if (sMountPoints == null || (now - sLastCachedTime) > MAX_CACHED_TIME) {
+                if (sMountPoints == null || (now - sLastCachedTime) > MAX_CACHED_TIME || FileManagerApplication.hasShellCommands()) {
                     //Retrieve the mount points
                     refreshMountPoints(console);
                 }