Fix a race condition in DeviceIdleControllerTest.
I noticed that the real ACTION_BATTERY_CHANGED races against the mocked calls to update power state and cycle through idle states. This actually works on a high-end phone or an emulator because the sticky broadcast goes through before the test finishes setting up. But on a slower device we sometimes beat the broadcast queue and wind up getting our state reset halfway through the test. Flaky tests are bad so let's not listen to broadcasts at all in the test. May address issue 118639768 [DeviceIdleControllerTest is flaky]. Bug: 110756616 Bug: 118639768 Test: atest com.android.server.DeviceIdleControllerTest Change-Id: Ie03ed10f2781ccaba4f39f4f34673a3e073e9f7f
Loading
Please register or sign in to comment