Browse Source

Grant that 'upload permission' is not changed when other properties of public share are updated

David A. Velasco 8 years ago
parent
commit
a12a1060ab

+ 1 - 1
owncloud-android-library

@@ -1 +1 @@
-Subproject commit 785562038e5b2c9847e8eb5f550065d05fd8137c
+Subproject commit cdce258a3f7fa40b362fef104bc2bd3e2f3babd6

+ 4 - 3
src/com/owncloud/android/operations/UpdateShareViaLinkOperation.java

@@ -40,7 +40,7 @@ public class UpdateShareViaLinkOperation extends SyncOperation {
 
     private String mPath;
     private String mPassword;
-    private boolean mPublicUpload;
+    private Boolean mPublicUpload;
     private long mExpirationDateInMillis;
 
     /**
@@ -53,7 +53,7 @@ public class UpdateShareViaLinkOperation extends SyncOperation {
         mPath = path;
         mPassword = null;
         mExpirationDateInMillis = 0;
-        mPublicUpload = false;
+        mPublicUpload = null;
     }
 
 
@@ -85,8 +85,9 @@ public class UpdateShareViaLinkOperation extends SyncOperation {
      * Enable upload permissions to update in Share resource.
      *
      * @param publicUpload    Upload Permission to set to the public link.
+     *                        Null results in no update applied to the upload permission.
      */
-    public void setPublicUpload(boolean publicUpload) {
+    public void setPublicUpload(Boolean publicUpload) {
         mPublicUpload = publicUpload;
     }
 

+ 5 - 2
src/com/owncloud/android/services/OperationsService.java

@@ -586,8 +586,11 @@ public class OperationsService extends Service {
                                 expirationDate
                         );
 
-                        boolean publicUpload = operationIntent.getBooleanExtra(EXTRA_SHARE_PUBLIC_UPLOAD, false);
-                        ((UpdateShareViaLinkOperation) operation).setPublicUpload(publicUpload);
+                        if (operationIntent.hasExtra(EXTRA_SHARE_PUBLIC_UPLOAD)) {
+                            ((UpdateShareViaLinkOperation) operation).setPublicUpload(
+                                operationIntent.getBooleanExtra(EXTRA_SHARE_PUBLIC_UPLOAD, false)
+                            );
+                        }
 
                     } else if (shareId > 0) {
                         operation = new UpdateSharePermissionsOperation(shareId);