-/* ownCloud Android client application\r
+/**\r
+ *   ownCloud Android client application\r
+ *\r
+ *   @author sassman\r
+ *   @author David A. Velasco\r
  *   Copyright (C) 2011  Bartek Przybylski\r
- *   Copyright (C) 2012-2013 ownCloud Inc.\r
+ *   Copyright (C) 2015 ownCloud Inc.\r
  *\r
  *   This program is free software: you can redistribute it and/or modify\r
  *   it under the terms of the GNU General Public License version 2,\r
 import org.apache.http.HttpResponse;\r
 import org.apache.http.client.ClientProtocolException;\r
 \r
+import com.owncloud.android.MainApp;\r
 import com.owncloud.android.datamodel.FileDataStorageManager;\r
 import com.owncloud.android.lib.common.accounts.AccountUtils;\r
 import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;\r
-import com.owncloud.android.lib.common.OwnCloudClientFactory;\r
+import com.owncloud.android.lib.common.OwnCloudAccount;\r
 import com.owncloud.android.lib.common.OwnCloudClient;\r
-\r
+import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;\r
 \r
 import android.accounts.Account;\r
 import android.accounts.AccountManager;\r
  * resource types, like FileSync, ConcatsSync, CalendarSync, etc..\r
  * \r
  * Implements the standard {@link AbstractThreadedSyncAdapter}.\r
- * \r
- * @author sassman\r
- * @author David A. Velasco\r
  */\r
 public abstract class AbstractOwnCloudSyncAdapter extends\r
         AbstractThreadedSyncAdapter {\r
         this.setAccountManager(AccountManager.get(context));\r
     }\r
 \r
-    public AbstractOwnCloudSyncAdapter(Context context, boolean autoInitialize, boolean allowParallelSyncs) {\r
+    public AbstractOwnCloudSyncAdapter(Context context, boolean autoInitialize,\r
+                                       boolean allowParallelSyncs) {\r
         super(context, autoInitialize, allowParallelSyncs);\r
         this.setAccountManager(AccountManager.get(context));\r
     }\r
         return mStoreManager;\r
     }\r
 \r
-    protected void initClientForCurrentAccount() throws OperationCanceledException, AuthenticatorException, IOException, AccountNotFoundException {\r
+    protected void initClientForCurrentAccount() throws OperationCanceledException,\r
+            AuthenticatorException, IOException, AccountNotFoundException {\r
         AccountUtils.constructFullURLForAccount(getContext(), account);\r
-        mClient = OwnCloudClientFactory.createOwnCloudClient(account, getContext());\r
+        OwnCloudAccount ocAccount = new OwnCloudAccount(account, getContext());\r
+        mClient = OwnCloudClientManagerFactory.getDefaultSingleton().\r
+                getClientFor(ocAccount, getContext());\r
     }\r
     \r
     protected OwnCloudClient getClient() {\r