Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Unable to resolve OneDrive Path from content URI #61

Merged
merged 1 commit into from
Jan 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/android/FilePath.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ private static boolean isGooglePhotosUri(Uri uri) {
private static boolean isGoogleDriveUri(Uri uri) {
return "com.google.android.apps.docs.storage".equals(uri.getAuthority()) || "com.google.android.apps.docs.storage.legacy".equals(uri.getAuthority());
}

/**
* @param uri The Uri to check.
* @return Whether the Uri authority is One Drive.
*/
private static boolean isOneDriveUri(Uri uri) {
return "com.microsoft.skydrive.content.external".equals(uri.getAuthority());
}

/**
* Get the value of the data column for this Uri. This is useful for
Expand Down Expand Up @@ -395,7 +403,7 @@ else if ("content".equalsIgnoreCase(uri.getScheme())) {
}
}

if(isGoogleDriveUri(uri)){
if(isGoogleDriveUri(uri) || isOneDriveUri(uri)){
return getDriveFilePath(uri,context);
}

Expand Down