summaryrefslogtreecommitdiff
path: root/core/java/android/os/BatteryStatsManager.java
Commit message (Collapse)AuthorAgeFilesLines
* removed hidden Bluetooth permissions in BatteryStatsManagerEtienne Ruffieux2022-02-031-6/+0
| | | | | | | Tag: #feature Bug: 200202780 Test: build Change-Id: I477ec9e53ce1b945a40108ea018a42e3bcfeea32
* Moving bt stats logging to BatteryStats.Etienne Ruffieux2022-01-281-0/+38
| | | | | | | Tag: #feature Bug: 211851706 Test: manual Change-Id: I7e40b64eaa334792dd409837fb9f512714f65eec
* Add BatteryStatsManager.getBluetoothBatteryStats() APIDmitri Plotnikov2022-01-211-0/+15
| | | | | | Bug: 202876405 Test: atest FrameworksCoreTests:BatteryStatsImplTest Change-Id: I4a7f880ddad7dc98e9919356859603b17a894705
* Add BatteryStatsManager.getWakeLockStats() APIDmitri Plotnikov2021-12-171-0/+16
| | | | | | Bug: 200753927 Test: atest FrameworksCoreTests:BatteryStatsImplTest Change-Id: Iafb216250e26b93cec5106d1305fa68c6f20282f
* Added Ble scan APIs to BatteryStatsManagerEtienne Ruffieux2021-07-081-6/+63
| | | | | | | | | | | Added missing service functions to manager to prevent directly calling BatteryStatsService from Bluetooth package. Updated system-current.txt accordingly. Tag: #feature Bug: 190442794 Test: Manual Change-Id: Ie6c6d3688d2da45956d57ea1dbc2cc4430f27783
* Change required permission declaration for BatteryStatsManager.get*BatteryStatsDmitri Plotnikov2021-06-231-2/+6
| | | | | | | | | This is a compatible change: either the new or the previously declared permission are allowed by the implementation of this API. Bug: 191784003 Test: Build Change-Id: Iee7b7ad5806dd13795aea07af3bbb1d88fdabe09
* Merge "Remove throws RuntimeException from APIs" am: ad274e531a am: ↵Chiachang Wang2021-04-121-4/+2
|\ | | | | | | | | | | | | | | d07131cb98 am: 3e04c95255 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669005 Change-Id: I8c9661c382e757a458569810d519c3e0bbd2c0d2
| * Remove throws RuntimeException from APIsChiachang Wang2021-04-081-4/+2
| | | | | | | | | | | | | | | | | | | | As API review feedback, the information provides no value to a user. Remove it from BatteryStatsManager#reportWifiRadioPowerState and BatteryStatsManager#reportMobileRadioPowerState. Fix: 184735838 Test: make update-api Change-Id: I8cce6523695ba58654cbe5d1db79045eeb46d913
| * Add a new API in BatteryStatsManager for connectivity serviceAaron Huang2021-03-091-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Connectivity service(CS) is going to be a mainline module and currently it uses IBatteryStats to communicate with battery stats service directly. CS cannot use this way after becomes a mainline module so add new system APIs to communicate with battery stats service through BatteryStatsManger. The new API reportNetworkInterfaceForTransports requires system-only permission NETWORK_STACK or MAINLINE_NETWORK_STACK so that given the only caller was in ConnectivityService. This change only add new surface, the usage in CS will be updated in follow-up CL. Bug: 171686421 Test: builds, boot, mobile and wifi work. Change-Id: Ifbd4a9784ed7664751e69d530f8204e292fa6b39 Merged-In: Ifbd4a9784ed7664751e69d530f8204e292fa6b39
* | Exposed some testAPIs in BatteryStatsManagerkholoud mohamed2021-03-121-1/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the following testsAPIs to replace the usage of adb shell commands in tests: * setChargerAcOnline * setBatteryLevel * unplugBattery * resetBattery * suspendBatteryInput Test: atest MixedDeviceOwnerTest#testInstallUpdate using the adb commands and the new testAPIs Bug: 182260585 Change-Id: I48c2ad37f6240f4d7a3c437416fdcc0beeed6bd1
* | Add a new API in BatteryStatsManager for connectivity serviceAaron Huang2021-03-081-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Connectivity service(CS) is going to be a mainline module and currently it uses IBatteryStats to communicate with battery stats service directly. CS cannot use this way after becomes a mainline module so add new system APIs to communicate with battery stats service through BatteryStatsManger. The new API reportNetworkInterfaceForTransports requires system-only permission NETWORK_STACK or MAINLINE_NETWORK_STACK so that given the only caller was in ConnectivityService. This change only add new surface, the usage in CS will be updated in follow-up CL. Bug: 171686421 Test: builds, boot, mobile and wifi work. Change-Id: Ifbd4a9784ed7664751e69d530f8204e292fa6b39
* | Change the API for getting PowerProfile-only BatteryUsageStatsDmitri Plotnikov2021-02-031-1/+14
| | | | | | | | | | | | Bug: 175644968 Test: mp :BatteryStatsViewer && adb shell am start -n com.android.frameworks.core.batterystatsviewer/.BatteryStatsViewerActivity Change-Id: I66ce64321805423d2545df4691a4df8508f40440
* | Merge "[IT02] Expose system api to report radio power state" am: b1de9a09bd ↵Chiachang Wang2020-12-231-0/+47
|\| | | | | | | | | | | | | | | | | | | am: 15cc8f0f71 am: df9fc2853d Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1517498 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I04944dae4059c790f3f1015068401057d0d81b79
| * [IT02] Expose system api to report radio power stateChiachang Wang2020-12-221-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support ConnectivityService mainline, the dependency with NMS should be removed. The idle timer control API should be replaced with calling INetd interface instead of using NMS hidden API. The state reporting will be triggered from updating idle timer and netd unsolicited interface activity changed events. BatteryStatsService should be able to get the netd event by registering the listener directly. This commit exposes two system APIs to report the radio power state for wifi and mobile for supporting update idle timer from CS directly to INetd. Bug: 170598012 Test: make update-api ; m Change-Id: I286d6aa237ecb2653e1464e26a3581b8eeeb9e63
* | Merge "BatterStatsManager: Remove "flag" for wifi IntDef's"Roshan Pius2020-12-171-2/+2
|\ \
| * | BatterStatsManager: Remove "flag" for wifi IntDef'sRoshan Pius2020-12-021-2/+2
| |/ | | | | | | | | | | | | | | These are not flags, should not be marked as flags. Bug: 174237669 Test: Compiles Change-Id: Ibea22254a2d7a455dc4ee540212cc9fb736c1709
* | Add "modeled" power componentsDmitri Plotnikov2020-12-161-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Modeled power components are computed without regard for power measured with ODPM/rails. The purpose of this is mostly to support testing of power models themselves. Bug: 175644968 Test: mp :BatteryStatsViewer && adb shell am start -n com.android.frameworks.core.batterystatsviewer/.BatteryStatsViewerActivity Change-Id: Icca6fe6954776baed48b593017abd8c9bab4dfb7
* | Introduce BatteryUsageStats APIDmitri Plotnikov2020-12-031-0/+16
|/ | | | | | | Bug: 158137862 Test: Start Settings app, navigate to Apps, pick an app, navigate to Battery Change-Id: I8da8cc9501e01282b855f1bee6032911d91aaf77
* BatteryStatsManager: Address API council feedbackRoshan Pius2020-03-051-6/+8
| | | | | | Bug: 144925883 Test: Compiles Change-Id: Ibdc61769965a97222fdd968084eca71b997e8feb
* Revert "Partial Revert of ag/10161061"Roshan Pius2020-01-291-1/+1
| | | | | | | | | This reverts commit 81d7cece57540d61ea16d2d33f253b474d60a963. Reason for revert: The telephony unit tests are fixed. Bug: 148282682 Change-Id: Ib835f0abf4faf33ea3a54420c84c1f8383d663c3
* Partial Revert of ag/10161061Roshan Pius2020-01-241-1/+1
| | | | | | | | | Making battery stats final broke telephony unit tests (old mockito does not allow mocking final objects). Bug: 148282682 Test: Compiles Change-Id: Id65ba702aa551c7c23bbd6efa527ef2b930478f5
* BatteryStatsManager: Address API council feedbackRoshan Pius2020-01-231-14/+14
| | | | | | Bug: 144925883 Test: Compiles, device boots up & connects to wifi networks Change-Id: If3e96428057232053b7edcf0442fdc001aa2dc89
* BatteryStatsManager: Move constants from @hide BatteryStatsRoshan Pius2019-12-121-2/+116
| | | | | | | | | Exposed the @hide constants from BatteryStats used in BatteryStatsManager as @SystemApi. Bug: 146009681 Test: Compiles Change-Id: If1c798181b4c160453c7775bd6bb779b9e81a6ee
* [MainLine] CellularBatteryStats expose @System ApiSongFerngWang2019-11-061-0/+16
| | | | | | | | | | | 1. add getCellularBatteryStats() at BatteryStatsManager.java 2. CellularBatteryStats API transform to @System Api Bug: 138806762 Test: build pass and device boots up atest TelephonyMetricsTest Change-Id: Iec67f45f18ea26c96198bd732eadf14f878bdaa0
* Add a new BatteryStatsManager classRoshan Pius2019-10-261-0/+247
Wifi/telephony mainline modules uses IBatteryStats which is an AIDL & hence cannot be made a @SystemApi. Create a new manager class to wrap around this AIDL to expose @System Api. Bug: 138806762 Test: Device boots up & connects to wifi networks. Change-Id: Ib8816c3df17ccc562b9664e7bea1ef01ab61f697