refresh account when session expires
authormasensio <masensio@solidgear.es>
Tue, 20 Aug 2013 09:02:17 +0000 (11:02 +0200)
committermasensio <masensio@solidgear.es>
Tue, 20 Aug 2013 09:02:17 +0000 (11:02 +0200)
src/com/owncloud/android/authentication/AuthenticatorActivity.java

index a768821..2387ad1 100644 (file)
@@ -1146,6 +1146,9 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
             mAccountMgr.setPassword(mAccount, mPasswordInput.getText().toString());\r
         }\r
         setAccountAuthenticatorResult(response);\r
             mAccountMgr.setPassword(mAccount, mPasswordInput.getText().toString());\r
         }\r
         setAccountAuthenticatorResult(response);\r
+        \r
+        // Sync Account\r
+        syncAccount();\r
     }\r
 \r
 \r
     }\r
 \r
 \r
@@ -1213,9 +1216,10 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
         setResult(RESULT_OK, intent);\r
 \r
         /// immediately request for the synchronization of the new account\r
         setResult(RESULT_OK, intent);\r
 \r
         /// immediately request for the synchronization of the new account\r
-        Bundle bundle = new Bundle();\r
-        bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);\r
-        ContentResolver.requestSync(mAccount, AccountAuthenticator.AUTHORITY, bundle);\r
+        syncAccount();\r
+//        Bundle bundle = new Bundle();\r
+//        bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);\r
+//        ContentResolver.requestSync(mAccount, AccountAuthenticator.AUTHORITY, bundle);\r
     }\r
 \r
 \r
     }\r
 \r
 \r
@@ -1560,4 +1564,11 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
         mAuthMessage.setVisibility(View.GONE);\r
     }\r
 \r
         mAuthMessage.setVisibility(View.GONE);\r
     }\r
 \r
+    \r
+    private void syncAccount(){\r
+        /// immediately request for the synchronization of the new account\r
+        Bundle bundle = new Bundle();\r
+        bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);\r
+        ContentResolver.requestSync(mAccount, AccountAuthenticator.AUTHORITY, bundle);\r
+    }\r
 }\r
 }\r