\r
\r
/**\r
- * Sets the proper response to get that the Account Authenticator that started this activity \r
+ * Updates the authentication token.\r
+ *\r
+ * Sets the proper response so that the AccountAuthenticator that started this activity\r
* saves a new authorization token for mAccount.\r
+ *\r
+ * Kills the session kept by OwnCloudClientManager so that a new one will created with\r
+ * the new credentials when needed.\r
*/\r
- private void updateToken() {\r
+ private void updateAccountAuthentication() throws AccountNotFoundException {\r
-\r
- OwnCloudClientManagerFactory.getDefaultSingleton().removeClientFor(\r
- new OwnCloudAccount(mAccount, this)\r
- );\r
++ try {\r
++ OwnCloudClientManagerFactory.getDefaultSingleton().removeClientFor(\r
++ new OwnCloudAccount(mAccount, this)\r
++ );\r
++ } catch (Exception e) {\r
++ Log_OC.e(TAG, "Exception", e);\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