AzureAD / microsoft-authentication-library-common-for-android

Common code used by both the Active Directory Authentication Library (ADAL) and the Microsoft Authentication Library (MSAL)
MIT License
41 stars 35 forks source link

Move the getActiveBroker() invocation to background thread #2352

Closed rpdome closed 6 months ago

rpdome commented 7 months ago

Why?

Once the BrokerDiscoveryClientFactory.IS_NEW_DISCOVERY_ENABLED is set to true, the getActiveBroker() operation could be long running (due to the first time broker discovery operation).

In order to avoid ANR issue (in MSAL), I'm moving the operation to the background thread.

This is done by making all the commands retrieve MSAL Controllers in its execute() block, which is executed by CommandDispatcher.

Changes