import android.graphics.drawable.Drawable;\r
import android.net.Uri;\r
import android.net.http.SslError;\r
-import android.os.AsyncTask;\r
import android.os.Bundle;\r
import android.os.Handler;\r
import android.os.IBinder;\r
import com.owncloud.android.MainApp;\r
import com.owncloud.android.R;\r
import com.owncloud.android.authentication.SsoWebViewClient.SsoWebViewClientListener;\r
-import com.owncloud.android.lib.common.OwnCloudAccount;\r
-import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;\r
+import com.owncloud.android.lib.common.OwnCloudCredentials;\r
+import com.owncloud.android.lib.common.OwnCloudCredentialsFactory;\r
import com.owncloud.android.lib.common.accounts.AccountTypeUtils;\r
import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;\r
import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;\r
import com.owncloud.android.lib.common.operations.RemoteOperationResult;\r
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;\r
import com.owncloud.android.lib.common.utils.Log_OC;\r
-import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;\r
import com.owncloud.android.lib.resources.status.OwnCloudVersion;\r
import com.owncloud.android.lib.resources.users.GetRemoteUserNameOperation;\r
import com.owncloud.android.operations.DetectAuthenticationMethodOperation.AuthenticationMethod;\r
/// Identifier of operation in progress which result shouldn't be lost \r
private long mWaitingForOpId = Long.MAX_VALUE;\r
\r
- \r
+ private final String BASIC_TOKEN_TYPE = AccountTypeUtils.getAuthTokenTypePass(MainApp.getAccountType());\r
+ private final String OAUTH_TOKEN_TYPE = AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType());\r
+ private final String SAML_TOKEN_TYPE =\r
+ AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType());\r
+\r
+\r
/**\r
* {@inheritDoc}\r
* \r
setContentView(R.layout.account_setup);\r
\r
/// initialize general UI elements\r
- initOverallUi(savedInstanceState);\r
+ initOverallUi();\r
\r
mOkButton = findViewById(R.id.buttonOK);\r
\r
\r
private String chooseAuthTokenType(boolean oauth, boolean saml) {\r
if (saml) {\r
- return AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType());\r
+ return SAML_TOKEN_TYPE;\r
} else if (oauth) {\r
- return AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType());\r
+ return OAUTH_TOKEN_TYPE;\r
} else {\r
- return AccountTypeUtils.getAuthTokenTypePass(MainApp.getAccountType());\r
+ return BASIC_TOKEN_TYPE;\r
}\r
}\r
\r
\r
/**\r
* Configures elements in the user interface under direct control of the Activity.\r
- * \r
- * @param savedInstanceState Saved activity state, as in {{@link #onCreate(Bundle)}\r
*/\r
- private void initOverallUi(Bundle savedInstanceState) {\r
+ private void initOverallUi() {\r
\r
/// step 1 - load and process relevant inputs (resources, intent, savedInstanceState)\r
boolean isWelcomeLinkVisible = getResources().getBoolean(R.bool.show_welcome_link);\r
// AsyncTask\r
boolean inProgress = savedInstanceState.getBoolean(KEY_ASYNC_TASK_IN_PROGRESS);\r
if (inProgress){\r
- mAsyncTask = new AuthenticatorAsyncTask(this);\r
String username = savedInstanceState.getString(KEY_USERNAME);\r
String password = savedInstanceState.getString(KEY_PASSWORD);\r
- String[] params = {mServerInfo.mBaseUrl, username, password, mAuthToken, mAuthTokenType};\r
- mAsyncTask.execute(params);\r
+\r
+ OwnCloudCredentials credentials = null;\r
+ if (BASIC_TOKEN_TYPE.equals(mAuthTokenType)) {\r
+ credentials = OwnCloudCredentialsFactory.newBasicCredentials(username, password);\r
+\r
+ } else if (OAUTH_TOKEN_TYPE.equals(mAuthTokenType)) {\r
+ credentials = OwnCloudCredentialsFactory.newBearerCredentials(mAuthToken);\r
+\r
+ }\r
+ accessRootFolder(credentials);\r
}\r
}\r
\r
*/\r
@Override\r
protected void onResume() {\r
- //Log_OC.wtf(TAG, "onResume init" );\r
super.onResume();\r
\r
// bound here to avoid spurious changes triggered by Android on device rotations\r
doOnResumeAndBound();\r
}\r
\r
- //Log_OC.wtf(TAG, "onResume end" );\r
}\r
\r
\r
@Override\r
protected void onPause() {\r
- //Log_OC.wtf(TAG, "onPause init" );\r
if (mOperationsServiceBinder != null) {\r
- //Log_OC.wtf(TAG, "unregistering to listen for operation callbacks" );\r
mOperationsServiceBinder.removeOperationListener(this);\r
}\r
\r
mHostUrlInput.setOnFocusChangeListener(null);\r
\r
super.onPause();\r
- //Log_OC.wtf(TAG, "onPause end" );\r
}\r
\r
@Override\r
public void onFocusChange(View view, boolean hasFocus) {\r
if (view.getId() == R.id.hostUrlInput) { \r
if (!hasFocus) {\r
- onUrlInputFocusLost((TextView) view);\r
+ onUrlInputFocusLost();\r
}\r
else {\r
showRefreshButton(false);\r
}\r
\r
} else if (view.getId() == R.id.account_password) {\r
- onPasswordFocusChanged((TextView) view, hasFocus);\r
+ onPasswordFocusChanged(hasFocus);\r
}\r
}\r
\r
* started. \r
* \r
* When hasFocus: user 'comes back' to write again the server URL.\r
- * \r
- * @param hostInput TextView with the URL input field receiving the change of focus.\r
*/\r
- private void onUrlInputFocusLost(TextView hostInput) {\r
+ private void onUrlInputFocusLost() {\r
if (!mServerInfo.mBaseUrl.equals(\r
normalizeUrl(mHostUrlInput.getText().toString(), mServerInfo.mIsSslConn))) {\r
// check server again only if the user changed something in the field\r
* \r
* When (!hasFocus), the button is made invisible and the password is hidden.\r
* \r
- * @param passwordInput TextView with the password input field receiving the change of focus.\r
* @param hasFocus 'True' if focus is received, 'false' if is lost\r
*/\r
- private void onPasswordFocusChanged(TextView passwordInput, boolean hasFocus) {\r
+ private void onPasswordFocusChanged(boolean hasFocus) {\r
if (hasFocus) {\r
showViewPasswordButton();\r
} else {\r
mServerStatusText = R.string.auth_wtf_reenter_URL;\r
showServerStatus();\r
mOkButton.setEnabled(false);\r
- //Log_OC.wtf(TAG, "The user was allowed to click 'connect' to an unchecked server!!");\r
return;\r
}\r
\r
dialog.show(getSupportFragmentManager(), WAIT_DIALOG_TAG);\r
\r
/// validate credentials accessing the root folder\r
- accessRootFolderRemoteOperation(username, password);\r
- \r
+ OwnCloudCredentials credentials = OwnCloudCredentialsFactory.newBasicCredentials(username, password);\r
+ accessRootFolder(credentials);\r
}\r
\r
- private void accessRootFolderRemoteOperation(String username, String password) {\r
- // delete the account if the token has changed\r
- if (mAction == ACTION_UPDATE_TOKEN || mAction == ACTION_UPDATE_EXPIRED_TOKEN) {\r
- // Remove the cookies in AccountManager\r
- mAccountMgr.setUserData(mAccount, Constants.KEY_COOKIES, null);\r
- }\r
-\r
+ private void accessRootFolder(OwnCloudCredentials credentials) {\r
mAsyncTask = new AuthenticatorAsyncTask(this);\r
- String[] params = { mServerInfo.mBaseUrl, username, password, mAuthToken, mAuthTokenType};\r
+ Object[] params = { mServerInfo.mBaseUrl, credentials };\r
mAsyncTask.execute(params);\r
-\r
}\r
\r
+\r
/**\r
* Starts the OAuth 'grant type' flow to get an access token, with \r
* a GET AUTHORIZATION request to the BUILT-IN authorization server. \r
* in the server.\r
*/\r
private void startSamlBasedFederatedSingleSignOnAuthorization() {\r
- // be gentle with the user\r
+ /// be gentle with the user\r
mAuthStatusIcon = R.drawable.progress_small;\r
mAuthStatusText = R.string.auth_connecting_auth_server;\r
showAuthStatus();\r
- IndeterminateProgressDialog dialog = \r
- IndeterminateProgressDialog.newInstance(R.string.auth_trying_to_login, true);\r
- dialog.show(getSupportFragmentManager(), WAIT_DIALOG_TAG);\r
-\r
- /// validate credentials accessing the root folder\r
- accessRootFolderRemoteOperation("", "");\r
\r
+ /// Show SAML-based SSO web dialog\r
+ String targetUrl = mServerInfo.mBaseUrl\r
+ + AccountUtils.getWebdavPath(mServerInfo.mVersion, mAuthTokenType);\r
+ SamlWebViewDialog dialog = SamlWebViewDialog.newInstance(targetUrl, targetUrl);\r
+ dialog.show(getSupportFragmentManager(), SAML_DIALOG_TAG);\r
}\r
\r
/**\r
} else if (operation instanceof OAuth2GetAccessToken) {\r
onGetOAuthAccessTokenFinish(result);\r
\r
- } else if (operation instanceof ExistenceCheckRemoteOperation) {\r
- // TODO : remove this response??\r
- //Log_OC.wtf(TAG, "received detection response through callback" );\r
- if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).\r
- equals(mAuthTokenType)) {\r
- onSamlBasedFederatedSingleSignOnAuthorizationStart(result);\r
-\r
- } else {\r
- onAuthorizationCheckFinish(result);\r
- }\r
} else if (operation instanceof GetRemoteUserNameOperation) {\r
onGetUserNameFinish(result);\r
}\r
\r
}\r
\r
- private void onSamlBasedFederatedSingleSignOnAuthorizationStart(RemoteOperationResult result) {\r
- mWaitingForOpId = Long.MAX_VALUE;\r
- dismissDialog(WAIT_DIALOG_TAG);\r
-\r
- if (result.isIdPRedirection()) {\r
- String targetUrl = mServerInfo.mBaseUrl \r
- + AccountUtils.getWebdavPath(mServerInfo.mVersion, mAuthTokenType);\r
-\r
- // Show dialog\r
- SamlWebViewDialog dialog = SamlWebViewDialog.newInstance(targetUrl, targetUrl); \r
- dialog.show(getSupportFragmentManager(), SAML_DIALOG_TAG);\r
-\r
- mAuthStatusIcon = 0;\r
- mAuthStatusText = 0;\r
-\r
- } else {\r
- mAuthStatusIcon = R.drawable.common_error;\r
- mAuthStatusText = R.string.auth_unsupported_auth_method;\r
-\r
- }\r
- showAuthStatus();\r
- }\r
-\r
-\r
/**\r
* Processes the result of the server check performed when the user finishes the enter of the\r
* server URL.\r
\r
\r
private boolean authSupported(AuthenticationMethod authMethod) {\r
- String basic = AccountTypeUtils.getAuthTokenTypePass(MainApp.getAccountType());\r
- String oAuth = AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType());\r
- String saml = AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType());\r
- \r
- return (( mAuthTokenType.equals(basic) && \r
- authMethod.equals(AuthenticationMethod.BASIC_HTTP_AUTH) ) ||\r
- ( mAuthTokenType.equals(oAuth) && \r
- authMethod.equals(AuthenticationMethod.BEARER_TOKEN)) ||\r
- ( mAuthTokenType.equals(saml) && \r
- authMethod.equals(AuthenticationMethod.SAML_WEB_SSO))\r
+ return (( BASIC_TOKEN_TYPE.equals(mAuthTokenType) &&\r
+ AuthenticationMethod.BASIC_HTTP_AUTH.equals(authMethod) ) ||\r
+ ( OAUTH_TOKEN_TYPE.equals(mAuthTokenType) &&\r
+ AuthenticationMethod.BEARER_TOKEN.equals(authMethod)) ||\r
+ ( SAML_TOKEN_TYPE.equals(mAuthTokenType) &&\r
+ AuthenticationMethod.SAML_WEB_SSO.equals(authMethod))\r
);\r
}\r
\r
Map<String, String> tokens = (Map<String, String>)(result.getData().get(0));\r
mAuthToken = tokens.get(OAuth2Constants.KEY_ACCESS_TOKEN);\r
Log_OC.d(TAG, "Got ACCESS TOKEN: " + mAuthToken);\r
- \r
- accessRootFolderRemoteOperation("", "");\r
+\r
+ /// validate token accessing to root folder / getting session\r
+ OwnCloudCredentials credentials = OwnCloudCredentialsFactory.newBearerCredentials(mAuthToken);\r
+ accessRootFolder(credentials);\r
\r
} else {\r
updateAuthStatusIconAndText(result);\r
*\r
* @param result Result of the operation.\r
*/\r
- private void onAuthorizationCheckFinish(RemoteOperationResult result) {\r
+ @Override\r
+ public void onAuthenticatorTaskCallback(RemoteOperationResult result) {\r
mWaitingForOpId = Long.MAX_VALUE;\r
dismissDialog(WAIT_DIALOG_TAG);\r
\r
*/\r
private void updateAccountAuthentication() throws AccountNotFoundException {\r
\r
-// OwnCloudClientManagerFactory.getDefaultSingleton().removeClientFor(\r
-// new OwnCloudAccount(mAccount, this)\r
-// );\r
-\r
Bundle response = new Bundle();\r
response.putString(AccountManager.KEY_ACCOUNT_NAME, mAccount.name);\r
response.putString(AccountManager.KEY_ACCOUNT_TYPE, mAccount.type);\r
final Intent intent = new Intent(); \r
intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, MainApp.getAccountType());\r
intent.putExtra(AccountManager.KEY_ACCOUNT_NAME, mAccount.name);\r
- /*if (!isOAuth)\r
- intent.putExtra(AccountManager.KEY_AUTHTOKEN, MainApp.getAccountType()); */\r
intent.putExtra(AccountManager.KEY_USERDATA, username);\r
if (isOAuth || isSaml) {\r
mAccountMgr.setAuthToken(mAccount, mAuthTokenType, mAuthToken);\r
public void onCheckClick(View view) {\r
CheckBox oAuth2Check = (CheckBox)view;\r
if (oAuth2Check.isChecked()) {\r
- mAuthTokenType = AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType());\r
+ mAuthTokenType = OAUTH_TOKEN_TYPE;\r
} else {\r
- mAuthTokenType = AccountTypeUtils.getAuthTokenTypePass(MainApp.getAccountType());\r
+ mAuthTokenType = BASIC_TOKEN_TYPE;\r
}\r
updateAuthenticationPreFragmentVisibility();\r
}\r
getUserNameIntent.putExtra(OperationsService.EXTRA_COOKIE, sessionCookie);\r
\r
if (mOperationsServiceBinder != null) {\r
- //Log_OC.wtf(TAG, "starting getRemoteUserNameOperation..." );\r
mWaitingForOpId = mOperationsServiceBinder.queueNewOperation(getUserNameIntent);\r
}\r
}\r
if (component.equals(\r
new ComponentName(AuthenticatorActivity.this, OperationsService.class)\r
)) {\r
- //Log_OC.wtf(TAG, "Operations service connected");\r
mOperationsServiceBinder = (OperationsServiceBinder) service;\r
\r
doOnResumeAndBound();\r
}\r
\r
\r
- @Override\r
- public void onAuthenticatorTaskCallback(RemoteOperationResult result) {\r
- //Log_OC.wtf(TAG, "received detection response through callback" );\r
- if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).\r
- equals(mAuthTokenType)) {\r
- onSamlBasedFederatedSingleSignOnAuthorizationStart(result);\r
-\r
- } else {\r
- onAuthorizationCheckFinish(result);\r
- }\r
- }\r
}\r
import android.net.Uri;
import android.os.AsyncTask;
-import com.owncloud.android.MainApp;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.OwnCloudClientFactory;
import com.owncloud.android.lib.common.OwnCloudCredentials;
-import com.owncloud.android.lib.common.OwnCloudCredentialsFactory;
-import com.owncloud.android.lib.common.accounts.AccountTypeUtils;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
*
* @author masensio on 09/02/2015.
*/
-public class AuthenticatorAsyncTask extends AsyncTask<String, Void, RemoteOperationResult> {
+public class AuthenticatorAsyncTask extends AsyncTask<Object, Void, RemoteOperationResult> {
private static String REMOTE_PATH = "/";
private static boolean SUCCESS_IF_ABSENT = false;
public AuthenticatorAsyncTask(Activity activity) {
mContext = activity.getApplicationContext();
mListener = new WeakReference<OnAuthenticatorTaskListener>((OnAuthenticatorTaskListener)activity);
- mActivity = activity;
}
@Override
- protected RemoteOperationResult doInBackground(String... params) {
+ protected RemoteOperationResult doInBackground(Object... params) {
RemoteOperationResult result;
- if (params!= null && params.length==5) {
- String url = params[0];
- String username = params[1];
- String password = params[2];
- String authToken = params[3];
- String authTokenType = params[4];
+ if (params!= null && params.length==2) {
+ String url = (String)params[0];
+ OwnCloudCredentials credentials = (OwnCloudCredentials)params[1];
// Client
- String basic = AccountTypeUtils.getAuthTokenTypePass(MainApp.getAccountType());
- String oAuth = AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType());
- String saml = AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType());
-
Uri uri = Uri.parse(url);
- OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(uri, mContext, false);
- OwnCloudCredentials credentials = null;
- if (authTokenType.equals(basic)) {
- credentials = OwnCloudCredentialsFactory.newBasicCredentials(
- username, password); // basic
-
- } else if (authTokenType.equals(oAuth)) {
- credentials = OwnCloudCredentialsFactory.newBearerCredentials(
- authToken); // bearer token
-
- } else if (authTokenType.equals(saml)) {
- credentials = OwnCloudCredentialsFactory.newSamlSsoCredentials(
- authToken); // SAML SSO
- }
+ OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(uri, mContext, true);
client.setCredentials(credentials);
// Operation
- ExistenceCheckRemoteOperation operation = new ExistenceCheckRemoteOperation(REMOTE_PATH,
- mContext, SUCCESS_IF_ABSENT);
+ ExistenceCheckRemoteOperation operation = new ExistenceCheckRemoteOperation(
+ REMOTE_PATH,
+ mContext,
+ SUCCESS_IF_ABSENT
+ );
result = operation.execute(client);
} else {
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
-import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.lib.resources.users.GetRemoteUserNameOperation;
import com.owncloud.android.operations.common.SyncOperation;
public static final String EXTRA_NEW_PARENT_PATH = "NEW_PARENT_PATH";
public static final String EXTRA_FILE = "FILE";
- // TODO review if ALL OF THEM are necessary
- public static final String EXTRA_SUCCESS_IF_ABSENT = "SUCCESS_IF_ABSENT";
- public static final String EXTRA_USERNAME = "USERNAME";
- public static final String EXTRA_PASSWORD = "PASSWORD";
- public static final String EXTRA_AUTH_TOKEN = "AUTH_TOKEN";
public static final String EXTRA_COOKIE = "COOKIE";
public static final String ACTION_CREATE_SHARE = "CREATE_SHARE";
public static final String ACTION_UNSHARE = "UNSHARE";
public static final String ACTION_GET_SERVER_INFO = "GET_SERVER_INFO";
public static final String ACTION_OAUTH2_GET_ACCESS_TOKEN = "OAUTH2_GET_ACCESS_TOKEN";
- public static final String ACTION_EXISTENCE_CHECK = "EXISTENCE_CHECK";
public static final String ACTION_GET_USER_NAME = "GET_USER_NAME";
public static final String ACTION_RENAME = "RENAME";
public static final String ACTION_REMOVE = "REMOVE";
public static final String ACTION_CREATE_FOLDER = "CREATE_FOLDER";
public static final String ACTION_SYNC_FILE = "SYNC_FILE";
public static final String ACTION_SYNC_FOLDER = "SYNC_FOLDER"; // for the moment, just to download
- //public static final String ACTION_CANCEL_SYNC_FOLDER = "CANCEL_SYNC_FOLDER"; // for the moment, just to download
public static final String ACTION_MOVE_FILE = "MOVE_FILE";
public static final String ACTION_OPERATION_ADDED = OperationsService.class.getName() + ".OPERATION_ADDED";
private static class Target {
public Uri mServerUrl = null;
public Account mAccount = null;
- public String mUsername = null;
- public String mPassword = null;
- public String mAuthToken = null;
public String mCookie = null;
- public Target(Account account, Uri serverUrl, String username, String password, String authToken,
- String cookie) {
+ public Target(Account account, Uri serverUrl, String cookie) {
mAccount = account;
mServerUrl = serverUrl;
- mUsername = username;
- mPassword = password;
- mAuthToken = authToken;
mCookie = cookie;
}
}
*/
@Override
public boolean onUnbind(Intent intent) {
- ((OperationsServiceBinder)mOperationsBinder).clearListeners();
+ mOperationsBinder.clearListeners();
return false; // not accepting rebinding (default behaviour)
}
);
} else {
OwnCloudCredentials credentials = null;
- if (mLastTarget.mUsername != null &&
- mLastTarget.mUsername.length() > 0) {
- credentials = OwnCloudCredentialsFactory.newBasicCredentials(
- mLastTarget.mUsername,
- mLastTarget.mPassword); // basic
-
- } else if (mLastTarget.mAuthToken != null &&
- mLastTarget.mAuthToken.length() > 0) {
- credentials = OwnCloudCredentialsFactory.newBearerCredentials(
- mLastTarget.mAuthToken); // bearer token
-
- } else if (mLastTarget.mCookie != null &&
+ if (mLastTarget.mCookie != null &&
mLastTarget.mCookie.length() > 0) {
+ // just used for GetUserName
+ // TODO refactor to run GetUserName as AsyncTask in the context of AuthenticatorActivity
credentials = OwnCloudCredentialsFactory.newSamlSsoCredentials(
mLastTarget.mCookie); // SAML SSO
}
}
//sendBroadcastOperationFinished(mLastTarget, mCurrentOperation, result);
- mService.dispatchResultToOperationListeners(mLastTarget, mCurrentOperation, result);
+ mService.dispatchResultToOperationListeners(mCurrentOperation, result);
}
}
} else {
Account account = operationIntent.getParcelableExtra(EXTRA_ACCOUNT);
String serverUrl = operationIntent.getStringExtra(EXTRA_SERVER_URL);
- String username = operationIntent.getStringExtra(EXTRA_USERNAME);
- String password = operationIntent.getStringExtra(EXTRA_PASSWORD);
- String authToken = operationIntent.getStringExtra(EXTRA_AUTH_TOKEN);
String cookie = operationIntent.getStringExtra(EXTRA_COOKIE);
target = new Target(
account,
(serverUrl == null) ? null : Uri.parse(serverUrl),
- username,
- password,
- authToken,
cookie
);
getString(R.string.oauth2_grant_type),
oauth2QueryParameters);
- } else if (action.equals(ACTION_EXISTENCE_CHECK)) {
- // Existence Check
- String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
- boolean successIfAbsent = operationIntent.getBooleanExtra(EXTRA_SUCCESS_IF_ABSENT, false);
- operation = new ExistenceCheckRemoteOperation(remotePath, OperationsService.this, successIfAbsent);
-
} else if (action.equals(ACTION_GET_USER_NAME)) {
// Get User Name
operation = new GetRemoteUserNameOperation();
/**
* Notifies the currently subscribed listeners about the end of an operation.
*
- * @param target Account or URL pointing to an OC server.
* @param operation Finished operation.
* @param result Result of the operation.
*/
protected void dispatchResultToOperationListeners(
- Target target, final RemoteOperation operation, final RemoteOperationResult result) {
+ final RemoteOperation operation, final RemoteOperationResult result
+ ) {
int count = 0;
Iterator<OnRemoteOperationListener> listeners = mOperationsBinder.mBoundListeners.keySet().iterator();
while (listeners.hasNext()) {