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

Commit b2229359 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 21748 into eclair

* changes:
  Get At command count from Bluetooth headset.
parents 97e47004 82cb029e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;
    }

+1 −0
Original line number Diff line number Diff line
@@ -260,6 +260,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub {
        enforceCallingPermission();
        synchronized (mStats) {
            mStats.noteBluetoothOnLocked();
            mStats.setBtHeadset(new android.bluetooth.BluetoothHeadset(mContext, null));
        }
    }