[fenix] For https://github.com/mozilla-mobile/fenix/issues/26511: Parallelize work...
commit759f7e2200fceb9506d5871c6bf03eecaa2062d5
authorMugurell <Mugurell@users.noreply.github.com>
Fri, 2 Sep 2022 10:39:56 +0000 (2 13:39 +0300)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 9 Sep 2022 13:36:09 +0000 (9 13:36 +0000)
tree31ded2042c7c8c1c9511670986a1a8c8c1aca42b
parentbd84f2f697035267fa39450fbf245c0e3c2e8940
[fenix] For https://github.com/mozilla-mobile/fenix/issues/26511: Parallelize work for setting the wallpaper

Split loading the bitmap from storage and actually setting it in two operations
with one that can run in parallel with onCreateView for HomeFragment and one
that can be used serially on the main thread to actually set the wallpaper.

This seems like the best compromise to ensure that everytime the homescreen is
shown it will have the wallpaper set but does affect the performance - there is
a delay in showing HomeFragment to account for waiting for the wallpaper to be
set.
In testing the new delay seems close to the one from the initial wallpapers
implementation. See more in https://github.com/mozilla-mobile/fenix/pull/26794.
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/WallpapersObserver.kt
mobile/android/fenix/app/src/test/java/org/mozilla/fenix/home/WallpapersObserverTest.kt