X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/8d38fd331d43f21800843ae4cf340bc33e583a40..a3798996e1361d0ec9cdb6b085f63a6aefa74c3b:/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 ee9d9bc1..fe50f379 100644 --- a/src/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/src/com/owncloud/android/authentication/AuthenticatorActivity.java @@ -43,7 +43,6 @@ import android.support.v4.app.FragmentTransaction; import android.text.Editable; import android.text.InputType; import android.text.TextWatcher; -import android.util.Log; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; @@ -174,7 +173,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { /// Identifier of operation in progress which result shouldn't be lost - private int mWaitingForOpId = -1; + private long mWaitingForOpId = Long.MAX_VALUE; /** @@ -211,7 +210,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { initAuthTokenType(); } else { mAuthTokenType = savedInstanceState.getString(KEY_AUTH_TOKEN_TYPE); - mWaitingForOpId = savedInstanceState.getInt(KEY_WAITING_FOR_OP_ID); + mWaitingForOpId = savedInstanceState.getLong(KEY_WAITING_FOR_OP_ID); } /// load user interface @@ -355,7 +354,8 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { findViewById(R.id.hostUrlFrame).setVisibility(View.GONE); mRefreshButton = findViewById(R.id.centeredRefreshButton); } - showRefreshButton(mServerIsChecked && !mServerIsValid && mWaitingForOpId == -1); + showRefreshButton(mServerIsChecked && !mServerIsValid && + mWaitingForOpId > Integer.MAX_VALUE); mServerStatusView = (TextView) findViewById(R.id.server_status_text); showServerStatus(); @@ -536,12 +536,12 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { */ @Override protected void onSaveInstanceState(Bundle outState) { - Log.wtf(TAG, "onSaveInstanceState init" ); + Log_OC.wtf(TAG, "onSaveInstanceState init" ); super.onSaveInstanceState(outState); /// global state outState.putString(KEY_AUTH_TOKEN_TYPE, mAuthTokenType); - outState.putInt(KEY_WAITING_FOR_OP_ID, mWaitingForOpId); + outState.putLong(KEY_WAITING_FOR_OP_ID, mWaitingForOpId); /// Server PRE-fragment state outState.putInt(KEY_SERVER_STATUS_TEXT, mServerStatusText); @@ -561,7 +561,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { outState.putInt(KEY_AUTH_STATUS_TEXT, mAuthStatusText); outState.putString(KEY_AUTH_TOKEN, mAuthToken); - Log.wtf(TAG, "onSaveInstanceState end" ); + Log_OC.wtf(TAG, "onSaveInstanceState end" ); } @@ -609,9 +609,9 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { @Override protected void onPause() { - Log.wtf(TAG, "onPause init" ); + Log_OC.wtf(TAG, "onPause init" ); if (mOperationsServiceBinder != null) { - Log.wtf(TAG, "unregistering to listen for operation callbacks" ); + Log_OC.wtf(TAG, "unregistering to listen for operation callbacks" ); mOperationsServiceBinder.removeOperationListener(this); } @@ -619,7 +619,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { mHostUrlInput.setOnFocusChangeListener(null); super.onPause(); - Log.wtf(TAG, "onPause end" ); + Log_OC.wtf(TAG, "onPause end" ); } @Override @@ -662,7 +662,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { queryParameters); if (mOperationsServiceBinder != null) { - //Log_OC.wtf(TAG, "getting access token..." ); + Log_OC.wtf(TAG, "getting access token..." ); mWaitingForOpId = mOperationsServiceBinder.newOperation(getServerInfoIntent); } } @@ -728,7 +728,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { getServerInfoIntent.putExtra(OperationsService.EXTRA_SERVER_URL, uri); getServerInfoIntent.putExtra(OperationsService.EXTRA_AUTH_TOKEN_TYPE, mAuthTokenType); if (mOperationsServiceBinder != null) { - //Log_OC.wtf(TAG, "checking server..." ); + Log_OC.wtf(TAG, "checking server..." ); mWaitingForOpId = mOperationsServiceBinder.newOperation(getServerInfoIntent); } @@ -952,7 +952,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { } private void onGetUserNameFinish(RemoteOperationResult result) { - mWaitingForOpId = -1; + mWaitingForOpId = Long.MAX_VALUE; if (result.isSuccess()) { boolean success = false; String username = (String) result.getData().get(0); @@ -985,7 +985,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { } private void onSamlBasedFederatedSingleSignOnAuthorizationStart(RemoteOperationResult result) { - mWaitingForOpId = -1; + mWaitingForOpId = Long.MAX_VALUE; dismissDialog(WAIT_DIALOG_TAG); //if (result.isTemporalRedirection() && result.isIdPRedirection()) { @@ -1020,7 +1020,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { private void onGetServerInfoFinish(RemoteOperationResult result) { /// update activity state mServerIsChecked = true; - mWaitingForOpId = -1; + mWaitingForOpId = Long.MAX_VALUE; // update server status, but don't show it yet updateServerStatusIconAndText(result); @@ -1287,7 +1287,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { * @param result Result of the operation. */ private void onGetOAuthAccessTokenFinish(RemoteOperationResult result) { - mWaitingForOpId = -1; + mWaitingForOpId = Long.MAX_VALUE; dismissDialog(WAIT_DIALOG_TAG); String webdav_path = AccountUtils.getWebdavPath(mServerInfo.mVersion, mAuthTokenType); @@ -1326,7 +1326,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { * @param result Result of the operation. */ private void onAuthorizationCheckFinish(RemoteOperationResult result) { - mWaitingForOpId = -1; + mWaitingForOpId = Long.MAX_VALUE; dismissDialog(WAIT_DIALOG_TAG); result = new RemoteOperationResult(new RuntimeException("FAKE")); @@ -1658,7 +1658,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { getUserNameIntent.putExtra(OperationsService.EXTRA_FOLLOW_REDIRECTS, followRedirects); if (mOperationsServiceBinder != null) { - //Log_OC.wtf(TAG, "starting getRemoteUserNameOperation..." ); + Log_OC.wtf(TAG, "starting getRemoteUserNameOperation..." ); mWaitingForOpId = mOperationsServiceBinder.newOperation(getUserNameIntent); } } @@ -1753,10 +1753,10 @@ SsoWebViewClientListener, OnSslUntrustedCertListener { private void doOnResumeAndBound() { - Log.wtf(TAG, "registering to listen for operation callbacks" ); + Log_OC.wtf(TAG, "registering to listen for operation callbacks" ); mOperationsServiceBinder.addOperationListener(AuthenticatorActivity.this, mHandler); - if (mWaitingForOpId != -1) { - mOperationsServiceBinder.dispatchResultIfFinished(mWaitingForOpId, this); + if (mWaitingForOpId <= Integer.MAX_VALUE) { + mOperationsServiceBinder.dispatchResultIfFinished((int)mWaitingForOpId, this); } }