Browse Source

Fixed lost automatic check of OC server on enforced update of password

David A. Velasco 11 years ago
parent
commit
e2f0af1c26
1 changed files with 11 additions and 7 deletions
  1. 11 7
      src/com/owncloud/android/authentication/AuthenticatorActivity.java

+ 11 - 7
src/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -153,6 +153,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
     
     private boolean mServerIsChecked = false;
     private boolean mServerIsValid = false;
+    private boolean mPendingAutoCheck = false;
 
     private GetServerInfoOperation.ServerInfo mServerInfo = 
             new GetServerInfoOperation.ServerInfo();
@@ -174,7 +175,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
     
     /// Identifier of operation in progress which result shouldn't be lost 
     private long mWaitingForOpId = Long.MAX_VALUE;
-    
+
     
     /**
      * {@inheritDoc}
@@ -406,12 +407,9 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         });
      
         
-        /// step 4 - automatic actions to start
-        if (savedInstanceState == null) {
-            if (mAction != ACTION_CREATE || !isUrlInputAllowed) {
-                checkOcServer(); 
-            }
-        }
+        /// step 4 - mark automatic check to be started when OperationsService is ready
+        mPendingAutoCheck = (savedInstanceState == null && 
+                (mAction != ACTION_CREATE || !isUrlInputAllowed));
     }
     
     
@@ -729,6 +727,8 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
             if (mOperationsServiceBinder != null) {
                 //Log_OC.wtf(TAG, "checking server..." );
                 mWaitingForOpId = mOperationsServiceBinder.newOperation(getServerInfoIntent);
+            } else {
+              Log_OC.wtf(TAG, "Server check tried with OperationService unbound!" );
             }
             
         } else {
@@ -1745,6 +1745,10 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         if (mWaitingForOpId <= Integer.MAX_VALUE) {
             mOperationsServiceBinder.dispatchResultIfFinished((int)mWaitingForOpId, this);
         }
+        
+        if (mPendingAutoCheck) {
+            checkOcServer();
+        }
     }