/frameworks/base/services/tests/powerstatstests/src/com/android/server/power/stats/ |
D | PowerStatsAggregatorTest.java | 81 PowerStats powerStats = new PowerStats(descriptor); in stateUpdates() local 86 powerStats.stats = new long[]{0}; in stateUpdates() 87 powerStats.uidStats.put(TEST_UID, new long[]{0}); in stateUpdates() 88 mHistory.recordPowerStats(mClock.realtime, mClock.uptime, powerStats); in stateUpdates() 98 powerStats.stats = new long[]{10000}; in stateUpdates() 99 powerStats.uidStats.put(TEST_UID, new long[]{1234}); in stateUpdates() 100 mHistory.recordPowerStats(mClock.realtime, mClock.uptime, powerStats); in stateUpdates() 118 powerStats.stats = new long[]{20000}; in stateUpdates() 119 powerStats.uidStats.put(TEST_UID, new long[]{4444}); in stateUpdates() 120 mHistory.recordPowerStats(mClock.realtime, mClock.uptime, powerStats); in stateUpdates() [all …]
|
D | MobileRadioPowerStatsCollectorTest.java | 239 PowerStats powerStats = collectPowerStats(true); in collectStats() local 240 assertThat(powerStats.durationMs).isEqualTo(100); in collectStats() 242 PowerStats.Descriptor descriptor = powerStats.descriptor; in collectStats() 245 assertThat(layout.getDeviceSleepTime(powerStats.stats)).isEqualTo(200); in collectStats() 246 assertThat(layout.getDeviceIdleTime(powerStats.stats)).isEqualTo(300); in collectStats() 247 assertThat(layout.getDeviceCallTime(powerStats.stats)).isEqualTo(40000); in collectStats() 248 assertThat(layout.getDeviceScanTime(powerStats.stats)).isEqualTo(60000); in collectStats() 249 assertThat(layout.getConsumedEnergy(powerStats.stats, 0)) in collectStats() 252 assertThat(powerStats.stateStats.size()).isEqualTo(2); in collectStats() 253 long[] state1 = powerStats.stateStats.get(MobileRadioPowerStatsCollector.makeStateKey( in collectStats() [all …]
|
D | WifiPowerStatsCollectorTest.java | 245 PowerStats powerStats = collectPowerStats(true); in collectStats_powerReportingSupported() local 246 assertThat(powerStats.durationMs).isEqualTo(7500); in collectStats_powerReportingSupported() 248 PowerStats.Descriptor descriptor = powerStats.descriptor; in collectStats_powerReportingSupported() 251 assertThat(layout.getDeviceRxTime(powerStats.stats)).isEqualTo(6000); in collectStats_powerReportingSupported() 252 assertThat(layout.getDeviceTxTime(powerStats.stats)).isEqualTo(1000); in collectStats_powerReportingSupported() 253 assertThat(layout.getDeviceScanTime(powerStats.stats)).isEqualTo(200); in collectStats_powerReportingSupported() 254 assertThat(layout.getDeviceIdleTime(powerStats.stats)).isEqualTo(300); in collectStats_powerReportingSupported() 255 assertThat(layout.getConsumedEnergy(powerStats.stats, 0)) in collectStats_powerReportingSupported() 258 verifyUidStats(powerStats); in collectStats_powerReportingSupported() 263 PowerStats powerStats = collectPowerStats(false); in collectStats_powerReportingUnsupported() local [all …]
|
D | BluetoothPowerStatsCollectorTest.java | 190 PowerStats powerStats = collectPowerStats(); in collectStats() local 191 assertThat(powerStats.durationMs).isEqualTo(7200); in collectStats() 193 BluetoothPowerStatsLayout layout = new BluetoothPowerStatsLayout(powerStats.descriptor); in collectStats() 194 assertThat(layout.getDeviceRxTime(powerStats.stats)).isEqualTo(6000); in collectStats() 195 assertThat(layout.getDeviceTxTime(powerStats.stats)).isEqualTo(1000); in collectStats() 196 assertThat(layout.getDeviceIdleTime(powerStats.stats)).isEqualTo(200); in collectStats() 197 assertThat(layout.getDeviceScanTime(powerStats.stats)).isEqualTo(800); in collectStats() 198 assertThat(layout.getConsumedEnergy(powerStats.stats, 0)) in collectStats() 201 assertThat(powerStats.uidStats.size()).isEqualTo(2); in collectStats() 202 long[] actual1 = powerStats.uidStats.get(APP_UID1); in collectStats() [all …]
|
D | PowerStatsExporterTest.java | 207 PowerStats powerStats = new PowerStats(mPowerStatsDescriptor); in recordBatteryHistory() local 209 powerStats.uidStats.put(APP_UID1, uidStats1); in recordBatteryHistory() 211 powerStats.uidStats.put(APP_UID2, uidStats2); in recordBatteryHistory() 216 mHistory.recordPowerStats(1000, 1000, powerStats); in recordBatteryHistory() 224 mCpuStatsArrayLayout.setTimeByScalingStep(powerStats.stats, 0, 11111); in recordBatteryHistory() 227 mHistory.recordPowerStats(1000, 1000, powerStats); in recordBatteryHistory() 229 mCpuStatsArrayLayout.setTimeByScalingStep(powerStats.stats, 0, 12345); in recordBatteryHistory() 232 mHistory.recordPowerStats(3000, 3000, powerStats); in recordBatteryHistory() 243 mCpuStatsArrayLayout.setTimeByScalingStep(powerStats.stats, 0, 54321); in recordBatteryHistory() 246 mHistory.recordPowerStats(6000, 6000, powerStats); in recordBatteryHistory() [all …]
|
D | BinaryStatePowerStatsProcessorTest.java | 157 PowerStats powerStats = new PowerStats(descriptor); in energyConsumerModel() local 158 powerStats.stats = new long[descriptor.statsArrayLength]; in energyConsumerModel() 163 processor.addPowerStats(stats, powerStats, mMonotonicClock.monotonicTime()); in energyConsumerModel() 174 statsLayout.setConsumedEnergy(powerStats.stats, 0, 2_160_000); in energyConsumerModel() 175 processor.addPowerStats(stats, powerStats, mMonotonicClock.monotonicTime()); in energyConsumerModel() 180 statsLayout.setConsumedEnergy(powerStats.stats, 0, 1_440_000); in energyConsumerModel() 181 processor.addPowerStats(stats, powerStats, mMonotonicClock.monotonicTime()); in energyConsumerModel()
|
D | BatteryStatsHistoryTest.java | 408 PowerStats powerStats = new PowerStats(descriptor); in recordPowerStats() local 409 powerStats.durationMs = 100; in recordPowerStats() 410 powerStats.stats[0] = 200; in recordPowerStats() 411 powerStats.uidStats.put(300, new long[]{400, 500}); in recordPowerStats() 412 powerStats.uidStats.put(600, new long[]{700, 800}); in recordPowerStats() 414 mHistory.recordPowerStats(200, 200, powerStats); in recordPowerStats()
|
D | MobileRadioPowerStatsProcessorTest.java | 227 PowerStats powerStats = collector.collectStats(); in powerProfileModel() local 229 aggregatedStats.addPowerStats(powerStats, 10_000); in powerProfileModel() 474 PowerStats powerStats = collector.collectStats(); in prepareAggregatedStats_energyConsumerModel() local 476 aggregatedStats.addPowerStats(powerStats, 10_000); in prepareAggregatedStats_energyConsumerModel()
|
D | CpuPowerStatsCollectorTest.java | 389 PowerStats powerStats = collector.collectStats(); in dump() local 393 powerStats.dump(pw); in dump()
|
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/location/gnss/hal/ |
D | GnssNativeTest.java | 80 GnssPowerStats powerStats = new GnssPowerStats(1, 2, 3, 4, 5, 6, 7, 8, new double[]{9, 10}); in testRequestPowerStats_onPowerStats_executesCallbackWithStats() local 81 mFakeGnssHal.setPowerStats(powerStats); in testRequestPowerStats_onPowerStats_executesCallbackWithStats() 88 verify(callback).onReportPowerStats(powerStats); in testRequestPowerStats_onPowerStats_executesCallbackWithStats() 100 GnssPowerStats powerStats = new GnssPowerStats(1, 2, 3, 4, 5, 6, 7, 8, new double[]{9, 10}); in testRequestPowerStatsBlocking_onPowerStats_returnsStats() local 101 mFakeGnssHal.setPowerStats(powerStats); in testRequestPowerStatsBlocking_onPowerStats_returnsStats() 103 assertThat(mGnssNative.requestPowerStatsBlocking()).isEqualTo(powerStats); in testRequestPowerStatsBlocking_onPowerStats_returnsStats() 108 GnssPowerStats powerStats = new GnssPowerStats(1, 2, 3, 4, 5, 6, 7, 8, new double[]{9, 10}); in testGetLastKnownPowerStats_onNull_preservesLastKnownPowerStats() local 110 mGnssNative.reportGnssPowerStats(powerStats); in testGetLastKnownPowerStats_onNull_preservesLastKnownPowerStats() 111 assertThat(mGnssNative.getLastKnownPowerStats()).isEqualTo(powerStats); in testGetLastKnownPowerStats_onNull_preservesLastKnownPowerStats() 114 assertThat(mGnssNative.getLastKnownPowerStats()).isEqualTo(powerStats); in testGetLastKnownPowerStats_onNull_preservesLastKnownPowerStats()
|
D | FakeGnssHal.java | 297 public void setPowerStats(GnssPowerStats powerStats) { in setPowerStats() argument 298 mState.mPowerStats = powerStats; in setPowerStats()
|
/frameworks/base/services/core/java/com/android/server/power/stats/ |
D | AggregatedPowerStats.java | 145 boolean isCompatible(PowerStats powerStats) { in isCompatible() argument 146 int powerComponentId = powerStats.descriptor.powerComponentId; in isCompatible() 148 if (stats.powerComponentId == powerComponentId && !stats.isCompatible(powerStats)) { in isCompatible() 155 void addPowerStats(PowerStats powerStats, long time) { in addPowerStats() argument 156 int powerComponentId = powerStats.descriptor.powerComponentId; in addPowerStats() 159 stats.getConfig().getProcessor().addPowerStats(stats, powerStats, time); in addPowerStats()
|
D | PowerComponentAggregatedPowerStats.java | 177 boolean isCompatible(PowerStats powerStats) { in isCompatible() argument 178 return mPowerStatsDescriptor == null || mPowerStatsDescriptor.equals(powerStats.descriptor); in isCompatible() 181 void addPowerStats(PowerStats powerStats, long timestampMs) { in addPowerStats() argument 182 mPowerStatsDescriptor = powerStats.descriptor; in addPowerStats() 188 for (int i = powerStats.stateStats.size() - 1; i >= 0; i--) { in addPowerStats() 189 int key = powerStats.stateStats.keyAt(i); in addPowerStats() 194 stateStats.increment(powerStats.stateStats.valueAt(i), timestampMs); in addPowerStats() 196 mDeviceStats.increment(powerStats.stats, timestampMs); in addPowerStats() 198 for (int i = powerStats.uidStats.size() - 1; i >= 0; i--) { in addPowerStats() 199 int uid = powerStats.uidStats.keyAt(i); in addPowerStats() [all …]
|
D | PowerStatsAggregator.java | 137 if (item.powerStats != null) { in aggregatePowerStats() 138 if (!mStats.isCompatible(item.powerStats)) { in aggregatePowerStats() 148 mStats.addPowerStats(item.powerStats, item.time); in aggregatePowerStats()
|
D | BinaryStatePowerStatsProcessor.java | 143 void addPowerStats(PowerComponentAggregatedPowerStats stats, PowerStats powerStats, in addPowerStats() argument 147 long consumedEnergy = mStatsLayout.getConsumedEnergy(powerStats.stats, 0); in addPowerStats()
|
D | PowerStatsProcessor.java | 58 void addPowerStats(PowerComponentAggregatedPowerStats stats, PowerStats powerStats, in addPowerStats() argument 60 stats.addPowerStats(powerStats, timestampMs); in addPowerStats()
|
/frameworks/base/services/core/java/com/android/server/location/gnss/ |
D | GnssMetrics.java | 641 GnssPowerStats powerStats = mGnssNative.requestPowerStatsBlocking(); in pullGnssPowerStats() local 642 if (powerStats == null) { in pullGnssPowerStats() 645 data.add(createPowerStatsEvent(atomTag, powerStats)); in pullGnssPowerStats() 651 @NonNull GnssPowerStats powerStats) { in createPowerStatsEvent() argument 653 double[] tempGnssPowerStatsOtherModes = powerStats.getOtherModesEnergyMilliJoule(); in createPowerStatsEvent() 658 (long) (powerStats.getElapsedRealtimeUncertaintyNanos()), in createPowerStatsEvent() 659 (long) (powerStats.getTotalEnergyMilliJoule() * CONVERT_MILLI_TO_MICRO), in createPowerStatsEvent() 660 (long) (powerStats.getSinglebandTrackingModeEnergyMilliJoule() in createPowerStatsEvent() 662 (long) (powerStats.getMultibandTrackingModeEnergyMilliJoule() in createPowerStatsEvent() 664 (long) (powerStats.getSinglebandAcquisitionModeEnergyMilliJoule() in createPowerStatsEvent() [all …]
|
D | GnssManagerService.java | 317 GnssPowerStats powerStats = mGnssNative.getLastKnownPowerStats(); in dump() local 318 if (powerStats != null) { in dump() 321 powerStats.dump(fd, ipw, args, mGnssNative.getCapabilities()); in dump()
|
D | GnssLocationProvider.java | 1184 mGnssNative.requestPowerStats(Runnable::run, powerStats -> {}); in onExtraCommand()
|
/frameworks/base/core/java/com/android/internal/os/ |
D | BatteryStatsHistoryIterator.java | 267 cur.powerStats = PowerStats.readFromParcel(src, mDescriptorRegistry); in readHistoryDelta() 269 cur.powerStats = null; in readHistoryDelta() 278 cur.powerStats = null; in readHistoryDelta()
|
D | BatteryStatsHistory.java | 1364 PowerStats powerStats) { in recordPowerStats() argument 1366 mHistoryCur.powerStats = powerStats; in recordPowerStats() 1773 && cur.powerStats == null in writeHistoryItem() 1811 && mHistoryLastWritten.powerStats == null in writeHistoryItem() 1863 copy.powerStats = null; in writeHistoryItem() 1938 cur.powerStats = null; in writeHistoryItem() 2071 if (cur.powerStats != null) { in writeHistoryDelta() 2073 if (!mWrittenPowerStatsDescriptors.contains(cur.powerStats.descriptor)) { in writeHistoryDelta() 2203 if (cur.powerStats != null) { in writeHistoryDelta() 2206 cur.powerStats.descriptor.writeSummaryToParcel(dest); in writeHistoryDelta() [all …]
|
/frameworks/base/services/core/java/com/android/server/location/gnss/hal/ |
D | GnssNative.java | 307 void onReportPowerStats(@Nullable GnssPowerStats powerStats); in onReportPowerStats() argument 972 mPendingPowerStatsCallbacks.add(powerStats -> { in requestPowerStats() 974 () -> executor.execute(() -> callback.onReportPowerStats(powerStats))); in requestPowerStats() 992 requestPowerStats(Runnable::run, powerStats -> { in requestPowerStatsBlocking() 993 statsWrapper.set(powerStats); in requestPowerStatsBlocking() 1236 void reportGnssPowerStats(GnssPowerStats powerStats) { in reportGnssPowerStats() argument 1239 if (powerStats != null) { in reportGnssPowerStats() 1240 mLastKnownPowerStats = powerStats; in reportGnssPowerStats() 1242 mPendingPowerStatsCallbacks.forEach(cb -> cb.onReportPowerStats(powerStats)); in reportGnssPowerStats()
|
/frameworks/base/core/java/android/os/health/ |
D | SystemHealthManager.java | 96 @Nullable IPowerStatsService powerStats) { in SystemHealthManager() argument 98 mPowerStats = powerStats; in SystemHealthManager()
|
/frameworks/base/core/java/android/app/ |
D | SystemServiceRegistry.java | 1181 IBinder powerStats = ServiceManager.getService(Context.POWER_STATS_SERVICE); in registerService() 1183 IPowerStatsService.Stub.asInterface(powerStats)); in registerService() argument
|
/frameworks/base/core/java/android/os/ |
D | BatteryStats.java | 2012 public PowerStats powerStats; field in BatteryStats.HistoryItem 2228 powerStats = null; in clear() 2279 powerStats = o.powerStats; in setToCommon() 7184 if (rec.powerStats != null && verbose) { in printNextItem() 7188 item.append(rec.powerStats.formatForBatteryHistory( in printNextItem()
|