Home
last modified time | relevance | path

Searched refs:batteryStats (Results 1 – 25 of 46) sorted by relevance

12

/frameworks/base/services/tests/powerstatstests/src/com/android/server/power/stats/
DBatteryUsageStatsProviderTest.java95 BatteryStatsImpl batteryStats = prepareBatteryStats(); in test_getBatteryUsageStats() local
101 provider.getBatteryUsageStats(batteryStats, BatteryUsageStatsQuery.DEFAULT); in test_getBatteryUsageStats()
131 BatteryStatsImpl batteryStats = prepareBatteryStats(); in test_selectPowerComponents() local
137 provider.getBatteryUsageStats(batteryStats, in test_selectPowerComponents()
157 BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats(); in prepareBatteryStats() local
160 synchronized (batteryStats) { in prepareBatteryStats()
161 batteryStats.noteActivityResumedLocked(APP_UID); in prepareBatteryStats()
165 synchronized (batteryStats) { in prepareBatteryStats()
166 batteryStats.noteUidProcessStateLocked(APP_UID, ActivityManager.PROCESS_STATE_TOP); in prepareBatteryStats()
169 synchronized (batteryStats) { in prepareBatteryStats()
[all …]
DScreenPowerCalculatorTest.java62 BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats(); in testMeasuredEnergyBasedModel() local
64 batteryStats.noteScreenStateLocked(0, Display.STATE_ON, 0, 0, 0); in testMeasuredEnergyBasedModel()
65 batteryStats.updateDisplayEnergyConsumerStatsLocked(new long[]{0}, in testMeasuredEnergyBasedModel()
70 batteryStats.updateDisplayEnergyConsumerStatsLocked(new long[]{200_000_000}, in testMeasuredEnergyBasedModel()
79 batteryStats.updateDisplayEnergyConsumerStatsLocked(new long[]{300_000_000}, in testMeasuredEnergyBasedModel()
82 batteryStats.noteScreenStateLocked(0, Display.STATE_OFF, in testMeasuredEnergyBasedModel()
87 batteryStats.updateDisplayEnergyConsumerStatsLocked(new long[]{100_000_000}, in testMeasuredEnergyBasedModel()
149 BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats(); in testMeasuredEnergyBasedModel_multiDisplay() local
153 batteryStats.noteScreenStateLocked(0, screenStates[0], 0, 0, 0); in testMeasuredEnergyBasedModel_multiDisplay()
154 batteryStats.noteScreenStateLocked(1, screenStates[1], 0, 0, 0); in testMeasuredEnergyBasedModel_multiDisplay()
[all …]
DBatteryChargeCalculatorTest.java61 final BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats(); in testDischargeTotals() local
63 synchronized (batteryStats) { in testDischargeTotals()
64 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals()
67 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals()
70 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals()
92 synchronized (batteryStats) { in testDischargeTotals()
93 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_CHARGING, 100, in testDischargeTotals()
104 final BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats(); in testDischargeTotals_chargeUahUnavailable() local
106 synchronized (batteryStats) { in testDischargeTotals_chargeUahUnavailable()
107 batteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100, in testDischargeTotals_chargeUahUnavailable()
[all …]
DWifiPowerCalculatorTest.java83 BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats(); in setupTestNetworkNumbers() local
85 batteryStats.noteNetworkInterfaceForTransports("wifi", in setupTestNetworkNumbers()
90 return batteryStats; in setupTestNetworkNumbers()
145 final BatteryStatsImpl batteryStats = setupTestNetworkNumbers(); in testPowerControllerBasedModel_nonMeasured() local
148 batteryStats.noteWifiScanStartedLocked(APP_UID, 500, 500); in testPowerControllerBasedModel_nonMeasured()
149 batteryStats.noteWifiScanStoppedLocked(APP_UID, 1500, 1500); in testPowerControllerBasedModel_nonMeasured()
151 batteryStats.updateWifiState(energyInfo, POWER_DATA_UNAVAILABLE, 2000, 2000, in testPowerControllerBasedModel_nonMeasured()
182 final BatteryStatsImpl batteryStats = setupTestNetworkNumbers(); in testPowerControllerBasedModel_powerProfile_byProcessState() local
186 BatteryStatsImpl.Uid uid = batteryStats.getUidStatsLocked(APP_UID); in testPowerControllerBasedModel_powerProfile_byProcessState()
190 batteryStats.updateWifiState(buildWifiActivityEnergyInfo(2000, in testPowerControllerBasedModel_powerProfile_byProcessState()
[all …]
DCustomEnergyConsumerPowerCalculatorTest.java53 final BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats(); in testMeasuredEnergyCopiedIntoBatteryConsumers() local
56 batteryStats.getUidStatsLocked(APP_UID); in testMeasuredEnergyCopiedIntoBatteryConsumers()
60 batteryStats.updateCustomEnergyConsumerStatsLocked(0, 100_000_000, uidEnergies); in testMeasuredEnergyCopiedIntoBatteryConsumers()
63 batteryStats.updateCustomEnergyConsumerStatsLocked(1, 200_000_000, uidEnergies); in testMeasuredEnergyCopiedIntoBatteryConsumers()
DBluetoothPowerCalculatorTest.java70 BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats(); in testTimerBasedModel() local
73 batteryStats.noteBluetoothScanStartedFromSourceLocked(ws, false, 0, 0); in testTimerBasedModel()
74 batteryStats.noteBluetoothScanStoppedFromSourceLocked(ws, false, 1000, 1000); in testTimerBasedModel()
101 BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats(); in testTimerBasedModel_byProcessState() local
103 BatteryStatsImpl.Uid uid = batteryStats.getUidStatsLocked(APP_UID); in testTimerBasedModel_byProcessState()
115 batteryStats.updateBluetoothStateLocked(info1, in testTimerBasedModel_byProcessState()
130 batteryStats.updateBluetoothStateLocked(info2, in testTimerBasedModel_byProcessState()
222 BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats(); in testMeasuredEnergyBasedModel_byProcessState() local
224 BatteryStatsImpl.Uid uid = batteryStats.getUidStatsLocked(APP_UID); in testMeasuredEnergyBasedModel_byProcessState()
237 batteryStats.updateBluetoothStateLocked(info1, in testMeasuredEnergyBasedModel_byProcessState()
[all …]
DWakelockPowerCalculatorTest.java58 BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats(); in testTimerBasedModel() local
60 synchronized (batteryStats) { in testTimerBasedModel()
61 batteryStats.noteStartWakeFromSourceLocked(new WorkSource(APP_UID), APP_PID, "awake", in testTimerBasedModel()
63 batteryStats.noteStopWakeFromSourceLocked(new WorkSource(APP_UID), APP_PID, "awake", in testTimerBasedModel()
DBatteryUsageStatsTest.java267 final MockBatteryStatsImpl batteryStats = new MockBatteryStatsImpl(clocks); in buildBatteryUsageStats1() local
278 addUidBatteryConsumer(builder, batteryStats, APP_UID1, "foo", in buildBatteryUsageStats1()
311 final MockBatteryStatsImpl batteryStats = new MockBatteryStatsImpl(clocks); in buildBatteryUsageStats2() local
321 addUidBatteryConsumer(builder, batteryStats, APP_UID1, null, in buildBatteryUsageStats2()
327 addUidBatteryConsumer(builder, batteryStats, APP_UID2, "bar", in buildBatteryUsageStats2()
347 MockBatteryStatsImpl batteryStats, int uid, String packageWithHighestDrain, in addUidBatteryConsumer() argument
354 final BatteryStatsImpl.Uid batteryStatsUid = batteryStats.getUidStatsLocked(uid); in addUidBatteryConsumer()
/frameworks/base/services/core/java/com/android/server/power/stats/
DBatteryChargeCalculator.java36 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
39 batteryStats.getDischargeAmount(BatteryStats.STATS_SINCE_CHARGED)); in calculate()
41 int batteryCapacityMah = batteryStats.getLearnedBatteryCapacity() / 1000; in calculate()
43 batteryCapacityMah = batteryStats.getMinLearnedBatteryCapacity() / 1000; in calculate()
45 batteryCapacityMah = batteryStats.getEstimatedBatteryCapacity(); in calculate()
51 batteryStats.getLowDischargeAmountSinceCharge() * batteryCapacityMah / 100.0; in calculate()
53 batteryStats.getHighDischargeAmountSinceCharge() * batteryCapacityMah / 100.0; in calculate()
55 batteryStats.getDischargeAmount(BatteryStats.STATS_SINCE_CHARGED)) in calculate()
58 .setDischargeDurationMs(batteryStats.getBatteryRealtime(rawRealtimeUs) / 1000); in calculate()
60 final long batteryTimeRemainingMs = batteryStats.computeBatteryTimeRemaining(rawRealtimeUs); in calculate()
[all …]
DAmbientDisplayPowerCalculator.java53 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
55 final long energyConsumerUC = batteryStats.getScreenDozeEnergyConsumptionUC(); in calculate()
57 final long durationMs = calculateDuration(batteryStats, rawRealtimeUs, in calculate()
59 final double powerMah = calculateTotalPower(powerModel, batteryStats, rawRealtimeUs, in calculate()
68 private long calculateDuration(BatteryStats batteryStats, long rawRealtimeUs, int statsType) { in calculateDuration() argument
69 return batteryStats.getScreenDozeTime(rawRealtimeUs, statsType) / 1000; in calculateDuration()
73 BatteryStats batteryStats, long rawRealtimeUs, long consumptionUC) { in calculateTotalPower() argument
79 return calculateEstimatedPower(batteryStats, rawRealtimeUs); in calculateTotalPower()
83 private double calculateEstimatedPower(BatteryStats batteryStats, long rawRealtimeUs) { in calculateEstimatedPower() argument
87 final long dozeTime = batteryStats.getDisplayScreenDozeTime(display, rawRealtimeUs) in calculateEstimatedPower()
DMemoryPowerCalculator.java46 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
48 final long durationMs = calculateDuration(batteryStats, rawRealtimeUs, in calculate()
50 final double powerMah = calculatePower(batteryStats, rawRealtimeUs, in calculate()
58 private long calculateDuration(BatteryStats batteryStats, long rawRealtimeUs, int statsType) { in calculateDuration() argument
60 LongSparseArray<? extends BatteryStats.Timer> timers = batteryStats.getKernelMemoryStats(); in calculateDuration()
68 private double calculatePower(BatteryStats batteryStats, long rawRealtimeUs, int statsType) { in calculatePower() argument
70 LongSparseArray<? extends BatteryStats.Timer> timers = batteryStats.getKernelMemoryStats(); in calculatePower()
DSystemServicePowerCalculator.java66 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
68 final BatteryStats.Uid systemUid = batteryStats.getUidStats().get(Process.SYSTEM_UID); in calculate()
78 systemServicePowerMah = calculatePowerUsingEnergyConsumption(batteryStats, in calculate()
81 systemServicePowerMah = calculatePowerUsingPowerProfile(batteryStats); in calculate()
120 private double calculatePowerUsingEnergyConsumption(BatteryStats batteryStats, in calculatePowerUsingEnergyConsumption() argument
126 final double systemServiceModeledPowerMah = calculatePowerUsingPowerProfile(batteryStats); in calculatePowerUsingEnergyConsumption()
137 private double calculatePowerUsingPowerProfile(BatteryStats batteryStats) { in calculatePowerUsingPowerProfile() argument
138 final long[] systemServiceTimeAtCpuSpeeds = batteryStats.getSystemServiceTimeAtCpuSpeeds(); in calculatePowerUsingPowerProfile()
DScreenPowerCalculator.java72 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
76 final long consumptionUC = batteryStats.getScreenOnEnergyConsumptionUC(); in calculate()
78 calculateTotalDurationAndPower(totalPowerAndDuration, powerModel, batteryStats, in calculate()
131 @BatteryConsumer.PowerModel int powerModel, BatteryStats batteryStats, in calculateTotalDurationAndPower() argument
133 totalPowerAndDuration.durationMs = calculateDuration(batteryStats, rawRealtimeUs, in calculateTotalDurationAndPower()
142 totalPowerAndDuration.powerMah = calculateTotalPowerFromBrightness(batteryStats, in calculateTotalDurationAndPower()
161 private long calculateDuration(BatteryStats batteryStats, long rawRealtimeUs, int statsType) { in calculateDuration() argument
162 return batteryStats.getScreenOnTime(rawRealtimeUs, statsType) / 1000; in calculateDuration()
165 private double calculateTotalPowerFromBrightness(BatteryStats batteryStats, in calculateTotalPowerFromBrightness() argument
170 final long displayTime = batteryStats.getDisplayScreenOnTime(display, rawRealtimeUs) in calculateTotalPowerFromBrightness()
[all …]
DIdlePowerCalculator.java53 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
55 calculatePowerAndDuration(batteryStats, rawRealtimeUs, rawUptimeUs, in calculate()
70 private void calculatePowerAndDuration(BatteryStats batteryStats, long rawRealtimeUs, in calculatePowerAndDuration() argument
72 long batteryRealtimeUs = batteryStats.computeBatteryRealtime(rawRealtimeUs, statsType); in calculatePowerAndDuration()
73 long batteryUptimeUs = batteryStats.computeBatteryUptime(rawUptimeUs, statsType); in calculatePowerAndDuration()
DWakelockPowerCalculator.java51 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
82 calculateRemaining(result, batteryStats, rawRealtimeUs, rawUptimeUs, in calculate()
91 long wakeTimeMs = calculateWakeTimeMillis(batteryStats, rawRealtimeUs, rawUptimeUs); in calculate()
158 private long calculateWakeTimeMillis(BatteryStats batteryStats, long rawRealtimeUs, in calculateWakeTimeMillis() argument
160 final long batteryUptimeUs = batteryStats.getBatteryUptime(rawUptimeUs); in calculateWakeTimeMillis()
162 batteryStats.getScreenOnTime(rawRealtimeUs, BatteryStats.STATS_SINCE_CHARGED); in calculateWakeTimeMillis()
DCameraPowerCalculator.java47 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
49 super.calculate(builder, batteryStats, rawRealtimeUs, rawUptimeUs, query); in calculate()
51 long consumptionUc = batteryStats.getCameraEnergyConsumptionUC(); in calculate()
54 batteryStats.getCameraOnTime( in calculate()
DPhonePowerCalculator.java43 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
45 final long energyConsumerUC = batteryStats.getPhoneEnergyConsumptionUC(); in calculate()
48 final long phoneOnTimeMs = batteryStats.getPhoneOnTime(rawRealtimeUs, in calculate()
DFlashlightPowerCalculator.java45 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
47 super.calculate(builder, batteryStats, rawRealtimeUs, rawUptimeUs, query); in calculate()
49 final long durationMs = batteryStats.getFlashlightOnTime(rawRealtimeUs, in calculate()
DBatteryStatsDumpHelperImpl.java31 public BatteryUsageStats getBatteryUsageStats(BatteryStats batteryStats, boolean detailed) { in getBatteryUsageStats() argument
37 return mBatteryUsageStatsProvider.getBatteryUsageStats((BatteryStatsImpl) batteryStats, in getBatteryUsageStats()
DMobileRadioPowerCalculator.java126 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
131 final long totalConsumptionUC = batteryStats.getMobileRadioEnergyConsumptionUC(); in calculate()
143 totalActivePowerMah = calculateActiveModemPowerMah(batteryStats, rawRealtimeUs); in calculate()
204 long totalActiveDurationMs = batteryStats.getMobileRadioActiveTime(rawRealtimeUs, in calculate()
274 batteryStats.getModemControllerActivity(); in calculate()
285 final long scanningTimeMs = batteryStats.getPhoneSignalScanningTime(rawRealtimeUs, in calculate()
289 long strengthTimeMs = batteryStats.getPhoneSignalStrengthTime(i, rawRealtimeUs, in calculate()
DGnssPowerCalculator.java51 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
54 final double averageGnssPowerMa = getAverageGnssPower(batteryStats, rawRealtimeUs, in calculate()
70 final long consumptionUC = batteryStats.getGnssEnergyConsumptionUC(); in calculate()
DWifiPowerCalculator.java89 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
115 batteryStats.hasWifiActivityReporting(), consumptionUC); in calculate()
141 final long consumptionUC = batteryStats.getWifiEnergyConsumptionUC(); in calculate()
143 calculateRemaining(powerDurationAndTraffic, powerModel, batteryStats, rawRealtimeUs, in calculate()
144 BatteryStats.STATS_SINCE_CHARGED, batteryStats.hasWifiActivityReporting(), in calculate()
DBluetoothPowerCalculator.java71 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
73 if (!batteryStats.hasBluetoothActivityReporting()) { in calculate()
96 final long consumedEnergyUC = batteryStats.getBluetoothEnergyConsumptionUC(); in calculate()
99 batteryStats.getBluetoothControllerActivity(); in calculate()
DCustomEnergyConsumerPowerCalculator.java47 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument
59 batteryStats.getCustomEnergyConsumerBatteryConsumptionUC()); in calculate()
DUserPowerCalculator.java41 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() argument

12