Recovered some extra logs before validating
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / AuthenticatorActivity.java
index ee9d9bc..fe50f37 100644 (file)
@@ -43,7 +43,6 @@ import android.support.v4.app.FragmentTransaction;
 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
@@ -174,7 +173,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
 \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
@@ -211,7 +210,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
             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
@@ -355,7 +354,8 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
             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
@@ -536,12 +536,12 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
      */\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
@@ -561,7 +561,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         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
@@ -609,9 +609,9 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
     \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
@@ -619,7 +619,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         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
@@ -662,7 +662,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
                 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
@@ -728,7 +728,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
             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
@@ -952,7 +952,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
     }\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
@@ -985,7 +985,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
     }\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
@@ -1020,7 +1020,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
     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
@@ -1287,7 +1287,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
      * @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
@@ -1326,7 +1326,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
      * @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
@@ -1658,7 +1658,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         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
@@ -1753,10 +1753,10 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
 \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