/frameworks/base/services/tests/powerstatstests/src/com/android/server/power/stats/ |
D | MultiStateStatsTest.java | 24 import android.os.BatteryConsumer; 43 .hasSerialStateCount(BatteryConsumer.PROCESS_STATE_COUNT * 4) in compositeStateIndex_allEnabled() 45 state(false, false, BatteryConsumer.PROCESS_STATE_FOREGROUND), in compositeStateIndex_allEnabled() 46 state(false, false, BatteryConsumer.PROCESS_STATE_BACKGROUND), in compositeStateIndex_allEnabled() 47 state(false, true, BatteryConsumer.PROCESS_STATE_FOREGROUND), in compositeStateIndex_allEnabled() 48 state(false, true, BatteryConsumer.PROCESS_STATE_BACKGROUND), in compositeStateIndex_allEnabled() 49 state(true, false, BatteryConsumer.PROCESS_STATE_FOREGROUND), in compositeStateIndex_allEnabled() 50 state(true, false, BatteryConsumer.PROCESS_STATE_BACKGROUND), in compositeStateIndex_allEnabled() 51 state(true, true, BatteryConsumer.PROCESS_STATE_FOREGROUND), in compositeStateIndex_allEnabled() 52 state(true, true, BatteryConsumer.PROCESS_STATE_BACKGROUND)); in compositeStateIndex_allEnabled() [all …]
|
D | CameraPowerCalculatorTest.java | 21 import android.os.BatteryConsumer; 69 assertThat(app1Consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_CAMERA)) in testTimerBasedModel() 71 assertThat(app1Consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_CAMERA)) in testTimerBasedModel() 73 assertThat(app1Consumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_CAMERA)) in testTimerBasedModel() 74 .isEqualTo(BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testTimerBasedModel() 77 assertThat(app2Consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_CAMERA)) in testTimerBasedModel() 79 assertThat(app2Consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_CAMERA)) in testTimerBasedModel() 81 assertThat(app2Consumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_CAMERA)) in testTimerBasedModel() 82 .isEqualTo(BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testTimerBasedModel() 84 final BatteryConsumer deviceBatteryConsumer = mStatsRule.getDeviceBatteryConsumer(); in testTimerBasedModel() [all …]
|
D | ScreenPowerCalculatorTest.java | 25 import android.os.BatteryConsumer; 98 assertThat(uid1.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_SCREEN)) in testMeasuredEnergyBasedModel() 104 assertThat(uid1.getConsumedPower(BatteryConsumer.POWER_COMPONENT_SCREEN)) in testMeasuredEnergyBasedModel() 106 assertThat(uid1.getPowerModel(BatteryConsumer.POWER_COMPONENT_SCREEN)) in testMeasuredEnergyBasedModel() 107 .isEqualTo(BatteryConsumer.POWER_MODEL_ENERGY_CONSUMPTION); in testMeasuredEnergyBasedModel() 110 assertThat(uid2.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_SCREEN)) in testMeasuredEnergyBasedModel() 116 assertThat(uid2.getConsumedPower(BatteryConsumer.POWER_COMPONENT_SCREEN)) in testMeasuredEnergyBasedModel() 118 assertThat(uid2.getPowerModel(BatteryConsumer.POWER_COMPONENT_SCREEN)) in testMeasuredEnergyBasedModel() 119 .isEqualTo(BatteryConsumer.POWER_MODEL_ENERGY_CONSUMPTION); in testMeasuredEnergyBasedModel() 121 BatteryConsumer deviceConsumer = mStatsRule.getDeviceBatteryConsumer(); in testMeasuredEnergyBasedModel() [all …]
|
D | BatteryUsageStatsTest.java | 19 import static android.os.BatteryConsumer.POWER_COMPONENT_ANY; 20 import static android.os.BatteryConsumer.POWER_MODEL_ENERGY_CONSUMPTION; 21 import static android.os.BatteryConsumer.POWER_MODEL_UNDEFINED; 22 import static android.os.BatteryConsumer.PROCESS_STATE_BACKGROUND; 23 import static android.os.BatteryConsumer.PROCESS_STATE_CACHED; 24 import static android.os.BatteryConsumer.PROCESS_STATE_FOREGROUND; 25 import static android.os.BatteryConsumer.PROCESS_STATE_FOREGROUND_SERVICE; 35 import android.os.BatteryConsumer; 116 .setConsumedPower(BatteryConsumer.POWER_COMPONENT_SCREEN, i * 100); in testParcelability_largeNumberOfUids() 178 for (int i = 0; i < BatteryConsumer.POWER_COMPONENT_COUNT; i++) { in testPowerComponentNames_existAndUnique() [all …]
|
D | GnssPowerCalculatorTest.java | 21 import android.os.BatteryConsumer; 67 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_GNSS)) in testTimerBasedModel() 69 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_GNSS)) in testTimerBasedModel() 71 assertThat(consumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_GNSS)) in testTimerBasedModel() 72 .isEqualTo(BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testTimerBasedModel() 74 BatteryConsumer deviceConsumer = mStatsRule.getDeviceBatteryConsumer(); in testTimerBasedModel() 75 assertThat(deviceConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_GNSS)) in testTimerBasedModel() 77 assertThat(deviceConsumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_GNSS)) in testTimerBasedModel() 78 .isEqualTo(BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testTimerBasedModel() 80 BatteryConsumer appsConsumer = mStatsRule.getAppsBatteryConsumer(); in testTimerBasedModel() [all …]
|
D | BluetoothPowerCalculatorTest.java | 27 import android.os.BatteryConsumer; 85 0.06944, 3000, BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testTimerBasedModel() 88 0.19444, 9000, BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testTimerBasedModel() 91 0.26388, 12000, BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testTimerBasedModel() 94 0.26388, 12000, BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testTimerBasedModel() 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() 148 .isEqualTo(BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testTimerBasedModel_byProcessState() 150 final BatteryConsumer.Key foreground = uidConsumer.getKey( in testTimerBasedModel_byProcessState() [all …]
|
D | WifiPowerCalculatorTest.java | 32 import android.os.BatteryConsumer; 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() 163 .isEqualTo(BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testPowerControllerBasedModel_nonMeasured() 165 BatteryConsumer deviceConsumer = mStatsRule.getDeviceBatteryConsumer(); in testPowerControllerBasedModel_nonMeasured() 166 assertThat(deviceConsumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_WIFI)) in testPowerControllerBasedModel_nonMeasured() 168 assertThat(deviceConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_WIFI)) in testPowerControllerBasedModel_nonMeasured() 170 assertThat(deviceConsumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_WIFI)) in testPowerControllerBasedModel_nonMeasured() 171 .isEqualTo(BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testPowerControllerBasedModel_nonMeasured() [all …]
|
D | MobileRadioPowerCalculatorTest.java | 33 import android.os.BatteryConsumer; 154 BatteryConsumer deviceConsumer = mStatsRule.getDeviceBatteryConsumer(); in testCounterBasedModel() 165 assertThat(deviceConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)) in testCounterBasedModel() 167 assertThat(deviceConsumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)) in testCounterBasedModel() 168 .isEqualTo(BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testCounterBasedModel() 178 BatteryConsumer appsConsumer = mStatsRule.getAppsBatteryConsumer(); in testCounterBasedModel() 179 assertThat(appsConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)) in testCounterBasedModel() 181 assertThat(appsConsumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)) in testCounterBasedModel() 182 .isEqualTo(BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testCounterBasedModel() 186 assertThat(uidConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)) in testCounterBasedModel() [all …]
|
D | PowerStatsExporterTest.java | 26 import android.os.BatteryConsumer; 89 config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_CPU) in setup() 115 mPowerStatsDescriptor = new PowerStats.Descriptor(BatteryConsumer.POWER_COMPONENT_CPU, in setup() 130 assertDevicePowerEstimate(message, actual, BatteryConsumer.POWER_COMPONENT_CPU, 7.51016); in breakdownByProcState_fullRange() 131 assertAllAppsPowerEstimate(message, actual, BatteryConsumer.POWER_COMPONENT_CPU, 7.51016); in breakdownByProcState_fullRange() 133 assertUidPowerEstimate(message, actual, APP_UID1, BatteryConsumer.POWER_COMPONENT_CPU, in breakdownByProcState_fullRange() 134 BatteryConsumer.PROCESS_STATE_ANY, 3.97099); in breakdownByProcState_fullRange() 135 assertUidPowerEstimate(message, actual, APP_UID1, BatteryConsumer.POWER_COMPONENT_CPU, in breakdownByProcState_fullRange() 136 BatteryConsumer.PROCESS_STATE_FOREGROUND, 2.198082); in breakdownByProcState_fullRange() 137 assertUidPowerEstimate(message, actual, APP_UID1, BatteryConsumer.POWER_COMPONENT_CPU, in breakdownByProcState_fullRange() [all …]
|
D | AmbientDisplayPowerCalculatorTest.java | 23 import android.os.BatteryConsumer; 76 BatteryConsumer consumer = mStatsRule.getDeviceBatteryConsumer(); in testMeasuredEnergyBasedModel() 77 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel() 80 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel() 82 assertThat(consumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel() 83 .isEqualTo(BatteryConsumer.POWER_MODEL_ENERGY_CONSUMPTION); in testMeasuredEnergyBasedModel() 136 BatteryConsumer consumer = mStatsRule.getDeviceBatteryConsumer(); in testMeasuredEnergyBasedModel_multiDisplay() 137 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel_multiDisplay() 141 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel_multiDisplay() 143 assertThat(consumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel_multiDisplay() [all …]
|
D | CpuPowerCalculatorTest.java | 30 import android.os.BatteryConsumer; 191 assertThat(uidConsumer1.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_CPU)) in testTimerBasedModel() 193 assertThat(uidConsumer1.getConsumedPower(BatteryConsumer.POWER_COMPONENT_CPU)) in testTimerBasedModel() 195 assertThat(uidConsumer1.getPowerModel(BatteryConsumer.POWER_COMPONENT_CPU)) in testTimerBasedModel() 196 .isEqualTo(BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testTimerBasedModel() 200 assertThat(uidConsumer2.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_CPU)) in testTimerBasedModel() 202 assertThat(uidConsumer2.getConsumedPower(BatteryConsumer.POWER_COMPONENT_CPU)) in testTimerBasedModel() 204 assertThat(uidConsumer2.getPowerModel(BatteryConsumer.POWER_COMPONENT_CPU)) in testTimerBasedModel() 205 .isEqualTo(BatteryConsumer.POWER_MODEL_POWER_PROFILE); in testTimerBasedModel() 208 final BatteryConsumer deviceBatteryConsumer = mStatsRule.getDeviceBatteryConsumer(); in testTimerBasedModel() [all …]
|
D | BatteryStatsManagerTest.java | 23 import android.os.BatteryConsumer; 50 {BatteryConsumer.POWER_COMPONENT_CPU, in testBatteryUsageStatsDataConsistency() 51 BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO, in testBatteryUsageStatsDataConsistency() 52 BatteryConsumer.POWER_COMPONENT_WIFI, in testBatteryUsageStatsDataConsistency() 53 BatteryConsumer.POWER_COMPONENT_BLUETOOTH}; in testBatteryUsageStatsDataConsistency() 55 {BatteryConsumer.PROCESS_STATE_FOREGROUND, in testBatteryUsageStatsDataConsistency() 56 BatteryConsumer.PROCESS_STATE_BACKGROUND, in testBatteryUsageStatsDataConsistency() 57 BatteryConsumer.PROCESS_STATE_FOREGROUND_SERVICE, in testBatteryUsageStatsDataConsistency() 58 BatteryConsumer.PROCESS_STATE_CACHED}; in testBatteryUsageStatsDataConsistency() 68 + BatteryConsumer.powerComponentIdToString(component) in testBatteryUsageStatsDataConsistency()
|
D | UserPowerCalculatorTest.java | 21 import android.os.BatteryConsumer; 67 .getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AUDIO)).isEqualTo(3000); in testAllUsers() 69 .getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_VIDEO)).isEqualTo(7000); in testAllUsers() 74 .getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AUDIO)).isEqualTo(5555); in testAllUsers() 76 .getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_VIDEO)).isEqualTo(9999); in testAllUsers() 91 .getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AUDIO)).isEqualTo(3000); in testSpecificUser() 93 .getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_VIDEO)).isEqualTo(7000); in testSpecificUser() 96 .getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AUDIO)).isEqualTo(7070); in testSpecificUser() 98 .getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_VIDEO)).isEqualTo(11110); in testSpecificUser() 101 assertThat(user2.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AUDIO)) in testSpecificUser() [all …]
|
D | VideoPowerCalculatorTest.java | 21 import android.os.BatteryConsumer; 63 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_VIDEO)) in testTimerBasedModel() 65 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_VIDEO)) in testTimerBasedModel() 68 final BatteryConsumer deviceBatteryConsumer = mStatsRule.getDeviceBatteryConsumer(); in testTimerBasedModel() 70 .getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_VIDEO)) in testTimerBasedModel() 72 assertThat(deviceBatteryConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_VIDEO)) in testTimerBasedModel() 75 final BatteryConsumer appsBatteryConsumer = mStatsRule.getDeviceBatteryConsumer(); in testTimerBasedModel() 77 .getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_VIDEO)) in testTimerBasedModel() 79 assertThat(appsBatteryConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_VIDEO)) in testTimerBasedModel()
|
D | AudioPowerCalculatorTest.java | 21 import android.os.BatteryConsumer; 63 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AUDIO)) in testTimerBasedModel() 65 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_AUDIO)) in testTimerBasedModel() 68 final BatteryConsumer deviceBatteryConsumer = mStatsRule.getDeviceBatteryConsumer(); in testTimerBasedModel() 70 .getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AUDIO)) in testTimerBasedModel() 72 assertThat(deviceBatteryConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_AUDIO)) in testTimerBasedModel() 75 final BatteryConsumer appsBatteryConsumer = mStatsRule.getDeviceBatteryConsumer(); in testTimerBasedModel() 77 .getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AUDIO)) in testTimerBasedModel() 79 assertThat(appsBatteryConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_AUDIO)) in testTimerBasedModel()
|
D | WakelockPowerCalculatorTest.java | 21 import android.os.BatteryConsumer; 75 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_WAKELOCK)) in testTimerBasedModel() 77 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_WAKELOCK)) in testTimerBasedModel() 81 assertThat(osConsumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_WAKELOCK)) in testTimerBasedModel() 83 assertThat(osConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_WAKELOCK)) in testTimerBasedModel() 86 BatteryConsumer deviceConsumer = mStatsRule.getDeviceBatteryConsumer(); in testTimerBasedModel() 87 assertThat(deviceConsumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_WAKELOCK)) in testTimerBasedModel() 89 assertThat(deviceConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_WAKELOCK)) in testTimerBasedModel() 92 BatteryConsumer appConsumer = mStatsRule.getAppsBatteryConsumer(); in testTimerBasedModel() 93 assertThat(appConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_WAKELOCK)) in testTimerBasedModel()
|
/frameworks/base/core/tests/batterystatstests/BatteryUsageStatsProtoTests/src/com/android/internal/os/ |
D | BatteryUsageStatsPulledTest.java | 28 import android.os.BatteryConsumer; 52 BatteryConsumer.PROCESS_STATE_FOREGROUND, 53 BatteryConsumer.PROCESS_STATE_BACKGROUND, 54 BatteryConsumer.PROCESS_STATE_FOREGROUND_SERVICE 85 for (int i = 0; i < BatteryConsumer.POWER_COMPONENT_COUNT; i++) { in testGetStatsProto() 125 private void assertSameBatteryConsumer(String message, BatteryConsumer consumer, in assertSameBatteryConsumer() 134 if (componentId < BatteryConsumer.POWER_COMPONENT_COUNT) { in assertSameBatteryConsumer() 151 for (int componentId = 0; componentId < BatteryConsumer.POWER_COMPONENT_COUNT; in assertSameBatteryConsumer() 153 final BatteryConsumer.Key[] keys = consumer.getKeys(componentId); in assertSameBatteryConsumer() 158 for (BatteryConsumer.Key key : keys) { in assertSameBatteryConsumer() [all …]
|
/frameworks/base/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/ |
D | BatteryConsumerData.java | 20 import android.os.BatteryConsumer; 81 BatteryConsumer requestedBatteryConsumer = getRequestedBatteryConsumer(batteryUsageStats, in populateForUidBatteryConsumer() 83 BatteryConsumer requestedModeledBatteryConsumer = getRequestedBatteryConsumer( in populateForUidBatteryConsumer() 94 double[] totalPowerByComponentMah = new double[BatteryConsumer.POWER_COMPONENT_COUNT]; in populateForUidBatteryConsumer() 96 new double[BatteryConsumer.POWER_COMPONENT_COUNT]; in populateForUidBatteryConsumer() 97 long[] totalDurationByComponentMs = new long[BatteryConsumer.POWER_COMPONENT_COUNT]; in populateForUidBatteryConsumer() 126 for (int component = 0; component < BatteryConsumer.POWER_COMPONENT_COUNT; component++) { in populateForUidBatteryConsumer() 129 if (powerModel == BatteryConsumer.POWER_MODEL_POWER_PROFILE in populateForUidBatteryConsumer() 130 || powerModel == BatteryConsumer.POWER_MODEL_UNDEFINED) { in populateForUidBatteryConsumer() 152 BatteryConsumer.FIRST_CUSTOM_POWER_COMPONENT_ID + component); in populateForUidBatteryConsumer() [all …]
|
/frameworks/base/core/java/android/os/ |
D | PowerComponents.java | 18 import static android.os.BatteryConsumer.BatteryConsumerDataLayout.POWER_MODEL_NOT_INCLUDED; 19 import static android.os.BatteryConsumer.POWER_COMPONENT_ANY; 20 import static android.os.BatteryConsumer.PROCESS_STATE_ANY; 21 import static android.os.BatteryConsumer.PROCESS_STATE_UNSPECIFIED; 22 import static android.os.BatteryConsumer.convertMahToDeciCoulombs; 45 private final BatteryConsumer.BatteryConsumerData mData; 51 PowerComponents(BatteryConsumer.BatteryConsumerData data) { in PowerComponents() 58 public double getConsumedPower(@NonNull BatteryConsumer.Dimensions dimensions) { in getConsumedPower() 67 final BatteryConsumer.Key[] keys = in getConsumedPower() 86 public double getConsumedPower(@NonNull BatteryConsumer.Key key) { in getConsumedPower() [all …]
|
/frameworks/base/services/core/java/com/android/server/power/stats/ |
D | CpuPowerCalculator.java | 18 import android.os.BatteryConsumer; 35 private static final BatteryConsumer.Key[] UNINITIALIZED_KEYS = new BatteryConsumer.Key[0]; 98 public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) { in isPowerComponentSupported() 99 return powerComponent == BatteryConsumer.POWER_COMPONENT_CPU; in isPowerComponentSupported() 107 BatteryConsumer.Key[] keys = UNINITIALIZED_KEYS; in calculate() 118 keys = app.getKeys(BatteryConsumer.POWER_COMPONENT_CPU); in calculate() 134 .setConsumedPower(BatteryConsumer.POWER_COMPONENT_CPU, totalPowerMah); in calculate() 137 .setConsumedPower(BatteryConsumer.POWER_COMPONENT_CPU, in calculate() 138 powerModel == BatteryConsumer.POWER_MODEL_ENERGY_CONSUMPTION in calculate() 143 BatteryUsageStatsQuery query, Result result, BatteryConsumer.Key[] keys) { in calculateApp() [all …]
|
D | CameraPowerCalculator.java | 18 import android.os.BatteryConsumer; 42 public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) { in isPowerComponentSupported() 43 return powerComponent == BatteryConsumer.POWER_COMPONENT_CAMERA; in isPowerComponentSupported() 57 if (powerModel == BatteryConsumer.POWER_MODEL_ENERGY_CONSUMPTION) { in calculate() 65 .setUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_CAMERA, durationMs) in calculate() 66 .setConsumedPower(BatteryConsumer.POWER_COMPONENT_CAMERA, powerMah, powerModel); in calculate() 69 .setUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_CAMERA, durationMs) in calculate() 70 .setConsumedPower(BatteryConsumer.POWER_COMPONENT_CAMERA, powerMah, powerModel); in calculate() 82 if (powerModel == BatteryConsumer.POWER_MODEL_ENERGY_CONSUMPTION) { in calculateApp() 88 app.setUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_CAMERA, durationMs) in calculateApp() [all …]
|
D | BluetoothPowerCalculator.java | 19 import android.os.BatteryConsumer; 36 private static final BatteryConsumer.Key[] UNINITIALIZED_KEYS = new BatteryConsumer.Key[0]; 49 public BatteryConsumer.Key[] keys; 66 public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) { in isPowerComponentSupported() 67 return powerComponent == BatteryConsumer.POWER_COMPONENT_BLUETOOTH; in isPowerComponentSupported() 77 BatteryConsumer.Key[] keys = UNINITIALIZED_KEYS; in calculate() 86 keys = app.getKeys(BatteryConsumer.POWER_COMPONENT_BLUETOOTH); in calculate() 113 .setUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_BLUETOOTH, in calculate() 115 .setConsumedPower(BatteryConsumer.POWER_COMPONENT_BLUETOOTH, in calculate() 121 .setUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_BLUETOOTH, in calculate() [all …]
|
D | WifiPowerCalculator.java | 18 import android.os.BatteryConsumer; 38 private static final BatteryConsumer.Key[] UNINITIALIZED_KEYS = new BatteryConsumer.Key[0]; 58 public BatteryConsumer.Key[] keys; 84 public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) { in isPowerComponentSupported() 85 return powerComponent == BatteryConsumer.POWER_COMPONENT_WIFI; in isPowerComponentSupported() 91 BatteryConsumer.Key[] keys = UNINITIALIZED_KEYS; in calculate() 101 keys = app.getKeys(BatteryConsumer.POWER_COMPONENT_WIFI); in calculate() 121 app.setUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_WIFI, in calculate() 123 app.setConsumedPower(BatteryConsumer.POWER_COMPONENT_WIFI, in calculate() 128 BatteryConsumer.Key key = keys[j]; in calculate() [all …]
|
D | FlashlightPowerCalculator.java | 18 import android.os.BatteryConsumer; 40 public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) { in isPowerComponentSupported() 41 return powerComponent == BatteryConsumer.POWER_COMPONENT_FLASHLIGHT; in isPowerComponentSupported() 54 .setUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_FLASHLIGHT, durationMs) in calculate() 55 .setConsumedPower(BatteryConsumer.POWER_COMPONENT_FLASHLIGHT, powerMah); in calculate() 58 .setUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_FLASHLIGHT, durationMs) in calculate() 59 .setConsumedPower(BatteryConsumer.POWER_COMPONENT_FLASHLIGHT, powerMah); in calculate() 68 app.setUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_FLASHLIGHT, durationMs) in calculateApp() 69 .setConsumedPower(BatteryConsumer.POWER_COMPONENT_FLASHLIGHT, powerMah); in calculateApp()
|
D | PowerCalculator.java | 19 import android.os.BatteryConsumer; 39 @BatteryConsumer.PowerComponent int powerComponent); in isPowerComponentSupported() 81 protected static @BatteryConsumer.PowerModel int getPowerModel( in getPowerModel() 85 return BatteryConsumer.POWER_MODEL_ENERGY_CONSUMPTION; in getPowerModel() 87 return BatteryConsumer.POWER_MODEL_POWER_PROFILE; in getPowerModel() 90 protected static @BatteryConsumer.PowerModel int getPowerModel(long consumedEnergyUC) { in getPowerModel() 92 ? BatteryConsumer.POWER_MODEL_ENERGY_CONSUMPTION in getPowerModel() 93 : BatteryConsumer.POWER_MODEL_POWER_PROFILE; in getPowerModel()
|