Home
last modified time | relevance | path

Searched refs:uidConsumer (Results 1 – 6 of 6) sorted by relevance

/frameworks/base/services/tests/powerstatstests/src/com/android/server/power/stats/
DWifiPowerCalculatorTest.java157 UidBatteryConsumer uidConsumer = mStatsRule.getUidBatteryConsumer(APP_UID); in testPowerControllerBasedModel_nonMeasured() local
158 assertThat(uidConsumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_WIFI)) in testPowerControllerBasedModel_nonMeasured()
160 assertThat(uidConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_WIFI)) in testPowerControllerBasedModel_nonMeasured()
162 assertThat(uidConsumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_WIFI)) in testPowerControllerBasedModel_nonMeasured()
212 UidBatteryConsumer uidConsumer = mStatsRule.getUidBatteryConsumer(APP_UID); in testPowerControllerBasedModel_powerProfile_byProcessState() local
213 assertThat(uidConsumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_WIFI)) in testPowerControllerBasedModel_powerProfile_byProcessState()
215 assertThat(uidConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_WIFI)) in testPowerControllerBasedModel_powerProfile_byProcessState()
217 assertThat(uidConsumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_WIFI)) in testPowerControllerBasedModel_powerProfile_byProcessState()
220 final BatteryConsumer.Key foreground = uidConsumer.getKey( in testPowerControllerBasedModel_powerProfile_byProcessState()
223 final BatteryConsumer.Key background = uidConsumer.getKey( in testPowerControllerBasedModel_powerProfile_byProcessState()
[all …]
DBluetoothPowerCalculatorTest.java142 UidBatteryConsumer uidConsumer = mStatsRule.getUidBatteryConsumer(APP_UID); in testTimerBasedModel_byProcessState() local
143 assertThat(uidConsumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_BLUETOOTH)) in testTimerBasedModel_byProcessState()
145 assertThat(uidConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_BLUETOOTH)) in testTimerBasedModel_byProcessState()
147 assertThat(uidConsumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_BLUETOOTH)) in testTimerBasedModel_byProcessState()
150 final BatteryConsumer.Key foreground = uidConsumer.getKey( in testTimerBasedModel_byProcessState()
153 final BatteryConsumer.Key background = uidConsumer.getKey( in testTimerBasedModel_byProcessState()
156 final BatteryConsumer.Key fgs = uidConsumer.getKey( in testTimerBasedModel_byProcessState()
159 final BatteryConsumer.Key cached = uidConsumer.getKey( in testTimerBasedModel_byProcessState()
163 assertThat(uidConsumer.getConsumedPower(foreground)).isWithin(PRECISION).of(0.081); in testTimerBasedModel_byProcessState()
164 assertThat(uidConsumer.getConsumedPower(background)).isWithin(PRECISION).of(0.0416666); in testTimerBasedModel_byProcessState()
[all …]
DMobileRadioPowerCalculatorTest.java185 UidBatteryConsumer uidConsumer = mStatsRule.getUidBatteryConsumer(APP_UID); in testCounterBasedModel() local
186 assertThat(uidConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)) in testCounterBasedModel()
188 assertThat(uidConsumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)) in testCounterBasedModel()
195 assertThat(uidConsumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)) in testCounterBasedModel()
342 UidBatteryConsumer uidConsumer = mStatsRule.getUidBatteryConsumer(APP_UID); in testCounterBasedModel_multipleDefinedRat() local
343 assertThat(uidConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)) in testCounterBasedModel_multipleDefinedRat()
345 assertThat(uidConsumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)) in testCounterBasedModel_multipleDefinedRat()
352 assertThat(uidConsumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)) in testCounterBasedModel_multipleDefinedRat()
462 UidBatteryConsumer uidConsumer = mStatsRule.getUidBatteryConsumer(APP_UID); in testCounterBasedModel_legacyPowerProfile() local
463 assertThat(uidConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)) in testCounterBasedModel_legacyPowerProfile()
[all …]
/frameworks/base/core/tests/batterystatstests/BatteryUsageStatsProtoTests/src/com/android/internal/os/
DBatteryUsageStatsPulledTest.java190 android.os.UidBatteryConsumer uidConsumer, in assertSameUidBatteryConsumer() argument
195 assertEquals("Uid consumers had mismatched uids", uid, uidConsumer.getUid()); in assertSameUidBatteryConsumer()
198 uidConsumer.getTimeInStateMs(android.os.UidBatteryConsumer.STATE_FOREGROUND), in assertSameUidBatteryConsumer()
201 uidConsumer.getTimeInStateMs(android.os.UidBatteryConsumer.STATE_BACKGROUND), in assertSameUidBatteryConsumer()
204 final long timeInStateMillis = uidConsumer.getTimeInProcessStateMs(processState); in assertSameUidBatteryConsumer()
221 uidConsumer, in assertSameUidBatteryConsumer()
/frameworks/base/services/core/java/com/android/server/am/
DAppBatteryTracker.java711 for (UidBatteryConsumer uidConsumer : uidConsumers) { in updateBatteryUsageStatsOnceInternal()
714 final int rawUid = uidConsumer.getUid(); in updateBatteryUsageStatsOnceInternal()
727 final BatteryUsage bgUsage = new BatteryUsage(uidConsumer, bgPolicy) in updateBatteryUsageStatsOnceInternal()
1143 private static double getConsumedPowerNoThrow(final UidBatteryConsumer uidConsumer, in getConsumedPowerNoThrow() argument
1146 return uidConsumer.getConsumedPower(dimens); in getConsumedPowerNoThrow()
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/am/
DBackgroundRestrictionTest.java2677 UidBatteryConsumer uidConsumer = mock(UidBatteryConsumer.class);
2678 doReturn(uid).when(uidConsumer).getUid();
2679 doReturn(bg).when(uidConsumer).getConsumedPower(
2681 doReturn(fgs).when(uidConsumer).getConsumedPower(
2683 doReturn(fg).when(uidConsumer).getConsumedPower(
2685 doReturn(cached).when(uidConsumer).getConsumedPower(
2687 return uidConsumer;