Merge branch 'develop' into videoInstandUploads
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / AuthenticatorActivity.java
index fd0849e..e0a0ba9 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
@@ -184,7 +183,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
      */\r
     @Override\r
     protected void onCreate(Bundle savedInstanceState) {\r
-        Log_OC.wtf(TAG,  "onCreate init");\r
+        //Log_OC.wtf(TAG,  "onCreate init");\r
         super.onCreate(savedInstanceState);\r
         getWindow().requestFeature(Window.FEATURE_NO_TITLE);\r
 \r
@@ -226,7 +225,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         /// initialize block to be moved to single Fragment to retrieve and validate credentials \r
         initAuthorizationPreFragment(savedInstanceState);\r
 \r
-        Log_OC.wtf(TAG,  "onCreate end");\r
+        //Log_OC.wtf(TAG,  "onCreate end");\r
     }\r
 \r
     private void initAuthTokenType() {\r
@@ -308,7 +307,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
 \r
         /// step 1 - load and process relevant inputs (resources, intent, savedInstanceState)\r
         boolean isUrlInputAllowed = getResources().getBoolean(R.bool.show_server_url_input); \r
-        //boolean refreshButtonEnabled = false;\r
         if (savedInstanceState == null) {\r
             if (mAccount != null) {\r
                 mServerInfo.mBaseUrl = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_BASE_URL);\r
@@ -322,7 +320,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
                 mServerInfo.mIsSslConn = mServerInfo.mBaseUrl.startsWith("https://");\r
             }\r
         } else {\r
-            //refreshButtonEnabled = savedInstanceState.getBoolean(KEY_REFRESH_BUTTON_ENABLED);\r
             mServerStatusText = savedInstanceState.getInt(KEY_SERVER_STATUS_TEXT);\r
             mServerStatusIcon = savedInstanceState.getInt(KEY_SERVER_STATUS_ICON);\r
             \r
@@ -537,7 +534,7 @@ 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
@@ -562,7 +559,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
@@ -589,7 +586,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
      */\r
     @Override\r
     protected void onResume() {\r
-        Log_OC.wtf(TAG, "onResume init" );\r
+        //Log_OC.wtf(TAG, "onResume init" );\r
         super.onResume();\r
         \r
         // bound here to avoid spurious changes triggered by Android on device rotations\r
@@ -604,15 +601,15 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
             doOnResumeAndBound();\r
         }\r
         \r
-        Log_OC.wtf(TAG, "onResume end" );\r
+        //Log_OC.wtf(TAG, "onResume end" );\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
@@ -620,7 +617,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
@@ -762,10 +759,8 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
 \r
 \r
     private void showViewPasswordButton() {\r
-        //int drawable = android.R.drawable.ic_menu_view;\r
         int drawable = R.drawable.ic_view;\r
         if (isPasswordVisible()) {\r
-            //drawable = android.R.drawable.ic_secure;\r
             drawable = R.drawable.ic_hide;\r
         }\r
         mPasswordInput.setCompoundDrawablesWithIntrinsicBounds(0, 0, drawable, 0);\r
@@ -813,7 +808,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
             mServerStatusText = R.string.auth_wtf_reenter_URL;\r
             showServerStatus();\r
             mOkButton.setEnabled(false);\r
-            Log_OC.wtf(TAG,  "The user was allowed to click 'connect' to an unchecked server!!");\r
+            //Log_OC.wtf(TAG,  "The user was allowed to click 'connect' to an unchecked server!!");\r
             return;\r
         }\r
 \r
@@ -866,7 +861,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         existenceCheckIntent.putExtra(OperationsService.EXTRA_FOLLOW_REDIRECTS, followRedirects);\r
         \r
         if (mOperationsServiceBinder != null) {\r
-            Log_OC.wtf(TAG, "starting existenceCheckRemoteOperation..." );\r
+            //Log_OC.wtf(TAG, "starting existenceCheckRemoteOperation..." );\r
             mWaitingForOpId = mOperationsServiceBinder.newOperation(existenceCheckIntent);\r
         }\r
     }\r
