Home
last modified time | relevance | path

Searched refs:BatteryStats (Results 1 – 25 of 81) sorted by relevance

1234

/frameworks/base/core/tests/coretests/src/com/android/internal/os/
DBatteryStatsSamplingTimerTest.java19 import android.os.BatteryStats;
43 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData()
44 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData()
48 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData()
49 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData()
53 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData()
54 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData()
69 assertEquals(0, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testEndSampleAndContinueWhenTimeOrCountDecreases()
70 assertEquals(0, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); in testEndSampleAndContinueWhenTimeOrCountDecreases()
76 assertEquals(0, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testEndSampleAndContinueWhenTimeOrCountDecreases()
[all …]
DBatteryStatsStopwatchTimerTest.java19 import android.os.BatteryStats;
38 null, BatteryStats.SENSOR, null, timeBase); 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()
53 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount()
58 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount()
66 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount()
69 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount()
75 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount()
[all …]
DBatteryStatsSensorTest.java20 import android.os.BatteryStats;
58 BatteryStats.Timer sensorTimer = bi.getUidStats().get(UID).getSensorStats() in testSensorStartStop()
60 BatteryStats.Timer sensorBgTimer = bi.getUidStats().get(UID).getSensorStats() in testSensorStartStop()
63 assertEquals(2, sensorTimer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testSensorStartStop()
65 clocks.realtime * 1000, BatteryStats.STATS_SINCE_CHARGED)); in testSensorStartStop()
67 assertEquals(1, sensorBgTimer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testSensorStartStop()
69 clocks.realtime * 1000, BatteryStats.STATS_SINCE_CHARGED)); in testSensorStartStop()
89 BatteryStats.Timer sensorTimer = bi.getUidStats().get(UID).getSensorStats() in testCountingWhileOffBattery()
92 sensorTimer.getTotalTimeLocked(curr, BatteryStats.STATS_SINCE_CHARGED)); in testCountingWhileOffBattery()
93 assertEquals(0, sensorTimer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCountingWhileOffBattery()
[all …]
DBatteryStatsCounterTest.java19 import android.os.BatteryStats;
46 assertEquals(0, counter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCounter()
54 assertEquals(4, counter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCounter()
61 assertEquals(4, counter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCounter()
67 assertEquals(6, counter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCounter()
82 assertEquals(3, origCounter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testParceling()
94 assertEquals(4, summaryCounter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testParceling()
99 assertEquals(4, summaryCounter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testParceling()
104 assertEquals(6, summaryCounter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testParceling()
116 assertEquals(7, fullParcelCounter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testParceling()
[all …]
DPowerCalculatorTest.java23 import android.os.BatteryStats;
55 BatteryStats.Uid u = mock(BatteryStats.Uid.class); in testMediaPowerCalculator()
56 BatteryStats.Timer audioTimer = mock(BatteryStats.Timer.class); in testMediaPowerCalculator()
59 BatteryStats.Timer videoTimer = mock(BatteryStats.Timer.class); in testMediaPowerCalculator()
DBatteryStatsImplTest.java19 import static android.os.BatteryStats.STATS_SINCE_CHARGED;
20 import static android.os.BatteryStats.Uid.NUM_PROCESS_STATE;
21 import static android.os.BatteryStats.Uid.PROCESS_STATE_BACKGROUND;
22 import static android.os.BatteryStats.Uid.PROCESS_STATE_CACHED;
23 import static android.os.BatteryStats.Uid.PROCESS_STATE_FOREGROUND_SERVICE;
24 import static android.os.BatteryStats.Uid.PROCESS_STATE_TOP;
34 import android.os.BatteryStats;
98 final BatteryStats.Uid u = mBatteryStatsImpl.getUidStatsLocked(testUids[i]); in testUpdateProcStateCpuTimes()
109 final BatteryStats.Uid u = mBatteryStatsImpl.getUidStats().get(testUids[i]); in testUpdateProcStateCpuTimes()
136 final BatteryStats.Uid u = mBatteryStatsImpl.getUidStats().get(testUids[i]); in testUpdateProcStateCpuTimes()
[all …]
DBatteryStatsDurationTimerTest.java19 import android.os.BatteryStats;
42 null, BatteryStats.WAKE_TYPE_PARTIAL, null, timeBase); in testStartStop()
114 null, BatteryStats.WAKE_TYPE_PARTIAL, null, timeBase); in testReset()
150 null, BatteryStats.WAKE_TYPE_PARTIAL, null, timeBase); in testResetAndDetach()
177 null, BatteryStats.WAKE_TYPE_PARTIAL, null, timeBase); in testParceling()
198 null, BatteryStats.WAKE_TYPE_PARTIAL, null, timeBase); in testParceling()
216 null, BatteryStats.WAKE_TYPE_PARTIAL, null, timeBase, fullParcel); in testParceling()
DBatteryStatsNoteTest.java19 import static android.os.BatteryStats.STATS_SINCE_CHARGED;
20 import static android.os.BatteryStats.WAKE_TYPE_PARTIAL;
23 import android.os.BatteryStats;
24 import android.os.BatteryStats.HistoryItem;
25 import android.os.BatteryStats.Uid.Sensor;
70 BatteryStats.Counter bgCntr = bi.getUidStats().get(UID).getBluetoothScanResultBgCounter(); in testNoteBluetoothScanResultLocked()
107 BatteryStats.Timer aggregTimer = bi.getUidStats().get(UID) in testNoteStartWakeLocked()
153 BatteryStats.Uid uid = bi.getUidStats().get(UID); in testNoteUidProcessStateLocked()
156 actualRunTimeUs = uid.getProcessStateTime(BatteryStats.Uid.PROCESS_STATE_TOP, elapsedTimeUs, in testNoteUidProcessStateLocked()
161 actualRunTimeUs = uid.getProcessStateTime(BatteryStats.Uid.PROCESS_STATE_FOREGROUND_SERVICE, in testNoteUidProcessStateLocked()
[all …]
/frameworks/base/services/core/java/com/android/server/am/
DHealthStatsBatteryStatsWriter.java19 import android.os.BatteryStats;
20 import static android.os.BatteryStats.STATS_SINCE_CHARGED;
50 public void writeUid(HealthStatsWriter uidWriter, BatteryStats bs, BatteryStats.Uid uid) { in writeUid()
52 BatteryStats.Timer timer; in writeUid()
53 SparseArray<? extends BatteryStats.Uid.Sensor> sensors; in writeUid()
54 SparseArray<? extends BatteryStats.Uid.Pid> pids; in writeUid()
55 BatteryStats.ControllerActivityCounter controller; in writeUid()
85 for (final Map.Entry<String,? extends BatteryStats.Uid.Wakelock> entry: in writeUid()
88 final BatteryStats.Uid.Wakelock wakelock = entry.getValue(); in writeUid()
91 timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_FULL); in writeUid()
[all …]
/frameworks/base/config/
Dhiddenapi-greylist-max-p.txt11 Landroid/os/BatteryStats$Counter;-><init>()V
12 Landroid/os/BatteryStats$HistoryItem;->clear()V
13 Landroid/os/BatteryStats$HistoryItem;->next:Landroid/os/BatteryStats$HistoryItem;
14 Landroid/os/BatteryStats$HistoryItem;->same(Landroid/os/BatteryStats$HistoryItem;)Z
15 Landroid/os/BatteryStats$HistoryItem;->setTo(JBLandroid/os/BatteryStats$HistoryItem;)V
16 Landroid/os/BatteryStats$HistoryItem;->setTo(Landroid/os/BatteryStats$HistoryItem;)V
17 Landroid/os/BatteryStats$Timer;-><init>()V
18 Landroid/os/BatteryStats$Uid$Pkg;-><init>()V
19 Landroid/os/BatteryStats$Uid$Proc;-><init>()V
20 Landroid/os/BatteryStats$Uid$Sensor;-><init>()V
[all …]
/frameworks/base/core/java/com/android/internal/os/
DMobileRadioPowerCalculator.java18 import android.os.BatteryStats;
28 private BatteryStats mStats;
38 final long mobileRx = mStats.getNetworkActivityPackets(BatteryStats.NETWORK_MOBILE_RX_DATA, in getMobilePowerPerPacket()
40 final long mobileTx = mStats.getNetworkActivityPackets(BatteryStats.NETWORK_MOBILE_TX_DATA, in getMobilePowerPerPacket()
52 public MobileRadioPowerCalculator(PowerProfile profile, BatteryStats stats) { in MobileRadioPowerCalculator()
84 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp()
87 app.mobileRxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_MOBILE_RX_DATA, in calculateApp()
89 app.mobileTxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_MOBILE_TX_DATA, in calculateApp()
93 app.mobileRxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_MOBILE_RX_DATA, in calculateApp()
95 app.mobileTxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_MOBILE_TX_DATA, in calculateApp()
[all …]
DWifiPowerCalculator.java18 import android.os.BatteryStats;
41 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp()
43 final BatteryStats.ControllerActivityCounter counter = u.getWifiControllerActivity(); in calculateApp()
59 app.wifiRxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_WIFI_RX_DATA, in calculateApp()
61 app.wifiTxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_WIFI_TX_DATA, in calculateApp()
63 app.wifiRxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_WIFI_RX_DATA, in calculateApp()
65 app.wifiTxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_WIFI_TX_DATA, in calculateApp()
75 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs, in calculateRemaining()
77 final BatteryStats.ControllerActivityCounter counter = stats.getWifiControllerActivity(); in calculateRemaining()
DSensorPowerCalculator.java20 import android.os.BatteryStats;
32 BatteryStats stats, long rawRealtimeUs, int statsType) { in SensorPowerCalculator()
38 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp()
41 final SparseArray<? extends BatteryStats.Uid.Sensor> sensorStats = u.getSensorStats(); in calculateApp()
44 final BatteryStats.Uid.Sensor sensor = sensorStats.valueAt(ise); in calculateApp()
46 final BatteryStats.Timer timer = sensor.getSensorTime(); in calculateApp()
50 case BatteryStats.Uid.Sensor.GPS: in calculateApp()
68 private double getAverageGpsPower(PowerProfile profile, BatteryStats stats, long rawRealtimeUs, in getAverageGpsPower()
DWakelockPowerCalculator.java18 import android.os.BatteryStats;
33 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp()
36 final ArrayMap<String, ? extends BatteryStats.Uid.Wakelock> wakelockStats = in calculateApp()
40 final BatteryStats.Uid.Wakelock wakelock = wakelockStats.valueAt(i); in calculateApp()
44 BatteryStats.Timer timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_PARTIAL); in calculateApp()
61 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs, in calculateRemaining()
DWifiPowerEstimator.java18 import android.os.BatteryStats;
51 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp()
53 app.wifiRxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_WIFI_RX_DATA, in calculateApp()
55 app.wifiTxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_WIFI_TX_DATA, in calculateApp()
57 app.wifiRxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_WIFI_RX_DATA, in calculateApp()
59 app.wifiTxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_WIFI_TX_DATA, in calculateApp()
73 for (int bin = 0; bin < BatteryStats.Uid.NUM_WIFI_BATCHED_SCAN_BINS; bin++) { in calculateApp()
88 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs, in calculateRemaining()
DBluetoothPowerCalculator.java18 import android.os.BatteryStats;
37 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp()
40 final BatteryStats.ControllerActivityCounter counter = u.getBluetoothControllerActivity(); in calculateApp()
59 app.btRxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_BT_RX_DATA, statsType); in calculateApp()
60 app.btTxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_BT_TX_DATA, statsType); in calculateApp()
67 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs, in calculateRemaining()
69 final BatteryStats.ControllerActivityCounter counter = in calculateRemaining()
DMediaPowerCalculator.java18 import android.os.BatteryStats;
36 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp()
40 final BatteryStats.Timer audioTimer = u.getAudioTurnedOnTimer(); in calculateApp()
51 final BatteryStats.Timer videoTimer = u.getVideoTurnedOnTimer(); in calculateApp()
DPowerCalculator.java18 import android.os.BatteryStats;
35 public abstract void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp()
49 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs, in calculateRemaining()
DMemoryPowerCalculator.java3 import android.os.BatteryStats;
25 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp()
29 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs, in calculateRemaining()
33 LongSparseArray<? extends BatteryStats.Timer> timers = stats.getKernelMemoryStats(); in calculateRemaining()
DCameraPowerCalculator.java18 import android.os.BatteryStats;
33 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp()
38 final BatteryStats.Timer timer = u.getCameraTurnedOnTimer(); in calculateApp()
DFlashlightPowerCalculator.java18 import android.os.BatteryStats;
31 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp()
36 final BatteryStats.Timer timer = u.getFlashlightTurnedOnTimer(); in calculateApp()
DBatteryStatsHelper.java27 import android.os.BatteryStats;
28 import android.os.BatteryStats.Uid;
71 private static BatteryStats sStatsXfer;
73 private static ArrayMap<File, BatteryStats> sFileXfer = new ArrayMap<>();
81 private BatteryStats mStats;
110 private int mStatsType = BatteryStats.STATS_SINCE_CHARGED;
158 public static boolean checkHasWifiPowerReporting(BatteryStats stats, PowerProfile profile) { in checkHasWifiPowerReporting()
165 public static boolean checkHasBluetoothPowerReporting(BatteryStats stats, in checkHasBluetoothPowerReporting()
221 public static BatteryStats statsFromFile(Context context, String fname) { in statsFromFile()
224 BatteryStats stats = sFileXfer.get(path); in statsFromFile()
[all …]
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/
DWifiStateTracker.java19 import android.os.BatteryStats;
62 int reportState = BatteryStats.WIFI_STATE_OFF; in updateState()
66 reportState = BatteryStats.WIFI_STATE_OFF_SCANNING; in updateState()
69 reportState = BatteryStats.WIFI_STATE_ON_DISCONNECTED; in updateState()
72 reportState = BatteryStats.WIFI_STATE_ON_CONNECTED_STA; in updateState()
75 reportState = BatteryStats.WIFI_STATE_SOFT_AP; in updateState()
DSupplicantStateTracker.java24 import android.os.BatteryStats;
189 case DISCONNECTED: supplState = BatteryStats.WIFI_SUPPL_STATE_DISCONNECTED; break; in sendSupplicantStateChangedBroadcast()
191 supplState = BatteryStats.WIFI_SUPPL_STATE_INTERFACE_DISABLED; break; in sendSupplicantStateChangedBroadcast()
192 case INACTIVE: supplState = BatteryStats.WIFI_SUPPL_STATE_INACTIVE; break; in sendSupplicantStateChangedBroadcast()
193 case SCANNING: supplState = BatteryStats.WIFI_SUPPL_STATE_SCANNING; break; in sendSupplicantStateChangedBroadcast()
194 case AUTHENTICATING: supplState = BatteryStats.WIFI_SUPPL_STATE_AUTHENTICATING; break; in sendSupplicantStateChangedBroadcast()
195 case ASSOCIATING: supplState = BatteryStats.WIFI_SUPPL_STATE_ASSOCIATING; break; in sendSupplicantStateChangedBroadcast()
196 case ASSOCIATED: supplState = BatteryStats.WIFI_SUPPL_STATE_ASSOCIATED; break; in sendSupplicantStateChangedBroadcast()
198 supplState = BatteryStats.WIFI_SUPPL_STATE_FOUR_WAY_HANDSHAKE; break; in sendSupplicantStateChangedBroadcast()
199 case GROUP_HANDSHAKE: supplState = BatteryStats.WIFI_SUPPL_STATE_GROUP_HANDSHAKE; break; in sendSupplicantStateChangedBroadcast()
[all …]
/frameworks/base/core/java/android/os/connectivity/
DWifiBatteryStats.java18 import android.os.BatteryStats;
239 Math.min(t.length, BatteryStats.NUM_WIFI_STATES)); in setTimeInStateMs()
245 Math.min(t.length, BatteryStats.NUM_WIFI_SIGNAL_STRENGTH_BINS)); in setTimeInRxSignalStrengthLevelMs()
251 t, 0, Math.min(t.length, BatteryStats.NUM_WIFI_SUPPL_STATES)); in setTimeInSupplicantStateMs()
283 mTimeInStateMs = new long[BatteryStats.NUM_WIFI_STATES]; in initialize()
285 mTimeInRxSignalStrengthLevelMs = new long[BatteryStats.NUM_WIFI_SIGNAL_STRENGTH_BINS]; in initialize()
287 mTimeInSupplicantStateMs = new long[BatteryStats.NUM_WIFI_SUPPL_STATES]; in initialize()

1234