Merge remote-tracking branch 'origin/enable_cookies' into enable_cookies
authormasensio <masensio@solidgear.es>
Fri, 13 Feb 2015 13:39:35 +0000 (14:39 +0100)
committermasensio <masensio@solidgear.es>
Fri, 13 Feb 2015 13:39:35 +0000 (14:39 +0100)
Conflicts:
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/authentication/AuthenticatorAsyncTask.java

1  2 
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/authentication/AuthenticatorAsyncTask.java

@@@ -1441,10 -1424,20 +1451,23 @@@ public class AuthenticatorActivity exte
  \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
@@@ -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>((OnAuthenticatorTaskListener)activity);
 +        mActivity = activity;
      }
  
      @Override