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

Commit 37820a16 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "storage: Don't list removed volumes in storage list" into cm-11.0

parents 1bc87e72 5a3c6b05
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2183,9 +2183,12 @@ class ContextImpl extends Context {
     * unable to create, they are filtered by replacing with {@code null}.
     */
    private File[] ensureDirsExistOrFilter(File[] dirs) {
        File[] result = new File[dirs.length];
        ArrayList<File> result = new ArrayList<File>(dirs.length);
        for (int i = 0; i < dirs.length; i++) {
            File dir = dirs[i];
            if (Environment.MEDIA_REMOVED.equals(Environment.getStorageState(dir))) {
                continue;
            }
            if (!dir.exists()) {
                if (!dir.mkdirs()) {
                    // recheck existence in case of cross-process race
@@ -2206,9 +2209,9 @@ class ContextImpl extends Context {
                    }
                }
            }
            result[i] = dir;
            result.add(dir);
        }
        return result;
        return result.toArray(new File[result.size()]);
    }

    // ----------------------------------------------------------------------