Bug 794881 - Phone state to dialing or connected will clear ForceForUse to None. r=philikon

During phone state of dialing or connected and speakerEnabled not set, the
AudioManager.ForceForUse(NONE) can't be called or will overrite existing
value Ex: BT_SCO during communication mode.
This commit is contained in:
Marco Chen 2012-09-28 14:03:43 +08:00
parent 458e5547c7
commit ff9e704159

View File

@ -940,9 +940,10 @@ RadioInterfaceLayer.prototype = {
case nsIRadioInterfaceLayer.CALL_STATE_DIALING: // Fall through...
case nsIRadioInterfaceLayer.CALL_STATE_CONNECTED:
gAudioManager.phoneState = nsIAudioManager.PHONE_STATE_IN_CALL;
let force = this.speakerEnabled ? nsIAudioManager.FORCE_SPEAKER
: nsIAudioManager.FORCE_NONE;
gAudioManager.setForceForUse(nsIAudioManager.USE_COMMUNICATION, force);
if (this.speakerEnabled) {
gAudioManager.setForceForUse(nsIAudioManager.USE_COMMUNICATION,
nsIAudioManager.FORCE_SPEAKER);
}
debug("Active call, put audio system into PHONE_STATE_IN_CALL: "
+ gAudioManager.phoneState);
break;