Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9260fa2 authored by Xin Guan's avatar Xin Guan
Browse files

JobScheduler: Fix flaky for QuotaControllerTest

Bug: 376215124
Test: atest --rerun-until-failure 500 QuotaControllerTest
Flag: EXEMPT test fix
FrameworksMockingServicesTests: com.android.server.job.controllers.QuotaControllerTest
Change-Id: I2d5441436c2a8d98cc27313ae605093eb47e5b21
parent fb66a266
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -295,15 +295,15 @@ public class QuotaControllerTest {
    }

    private void setCharging() {
        doReturn(true).when(mJobSchedulerService).isBatteryCharging();
        synchronized (mQuotaController.mLock) {
            doReturn(true).when(mJobSchedulerService).isBatteryCharging();
            mQuotaController.onBatteryStateChangedLocked();
        }
    }

    private void setDischarging() {
        doReturn(false).when(mJobSchedulerService).isBatteryCharging();
        synchronized (mQuotaController.mLock) {
            doReturn(false).when(mJobSchedulerService).isBatteryCharging();
            mQuotaController.onBatteryStateChangedLocked();
        }
    }