/frameworks/base/core/tests/coretests/src/com/android/internal/os/ |
D | BatteryStatsSamplingTimerTest.java | 18 import android.os.BatteryStats; 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() [all …]
|
D | BatteryStatsTimeBaseTest.java | 22 import android.os.BatteryStats; 283 tb.computeUptime(666, BatteryStats.STATS_SINCE_CHARGED)); in testComputeUptime() 285 tb.computeUptime(666, BatteryStats.STATS_CURRENT)); in testComputeUptime() 287 tb.computeUptime(666, BatteryStats.STATS_SINCE_UNPLUGGED)); in testComputeUptime() 302 tb.computeRealtime(6666, BatteryStats.STATS_SINCE_CHARGED)); in testComputeRealtime() 304 tb.computeRealtime(6666, BatteryStats.STATS_CURRENT)); in testComputeRealtime() 306 tb.computeRealtime(6666, BatteryStats.STATS_SINCE_UNPLUGGED)); in testComputeRealtime()
|
D | BatteryStatsServTest.java | 19 import android.os.BatteryStats; 601 Assert.assertEquals(8085, serv.getLaunches(BatteryStats.STATS_SINCE_CHARGED)); in testGetLaunches() 602 Assert.assertEquals(8085-11118, serv.getLaunches(BatteryStats.STATS_CURRENT)); in testGetLaunches() 603 Assert.assertEquals(8085-17714, serv.getLaunches(BatteryStats.STATS_SINCE_UNPLUGGED)); in testGetLaunches() 638 serv.getStartTime(20000, BatteryStats.STATS_SINCE_CHARGED)); in testGetStartTimeRunning() 640 serv.getStartTime(20000, BatteryStats.STATS_CURRENT)); in testGetStartTimeRunning() 642 serv.getStartTime(20000, BatteryStats.STATS_SINCE_UNPLUGGED)); in testGetStartTimeRunning() 677 serv.getStartTime(20000, BatteryStats.STATS_SINCE_CHARGED)); in testGetStartTimeNotRunning() 679 serv.getStartTime(20000, BatteryStats.STATS_CURRENT)); in testGetStartTimeNotRunning() 681 serv.getStartTime(20000, BatteryStats.STATS_SINCE_UNPLUGGED)); in testGetStartTimeNotRunning() [all …]
|
D | BatteryStatsTimerTest.java | 19 import android.os.BatteryStats; 375 timer.getTotalTimeLocked(66, BatteryStats.STATS_SINCE_CHARGED)); in testGetTotalTimeLocked() 380 Assert.assertEquals(9800, timer.getTotalTimeLocked(66, BatteryStats.STATS_CURRENT)); in testGetTotalTimeLocked() 385 Assert.assertEquals(9600, timer.getTotalTimeLocked(66, BatteryStats.STATS_SINCE_UNPLUGGED)); in testGetTotalTimeLocked() 414 Assert.assertEquals(10000, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testGetCountLocked() 418 Assert.assertEquals(9998, timer.getCountLocked(BatteryStats.STATS_CURRENT)); in testGetCountLocked() 422 Assert.assertEquals(9996, timer.getCountLocked(BatteryStats.STATS_SINCE_UNPLUGGED)); in testGetCountLocked()
|
D | MockBatteryStatsImpl.java | 23 import android.os.BatteryStats;
|
D | BatteryStatsUidTest.java | 23 import android.os.BatteryStats;
|
/frameworks/base/services/core/java/com/android/server/am/ |
D | HealthStatsBatteryStatsWriter.java | 19 import android.os.BatteryStats; 20 import static android.os.BatteryStats.STATS_SINCE_UNPLUGGED; 49 public void writeUid(HealthStatsWriter uidWriter, BatteryStats bs, BatteryStats.Uid uid) { in writeUid() 51 BatteryStats.Timer timer; in writeUid() 52 SparseArray<? extends BatteryStats.Uid.Sensor> sensors; in writeUid() 53 SparseArray<? extends BatteryStats.Uid.Pid> pids; in writeUid() 54 BatteryStats.ControllerActivityCounter controller; in writeUid() 84 for (final Map.Entry<String,? extends BatteryStats.Uid.Wakelock> entry: in writeUid() 87 final BatteryStats.Uid.Wakelock wakelock = entry.getValue(); in writeUid() 90 timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_FULL); in writeUid() [all …]
|
D | BatteryStatsService.java | 27 import android.os.BatteryStats; 225 ServiceManager.addService(BatteryStats.SERVICE_NAME, asBinder()); in publish() 255 IBinder b = ServiceManager.getService(BatteryStats.SERVICE_NAME); in getService() 1165 flags |= BatteryStats.DUMP_HISTORY_ONLY; in dump() 1167 flags |= BatteryStats.DUMP_HISTORY_ONLY; in dump() 1178 flags |= BatteryStats.DUMP_INCLUDE_HISTORY; in dump() 1180 flags |= BatteryStats.DUMP_CHARGED_ONLY; in dump() 1182 flags |= BatteryStats.DUMP_DAILY_ONLY; in dump() 1227 flags |= BatteryStats.DUMP_VERBOSE; in dump() 1252 flags |= BatteryStats.DUMP_DEVICE_WIFI_ONLY; in dump() [all …]
|
/frameworks/base/core/java/com/android/internal/os/ |
D | MobileRadioPowerCalculator.java | 18 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() 62 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp() 65 app.mobileRxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_MOBILE_RX_DATA, in calculateApp() 67 app.mobileTxPackets = u.getNetworkActivityPackets(BatteryStats.NETWORK_MOBILE_TX_DATA, in calculateApp() 71 app.mobileRxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_MOBILE_RX_DATA, in calculateApp() 73 app.mobileTxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_MOBILE_TX_DATA, in calculateApp() [all …]
|
D | WifiPowerCalculator.java | 18 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()
|
D | WifiPowerEstimator.java | 18 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()
|
D | WakelockPowerCalculator.java | 18 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()
|
D | SensorPowerCalculator.java | 20 import android.os.BatteryStats; 35 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp() 38 final SparseArray<? extends BatteryStats.Uid.Sensor> sensorStats = u.getSensorStats(); in calculateApp() 41 final BatteryStats.Uid.Sensor sensor = sensorStats.valueAt(ise); in calculateApp() 43 final BatteryStats.Timer timer = sensor.getSensorTime(); in calculateApp() 46 case BatteryStats.Uid.Sensor.GPS: in calculateApp()
|
D | BluetoothPowerCalculator.java | 18 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()
|
D | PowerCalculator.java | 18 import android.os.BatteryStats; 34 public abstract void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp() 47 public void calculateRemaining(BatterySipper app, BatteryStats stats, long rawRealtimeUs, in calculateRemaining()
|
D | FlashlightPowerCalculator.java | 18 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()
|
D | CameraPowerCalculator.java | 18 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()
|
D | BatteryStatsHelper.java | 24 import android.os.BatteryStats; 25 import android.os.BatteryStats.Uid; 63 private static BatteryStats sStatsXfer; 65 private static ArrayMap<File, BatteryStats> sFileXfer = new ArrayMap<>(); 72 private BatteryStats mStats; 95 private int mStatsType = BatteryStats.STATS_SINCE_CHARGED; 138 public static boolean checkHasWifiPowerReporting(BatteryStats stats, PowerProfile profile) { in checkHasWifiPowerReporting() 145 public static boolean checkHasBluetoothPowerReporting(BatteryStats stats, in checkHasBluetoothPowerReporting() 191 public static BatteryStats statsFromFile(Context context, String fname) { in statsFromFile() 194 BatteryStats stats = sFileXfer.get(path); in statsFromFile() [all …]
|
D | CpuPowerCalculator.java | 18 import android.os.BatteryStats; 32 public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs, in calculateApp() 75 final ArrayMap<String, ? extends BatteryStats.Uid.Proc> processStats = u.getProcessStats(); in calculateApp() 78 final BatteryStats.Uid.Proc ps = processStats.valueAt(i); in calculateApp()
|
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/ |
D | SupplicantStateTracker.java | 24 import android.os.BatteryStats; 95 mBatteryStats = (IBatteryStats)ServiceManager.getService(BatteryStats.SERVICE_NAME); in SupplicantStateTracker() 172 case DISCONNECTED: supplState = BatteryStats.WIFI_SUPPL_STATE_DISCONNECTED; break; in sendSupplicantStateChangedBroadcast() 174 supplState = BatteryStats.WIFI_SUPPL_STATE_INTERFACE_DISABLED; break; in sendSupplicantStateChangedBroadcast() 175 case INACTIVE: supplState = BatteryStats.WIFI_SUPPL_STATE_INACTIVE; break; in sendSupplicantStateChangedBroadcast() 176 case SCANNING: supplState = BatteryStats.WIFI_SUPPL_STATE_SCANNING; break; in sendSupplicantStateChangedBroadcast() 177 case AUTHENTICATING: supplState = BatteryStats.WIFI_SUPPL_STATE_AUTHENTICATING; break; in sendSupplicantStateChangedBroadcast() 178 case ASSOCIATING: supplState = BatteryStats.WIFI_SUPPL_STATE_ASSOCIATING; break; in sendSupplicantStateChangedBroadcast() 179 case ASSOCIATED: supplState = BatteryStats.WIFI_SUPPL_STATE_ASSOCIATED; break; in sendSupplicantStateChangedBroadcast() 181 supplState = BatteryStats.WIFI_SUPPL_STATE_FOUR_WAY_HANDSHAKE; break; in sendSupplicantStateChangedBroadcast() [all …]
|
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/ |
D | BatteryInfo.java | 23 import android.os.BatteryStats; 24 import android.os.BatteryStats.HistoryItem; 41 private BatteryStats mStats; 104 new AsyncTask<Void, Void, BatteryStats>() { in getBatteryInfo() 106 protected BatteryStats doInBackground(Void... params) { in getBatteryInfo() 113 protected void onPostExecute(BatteryStats batteryStats) { in getBatteryInfo() 125 BatteryStats stats, long elapsedRealtimeUs) { in getBatteryInfo() 131 BatteryStats stats, long elapsedRealtimeUs, boolean shortString) { in getBatteryInfo() 205 private static void parse(BatteryStats stats, long remainingTimeUs, in parse()
|
/frameworks/base/core/java/android/os/health/ |
D | SystemHealthManager.java | 20 import android.os.BatteryStats; 51 ServiceManager.getService(BatteryStats.SERVICE_NAME)); in SystemHealthManager()
|
/frameworks/base/services/core/java/com/android/server/power/ |
D | Notifier.java | 36 import android.os.BatteryStats; 262 return BatteryStats.WAKE_TYPE_PARTIAL; in getBatteryStatsWakeLockMonitorType() 266 return BatteryStats.WAKE_TYPE_FULL; in getBatteryStatsWakeLockMonitorType() 272 return BatteryStats.WAKE_TYPE_PARTIAL; in getBatteryStatsWakeLockMonitorType() 275 return BatteryStats.WAKE_TYPE_DRAW; in getBatteryStatsWakeLockMonitorType()
|
/frameworks/native/include/binder/ |
D | IBatteryStats.h | 29 DECLARE_META_INTERFACE(BatteryStats);
|
/frameworks/base/core/java/android/os/ |
D | BatteryManager.java | 216 ServiceManager.getService(BatteryStats.SERVICE_NAME)); in BatteryManager()
|