Correction in license of CheckBoxPreferenceWithLongTitle
[pub/Android/ownCloud.git] / src / com / owncloud / android / syncadapter / FileSyncAdapter.java
index dab51eb..4f1cd68 100644 (file)
@@ -30,7 +30,6 @@ import com.owncloud.android.R;
 import com.owncloud.android.authentication.AuthenticatorActivity;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.operations.SynchronizeFolderOperation;
 import com.owncloud.android.operations.UpdateOCVersionOperation;
@@ -41,7 +40,6 @@ import com.owncloud.android.utils.Log_OC;
 
 
 import android.accounts.Account;
-import android.accounts.AccountManager;
 import android.accounts.AccountsException;
 import android.app.Notification;
 import android.app.NotificationManager;
@@ -75,7 +73,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
     public static final String EVENT_FULL_SYNC_START = FileSyncAdapter.class.getName() + ".EVENT_FULL_SYNC_START";
     public static final String EVENT_FULL_SYNC_END = FileSyncAdapter.class.getName() + ".EVENT_FULL_SYNC_END";
     public static final String EVENT_FULL_SYNC_FOLDER_CONTENTS_SYNCED = FileSyncAdapter.class.getName() + ".EVENT_FULL_SYNC_FOLDER_CONTENTS_SYNCED";
-    public static final String EVENT_FULL_SYNC_FOLDER_SIZE_SYNCED = FileSyncAdapter.class.getName() + ".EVENT_FULL_SYNC_FOLDER_SIZE_SYNCED";
+    //public static final String EVENT_FULL_SYNC_FOLDER_SIZE_SYNCED = FileSyncAdapter.class.getName() + ".EVENT_FULL_SYNC_FOLDER_SIZE_SYNCED";
     
     public static final String EXTRA_ACCOUNT_NAME = FileSyncAdapter.class.getName() + ".EXTRA_ACCOUNT_NAME";
     public static final String EXTRA_FOLDER_PATH = FileSyncAdapter.class.getName() + ".EXTRA_FOLDER_PATH";
@@ -110,7 +108,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
     private SyncResult mSyncResult;
 
     /** 'True' means that the server supports the share API */
-    private boolean mIsSharedSupported;
+    private boolean mIsShareSupported;
     
     
     /**
@@ -156,9 +154,6 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
         this.setContentProviderClient(providerClient);
         this.setStorageManager(new FileDataStorageManager(account, providerClient));
         
-        AccountManager accountManager = getAccountManager();
-        mIsSharedSupported = Boolean.parseBoolean(accountManager.getUserData(account, Constants.KEY_SUPPORTS_SHARE_API));
-
         try {
             this.initClientForCurrentAccount();
         } catch (IOException e) {
@@ -235,6 +230,8 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
         RemoteOperationResult result = update.execute(getClient());
         if (!result.isSuccess()) {
             mLastFailedResult = result; 
+        } else {
+            mIsShareSupported = update.getOCVersion().isSharedSupported();
         }
     }
     
@@ -269,7 +266,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
         SynchronizeFolderOperation synchFolderOp = new SynchronizeFolderOperation(  folder, 
                                                                                     mCurrentSyncTime, 
                                                                                     true,
-                                                                                    mIsSharedSupported,
+                                                                                    mIsShareSupported,
                                                                                     getStorageManager(), 
                                                                                     getAccount(), 
                                                                                     getContext()