Merge \\\"Fixed check for visible volume.\\\" into nyc-dev am: be0bacda9b am: 2ee81a3211

am: 18ee3e53c8

Change-Id: I4ca401686049e969e6f257b76714e7f3289864c5
This commit is contained in:
Felipe Leme
2016-06-10 22:04:43 +00:00
committed by android-build-merger

View File

@@ -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);
Log.d(TAG, "Volume: " + volume
+ "\n\tuserId: " + userId
+ "\n\tuserPath: " + userPath
+ "\n\troot: " + root
+ "\n\tpath: " + path
+ "\n\tisMounted: " + isMounted);
return isVisible && root.equals(path);
return isMounted && root.equals(path);
}
private static Uri getGrantedUriPermission(Context context, ContentProviderClient provider,