@@ -882,14 +877,12 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         showAuthStatus();\r
 \r
         // GET AUTHORIZATION request\r
-        //Uri uri = Uri.parse(getString(R.string.oauth2_url_endpoint_auth));\r
         Uri uri = Uri.parse(mOAuthAuthEndpointText.getText().toString().trim());\r
         Uri.Builder uriBuilder = uri.buildUpon();\r
         uriBuilder.appendQueryParameter(OAuth2Constants.KEY_RESPONSE_TYPE, getString(R.string.oauth2_response_type));\r
         uriBuilder.appendQueryParameter(OAuth2Constants.KEY_REDIRECT_URI, getString(R.string.oauth2_redirect_uri));   \r
         uriBuilder.appendQueryParameter(OAuth2Constants.KEY_CLIENT_ID, getString(R.string.oauth2_client_id));\r
         uriBuilder.appendQueryParameter(OAuth2Constants.KEY_SCOPE, getString(R.string.oauth2_scope));\r
-        //uriBuilder.appendQueryParameter(OAuth2Constants.KEY_STATE, whateverwewant);\r
         uri = uriBuilder.build();\r
         Log_OC.d(TAG, "Starting browser to view " + uri.toString());\r
         Intent i = new Intent(Intent.ACTION_VIEW, uri);\r
@@ -939,7 +932,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
             onGetOAuthAccessTokenFinish(result);\r
 \r
         } else if (operation instanceof ExistenceCheckRemoteOperation)  {\r
-            Log_OC.wtf(TAG, "received detection response through callback" );\r
+            //Log_OC.wtf(TAG, "received detection response through callback" );\r
             if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType)) {\r
                 onSamlBasedFederatedSingleSignOnAuthorizationStart(result);\r
 \r
@@ -989,7 +982,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         mWaitingForOpId = Long.MAX_VALUE;\r
         dismissDialog(WAIT_DIALOG_TAG);\r
 
-        //if (result.isTemporalRedirection() && result.isIdPRedirection()) {\r
         if (result.isIdPRedirection()) {
             String url = result.getRedirectedLocation();\r
             String targetUrl = mServerInfo.mBaseUrl \r
@@ -1330,7 +1322,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         mWaitingForOpId = Long.MAX_VALUE;\r
         dismissDialog(WAIT_DIALOG_TAG);\r
 \r
-        result = new RemoteOperationResult(new RuntimeException("FAKE"));\r
         if (result.isSuccess()) {\r
             Log_OC.d(TAG, "Successful access - time to save the account");\r
 \r
@@ -1352,12 +1343,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
             /// the server\r
             mServerIsChecked = true;\r
             mServerIsValid = false;\r
-            /*\r
-            mServerInfo.mIsSslConn = false;\r
-            mServerInfo.mVersion = null;\r
-            mServerInfo.mBaseUrl = \r
-                    normalizeUrl(mHostUrlInput.getText().toString(), mServerInfo.mIsSslConn);    // TODO remove?\r
-                    */\r
             mServerInfo = new GetServerInfoOperation.ServerInfo();  \r
 \r
             // update status icon and text\r
@@ -1754,7 +1739,7 @@ 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 <= Integer.MAX_VALUE) {\r
             mOperationsServiceBinder.dispatchResultIfFinished((int)mWaitingForOpId, this);\r
@@ -1779,7 +1764,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         @Override\r
         public void onServiceConnected(ComponentName component, IBinder service) {\r
             if (component.equals(new ComponentName(AuthenticatorActivity.this, OperationsService.class))) {\r
-                Log_OC.wtf(TAG, "Operations service connected");\r
+                //Log_OC.wtf(TAG, "Operations service connected");\r
                 mOperationsServiceBinder = (OperationsServiceBinder) service;\r
                 \r
                 doOnResumeAndBound();\r