\r
} else if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType)) {\r
\r
- String username= getUserNameForSaml(mHostBaseUrl);\r
+ String username= getUserNameForSaml();\r
if (username == null)\r
return false;\r
\r
Uri uri = Uri.parse(mHostBaseUrl);\r
String username = mUsernameInput.getText().toString().trim();\r
if (isSaml) {\r
- username = getUserNameForSaml(mHostBaseUrl);\r
+ username = getUserNameForSaml();\r
if (username == null)\r
return false;\r
\r
* Asynchronous task to get the SAML User name from OCS-API\r
*\r
*/\r
- private class GetUserNameTask extends AsyncTask<String, Void, String>{\r
+ private class GetUserNameTask extends AsyncTask<Void, Void, String>{\r
\r
@Override\r
- protected String doInBackground(String... params) {\r
+ protected String doInBackground(Void... params) {\r
\r
- String hostUrl = (String)params[0];\r
- \r
- GetUserNameRemoteOperation getUserOperation = new GetUserNameRemoteOperation(hostUrl, mAuthToken);\r
- WebdavClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(hostUrl), getApplicationContext(), true);\r
+ GetUserNameRemoteOperation getUserOperation = new GetUserNameRemoteOperation(mHostBaseUrl, mAuthToken);\r
+ WebdavClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(mHostBaseUrl), getApplicationContext(), true);\r
RemoteOperationResult result = getUserOperation.execute(client);\r
\r
return result.getUserName();\r
\r
/**\r
* Get the user name form OCS-API\r
- * @param hostUrl\r
* @return username\r
*/\r
- private String getUserNameForSaml(String hostUrl){\r
+ private String getUserNameForSaml(){\r
\r
GetUserNameTask getUserTask = new GetUserNameTask();\r
String username = null;\r
try {\r
- username = getUserTask.execute(mHostBaseUrl).get();\r
+ username = getUserTask.execute().get();\r
} catch (InterruptedException e) {\r
e.printStackTrace();\r
} catch (ExecutionException e) {\r