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

Commit 527dde6d authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Wire up getStorageVolume() for synthetic paths."

parents 465d20a7 14003828
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.os.storage;

import static android.content.ContentResolver.DEPRECATE_DATA_PREFIX;

import android.annotation.BytesLong;
import android.annotation.IntDef;
import android.annotation.NonNull;
@@ -30,6 +32,7 @@ import android.annotation.UnsupportedAppUsage;
import android.annotation.WorkerThread;
import android.app.Activity;
import android.app.ActivityThread;
import android.app.AppGlobals;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
@@ -1139,6 +1142,12 @@ public class StorageManager {
        if (file == null) {
            return null;
        }
        final String path = file.getAbsolutePath();
        if (path.startsWith(DEPRECATE_DATA_PREFIX)) {
            final Uri uri = ContentResolver.translateDeprecatedDataPath(path);
            return AppGlobals.getInitialApplication().getSystemService(StorageManager.class)
                    .getStorageVolume(uri);
        }
        try {
            file = file.getCanonicalFile();
        } catch (IOException ignored) {