diff options
Diffstat (limited to 'services/java/com/android/server/am/BatteryStatsService.java')
-rw-r--r-- | services/java/com/android/server/am/BatteryStatsService.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/java/com/android/server/am/BatteryStatsService.java b/services/java/com/android/server/am/BatteryStatsService.java index ab20208..99cb2c8 100644 --- a/services/java/com/android/server/am/BatteryStatsService.java +++ b/services/java/com/android/server/am/BatteryStatsService.java @@ -330,6 +330,13 @@ public final class BatteryStatsService extends IBatteryStats.Stub { synchronized (mStats) { mBluetoothPendingStats = false; mStats.noteBluetoothOffLocked(); + mStats.setBtHeadset(null); + } + + BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); + if (adapter != null && mBluetoothHeadset != null) { + adapter.closeProfileProxy(BluetoothProfile.HEADSET, mBluetoothHeadset); + mBluetoothHeadset = null; } } |