Merge branch 'master' into develop
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / AuthenticatorActivity.java
index 97dcfde..8d7182d 100644 (file)
@@ -85,6 +85,7 @@ import com.owncloud.android.ui.dialog.IndeterminateProgressDialog;
 import com.owncloud.android.ui.dialog.SamlWebViewDialog;\r
 import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;\r
 import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener;\r
 import com.owncloud.android.ui.dialog.SamlWebViewDialog;\r
 import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;\r
 import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener;\r
+import com.owncloud.android.utils.DisplayUtils;\r
 \r
 /**\r
  * This Activity is used to add an ownCloud account to the App\r
 \r
 /**\r
  * This Activity is used to add an ownCloud account to the App\r
@@ -356,7 +357,8 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         \r
         /// step 2 - set properties of UI elements (text, visibility, enabled...)\r
         mHostUrlInput = (EditText) findViewById(R.id.hostUrlInput);\r
         \r
         /// step 2 - set properties of UI elements (text, visibility, enabled...)\r
         mHostUrlInput = (EditText) findViewById(R.id.hostUrlInput);\r
-        mHostUrlInput.setText(mServerInfo.mBaseUrl);\r
+        // Convert IDN to Unicode\r
+        mHostUrlInput.setText(DisplayUtils.convertIdn(mServerInfo.mBaseUrl, false));\r
         if (mAction != ACTION_CREATE) {\r
             /// lock things that should not change\r
             mHostUrlInput.setEnabled(false);\r
         if (mAction != ACTION_CREATE) {\r
             /// lock things that should not change\r
             mHostUrlInput.setEnabled(false);\r
@@ -681,7 +683,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         \r
         if (mOperationsServiceBinder != null) {\r
             //Log_OC.wtf(TAG, "getting access token..." );\r
         \r
         if (mOperationsServiceBinder != null) {\r
             //Log_OC.wtf(TAG, "getting access token..." );\r
-            mWaitingForOpId = mOperationsServiceBinder.newOperation(getServerInfoIntent);\r
+            mWaitingForOpId = mOperationsServiceBinder.queueNewOperation(getServerInfoIntent);\r
         }\r
     }\r
 \r
         }\r
     }\r
 \r
@@ -737,6 +739,8 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         showRefreshButton(false);\r
         \r
         if (uri.length() != 0) {\r
         showRefreshButton(false);\r
         \r
         if (uri.length() != 0) {\r
+            // Handle internationalized domain names\r
+            uri = DisplayUtils.convertIdn(uri, true);\r
             mServerStatusText = R.string.auth_testing_connection;\r
             mServerStatusIcon = R.drawable.progress_small;\r
             showServerStatus();\r
             mServerStatusText = R.string.auth_testing_connection;\r
             mServerStatusIcon = R.drawable.progress_small;\r
             showServerStatus();\r
@@ -748,7 +752,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
                 normalizeUrlSuffix(uri)\r
             );\r
             if (mOperationsServiceBinder != null) {\r
                 normalizeUrlSuffix(uri)\r
             );\r
             if (mOperationsServiceBinder != null) {\r
-                mWaitingForOpId = mOperationsServiceBinder.newOperation(getServerInfoIntent);\r
+                mWaitingForOpId = mOperationsServiceBinder.queueNewOperation(getServerInfoIntent);\r
             } else {\r
               Log_OC.wtf(TAG, "Server check tried with OperationService unbound!" );\r
             }\r
             } else {\r
               Log_OC.wtf(TAG, "Server check tried with OperationService unbound!" );\r
             }\r
@@ -884,7 +888,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         \r
         if (mOperationsServiceBinder != null) {\r
             //Log_OC.wtf(TAG, "starting existenceCheckRemoteOperation..." );\r
         \r
         if (mOperationsServiceBinder != null) {\r
             //Log_OC.wtf(TAG, "starting existenceCheckRemoteOperation..." );\r
-            mWaitingForOpId = mOperationsServiceBinder.newOperation(existenceCheckIntent);\r
+            mWaitingForOpId = mOperationsServiceBinder.queueNewOperation(existenceCheckIntent);\r
         }\r
     }\r
 \r
         }\r
     }\r
 \r
@@ -1016,12 +1020,11 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         dismissDialog(WAIT_DIALOG_TAG);\r
 
         if (result.isIdPRedirection()) {
         dismissDialog(WAIT_DIALOG_TAG);\r
 
         if (result.isIdPRedirection()) {
-            String url = result.getRedirectedLocation();\r
             String targetUrl = mServerInfo.mBaseUrl \r
                     + AccountUtils.getWebdavPath(mServerInfo.mVersion, mAuthTokenType);\r
 \r
             // Show dialog\r
             String targetUrl = mServerInfo.mBaseUrl \r
                     + AccountUtils.getWebdavPath(mServerInfo.mVersion, mAuthTokenType);\r
 \r
             // Show dialog\r
-            SamlWebViewDialog dialog = SamlWebViewDialog.newInstance(url, targetUrl);            \r
+            SamlWebViewDialog dialog = SamlWebViewDialog.newInstance(targetUrl, targetUrl);            \r
             dialog.show(getSupportFragmentManager(), SAML_DIALOG_TAG);\r
 \r
             mAuthStatusIcon = 0;\r
             dialog.show(getSupportFragmentManager(), SAML_DIALOG_TAG);\r
 \r
             mAuthStatusIcon = 0;\r
@@ -1700,7 +1703,7 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         \r
         if (mOperationsServiceBinder != null) {\r
             //Log_OC.wtf(TAG, "starting getRemoteUserNameOperation..." );\r
         \r
         if (mOperationsServiceBinder != null) {\r
             //Log_OC.wtf(TAG, "starting getRemoteUserNameOperation..." );\r
-            mWaitingForOpId = mOperationsServiceBinder.newOperation(getUserNameIntent);\r
+            mWaitingForOpId = mOperationsServiceBinder.queueNewOperation(getUserNameIntent);\r
         }\r
     }\r
 \r
         }\r
     }\r
 \r