Modify DetectAuthenticationMethodOperation so that , when returning its result throug...
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / AuthenticatorActivity.java
index 638b5dd..074751e 100644 (file)
@@ -518,7 +518,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         // refresh button enabled\r
         outState.putBoolean(KEY_REFRESH_BUTTON_ENABLED, (mRefreshButton.getVisibility() == View.VISIBLE));\r
 \r
-\r
     }\r
 \r
 \r
@@ -539,6 +538,26 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
     }\r
 \r
 \r
+    @Override \r
+    protected void onStart() {\r
+        if (mOperationsServiceBinder != null) {\r
+            mOperationsServiceBinder.addOperationListener(AuthenticatorActivity.this, mHandler);\r
+        }\r
+        \r
+        super.onStart();\r
+    }\r
+    \r
+    \r
+    @Override \r
+    protected void onStop() {\r
+        if (mOperationsServiceBinder != null) {\r
+            mOperationsServiceBinder.removeOperationListener(this);\r
+        }\r
+        super.onStop();\r
+    }\r
+    \r
+\r
+\r
     /**\r
      * The redirection triggered by the OAuth authentication server as response to the GET AUTHORIZATION, and \r
      * deferred in {@link #onNewIntent(Intent)}, is processed here.\r
@@ -1014,11 +1033,14 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
     private void detectAuthorizationMethod() {\r
 \r
         Log_OC.d(TAG, "Trying empty authorization to detect authentication method");\r
-\r
+        \r
+        String webdav_path = AccountUtils.getWebdavPath(mDiscoveredVersion, mAuthTokenType);\r
+        \r
         /// test credentials \r
-        Intent service = new Intent(this, OperationsService.class);\r
+        Intent service = new Intent(this, OperationsService.class);        \r
         service.setAction(OperationsService.ACTION_DETECT_AUTHENTICATION_METHOD);\r
         service.putExtra(OperationsService.EXTRA_SERVER_URL, mHostBaseUrl);\r
+        service.putExtra(OperationsService.EXTRA_WEBDAV_PATH, webdav_path);\r
         startService(service);\r
     }\r
 \r