Merge \\"Fixed check for visible volume.\\" into nyc-dev am: be0bacda9b
am: 2ee81a3211
Change-Id: I6c568b5934268eb8d7d44bd65a59adba4dabd7a7
This commit is contained in:
@@ -287,15 +287,16 @@ public class OpenExternalDirectoryActivity extends Activity {
|
|||||||
private static boolean isRightVolume(VolumeInfo volume, String root, int userId) {
|
private static boolean isRightVolume(VolumeInfo volume, String root, int userId) {
|
||||||
final File userPath = volume.getPathForUser(userId);
|
final File userPath = volume.getPathForUser(userId);
|
||||||
final String path = userPath == null ? null : volume.getPathForUser(userId).getPath();
|
final String path = userPath == null ? null : volume.getPathForUser(userId).getPath();
|
||||||
final boolean isVisible = volume.isVisibleForWrite(userId);
|
final boolean isMounted = volume.isMountedReadable();
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
Log.d(TAG, "Volume: " + volume + " userId: " + userId + " root: " + root
|
Log.d(TAG, "Volume: " + volume
|
||||||
+ " volumePath: " + volume.getPath()
|
+ "\n\tuserId: " + userId
|
||||||
+ " pathForUser: " + path
|
+ "\n\tuserPath: " + userPath
|
||||||
+ " internalPathForUser: " + volume.getInternalPath()
|
+ "\n\troot: " + root
|
||||||
+ " isVisible: " + isVisible);
|
+ "\n\tpath: " + path
|
||||||
|
+ "\n\tisMounted: " + isMounted);
|
||||||
|
|
||||||
return isVisible && root.equals(path);
|
return isMounted && root.equals(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Uri getGrantedUriPermission(Context context, ContentProviderClient provider,
|
private static Uri getGrantedUriPermission(Context context, ContentProviderClient provider,
|
||||||
|
|||||||
Reference in New Issue
Block a user