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

Commit b0829d61 authored by Danesh M's avatar Danesh M Committed by cretin45
Browse files

FileManager : Index all storage volumes

Fix disk usage for no categories
If no categories are found, ensure we fallback to drawUsed
so the graph represents the information correctly.

FEIJ-650

Change-Id: Ifdc069b1266c96dc1dc2569a2c0d45146f96b73d
parent 9d2b05ef
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.os.Environment;
import android.os.storage.StorageVolume;
import android.util.Log;

import com.cyanogenmod.filemanager.console.Console;
@@ -42,6 +43,7 @@ import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.AIDHelper;
import com.cyanogenmod.filemanager.util.AndroidHelper;
import com.cyanogenmod.filemanager.util.MimeTypeHelper;
import com.cyanogenmod.filemanager.util.StorageHelper;

import java.io.File;
import java.io.FileInputStream;
@@ -183,6 +185,11 @@ public final class FileManagerApplication extends Application {
        File externalStorage = Environment.getExternalStorageDirectory();
        MimeTypeIndexService.indexFileRoot(this, externalStorage.getAbsolutePath());
        MimeTypeIndexService.indexFileRoot(this, Environment.getRootDirectory().getAbsolutePath());
        StorageVolume[] storageVolumes = StorageHelper.getStorageVolumes(this, true);
        for (StorageVolume storageVolume : storageVolumes) {
            MimeTypeIndexService.indexFileRoot(this, storageVolume.getPath());
        }


        // Schedule in case not scheduled (i.e. never booted with this app on device
        SecureCacheCleanupService.scheduleCleanup(getApplicationContext());
+3 −3
Original line number Diff line number Diff line
@@ -340,10 +340,10 @@ public class DiskUsageGraph extends View {
            drawTotal(rect, stroke);

            // Draw the usage
            if (USE_COLORS) {
                drawUsedWithColors(rect, stroke);
            } else {
            if (!USE_COLORS || mDiskUsage == null || mDiskUsage.getUsageCategoryList().isEmpty()) {
                drawUsed(rect, stroke, used);
            } else {
                drawUsedWithColors(rect, stroke);
            }

            if (used >= mDiskWarningAngle) {