/frameworks/base/core/tests/coretests/src/com/android/internal/os/ |
BatteryStatsCounterTest.java | 18 import android.os.BatteryStats; 44 assertEquals(0, counter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 45 assertEquals(0, counter.getCountLocked(BatteryStats.STATS_CURRENT)); 46 assertEquals(0, counter.getCountLocked(BatteryStats.STATS_SINCE_UNPLUGGED)); 54 assertEquals(4, counter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 55 assertEquals(4, counter.getCountLocked(BatteryStats.STATS_CURRENT)); 56 assertEquals(4, counter.getCountLocked(BatteryStats.STATS_SINCE_UNPLUGGED)); 63 assertEquals(4, counter.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 64 assertEquals(4, counter.getCountLocked(BatteryStats.STATS_CURRENT)); 65 assertEquals(4, counter.getCountLocked(BatteryStats.STATS_SINCE_UNPLUGGED)) [all...] |
BatteryStatsSamplingTimerTest.java | 18 import android.os.BatteryStats; 41 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 42 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); 46 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 47 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); 51 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 52 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); 67 assertEquals(0, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 68 assertEquals(0, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); 74 assertEquals(0, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)) [all...] |
BatteryStatsStopwatchTimerTest.java | 18 import android.os.BatteryStats; 36 null, BatteryStats.SENSOR, null, timeBase); 45 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 47 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 49 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 51 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 56 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 64 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 67 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 73 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)) [all...] |
BatteryStatsSensorTest.java | 19 import android.os.BatteryStats; 55 BatteryStats.Timer sensorTimer = bi.getUidStats().get(UID).getSensorStats() 57 BatteryStats.Timer sensorBgTimer = bi.getUidStats().get(UID).getSensorStats() 60 assertEquals(2, sensorTimer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 62 clocks.realtime * 1000, BatteryStats.STATS_SINCE_CHARGED)); 64 assertEquals(1, sensorBgTimer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); 66 clocks.realtime * 1000, BatteryStats.STATS_SINCE_CHARGED)); 86 BatteryStats.Timer sensorTimer = bi.getUidStats().get(UID).getSensorStats() 89 sensorTimer.getTotalTimeLocked(curr, BatteryStats.STATS_SINCE_CHARGED)); 90 assertEquals(0, sensorTimer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)) [all...] |
BatteryStatsUidTest.java | 23 import android.os.BatteryStats; 36 * Provides test cases for android.os.BatteryStats.
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/ |
BatteryWifiParser.java | 17 import android.os.BatteryStats; 18 import android.os.BatteryStats.HistoryItem; 30 case BatteryStats.WIFI_SUPPL_STATE_DISCONNECTED: 31 case BatteryStats.WIFI_SUPPL_STATE_DORMANT: 32 case BatteryStats.WIFI_SUPPL_STATE_INACTIVE: 33 case BatteryStats.WIFI_SUPPL_STATE_INTERFACE_DISABLED: 34 case BatteryStats.WIFI_SUPPL_STATE_INVALID: 35 case BatteryStats.WIFI_SUPPL_STATE_UNINITIALIZED:
|
BatteryUtils.java | 20 import android.os.BatteryStats; 78 public long getProcessTimeMs(@StatusType int type, @Nullable BatteryStats.Uid uid, 96 private long getProcessBackgroundTimeMs(BatteryStats.Uid uid, int which) { 99 BatteryStats.Uid.PROCESS_STATE_BACKGROUND, rawRealTimeUs, which); 106 private long getProcessForegroundTimeMs(BatteryStats.Uid uid, int which) { 108 final int foregroundTypes[] = {BatteryStats.Uid.PROCESS_STATE_TOP}; 167 final BatteryStats.Uid uid = sippers.get(i).uidObj; 210 * @param dischargeAmount The discharge amount calculated by {@link BatteryStats} 212 * @see BatteryStats#getDischargeAmount(int) 262 long getForegroundActivityTotalTimeMs(BatteryStats.Uid uid, long rawRealtimeMs) [all...] |
BatteryStatsHelperLoader.java | 20 import android.os.BatteryStats; 58 statsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED, mUserManager.getUserProfiles());
|
/frameworks/base/core/java/com/android/internal/os/ |
PowerCalculator.java | 18 import android.os.BatteryStats; 30 * @param statsType The type of stats. Can be {@link BatteryStats#STATS_CURRENT}, 31 * {@link BatteryStats#STATS_SINCE_CHARGED}, or 32 * {@link BatteryStats#STATS_SINCE_UNPLUGGED}. 34 public abstract void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, 40 * @param stats The BatteryStats object from which to retrieve data. 43 * @param statsType The type of stats. Can be {@link BatteryStats#STATS_CURRENT}, 44 * {@link BatteryStats#STATS_SINCE_CHARGED}, or 45 * {@link BatteryStats#STATS_SINCE_UNPLUGGED}. 47 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs [all...] |
WakelockPowerCalculator.java | 18 import android.os.BatteryStats; 33 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, 36 final ArrayMap<String, ? extends BatteryStats.Uid.Wakelock> wakelockStats = 40 final BatteryStats.Uid.Wakelock wakelock = wakelockStats.valueAt(i); 44 BatteryStats.Timer timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_PARTIAL); 61 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs,
|
WifiPowerCalculator.java | 18 import android.os.BatteryStats; 22 * WiFi power calculator for when BatteryStats supports energy reporting 41 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, 43 final BatteryStats.ControllerActivityCounter counter = u.getWifiControllerActivity(); 59 app.wifiRxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_WIFI_RX_DATA, 61 app.wifiTxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_WIFI_TX_DATA, 63 app.wifiRxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_WIFI_RX_DATA, 65 app.wifiTxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_WIFI_TX_DATA, 75 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs, 77 final BatteryStats.ControllerActivityCounter counter = stats.getWifiControllerActivity() [all...] |
WifiPowerEstimator.java | 18 import android.os.BatteryStats; 22 * Estimates WiFi power usage based on timers in BatteryStats. 51 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, 53 app.wifiRxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_WIFI_RX_DATA, 55 app.wifiTxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_WIFI_TX_DATA, 57 app.wifiRxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_WIFI_RX_DATA, 59 app.wifiTxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_WIFI_TX_DATA, 73 for (int bin = 0; bin < BatteryStats.Uid.NUM_WIFI_BATCHED_SCAN_BINS; bin++) { 88 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs,
|
SensorPowerCalculator.java | 20 import android.os.BatteryStats; 35 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, 38 final SparseArray<? extends BatteryStats.Uid.Sensor> sensorStats = u.getSensorStats(); 41 final BatteryStats.Uid.Sensor sensor = sensorStats.valueAt(ise); 43 final BatteryStats.Timer timer = sensor.getSensorTime(); 46 case BatteryStats.Uid.Sensor.GPS:
|
MemoryPowerCalculator.java | 3 import android.os.BatteryStats; 25 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, 29 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs, 33 LongSparseArray<? extends BatteryStats.Timer> timers = stats.getKernelMemoryStats();
|
CameraPowerCalculator.java | 18 import android.os.BatteryStats; 33 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, 38 final BatteryStats.Timer timer = u.getCameraTurnedOnTimer();
|
FlashlightPowerCalculator.java | 18 import android.os.BatteryStats; 31 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, 36 final BatteryStats.Timer timer = u.getFlashlightTurnedOnTimer();
|
MobileRadioPowerCalculator.java | 18 import android.os.BatteryStats; 28 private BatteryStats mStats; 38 final long mobileRx = mStats.getNetworkActivityPackets(BatteryStats.NETWORK_MOBILE_RX_DATA, 40 final long mobileTx = mStats.getNetworkActivityPackets(BatteryStats.NETWORK_MOBILE_TX_DATA, 52 public MobileRadioPowerCalculator(PowerProfile profile, BatteryStats stats) { 62 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, 65 app.mobileRxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_MOBILE_RX_DATA, 67 app.mobileTxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_MOBILE_TX_DATA, 71 app.mobileRxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_MOBILE_RX_DATA, 73 app.mobileTxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_MOBILE_TX_DATA [all...] |
BluetoothPowerCalculator.java | 18 import android.os.BatteryStats; 37 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, 40 final BatteryStats.ControllerActivityCounter counter = u.getBluetoothControllerActivity(); 59 app.btRxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_BT_RX_DATA, statsType); 60 app.btTxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_BT_TX_DATA, statsType); 67 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs, 69 final BatteryStats.ControllerActivityCounter counter =
|
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/ |
WifiStateTracker.java | 19 import android.os.BatteryStats; 26 * This class is used to track WifiState to update BatteryStats 54 * WifiState corresponding to BatteryStats. 58 int reportState = BatteryStats.WIFI_STATE_OFF; 62 reportState = BatteryStats.WIFI_STATE_OFF_SCANNING; 65 reportState = BatteryStats.WIFI_STATE_ON_DISCONNECTED; 68 reportState = BatteryStats.WIFI_STATE_ON_CONNECTED_STA; 71 reportState = BatteryStats.WIFI_STATE_SOFT_AP;
|
SupplicantStateTracker.java | 24 import android.os.BatteryStats; 189 case DISCONNECTED: supplState = BatteryStats.WIFI_SUPPL_STATE_DISCONNECTED; break; 191 supplState = BatteryStats.WIFI_SUPPL_STATE_INTERFACE_DISABLED; break; 192 case INACTIVE: supplState = BatteryStats.WIFI_SUPPL_STATE_INACTIVE; break; 193 case SCANNING: supplState = BatteryStats.WIFI_SUPPL_STATE_SCANNING; break; 194 case AUTHENTICATING: supplState = BatteryStats.WIFI_SUPPL_STATE_AUTHENTICATING; break; 195 case ASSOCIATING: supplState = BatteryStats.WIFI_SUPPL_STATE_ASSOCIATING; break; 196 case ASSOCIATED: supplState = BatteryStats.WIFI_SUPPL_STATE_ASSOCIATED; break; 198 supplState = BatteryStats.WIFI_SUPPL_STATE_FOUR_WAY_HANDSHAKE; break; 199 case GROUP_HANDSHAKE: supplState = BatteryStats.WIFI_SUPPL_STATE_GROUP_HANDSHAKE; break [all...] |
/frameworks/base/services/core/java/com/android/server/am/ |
HealthStatsBatteryStatsWriter.java | 19 import android.os.BatteryStats; 20 import static android.os.BatteryStats.STATS_SINCE_UNPLUGGED; 47 * Writes the contents of a BatteryStats.Uid into a HealthStatsWriter. 50 public void writeUid(HealthStatsWriter uidWriter, BatteryStats bs, BatteryStats.Uid uid) { 52 BatteryStats.Timer timer; 53 SparseArray<? extends BatteryStats.Uid.Sensor> sensors; 54 SparseArray<? extends BatteryStats.Uid.Pid> pids; 55 BatteryStats.ControllerActivityCounter controller; 85 for (final Map.Entry<String,? extends BatteryStats.Uid.Wakelock> entry [all...] |
/cts/hostsidetests/incident/apps/batterystatsapp/res/xml/ |
syncadapter.xml | 18 android:contentAuthority="com.android.server.cts.device.batterystats.provider" 19 android:accountType="com.android.server.cts.device.batterystats"
|
/cts/hostsidetests/incident/apps/batterystatsapp/src/com/android/server/cts/device/batterystats/ |
BatteryStatsBackgroundService.java | 17 package com.android.server.cts.device.batterystats; 19 import static com.android.server.cts.device.batterystats.BatteryStatsBgVsFgActions.KEY_ACTION; 20 import static com.android.server.cts.device.batterystats.BatteryStatsBgVsFgActions.KEY_REQUEST_CODE; 21 import static com.android.server.cts.device.batterystats.BatteryStatsBgVsFgActions.doAction;
|
BatteryStatsForegroundActivity.java | 17 package com.android.server.cts.device.batterystats; 19 import static com.android.server.cts.device.batterystats.BatteryStatsBgVsFgActions.ACTION_SYNC; 20 import static com.android.server.cts.device.batterystats.BatteryStatsBgVsFgActions.KEY_ACTION; 21 import static com.android.server.cts.device.batterystats.BatteryStatsBgVsFgActions.KEY_REQUEST_CODE; 22 import static com.android.server.cts.device.batterystats.BatteryStatsBgVsFgActions.doAction;
|
BatteryStatsProvider.java | 16 package com.android.server.cts.device.batterystats; 27 public static final String AUTHORITY = "com.android.server.cts.device.batterystats.provider";
|