mirror of
https://github.com/owncloud/android-library.git
synced 2026-08-20 21:02:53 +00:00
Add cookie restoring to SingleSessionManager#getClientFor(Uri ... ) after calling OwnCloudClientFactory#create
This commit is contained in:
@@ -30,7 +30,6 @@ import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.OwnCloudClientFactory;
|
||||
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
|
||||
import com.owncloud.android.lib.common.OwnCloudCredentials;
|
||||
import com.owncloud.android.lib.common.SingleSessionManager;
|
||||
import com.owncloud.android.lib.common.accounts.AccountUtils;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
|
||||
|
||||
@@ -257,8 +256,7 @@ public abstract class RemoteOperation implements Runnable {
|
||||
mClient = OwnCloudClientManagerFactory.getDefaultSingleton().
|
||||
getClientFor(mAccount, mContext);
|
||||
}
|
||||
// Save Client Cookies
|
||||
AccountUtils.saveClient(mClient, mAccount, mContext);
|
||||
|
||||
} else {
|
||||
throw new IllegalStateException("Trying to run a remote operation asynchronously with no client instance or account");
|
||||
}
|
||||
@@ -303,6 +301,11 @@ public abstract class RemoteOperation implements Runnable {
|
||||
/** EOF DEPRECATED BLOCK **/
|
||||
} while (repeat);
|
||||
|
||||
if (mAccount != null && mContext != null) {
|
||||
// Save Client Cookies
|
||||
AccountUtils.saveClient(mClient, mAccount, mContext);
|
||||
}
|
||||
|
||||
final RemoteOperationResult resultToSend = result;
|
||||
if (mListenerHandler != null && mListener != null) {
|
||||
mListenerHandler.post(new Runnable() {
|
||||
|
||||
Reference in New Issue
Block a user