Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken caching behavior in SplashImageTransferTask on dark / light mode switches #461

Open
uwolfer opened this issue Mar 4, 2024 · 0 comments

Comments

@uwolfer
Copy link

uwolfer commented Mar 4, 2024

In case you provide both normal (light) and dark (night) mode resources for your slash screen, SplashImageTransferTask does not work as expected: it keeps the splash screen for the previous mode. The only workaround is reinstalling the app.

To Reproduce

  1. Add a folder res/drawable-night next to the existing res/drawable folder with a splash.png file.
  2. Toggle the device color schema mode (light / dark).
  3. The splash displayed shows still the "old" splash image.

I think I was able to find the cause of this issue:
https://github.com/GoogleChrome/android-browser-helper/blob/main/androidbrowserhelper/src/main/java/com/google/androidbrowserhelper/trusted/splashscreens/SplashImageTransferTask.java#L107 checks the last app update time, and compares it with the persisted time when the splash got last cached (PREF_LAST_UPDATE_TIME). That means for the case when you update the color schema of your device, but you do not reinstall the app, it will take the shortcut and use the already cached splash setup.

Expected behavior
Whenever the user changes color schema of their device, the proper splash should be rendered.

khmyznikov added a commit to khmyznikov/android-browser-helper that referenced this issue Mar 10, 2024
Trying to address this bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant