import android.text.Editable;\r
import android.text.InputType;\r
import android.text.TextWatcher;\r
-import android.util.Log;\r
import android.view.KeyEvent;\r
import android.view.MotionEvent;\r
import android.view.View;\r
\r
\r
/// Identifier of operation in progress which result shouldn't be lost \r
- private int mWaitingForOpId = -1;\r
+ private long mWaitingForOpId = Long.MAX_VALUE;\r
\r
\r
/**\r
initAuthTokenType();\r
} else {\r
mAuthTokenType = savedInstanceState.getString(KEY_AUTH_TOKEN_TYPE);\r
- mWaitingForOpId = savedInstanceState.getInt(KEY_WAITING_FOR_OP_ID);\r
+ mWaitingForOpId = savedInstanceState.getLong(KEY_WAITING_FOR_OP_ID);\r
}\r
\r
/// load user interface\r
findViewById(R.id.hostUrlFrame).setVisibility(View.GONE);\r
mRefreshButton = findViewById(R.id.centeredRefreshButton);\r
}\r
- showRefreshButton(mServerIsChecked && !mServerIsValid && mWaitingForOpId == -1);\r
+ showRefreshButton(mServerIsChecked && !mServerIsValid && \r
+ mWaitingForOpId > Integer.MAX_VALUE);\r
mServerStatusView = (TextView) findViewById(R.id.server_status_text);\r
showServerStatus();\r
\r
*/\r
@Override\r
protected void onSaveInstanceState(Bundle outState) {\r
- Log.wtf(TAG, "onSaveInstanceState init" );\r
+ Log_OC.wtf(TAG, "onSaveInstanceState init" );\r
super.onSaveInstanceState(outState);\r
\r
/// global state\r
outState.putString(KEY_AUTH_TOKEN_TYPE, mAuthTokenType);\r
- outState.putInt(KEY_WAITING_FOR_OP_ID, mWaitingForOpId);\r
+ outState.putLong(KEY_WAITING_FOR_OP_ID, mWaitingForOpId);\r
\r
/// Server PRE-fragment state\r
outState.putInt(KEY_SERVER_STATUS_TEXT, mServerStatusText);\r
outState.putInt(KEY_AUTH_STATUS_TEXT, mAuthStatusText);\r
outState.putString(KEY_AUTH_TOKEN, mAuthToken);\r
\r
- Log.wtf(TAG, "onSaveInstanceState end" );\r
+ Log_OC.wtf(TAG, "onSaveInstanceState end" );\r
}\r
\r
\r
\r
@Override\r
protected void onPause() {\r
- Log.wtf(TAG, "onPause init" );\r
+ Log_OC.wtf(TAG, "onPause init" );\r
if (mOperationsServiceBinder != null) {\r
- Log.wtf(TAG, "unregistering to listen for operation callbacks" );\r
+ Log_OC.wtf(TAG, "unregistering to listen for operation callbacks" );\r
mOperationsServiceBinder.removeOperationListener(this);\r
}\r
\r
mHostUrlInput.setOnFocusChangeListener(null);\r
\r
super.onPause();\r
- Log.wtf(TAG, "onPause end" );\r
+ Log_OC.wtf(TAG, "onPause end" );\r
}\r
\r
@Override\r
queryParameters);\r
\r
if (mOperationsServiceBinder != null) {\r
- //Log_OC.wtf(TAG, "getting access token..." );\r
+ Log_OC.wtf(TAG, "getting access token..." );\r
mWaitingForOpId = mOperationsServiceBinder.newOperation(getServerInfoIntent);\r
}\r
}\r
getServerInfoIntent.putExtra(OperationsService.EXTRA_SERVER_URL, uri);\r
getServerInfoIntent.putExtra(OperationsService.EXTRA_AUTH_TOKEN_TYPE, mAuthTokenType);\r
if (mOperationsServiceBinder != null) {\r
- //Log_OC.wtf(TAG, "checking server..." );\r
+ Log_OC.wtf(TAG, "checking server..." );\r
mWaitingForOpId = mOperationsServiceBinder.newOperation(getServerInfoIntent);\r
}\r
\r
}\r
\r
private void onGetUserNameFinish(RemoteOperationResult result) {\r
- mWaitingForOpId = -1;\r
+ mWaitingForOpId = Long.MAX_VALUE;\r
if (result.isSuccess()) {\r
boolean success = false;\r
String username = (String) result.getData().get(0);\r
}\r
\r
private void onSamlBasedFederatedSingleSignOnAuthorizationStart(RemoteOperationResult result) {\r
- mWaitingForOpId = -1;\r
+ mWaitingForOpId = Long.MAX_VALUE;\r
dismissDialog(WAIT_DIALOG_TAG);\r
//if (result.isTemporalRedirection() && result.isIdPRedirection()) {\r
private void onGetServerInfoFinish(RemoteOperationResult result) {\r
/// update activity state\r
mServerIsChecked = true;\r
- mWaitingForOpId = -1;\r
+ mWaitingForOpId = Long.MAX_VALUE;\r
\r
// update server status, but don't show it yet\r
updateServerStatusIconAndText(result);\r
* @param result Result of the operation.\r
*/\r
private void onGetOAuthAccessTokenFinish(RemoteOperationResult result) {\r
- mWaitingForOpId = -1;\r
+ mWaitingForOpId = Long.MAX_VALUE;\r
dismissDialog(WAIT_DIALOG_TAG);\r
\r
String webdav_path = AccountUtils.getWebdavPath(mServerInfo.mVersion, mAuthTokenType);\r
* @param result Result of the operation.\r
*/\r
private void onAuthorizationCheckFinish(RemoteOperationResult result) {\r
- mWaitingForOpId = -1;\r
+ mWaitingForOpId = Long.MAX_VALUE;\r
dismissDialog(WAIT_DIALOG_TAG);\r
\r
result = new RemoteOperationResult(new RuntimeException("FAKE"));\r
getUserNameIntent.putExtra(OperationsService.EXTRA_FOLLOW_REDIRECTS, followRedirects);\r
\r
if (mOperationsServiceBinder != null) {\r
- //Log_OC.wtf(TAG, "starting getRemoteUserNameOperation..." );\r
+ Log_OC.wtf(TAG, "starting getRemoteUserNameOperation..." );\r
mWaitingForOpId = mOperationsServiceBinder.newOperation(getUserNameIntent);\r
}\r
}\r
\r
\r
private void doOnResumeAndBound() {\r
- Log.wtf(TAG, "registering to listen for operation callbacks" );\r
+ Log_OC.wtf(TAG, "registering to listen for operation callbacks" );\r
mOperationsServiceBinder.addOperationListener(AuthenticatorActivity.this, mHandler);\r
- if (mWaitingForOpId != -1) {\r
- mOperationsServiceBinder.dispatchResultIfFinished(mWaitingForOpId, this);\r
+ if (mWaitingForOpId <= Integer.MAX_VALUE) {\r
+ mOperationsServiceBinder.dispatchResultIfFinished((int)mWaitingForOpId, this);\r
}\r
}\r
\r