Merge change 21748 into eclair
* changes: Get At command count from Bluetooth headset.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -260,6 +260,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub {
|
||||
enforceCallingPermission();
|
||||
synchronized (mStats) {
|
||||
mStats.noteBluetoothOnLocked();
|
||||
mStats.setBtHeadset(new android.bluetooth.BluetoothHeadset(mContext, null));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user