Modify kitkat document provider implementation in order to cover all 'content://...
authorjabarros <jabarros@solidgear.es>
Wed, 12 Nov 2014 07:46:29 +0000 (08:46 +0100)
committerjabarros <jabarros@solidgear.es>
Wed, 12 Nov 2014 07:46:29 +0000 (08:46 +0100)
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

index bc0231f..2469dcf 100644 (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();
             }
         }
@@ -1042,6 +1042,15 @@ OnSslUntrustedCertListener, OnEnforceableRefreshListener {
     }
 
     /**
+     * 
+     * @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
      * @throws IllegalArgumentException If the {@link OCFile#isFolder()} returns false.