Closed Bug 794881 Opened 8 years ago Closed 8 years ago

Phone state to dialing or connected will clear ForceForUse to None

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mchen, Assigned: mchen)

Details

Attachments

(1 file, 1 obsolete file)

On the test of BT SCO feature, the voice will be came from handset not BT_SCO.

Re-produce Steps:
  1. parring the BT handset with phone on SCO profile.
  2. Make a MO call.

Expected Result:
  Remote voice is came from BT handset.

Failed Result:
  Remote voice is came from handset.
Assignee: nobody → mchen
Attached patch WIPv1 (obsolete) — Splinter Review
During phone state of dialing or connected and speakerEnabled not set, the AudioManager.ForceForUse(NONE) can't be called or will overwrite existing value Ex: BT_SCO during communication mode.
Attachment #665352 - Flags: review?(philipp)
Comment on attachment 665352 [details] [diff] [review]
WIPv1

Review of attachment 665352 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/gonk/RadioInterfaceLayer.js
@@ +836,5 @@
>        case nsIRadioInterfaceLayer.CALL_STATE_CONNECTED:
>          gAudioManager.phoneState = nsIAudioManager.PHONE_STATE_IN_CALL;
> +        if( this.speakerEnabled )
> +          gAudioManager.setForceForUse(nsIAudioManager.USE_COMMUNICATION,
> +                                       nsIAudioManager.FORCE_SPEAKER);

Style nits:

  if (this.speakerEnabled) {
    gAudioManager.setForceForUse(nsIAudioManager.USE_COMMUNICATION,
                                 nsIAudioManager.FORCE_SPEAKER);
  }

Basically:

* Correct use of whitespace for `if`
* Always need braces for blocks

Tip: pay attention to surrounding style when modifying files. 

r=me with that.
Attachment #665352 - Flags: review?(philipp) → review+
Attached patch Reviewed_PatchSplinter Review
Follow Philikon's comment and thanks for advice.
Attachment #665352 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/6ce8440e0e2f
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.