Bug 794881 - Phone state to dialing or connected will clear ForceForUse to None. r=philikon
authorMarco Chen <mchen@mozilla.com>
Fri, 28 Sep 2012 14:03:43 +0800
changeset 108638 6ce8440e0e2f67d9c1efc4be40d718a54b3f219e
parent 108637 cc62b6addaf3f1d4b0d2a0c573e6511665c5a650
child 108639 e05d8c7fc54b598630a927569f92c18991d0765b
push id15608
push userryanvm@gmail.com
push dateSat, 29 Sep 2012 16:32:50 +0000
treeherdermozilla-inbound@e05d8c7fc54b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilikon
bugs794881
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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.
dom/system/gonk/RadioInterfaceLayer.js
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -935,19 +935,20 @@ RadioInterfaceLayer.prototype = {
       case nsIRadioInterfaceLayer.CALL_STATE_INCOMING:
         gAudioManager.phoneState = nsIAudioManager.PHONE_STATE_RINGTONE;
         debug("Incoming call, put audio system into PHONE_STATE_RINGTONE: "
               + gAudioManager.phoneState);
         break;
       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;
     }
   },
 
   /**
    * Handle call state changes by updating our current state and the audio