Browse Source

Merge branch 'testing_cancel_sync'

David A. Velasco 12 years ago
parent
commit
424164206f

+ 6 - 0
src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java

@@ -265,5 +265,11 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
         }
         getContext().sendStickyBroadcast(i);
     }
+    
+    @Override
+    public void onSyncCanceled() {
+        Log.d(TAG, "sync is being cancelled !! ************************************************");
+        super.onSyncCanceled();
+    }
 
 }

+ 1 - 0
src/eu/alefzero/owncloud/ui/activity/AccountSelectActivity.java

@@ -78,6 +78,7 @@ public class AccountSelectActivity extends SherlockListActivity implements
         AccountUtils.setCurrentOwnCloudAccount(this, accountName);
 
         // trigger synchronization when current account is changed
+        ContentResolver.cancelSync(null, "org.owncloud");
         Bundle bundle = new Bundle();
         bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
         ContentResolver.requestSync(AccountUtils.getCurrentOwnCloudAccount(this), "org.owncloud", bundle);