From: masensio Date: Fri, 13 Feb 2015 13:39:35 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/enable_cookies' into enable_cookies X-Git-Tag: oc-android-1.7.1_signed^2~42^2~4 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/fba65e37f68f5cd72fb20c96982607702193a509?ds=inline Merge remote-tracking branch 'origin/enable_cookies' into enable_cookies Conflicts: src/com/owncloud/android/authentication/AuthenticatorActivity.java src/com/owncloud/android/authentication/AuthenticatorAsyncTask.java --- fba65e37f68f5cd72fb20c96982607702193a509 diff --cc src/com/owncloud/android/authentication/AuthenticatorActivity.java index 6d092a2a,0c735401..e2c3c033 --- a/src/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/src/com/owncloud/android/authentication/AuthenticatorActivity.java @@@ -1441,10 -1424,20 +1451,23 @@@ public class AuthenticatorActivity exte /** - * Sets the proper response to get that the Account Authenticator that started this activity + * Updates the authentication token. + * + * Sets the proper response so that the AccountAuthenticator that started this activity * saves a new authorization token for mAccount. + * + * Kills the session kept by OwnCloudClientManager so that a new one will created with + * the new credentials when needed. */ - private void updateToken() { + private void updateAccountAuthentication() throws AccountNotFoundException { - - OwnCloudClientManagerFactory.getDefaultSingleton().removeClientFor( - new OwnCloudAccount(mAccount, this) - ); ++ try { ++ OwnCloudClientManagerFactory.getDefaultSingleton().removeClientFor( ++ new OwnCloudAccount(mAccount, this) ++ ); ++ } catch (Exception e) { ++ Log_OC.e(TAG, "Exception", e); ++ } + Bundle response = new Bundle(); response.putString(AccountManager.KEY_ACCOUNT_NAME, mAccount.name); response.putString(AccountManager.KEY_ACCOUNT_TYPE, mAccount.type); diff --cc src/com/owncloud/android/authentication/AuthenticatorAsyncTask.java index bf2355c8,43822bfd..6e215342 --- a/src/com/owncloud/android/authentication/AuthenticatorAsyncTask.java +++ b/src/com/owncloud/android/authentication/AuthenticatorAsyncTask.java @@@ -49,8 -33,7 +49,8 @@@ public class AuthenticatorAsyncTask ex public AuthenticatorAsyncTask(Activity activity) { mContext = activity.getApplicationContext(); - mListener = new WeakReference<>((OnAuthenticatorTaskListener)activity); + mListener = new WeakReference((OnAuthenticatorTaskListener)activity); + mActivity = activity; } @Override