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

Commit a8da1555 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge \"Fixed check for visible volume.\" into nyc-dev

am: be0bacda9b

Change-Id: I5b1aa0be01603cfaa09e3dfaa774182f6a62c188
parents 1316bc94 fffd8fc5
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -287,15 +287,16 @@ public class OpenExternalDirectoryActivity extends Activity {
    private static boolean isRightVolume(VolumeInfo volume, String root, int userId) {
        final File userPath = volume.getPathForUser(userId);
        final String path = userPath == null ? null : volume.getPathForUser(userId).getPath();
        final boolean isVisible = volume.isVisibleForWrite(userId);
        final boolean isMounted = volume.isMountedReadable();
        if (DEBUG)
            Log.d(TAG, "Volume: " + volume + " userId: " + userId + " root: " + root
                    + " volumePath: " + volume.getPath()
                    + " pathForUser: " + path
                    + " internalPathForUser: " + volume.getInternalPath()
                    + " isVisible: " + isVisible);

        return isVisible && root.equals(path);
            Log.d(TAG, "Volume: " + volume
                    + "\n\tuserId: " + userId
                    + "\n\tuserPath: " + userPath
                    + "\n\troot: " + root
                    + "\n\tpath: " + path
                    + "\n\tisMounted: " + isMounted);

        return isMounted && root.equals(path);
    }

    private static Uri getGrantedUriPermission(Context context, ContentProviderClient provider,