Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 152b6353 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

chore: add debug instruction

parent a42d22e4
Loading
Loading
Loading
Loading
Loading
+16 −6
Original line number Diff line number Diff line
@@ -17,10 +17,9 @@ import at.bitfire.davdroid.log.Logger

class ReLoginWithOidcActivity : AppCompatActivity() {

    private var needLogout = true

    override fun onStart() {
        super.onStart()
        Logger.log.info("Vincent: onStart()")

        val accountName = intent?.extras?.getString(KEY_ACCOUNT_NAME, null) ?: run {
            finish()
@@ -28,9 +27,17 @@ class ReLoginWithOidcActivity : AppCompatActivity() {
        }

        Logger.log.info("Vincent: onStart() call and gonna logout account")
        if (needLogout) {
        logoutAccount(accountName)
    }

    override fun onStop() {
        super.onStop()
        Logger.log.info("Vincent: onStop()")
    }

    override fun onDestroy() {
        super.onDestroy()
        Logger.log.info("Vincent: onDestroy()")
    }

    private fun logoutAccount(accountName: String)
@@ -43,7 +50,7 @@ class ReLoginWithOidcActivity : AppCompatActivity() {
            val success = future.result.getBoolean(KEY_BOOLEAN_RESULT)

            if (success) {
                needLogout = false
                Logger.log.info("Vincent: Account removed. Now will sign in again with OIDC")
                loginAccount(eAccountType)
            } else {
                Logger.log.info("failed to remove account: $accountName ")
@@ -55,6 +62,7 @@ class ReLoginWithOidcActivity : AppCompatActivity() {
        eAccounts.firstOrNull() {
            it.name == accountName
        } ?.run {
            Logger.log.info("Vincent: about to call accountManager.removeAccount")
            accountManager.removeAccount(this, activity, callback, null)
        } ?: finish()
    }
@@ -64,7 +72,9 @@ class ReLoginWithOidcActivity : AppCompatActivity() {

        val callback: (AliasFuture) -> Unit = { future ->
            val intent = getIntentFromFuture(future)
            Logger.log.info("Vincent: callback for login account. About to start intent(is null ?: ${intent == null})")
            intent?.let(::startActivity)
            Logger.log.info("Vincent: callback for login account. Intent started. About to finish ${this.javaClass}")
            finish()
        }