diff options
author | Amith Yamasani <yamasani@google.com> | 2009-08-18 11:29:28 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2009-08-18 12:38:06 -0700 |
commit | 82cb029e2a4907ee55fed4a00493b76b3e11a7a1 (patch) | |
tree | 1264377aae5de49f1dbbbf9f1ef14b8655f03e33 /core | |
parent | 54ba86f0e236a55fb4dc3aabbd81078f586321a5 (diff) | |
download | frameworks_base-82cb029e2a4907ee55fed4a00493b76b3e11a7a1.zip frameworks_base-82cb029e2a4907ee55fed4a00493b76b3e11a7a1.tar.gz frameworks_base-82cb029e2a4907ee55fed4a00493b76b3e11a7a1.tar.bz2 |
Get At command count from Bluetooth headset.
Pass in the BT headset object when available to the BatteryStats.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/com/android/internal/os/BatteryStatsImpl.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java index a449e5f..2da72df 100644 --- a/core/java/com/android/internal/os/BatteryStatsImpl.java +++ b/core/java/com/android/internal/os/BatteryStatsImpl.java @@ -978,10 +978,13 @@ public final class BatteryStatsImpl extends BatteryStats { } else if (mBtHeadset != null) { return getCurrentBluetoothPingCount() - mBluetoothPingStart; } - return -1; + return 0; } public void setBtHeadset(BluetoothHeadset headset) { + if (headset != null && mBtHeadset == null && isOnBattery() && mBluetoothPingStart == -1) { + mBluetoothPingStart = getCurrentBluetoothPingCount(); + } mBtHeadset = headset; } |