X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/ffdc77f8d8836376157414ca9a611ae685ec74b8..cfe589231a558f3f7e5ce483ae46f1422182e8e1:/src/com/owncloud/android/authentication/AuthenticatorActivity.java diff --git a/src/com/owncloud/android/authentication/AuthenticatorActivity.java b/src/com/owncloud/android/authentication/AuthenticatorActivity.java index f6decb81..32bbcdcc 100644 --- a/src/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/src/com/owncloud/android/authentication/AuthenticatorActivity.java @@ -114,7 +114,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { private static final String KEY_AUTH_STATUS_TEXT = "AUTH_STATUS_TEXT"; private static final String KEY_AUTH_STATUS_ICON = "AUTH_STATUS_ICON"; private static final String KEY_SERVER_AUTH_METHOD = "SERVER_AUTH_METHOD"; - private static final String KEY_WAITING_FOR_OP_ID = "DETECT_AUTH_OP_ID"; + private static final String KEY_WAITING_FOR_OP_ID = "WAITING_FOR_OP_ID"; private static final String KEY_AUTH_TOKEN = "AUTH_TOKEN"; private static final String AUTH_ON = "on"; @@ -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(); + } }