Fix high flakiness of InsetsPolicyTest
The spy() will return a different instance. The caller who doesn't use the instance will only update its own fields. The test app window was default non-focusable set up by test. So it was no problem before the change [1], that there will be no candidate window in updateSystemBarAttributes. Now updateSystemBarAttributes will choose the app window and then updateBarControlTarget(). That causes abortTransient() because focus change. And the focus change is because the policy.updateBarControlTarget updated to a different instance of InsetsPolicy#mFocusedWin. [1] I957e1eddcfa3f7b873f7a9b32eeaf69db5927b00 Bug: 254268165 Test: atest InsetsPolicyTest Change-Id: I21eb14313cc848894b6be3aafc4965a42c10ae0d
Loading
Please register or sign in to comment