/frameworks/base/core/tests/coretests/src/com/android/internal/os/ |
D | BatteryStatsSamplingTimerTest.java | 41 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData() 42 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData() 46 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData() 47 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData() 51 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData() 52 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData() 67 assertEquals(0, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testEndSampleAndContinueWhenTimeOrCountDecreases() 68 assertEquals(0, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); in testEndSampleAndContinueWhenTimeOrCountDecreases() 74 assertEquals(0, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testEndSampleAndContinueWhenTimeOrCountDecreases() 75 assertEquals(0, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); in testEndSampleAndContinueWhenTimeOrCountDecreases() [all …]
|
D | BatteryStatsStopwatchTimerTest.java | 45 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount() 47 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount() 49 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount() 51 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount() 56 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount() 64 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount() 67 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount() 73 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount() 76 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount() 87 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount() [all …]
|
D | BatteryStatsSensorTest.java | 61 assertEquals(2, sensorTimer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testSensorStartStop() 63 clocks.realtime * 1000, BatteryStats.STATS_SINCE_CHARGED)); in testSensorStartStop() 65 assertEquals(1, sensorBgTimer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testSensorStartStop() 67 clocks.realtime * 1000, BatteryStats.STATS_SINCE_CHARGED)); in testSensorStartStop() 90 sensorTimer.getTotalTimeLocked(curr, BatteryStats.STATS_SINCE_CHARGED)); in testCountingWhileOffBattery() 91 assertEquals(0, sensorTimer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCountingWhileOffBattery() 102 sensorTimer.getTotalTimeLocked(curr, BatteryStats.STATS_SINCE_CHARGED)); in testCountingWhileOffBattery() 103 assertEquals(0, sensorTimer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCountingWhileOffBattery() 125 sensorTimer.getTotalTimeLocked(curr, BatteryStats.STATS_SINCE_CHARGED)); in testCountingWhileOnBattery() 126 assertEquals(1, sensorTimer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCountingWhileOnBattery() [all …]
|
D | BatteryStatsCounterTest.java | 44 assertEquals(0, counter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCounter() 54 assertEquals(4, counter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCounter() 63 assertEquals(4, counter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCounter() 71 assertEquals(6, counter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCounter() 88 assertEquals(3, origCounter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testParceling() 102 assertEquals(4, summaryCounter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testParceling() 109 assertEquals(4, summaryCounter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testParceling() 116 assertEquals(6, summaryCounter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testParceling() 130 assertEquals(7, fullParcelCounter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testParceling() 137 assertEquals(7, fullParcelCounter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testParceling() [all …]
|
D | BatteryStatsBackgroundStatsTest.java | 18 import static android.os.BatteryStats.STATS_SINCE_CHARGED; 50 assertEquals(0, bgtb.computeRealtime(cur, STATS_SINCE_CHARGED)); in testBgTimeBase() 57 assertEquals(0, bgtb.computeRealtime(cur, STATS_SINCE_CHARGED)); in testBgTimeBase() 64 assertEquals(0, bgtb.computeRealtime(cur, STATS_SINCE_CHARGED)); in testBgTimeBase() 72 assertEquals(0, bgtb.computeRealtime(cur, STATS_SINCE_CHARGED)); in testBgTimeBase() 79 assertEquals(106_000, bgtb.computeRealtime(cur, STATS_SINCE_CHARGED)); in testBgTimeBase() 86 assertEquals(114_000, bgtb.computeRealtime(cur, STATS_SINCE_CHARGED)); in testBgTimeBase() 94 assertEquals(227_000, bgtb.computeRealtime(cur, STATS_SINCE_CHARGED)); in testBgTimeBase() 101 assertEquals(227_000, bgtb.computeRealtime(cur, STATS_SINCE_CHARGED)); in testBgTimeBase() 150 assertEquals(150_000, bgtb.computeRealtime(cur, STATS_SINCE_CHARGED)); in testScreenOffBgTimeBase() [all …]
|
D | BatteryStatsNoteTest.java | 18 import static android.os.BatteryStats.STATS_SINCE_CHARGED; 62 .getCountLocked(STATS_SINCE_CHARGED)); in testNoteBluetoothScanResultLocked() 65 assertEquals(0, bgCntr.getCountLocked(STATS_SINCE_CHARGED)); in testNoteBluetoothScanResultLocked() 72 .getCountLocked(STATS_SINCE_CHARGED)); in testNoteBluetoothScanResultLocked() 75 .getCountLocked(STATS_SINCE_CHARGED)); in testNoteBluetoothScanResultLocked() 98 long actualTime = aggregTimer.getTotalTimeLocked(300_000, STATS_SINCE_CHARGED); in testNoteStartWakeLocked() 99 long bgTime = aggregTimer.getSubTimer().getTotalTimeLocked(300_000, STATS_SINCE_CHARGED); in testNoteStartWakeLocked() 144 STATS_SINCE_CHARGED); in testNoteUidProcessStateLocked() 150 elapsedTimeUs, STATS_SINCE_CHARGED); in testNoteUidProcessStateLocked() 158 elapsedTimeUs, STATS_SINCE_CHARGED); in testNoteUidProcessStateLocked() [all …]
|
D | LongSamplingCounterArrayTest.java | 19 import static android.os.BatteryStats.STATS_SINCE_CHARGED; 140 long[] actualVal = mCounterArray.getCountsLocked(STATS_SINCE_CHARGED); in testGetCountsLocked() 145 actualVal = mCounterArray.getCountsLocked(STATS_SINCE_CHARGED); in testGetCountsLocked()
|
D | BatteryStatsTimeBaseTest.java | 283 tb.computeUptime(666, BatteryStats.STATS_SINCE_CHARGED)); in testComputeUptime() 302 tb.computeRealtime(6666, BatteryStats.STATS_SINCE_CHARGED)); in testComputeRealtime()
|
D | BatteryStatsServTest.java | 601 Assert.assertEquals(8085, serv.getLaunches(BatteryStats.STATS_SINCE_CHARGED)); in testGetLaunches() 638 serv.getStartTime(20000, BatteryStats.STATS_SINCE_CHARGED)); in testGetStartTimeRunning() 677 serv.getStartTime(20000, BatteryStats.STATS_SINCE_CHARGED)); in testGetStartTimeNotRunning() 713 Assert.assertEquals(4042, serv.getStarts(BatteryStats.STATS_SINCE_CHARGED)); in testGetStarts()
|
D | BatteryStatsTimerTest.java | 375 timer.getTotalTimeLocked(66, BatteryStats.STATS_SINCE_CHARGED)); in testGetTotalTimeLocked() 414 Assert.assertEquals(10000, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testGetCountLocked()
|
D | BatteryStatsHelperTest.java | 256 BatteryStats.STATS_SINCE_CHARGED); in testGetProcessForegroundTimeMs_largerActivityTime_returnMinTime()
|
/frameworks/base/core/java/com/android/internal/os/ |
D | BatteryStatsHelper.java | 105 private int mStatsType = BatteryStats.STATS_SINCE_CHARGED; 873 BatteryStats.STATS_SINCE_CHARGED); in smearScreenBatterySipper() 954 return timer.getTotalTimeLocked(rawRealtimeUs, BatteryStats.STATS_SINCE_CHARGED); in getForegroundActivityTotalTimeUs()
|
D | BatteryStatsImpl.java | 805 case STATS_SINCE_CHARGED: in computeUptime() 817 case STATS_SINCE_CHARGED: in computeRealtime() 889 out.writeLong(computeUptime(uptime, STATS_SINCE_CHARGED)); in writeSummaryToParcel() 890 out.writeLong(computeRealtime(realtime, STATS_SINCE_CHARGED)); in writeSummaryToParcel() 980 } else if (which != STATS_SINCE_CHARGED) { in getCountLocked() 1079 } else if (which != STATS_SINCE_CHARGED) { in getCountsLocked() 1247 } else if (which != STATS_SINCE_CHARGED) { in getCountLocked() 1456 } else if (which != STATS_SINCE_CHARGED) { in getTotalTimeLocked() 1468 } else if (which != STATS_SINCE_CHARGED) { in getCountLocked() 11123 case STATS_SINCE_CHARGED: return mUptime + (curTime-mUptimeStart); in computeUptime() [all …]
|
/frameworks/base/core/java/android/os/ |
D | BatteryStats.java | 180 public static final int STATS_SINCE_CHARGED = 0; field in BatteryStats 3209 which == STATS_SINCE_CHARGED ? getStartCount() : "N/A", in dumpCheckinLocked() 4868 computeBatteryRealtime(rawRealtime, STATS_SINCE_CHARGED))); in dumpLocked() 4875 computeBatteryRealtime(rawRealtime, STATS_SINCE_CHARGED))); in dumpLocked() 5371 numExcessive = which == STATS_SINCE_CHARGED in dumpLocked() 6340 dumpLocked(context, pw, "", STATS_SINCE_CHARGED, reqUid, in dumpLocked() 6433 dumpCheckinLocked(context, pw, STATS_SINCE_CHARGED, -1, in dumpCheckinLocked()
|