1
0
mirror of https://github.com/owncloud/android-library.git synced 2026-08-20 12:52:53 +00:00

Removed duplication of OwnCloudClientManager#getClientFor methods with different parameter types

This commit is contained in:
David A. Velasco
2014-06-13 12:42:40 +02:00
parent 0c4954928b
commit 9be1323745
6 changed files with 27 additions and 18 deletions
@@ -26,6 +26,7 @@ package com.owncloud.android.lib.common.operations;
import java.io.IOException;
import com.owncloud.android.lib.common.OwnCloudAccount;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.OwnCloudClientFactory;
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
@@ -105,8 +106,9 @@ public abstract class RemoteOperation implements Runnable {
mAccount = account;
mContext = context.getApplicationContext();
try {
OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount, mContext);
mClient = OwnCloudClientManagerFactory.getDefaultSingleton().
getClientFor(mAccount, mContext);
getClientFor(ocAccount, mContext);
} catch (Exception e) {
Log.e(TAG, "Error while trying to access to " + mAccount.name, e);
return new RemoteOperationResult(e);
@@ -253,8 +255,9 @@ public abstract class RemoteOperation implements Runnable {
mAccount, mContext, mCallerActivity);
} else {
/** EOF DEPRECATED */
OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount, mContext);
mClient = OwnCloudClientManagerFactory.getDefaultSingleton().
getClientFor(mAccount, mContext);
getClientFor(ocAccount, mContext);
}
} else {