am 34964701: am db41880d: Merge "Fix exception in AudioService when no BT Headset is connected." into lmp-mr1-dev

* commit '34964701e0ff9c07e8d3456fe6d1246d6e8078d1':
  Fix exception in AudioService when no BT Headset is connected.
This commit is contained in:
Andre Eisenbach
2014-10-30 23:42:40 +00:00
committed by Android Git Automerger

View File

@@ -2574,13 +2574,17 @@ public class AudioService extends IAudioService.Stub {
if (mScoAudioState == SCO_STATE_INACTIVE) { if (mScoAudioState == SCO_STATE_INACTIVE) {
mScoAudioMode = scoAudioMode; mScoAudioMode = scoAudioMode;
if (scoAudioMode == SCO_MODE_UNDEFINED) { if (scoAudioMode == SCO_MODE_UNDEFINED) {
mScoAudioMode = new Integer(Settings.Global.getInt( if (mBluetoothHeadsetDevice != null) {
mContentResolver, mScoAudioMode = new Integer(Settings.Global.getInt(
"bluetooth_sco_channel_"+ mContentResolver,
mBluetoothHeadsetDevice.getAddress(), "bluetooth_sco_channel_"+
SCO_MODE_VIRTUAL_CALL)); mBluetoothHeadsetDevice.getAddress(),
if (mScoAudioMode > SCO_MODE_MAX || mScoAudioMode < 0) { SCO_MODE_VIRTUAL_CALL));
mScoAudioMode = SCO_MODE_VIRTUAL_CALL; if (mScoAudioMode > SCO_MODE_MAX || mScoAudioMode < 0) {
mScoAudioMode = SCO_MODE_VIRTUAL_CALL;
}
} else {
mScoAudioMode = SCO_MODE_RAW;
} }
} }
if (mBluetoothHeadset != null && mBluetoothHeadsetDevice != null) { if (mBluetoothHeadset != null && mBluetoothHeadsetDevice != null) {