1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-07-23 01:45:50 +00:00

Fix credentials in switch accounts

This commit is contained in:
davigonz 2018-08-30 11:04:12 +02:00
parent 782361267d
commit f3eb0c4431
2 changed files with 5 additions and 1 deletions

View File

@ -117,6 +117,10 @@ public class OwnCloudClient extends HttpClient {
mCredentials.applyTo(this); mCredentials.applyTo(this);
} }
public void applyCredentials() {
mCredentials.applyTo(this);
}
public int executeHttpMethod (HttpBaseMethod method) throws Exception { public int executeHttpMethod (HttpBaseMethod method) throws Exception {
boolean repeatWithFreshCredentials; boolean repeatWithFreshCredentials;

View File

@ -145,7 +145,7 @@ public abstract class RemoteOperation<T extends Object> implements Runnable {
OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount, mContext); OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount, mContext);
mClient = OwnCloudClientManagerFactory.getDefaultSingleton(). mClient = OwnCloudClientManagerFactory.getDefaultSingleton().
getClientFor(ocAccount, mContext); getClientFor(ocAccount, mContext);
mClient.applyCredentials();
} else { } else {
throw new IllegalStateException("Trying to run a remote operation " + throw new IllegalStateException("Trying to run a remote operation " +
"asynchronously with no client and no chance to create one (no account)"); "asynchronously with no client and no chance to create one (no account)");