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

Commit 40b68c07 authored by Merissa Mitchell's avatar Merissa Mitchell
Browse files

[WindowDecor] Move WindowDecorTaskResourceLoader calls to main thread

This CL makes the following changes:
- Combine getName and getHeaderIcon since they are always called
  together by their callers
- getNameAndHeaderIcon and getVeilIcon are now run on the main thread
  instead of the background thread. If the resource is not cached,
loadAppResources is run on the background thread. The result is then
returned on the main thread.

This eliminates the following race condition:
1) WindowDecor created, relayout called for the first time and schedules
   the loading of resources (including checking the cache) in the
background thread
2) WindowDecor destroyed while the callback for loading the resources
   has not finished
3) When the callback is finally run, the WindowDecor no longer exists,
   and checkWindowDecorExists throws an IllegalStateException

Test: atest WMShellUnitTests:com.android.wm.shell.windowdecor
Bug: 425315974
Flag: EXEMPT bugfix
Change-Id: Icad26c7641bb4d890318614e77f768d23b9c5d7b
parent 97d8da20
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment