diff --git a/app/src/main/java/com/etesync/syncadapter/ui/setup/BaseConfigurationFinder.kt b/app/src/main/java/com/etesync/syncadapter/ui/setup/BaseConfigurationFinder.kt index 4ece9937..7b58aa47 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/setup/BaseConfigurationFinder.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/setup/BaseConfigurationFinder.kt @@ -70,10 +70,10 @@ class BaseConfigurationFinder(protected val context: Context, protected val cred val userInfoManager = UserInfoManager(authenticatedHttpClient, uri.toHttpUrlOrNull()!!) userInfo = userInfoManager.fetch(credentials.userName) } catch (e: Exceptions.HttpException) { - Logger.log.warning(e.message) + Logger.log.warning(e.localizedMessage) exception = e } catch (e: IOException) { - Logger.log.warning(e.message) + Logger.log.warning(e.localizedMessage) exception = e } @@ -98,6 +98,7 @@ class BaseConfigurationFinder(protected val context: Context, protected val cred val etebase = Account.login(client, credentials.userName, credentials.password) etebaseSession = etebase.save(null) } catch (e: EtebaseException) { + Logger.log.warning(e.localizedMessage) exception = e } @@ -114,8 +115,10 @@ class BaseConfigurationFinder(protected val context: Context, protected val cred fun findInitialConfiguration(): Configuration { try { if (isServerEtebase()) { + Logger.log.fine("Attempting to login to etebase") return findInitialConfigurationEtebase() } else { + Logger.log.fine("Attempting to login to EteSync legacy") return findInitialConfigurationLegacy() } } catch (e: Exception) { diff --git a/app/src/main/java/com/etesync/syncadapter/ui/setup/DetectConfigurationFragment.kt b/app/src/main/java/com/etesync/syncadapter/ui/setup/DetectConfigurationFragment.kt index 28059cac..74d9a409 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/setup/DetectConfigurationFragment.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/setup/DetectConfigurationFragment.kt @@ -39,6 +39,7 @@ class DetectConfigurationFragment : DialogFragment(), LoaderManager.LoaderCallba override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + Logger.log.fine("DetectConfigurationFragment: loading") loaderManager.initLoader(0, arguments, this) } @@ -49,17 +50,20 @@ class DetectConfigurationFragment : DialogFragment(), LoaderManager.LoaderCallba override fun onLoadFinished(loader: Loader, data: Configuration?) { if (data != null) { if (data.isFailed) { + Logger.log.warning("Failed login configuration ${data.error?.localizedMessage}") // no service found: show error message requireFragmentManager().beginTransaction() .add(NothingDetectedFragment.newInstance(data.error!!.localizedMessage), null) .commitAllowingStateLoss() } else if (data.isLegacy) { // legacy service found: continue + Logger.log.info("Found legacy account - asking for encryption details") requireFragmentManager().beginTransaction() .replace(android.R.id.content, EncryptionDetailsFragment.newInstance(data)) .addToBackStack(null) .commitAllowingStateLoss() } else { + Logger.log.info("Found Etebase account account") requireFragmentManager().beginTransaction() .replace(android.R.id.content, CreateAccountFragment.newInstance(data)) .addToBackStack(null)