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

Commit 2c06c196 authored by Dmitri Plotnikov's avatar Dmitri Plotnikov Committed by Automerger Merge Worker
Browse files

Merge "Fix BatteryStatsImplTest." into sc-dev am: 4162c032 am: d6956bc2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15291010

Change-Id: I19bc29d6bf83c8d077e9b8961fcc41100edf3f27
parents cde82d50 d6956bc2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1106,8 +1106,9 @@ public class BatteryStatsImpl extends BatteryStats {
    @VisibleForTesting
    protected PowerProfile mPowerProfile;
    @VisibleForTesting
    @GuardedBy("this")
    final Constants mConstants;
    protected final Constants mConstants;
    /*
     * Holds a SamplingTimer associated with each Resource Power Manager state and voter,
+2 −3
Original line number Diff line number Diff line
@@ -69,11 +69,11 @@ public class BatteryStatsImplTest {
        when(mKernelSingleUidTimeReader.singleUidCpuTimesAvailable()).thenReturn(true);
        mBatteryStatsImpl = new MockBatteryStatsImpl()
                .setKernelCpuUidFreqTimeReader(mKernelUidCpuFreqTimeReader)
                .setKernelSingleUidTimeReader(mKernelSingleUidTimeReader);
                .setKernelSingleUidTimeReader(mKernelSingleUidTimeReader)
                .setTrackingCpuByProcStateEnabled(true);
    }

    @Test
    @SkipPresubmit("b/180015146")
    public void testUpdateProcStateCpuTimes() {
        mBatteryStatsImpl.setOnBatteryInternal(true);
        mBatteryStatsImpl.updateTimeBasesLocked(false, Display.STATE_ON, 0, 0);
@@ -231,7 +231,6 @@ public class BatteryStatsImplTest {
    }

    @Test
    @SkipPresubmit("b/180015146")
    public void testCopyFromAllUidsCpuTimes() {
        mBatteryStatsImpl.setOnBatteryInternal(false);
        mBatteryStatsImpl.updateTimeBasesLocked(false, Display.STATE_ON, 0, 0);
+5 −0
Original line number Diff line number Diff line
@@ -174,6 +174,11 @@ public class MockBatteryStatsImpl extends BatteryStatsImpl {
        return this;
    }

    public MockBatteryStatsImpl setTrackingCpuByProcStateEnabled(boolean enabled) {
        mConstants.TRACK_CPU_TIMES_BY_PROC_STATE = enabled;
        return this;
    }

    public SparseIntArray getPendingUids() {
        return mPendingUids;
    }