Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d765ad15 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Fix to unbind BluetoothHeadset service" into gingerbread

parents f7a11058 de27fa37
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1184,6 +1184,10 @@ public final class BatteryStatsImpl extends BatteryStats {
        mBtHeadset = headset;
        mBtHeadset = headset;
    }
    }


    public BluetoothHeadset getBtHeadset() {
        return mBtHeadset;
    }

    int mChangedStates = 0;
    int mChangedStates = 0;


    void addHistoryRecordLocked(long curTime) {
    void addHistoryRecordLocked(long curTime) {
+5 −0
Original line number Original line Diff line number Diff line
@@ -296,8 +296,13 @@ public final class BatteryStatsService extends IBatteryStats.Stub {
    
    
    public void noteBluetoothOff() {
    public void noteBluetoothOff() {
        enforceCallingPermission();
        enforceCallingPermission();
        BluetoothHeadset headset = null;
        synchronized (mStats) {
        synchronized (mStats) {
            mStats.noteBluetoothOffLocked();
            mStats.noteBluetoothOffLocked();
            headset = mStats.getBtHeadset();
        }
        if (headset != null) {
            headset.close();
        }
        }
    }
    }