/frameworks/base/services/tests/powerstatstests/src/com/android/server/power/stats/ |
D | BatteryUsageStatsTest.java | 36 import android.os.BatteryUsageStats; 78 BatteryUsageStats batteryUsageStats = buildBatteryUsageStats1(true).build(); in testBuilder() 84 BatteryUsageStats batteryUsageStats = buildBatteryUsageStats1(false).build(); in testBuilder_noProcessStateData() 90 final BatteryUsageStats outBatteryUsageStats = buildBatteryUsageStats1(true).build(); in testParcelability_smallNumberOfUids() 98 final BatteryUsageStats inBatteryUsageStats = in testParcelability_smallNumberOfUids() 106 final BatteryUsageStats.Builder builder = in testParcelability_largeNumberOfUids() 107 new BatteryUsageStats.Builder(new String[0]); in testParcelability_largeNumberOfUids() 119 BatteryUsageStats outBatteryUsageStats = builder.build(); in testParcelability_largeNumberOfUids() 129 final BatteryUsageStats inBatteryUsageStats = in testParcelability_largeNumberOfUids() 130 parcel.readParcelable(getClass().getClassLoader(), BatteryUsageStats.class); in testParcelability_largeNumberOfUids() [all …]
|
D | PowerStatsExporterTest.java | 28 import android.os.BatteryUsageStats; 122 BatteryUsageStats.Builder builder = new BatteryUsageStats.Builder( in breakdownByProcState_fullRange() 127 BatteryUsageStats actual = builder.build(); in breakdownByProcState_fullRange() 150 BatteryUsageStats.Builder builder = new BatteryUsageStats.Builder( in breakdownByProcState_subRange() 155 BatteryUsageStats actual = builder.build(); in breakdownByProcState_subRange() 178 BatteryUsageStats.Builder builder = new BatteryUsageStats.Builder( in combinedProcessStates() 183 BatteryUsageStats actual = builder.build(); in combinedProcessStates() 266 private void exportAggregatedPowerStats(BatteryUsageStats.Builder builder, in exportAggregatedPowerStats() 274 private void assertDevicePowerEstimate(String message, BatteryUsageStats bus, int componentId, in assertDevicePowerEstimate() 277 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE); in assertDevicePowerEstimate() [all …]
|
/frameworks/base/core/java/android/os/ |
D | AggregateBatteryConsumer.java | 68 @BatteryUsageStats.AggregateBatteryConsumerScope int scope) throws IOException { in writeToXml() 69 serializer.startTag(null, BatteryUsageStats.XML_TAG_AGGREGATE); in writeToXml() 70 serializer.attributeInt(null, BatteryUsageStats.XML_ATTR_SCOPE, scope); in writeToXml() 71 serializer.attributeDouble(null, BatteryUsageStats.XML_ATTR_POWER, getConsumedPower()); in writeToXml() 73 serializer.endTag(null, BatteryUsageStats.XML_TAG_AGGREGATE); in writeToXml() 77 static void parseXml(TypedXmlPullParser parser, BatteryUsageStats.Builder builder) in parseXml() 79 final int scope = parser.getAttributeInt(null, BatteryUsageStats.XML_ATTR_SCOPE); in parseXml() 84 BatteryUsageStats.XML_TAG_AGGREGATE)) { in parseXml() 89 parser.getAttributeDouble(null, BatteryUsageStats.XML_ATTR_POWER)); in parseXml() 92 BatteryUsageStats.XML_TAG_AGGREGATE)) in parseXml() [all …]
|
D | UidBatteryConsumer.java | 173 serializer.startTag(null, BatteryUsageStats.XML_TAG_UID); in writeToXml() 174 serializer.attributeInt(null, BatteryUsageStats.XML_ATTR_UID, getUid()); in writeToXml() 177 serializer.attribute(null, BatteryUsageStats.XML_ATTR_HIGHEST_DRAIN_PACKAGE, in writeToXml() 180 serializer.attributeLong(null, BatteryUsageStats.XML_ATTR_TIME_IN_FOREGROUND, in writeToXml() 182 serializer.attributeLong(null, BatteryUsageStats.XML_ATTR_TIME_IN_BACKGROUND, in writeToXml() 184 serializer.attributeLong(null, BatteryUsageStats.XML_ATTR_TIME_IN_FOREGROUND_SERVICE, in writeToXml() 187 serializer.endTag(null, BatteryUsageStats.XML_TAG_UID); in writeToXml() 191 static void createFromXml(TypedXmlPullParser parser, BatteryUsageStats.Builder builder) in createFromXml() 193 final int uid = parser.getAttributeInt(null, BatteryUsageStats.XML_ATTR_UID); in createFromXml() 199 || !parser.getName().equals(BatteryUsageStats.XML_TAG_UID)) { in createFromXml() [all …]
|
D | PowerComponents.java | 331 serializer.startTag(null, BatteryUsageStats.XML_TAG_POWER_COMPONENTS); in writeToXml() 342 serializer.startTag(null, BatteryUsageStats.XML_TAG_COMPONENT); in writeToXml() 343 serializer.attributeInt(null, BatteryUsageStats.XML_ATTR_ID, componentId); in writeToXml() 345 serializer.attributeInt(null, BatteryUsageStats.XML_ATTR_PROCESS_STATE, in writeToXml() 349 serializer.attributeDouble(null, BatteryUsageStats.XML_ATTR_POWER, powerMah); in writeToXml() 352 serializer.attributeLong(null, BatteryUsageStats.XML_ATTR_DURATION, durationMs); in writeToXml() 355 serializer.attributeInt(null, BatteryUsageStats.XML_ATTR_MODEL, in writeToXml() 358 serializer.endTag(null, BatteryUsageStats.XML_TAG_COMPONENT); in writeToXml() 373 serializer.startTag(null, BatteryUsageStats.XML_TAG_CUSTOM_COMPONENT); in writeToXml() 374 serializer.attributeInt(null, BatteryUsageStats.XML_ATTR_ID, componentId); in writeToXml() [all …]
|
D | UserBatteryConsumer.java | 75 serializer.startTag(null, BatteryUsageStats.XML_TAG_USER); in writeToXml() 76 serializer.attributeInt(null, BatteryUsageStats.XML_ATTR_USER_ID, getUserId()); in writeToXml() 78 serializer.endTag(null, BatteryUsageStats.XML_TAG_USER); in writeToXml() 82 static void createFromXml(TypedXmlPullParser parser, BatteryUsageStats.Builder builder) in createFromXml() 84 final int userId = parser.getAttributeInt(null, BatteryUsageStats.XML_ATTR_USER_ID); in createFromXml() 90 || !parser.getName().equals(BatteryUsageStats.XML_TAG_USER)) { in createFromXml() 94 && parser.getName().equals(BatteryUsageStats.XML_TAG_USER)) in createFromXml() 97 if (parser.getName().equals(BatteryUsageStats.XML_TAG_POWER_COMPONENTS)) { in createFromXml()
|
D | TEST_MAPPING | 72 "BatteryUsageStats[^/]*\\.java", 85 "BatteryUsageStats[^/]*\\.java", 97 "BatteryUsageStats[^/]*\\.java", 118 "BatteryUsageStats[^/]*\\.java",
|
/frameworks/base/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/ |
D | BatteryConsumerData.java | 21 import android.os.BatteryUsageStats; 65 List<BatteryUsageStats> batteryUsageStatsList, String batteryConsumerId) { in BatteryConsumerData() 77 Context context, List<BatteryUsageStats> batteryUsageStatsList, in populateForUidBatteryConsumer() 79 BatteryUsageStats batteryUsageStats = batteryUsageStatsList.get(0); in populateForUidBatteryConsumer() 80 BatteryUsageStats modeledBatteryUsageStats = batteryUsageStatsList.get(1); in populateForUidBatteryConsumer() 111 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS) in populateForUidBatteryConsumer() 117 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS) in populateForUidBatteryConsumer() 122 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS) in populateForUidBatteryConsumer() 203 List<BatteryUsageStats> batteryUsageStatsList) { in populateForAggregateBatteryConsumer() 204 BatteryUsageStats batteryUsageStats = batteryUsageStatsList.get(0); in populateForAggregateBatteryConsumer() [all …]
|
D | BatteryStatsViewerActivity.java | 21 import android.os.BatteryUsageStats; 66 private List<BatteryUsageStats> mBatteryUsageStats; 125 AsyncLoaderCompat<List<BatteryUsageStats>> { 136 public List<BatteryUsageStats> loadInBackground() { in loadInBackground() 156 protected void onDiscardResult(List<BatteryUsageStats> result) { in onDiscardResult() 161 implements LoaderCallbacks<List<BatteryUsageStats>> { 164 public Loader<List<BatteryUsageStats>> onCreateLoader(int id, Bundle args) { in onCreateLoader() 170 public void onLoadFinished(@NonNull Loader<List<BatteryUsageStats>> loader, in onLoadFinished() 171 List<BatteryUsageStats> batteryUsageStats) { in onLoadFinished() 176 public void onLoaderReset(@NonNull Loader<List<BatteryUsageStats>> loader) { in onLoaderReset() [all …]
|
/frameworks/base/tests/BatteryStatsPerfTest/src/com/android/internal/os/ |
D | BatteryUsageStatsPerfTest.java | 28 import android.os.BatteryUsageStats; 69 BatteryUsageStats batteryUsageStats = batteryStatsManager.getBatteryUsageStats( in testGetBatteryUsageStats() 119 final BatteryUsageStats batteryUsageStats = in testBatteryUsageStatsTransferOverBinder() 120 BatteryUsageStats.CREATOR.createFromParcel(reply); in testBatteryUsageStatsTransferOverBinder() 140 private final BatteryUsageStats mBatteryUsageStats; 160 private static BatteryUsageStats buildBatteryUsageStats() { 161 final BatteryUsageStats.Builder builder = 162 new BatteryUsageStats.Builder(new String[]{"FOO"}, true, false, 0) 170 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS)
|
/frameworks/base/services/core/java/com/android/server/power/stats/ |
D | BatteryUsageStatsSection.java | 19 import android.os.BatteryUsageStats; 29 private final BatteryUsageStats mBatteryUsageStats; 31 BatteryUsageStatsSection(BatteryUsageStats batteryUsageStats) { in BatteryUsageStatsSection() 36 public BatteryUsageStats getBatteryUsageStats() { in getBatteryUsageStats()
|
D | BatteryUsageStatsProvider.java | 23 import android.os.BatteryUsageStats; 145 public List<BatteryUsageStats> getBatteryUsageStats(BatteryStatsImpl stats, in getBatteryUsageStats() 147 ArrayList<BatteryUsageStats> results = new ArrayList<>(queries.size()); in getBatteryUsageStats() 162 public BatteryUsageStats getBatteryUsageStats(BatteryStatsImpl stats, in getBatteryUsageStats() 167 private BatteryUsageStats getBatteryUsageStats(BatteryStatsImpl stats, in getBatteryUsageStats() 176 private BatteryUsageStats getCurrentBatteryUsageStats(BatteryStatsImpl stats, in getCurrentBatteryUsageStats() 190 final BatteryUsageStats.Builder batteryUsageStatsBuilder; in getCurrentBatteryUsageStats() 196 batteryUsageStatsBuilder = new BatteryUsageStats.Builder( in getCurrentBatteryUsageStats() 252 BatteryUsageStats batteryUsageStats = batteryUsageStatsBuilder.build(); in getCurrentBatteryUsageStats() 261 private void verify(BatteryUsageStats stats) { in verify() [all …]
|
D | FlashlightPowerCalculator.java | 20 import android.os.BatteryUsageStats; 45 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() 53 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE) in calculate() 57 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS) in calculate()
|
D | AudioPowerCalculator.java | 20 import android.os.BatteryUsageStats; 54 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() 66 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE) in calculate() 71 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS) in calculate()
|
D | CameraPowerCalculator.java | 20 import android.os.BatteryUsageStats; 47 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() 64 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE) in calculate() 68 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS) in calculate()
|
D | VideoPowerCalculator.java | 20 import android.os.BatteryUsageStats; 51 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() 63 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE) in calculate() 68 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS) in calculate()
|
D | PowerStatsExporter.java | 21 import android.os.BatteryUsageStats; 60 public void exportAggregatedPowerStats(BatteryUsageStats.Builder batteryUsageStatsBuilder, in exportAggregatedPowerStats() 117 BatteryUsageStats.Builder batteryUsageStatsBuilder, AggregatedPowerStats stats) { in populateBatteryUsageStatsBuilder() 128 BatteryUsageStats.Builder batteryUsageStatsBuilder, AggregatedPowerStats stats, in populateBatteryUsageStatsBuilder() 163 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE); in populateBatteryUsageStatsBuilder() 174 BatteryUsageStats.Builder batteryUsageStatsBuilder, in populateUidBatteryConsumers() 238 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS); in populateUidBatteryConsumers()
|
D | PhonePowerCalculator.java | 21 import android.os.BatteryUsageStats; 43 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() 64 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE) in calculate()
|
D | BatteryChargeCalculator.java | 21 import android.os.BatteryUsageStats; 36 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() 77 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE) in calculate()
|
D | CustomEnergyConsumerPowerCalculator.java | 21 import android.os.BatteryUsageStats; 47 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() 63 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE); in calculate() 73 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS); in calculate()
|
D | IdlePowerCalculator.java | 21 import android.os.BatteryUsageStats; 53 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() 59 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE) in calculate()
|
D | SystemServicePowerCalculator.java | 21 import android.os.BatteryUsageStats; 66 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() 111 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE) in calculate() 115 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS) in calculate()
|
D | SensorPowerCalculator.java | 22 import android.os.BatteryUsageStats; 47 public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats, in calculate() 60 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE) in calculate() 63 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS) in calculate()
|
D | BatteryStatsDumpHelperImpl.java | 20 import android.os.BatteryUsageStats; 31 public BatteryUsageStats getBatteryUsageStats(BatteryStats batteryStats, boolean detailed) { in getBatteryUsageStats()
|
/frameworks/base/core/tests/batterystatstests/BatteryUsageStatsProtoTests/src/com/android/internal/os/ |
D | BatteryUsageStatsPulledTest.java | 18 import static android.os.BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE; 29 import android.os.BatteryUsageStats; 59 final BatteryUsageStats bus = buildBatteryUsageStats(); in testGetStatsProto() 259 private BatteryUsageStats buildBatteryUsageStats() { in buildBatteryUsageStats() 260 final BatteryUsageStats.Builder builder = in buildBatteryUsageStats() 261 new BatteryUsageStats.Builder(new String[]{"CustomConsumer1", "CustomConsumer2"}, in buildBatteryUsageStats() 335 BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS) in buildBatteryUsageStats() 347 final BatteryUsageStats.Builder builder = in testLargeAtomTruncated() 348 new BatteryUsageStats.Builder(new String[0], true, false, 0); in testLargeAtomTruncated() 377 BatteryUsageStats batteryUsageStats = builder.build(); in testLargeAtomTruncated()
|