Fix test flakiness.
The test tests a part of the asynchronous code but didn't lock around
critical calls itself, which led to race conditions and resulting test
flakes.
Bug: 171095356
Test: atest --rerun-until-failure 50 com.android.server.job.controllers.QuotaControllerTest#testTimerTracking_ForegroundAndBackground
Test: atest --rerun-until-failure 50 com.android.server.job.controllers.QuotaControllerTest#testTimerTracking_TopAndNonTop
Test: atest --rerun-until-failure 5 com.android.server.job.controllers.QuotaControllerTest
Change-Id: I66f0a04ca2ee1382d9cf44756449360043f3b303
1 file changed