Test: Fix flaky PhonePolicyTest and ActiveDeviceManagerTest
* PhonePolicyTest needs to stub A2dpService.connect() and HeadsetService.connect() methods for it to pass stably * Fixed a miscounted frequency for HeadsetService.setPriority() in PhonePolicyTes.testDisconnectNoAutoConnect(). * Fixed a race condition in ActiveDeviceManagerTest where dependency calls such as HearingAidService.setActiveDevice() happens before internal state such as mHearingAidActiveDevice is set. The fix requires ActiveDeviceManagerTest to wait for ActiveDeviceManager's handler looper to finish executing scheduled tasks before checking any internal states Bug: 80437170 Test: run PhonePolicyTest, ActiveDeviceManagerTest 100 times Change-Id: Iece11914c4c7f7c54abcbf78caa7ddd2ba1d740f (cherry picked from commit 4afa9552)
Loading
Please register or sign in to comment