[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
Loading
Please register or sign in to comment