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

Commit 764205f9 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

chore: try to remove callback

parent b137fb3c
Loading
Loading
Loading
Loading
Loading
+1 −17
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ class ReLoginWithOidcActivity : AppCompatActivity() {
                null,
                null,
                this,
                { future -> startAddAccount(future) },
                null,
                null
            )
        } catch (exception: AuthenticatorException) {
@@ -77,22 +77,6 @@ class ReLoginWithOidcActivity : AppCompatActivity() {
            Logger.log.info("Vincent: catch unexpected exception: ${exception.message}")
        }
    }


    private fun startAddAccount(future: AliasFuture) {
        val result = future.result?: run {
            Logger.log.info("Vincent: Can't add new account: future.result is null")
            return
        }

        val accountName = result.getString(KEY_ACCOUNT_NAME)
        val accountType = result.getString(KEY_ACCOUNT_TYPE, "unexepected account type")

        if (accountName != null) {
            Logger.log.info("Vincent: ($accountType) account added: $accountName")
        }
        finish()
    }
}

typealias AliasFuture = AccountManagerFuture<Bundle>