make confirmation dialog more universal
[pub/Android/ownCloud.git] / src / eu / alefzero / owncloud / syncadapter / AbstractOwnCloudSyncAdapter.java
index 2b11978..5ea4e3e 100644 (file)
@@ -149,18 +149,11 @@ public abstract class AbstractOwnCloudSyncAdapter extends
     protected WebdavClient getClient() throws OperationCanceledException,\r
             AuthenticatorException, IOException {\r
         if (mClient == null) {\r
-            String username = getAccount().name.split("@")[0];\r
-            String password = this.getAccountManager().blockingGetAuthToken(\r
-                    getAccount(), AccountAuthenticator.AUTH_TOKEN_TYPE, true);\r
             if (this.getAccountManager().getUserData(getAccount(),\r
                     AccountAuthenticator.KEY_OC_URL) == null) {\r
                 throw new UnknownHostException();\r
             }\r
-            Uri uri = getUri();\r
-\r
-            mClient = new WebdavClient(uri);\r
-            mClient.setCredentials(username, password);\r
-            mClient.allowSelfsignedCertificates();\r
+            mClient = new WebdavClient(account, getContext());\r
             // mHost = mClient.getTargetHost();\r
         }\r
 \r