Convert accessRootFolderRemoteOperation method in AsyncTask

This commit is contained in:
masensio 2015-02-09 14:13:40 +01:00
parent 3605bd70da
commit 0b217c465d
2 changed files with 22 additions and 15 deletions

@ -1 +1 @@
Subproject commit e87f5f25ad91950d47ec9b6fa01401360cd7ec8d
Subproject commit 2f178c9c34e3dab507c46e718705913ed44db3c5

View file

@ -101,8 +101,9 @@ import com.owncloud.android.utils.DisplayUtils;
* @author masensio
*/
public class AuthenticatorActivity extends AccountAuthenticatorActivity
implements OnRemoteOperationListener, OnFocusChangeListener, OnEditorActionListener,
SsoWebViewClientListener, OnSslUntrustedCertListener {
implements OnRemoteOperationListener, OnFocusChangeListener, OnEditorActionListener,
SsoWebViewClientListener, OnSslUntrustedCertListener,
AuthenticatorAsyncTask.OnAuthenticatorTaskListener {
private static final String TAG = AuthenticatorActivity.class.getSimpleName();
@ -892,18 +893,10 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
mAccountMgr.setUserData(mAccount, Constants.KEY_COOKIES, null);
}
Intent existenceCheckIntent = new Intent();
existenceCheckIntent.setAction(OperationsService.ACTION_EXISTENCE_CHECK);
existenceCheckIntent.putExtra(OperationsService.EXTRA_SERVER_URL, mServerInfo.mBaseUrl);
existenceCheckIntent.putExtra(OperationsService.EXTRA_REMOTE_PATH, "/");
existenceCheckIntent.putExtra(OperationsService.EXTRA_USERNAME, username);
existenceCheckIntent.putExtra(OperationsService.EXTRA_PASSWORD, password);
existenceCheckIntent.putExtra(OperationsService.EXTRA_AUTH_TOKEN, mAuthToken);
AuthenticatorAsyncTask asyncTask = new AuthenticatorAsyncTask(this);
String[] params = { mServerInfo.mBaseUrl, username, password, mAuthToken, mAuthTokenType};
asyncTask.execute(params);
if (mOperationsServiceBinder != null) {
//Log_OC.wtf(TAG, "starting existenceCheckRemoteOperation..." );
mWaitingForOpId = mOperationsServiceBinder.queueNewOperation(existenceCheckIntent);
}
}
/**
@ -974,6 +967,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
onGetOAuthAccessTokenFinish(result);
} else if (operation instanceof ExistenceCheckRemoteOperation) {
// TODO : remove this response??
//Log_OC.wtf(TAG, "received detection response through callback" );
if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).
equals(mAuthTokenType)) {
@ -1900,4 +1894,17 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
public void doNegativeAuthenticatioDialogClick(){
mIsFirstAuthAttempt = true;
}
@Override
public void onAuthenticatorTaskCallback(RemoteOperationResult result) {
//Log_OC.wtf(TAG, "received detection response through callback" );
if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).
equals(mAuthTokenType)) {
onSamlBasedFederatedSingleSignOnAuthorizationStart(result);
} else {
onAuthorizationCheckFinish(result);
}
}
}