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

* commit '1bf7bca511e3fdbb5e71bb71158d56400538b910':
  Fix exception in AudioService when no BT Headset is connected.
This commit is contained in:
Andre Eisenbach
2014-10-30 23:59:39 +00:00
committed by Android Git Automerger

View File

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