Merge branch 'share_link__unshare_file' into release-1.5.4
[pub/Android/ownCloud.git] / src / com / owncloud / android / services / OperationsService.java
index 53befed..200d7a3 100644 (file)
@@ -28,7 +28,6 @@ import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.lib.network.OwnCloudClientFactory;
 import com.owncloud.android.lib.network.OwnCloudClient;
 import com.owncloud.android.operations.CreateShareOperation;
-import com.owncloud.android.operations.GetSharesOperation;
 import com.owncloud.android.operations.UnshareLinkOperation;
 import com.owncloud.android.operations.common.SyncOperation;
 import com.owncloud.android.lib.operations.common.OnRemoteOperationListener;
@@ -124,20 +123,21 @@ public class OperationsService extends Service {
             RemoteOperation operation = null;
             
             String action = intent.getAction();
-            if (action == ACTION_CREATE_SHARE) {  // Create Share
+            if (action.equals(ACTION_CREATE_SHARE)) {  // Create Share
                 String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH);
                 Intent sendIntent = intent.getParcelableExtra(EXTRA_SEND_INTENT);
                 if (remotePath.length() > 0) {
                     operation = new CreateShareOperation(remotePath, ShareType.PUBLIC_LINK, 
                             "", false, "", 1, sendIntent);
                 }
-            } else if (action == ACTION_UNSHARE) {  // Unshare file
+            } else if (action.equals(ACTION_UNSHARE)) {  // Unshare file
                 String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH);
                 if (remotePath.length() > 0) {
                     operation = new UnshareLinkOperation(remotePath, this.getApplicationContext());
                 }
             } else {
-                operation = new GetSharesOperation();
+                // nothing we are going to handle
+                return START_NOT_STICKY;
             }
             
             mPendingOperations.add(new Pair<Target , RemoteOperation>(target, operation));