diff options
author | Adam Lesinski <adamlesinski@google.com> | 2015-04-10 13:17:47 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2015-04-10 13:17:47 -0700 |
commit | 1739076ef9cc940c54cbde3f0576f0dc228f7d68 (patch) | |
tree | 7c795b2691d15cc27591e978ac32bd72082dfe5c /core/java/android/os/BatteryStats.java | |
parent | a826c4b7a4c7ffd471973d58e46ac6f1f2cad83a (diff) | |
download | frameworks_base-1739076ef9cc940c54cbde3f0576f0dc228f7d68.zip frameworks_base-1739076ef9cc940c54cbde3f0576f0dc228f7d68.tar.gz frameworks_base-1739076ef9cc940c54cbde3f0576f0dc228f7d68.tar.bz2 |
Fix deadlock issue in BatteryStatsHelper.
It was assumed that BatteryStatsHelper could safely call into system services.
Because it is used when dumping information from the BatteryStatsService,
this assumption was incorrect.
Now the BatteryStats object carries around the state of the energy reporting
for Bluetooth and WiFi, so BatteryStatsHelper avoids a query into WiFiManager.
b/19729960
Change-Id: I8745cf6aafeea8e862e34fe63b20056f6ba54b40
Diffstat (limited to 'core/java/android/os/BatteryStats.java')
-rw-r--r-- | core/java/android/os/BatteryStats.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java index 1566985..c7edb1a 100644 --- a/core/java/android/os/BatteryStats.java +++ b/core/java/android/os/BatteryStats.java @@ -1947,6 +1947,13 @@ public abstract class BatteryStats implements Parcelable { public static final int NUM_CONTROLLER_ACTIVITY_TYPES = CONTROLLER_POWER_DRAIN + 1; /** + * Returns true if the BatteryStats object has detailed bluetooth power reports. + * When true, calling {@link #getBluetoothControllerActivity(int, int)} will yield the + * actual power data. + */ + public abstract boolean hasBluetoothActivityReporting(); + + /** * For {@link #CONTROLLER_IDLE_TIME}, {@link #CONTROLLER_RX_TIME}, and * {@link #CONTROLLER_TX_TIME}, returns the time spent (in milliseconds) in the * respective state. @@ -1956,6 +1963,13 @@ public abstract class BatteryStats implements Parcelable { public abstract long getBluetoothControllerActivity(int type, int which); /** + * Returns true if the BatteryStats object has detailed WiFi power reports. + * When true, calling {@link #getWifiControllerActivity(int, int)} will yield the + * actual power data. + */ + public abstract boolean hasWifiActivityReporting(); + + /** * For {@link #CONTROLLER_IDLE_TIME}, {@link #CONTROLLER_RX_TIME}, and * {@link #CONTROLLER_TX_TIME}, returns the time spent (in milliseconds) in the * respective state. |