Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Fix AccountUi lag #919

Merged
merged 2 commits into from
Jun 1, 2022
Merged

Fix AccountUi lag #919

merged 2 commits into from
Jun 1, 2022

Conversation

janbina
Copy link
Contributor

@janbina janbina commented Jun 1, 2022

There is a massive UI lag when opening the AccountUi dialog, which is caused by the AppAuth's AuthorizationService:

AuthorizationService will create a bound service connection to the browser in order to perform a "warm up" that makes the custom tab load faster. As such, you should create your AuthorizationService instance early in your activity's lifecycle to benefit from this warmup, and not at the moment at which you click "sign in".
openid/AppAuth-Android#328

As of now, ActivityTraktAuthManager::buildLoginIntent is called right after AccountUi dialog is opened.
I modified LoginTrakt and TraktAuthManager such that buildLoginIntent is only called after user clicks the login button and the ActivityTraktAuthManager such that AuthorizationService is not initialized lazily.

Copy link
Owner

@chrisbanes chrisbanes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great detective work! Thanks

@chrisbanes chrisbanes enabled auto-merge (squash) June 1, 2022 00:30
@chrisbanes chrisbanes merged commit bee3200 into chrisbanes:main Jun 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants