Modify kitkat document provider implementation in order to cover all 'content://' cases

This commit is contained in:
jabarros 2014-11-12 08:46:29 +01:00
parent 903b66595f
commit 3cae3d3eb8

View file

@ -949,8 +949,8 @@ OnSslUntrustedCertListener, OnEnforceableRefreshListener {
return getDataColumn(getApplicationContext(), contentUri, selection, selectionArgs);
}
// Google Drive
else if (isGoogleDriveDocument(uri)) {
// Documents providers returned as content://...
else if (isAContentDocument(uri)) {
return uri.toString();
}
}
@ -1041,6 +1041,15 @@ OnSslUntrustedCertListener, OnEnforceableRefreshListener {
return "com.google.android.apps.docs.storage".equals(uri.getAuthority());
}
/**
*
* @param uri The Uri to check.
* @return Whether the Uri is from a content provider as kind "content://..."
*/
public static boolean isAContentDocument(Uri uri) {
return uri.toString().startsWith("content://");
}
/**
* Pushes a directory to the drop down list
* @param directory to push