Closed
Bug 811204
Opened 13 years ago
Closed 13 years ago
[Dialer] voice call can't switch between speaker and bt sco audio path
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(blocking-basecamp:+, firefox18 fixed, firefox19 fixed)
RESOLVED
FIXED
blocking-basecamp | + |
People
(Reporter: rlin, Assigned: rlin)
Details
Attachments
(1 file, 3 obsolete files)
4.17 KB,
patch
|
Details | Diff | Splinter Review |
1. make voice call, make sure bt sco is connected
2. switch to speaker
3. switch back to bt sco, found the voice sound output to receiver
![]() |
Assignee | |
Updated•13 years ago
|
Assignee: nobody → rlin
![]() |
Assignee | |
Updated•13 years ago
|
blocking-basecamp: --- → ?
![]() |
Assignee | |
Comment 1•13 years ago
|
||
Attachment #680983 -
Flags: review?(mwu)
Updated•13 years ago
|
blocking-basecamp: ? → +
![]() |
Assignee | |
Comment 2•13 years ago
|
||
try server result: pass
https://tbpl.mozilla.org/?tree=Try&rev=b6435d19c8c3
Comment 3•13 years ago
|
||
Comment on attachment 680983 [details] [diff] [review]
fix-patch1
Review of attachment 680983 [details] [diff] [review]:
-----------------------------------------------------------------
Approach looks ok for now, but it needs some cleanup.
::: dom/system/gonk/AudioManager.cpp
@@ +53,5 @@
> static int sHeadsetState;
> static int kBtSampleRate = 8000;
>
> static bool
> +IsBtScoOn()
Let's just generalize this (and IsFmRadioAudioOn) function to take a device and report whether it is available.
@@ +59,5 @@
> + if (static_cast<
> + audio_policy_dev_state_t (*) (audio_devices_t, const char *)
> + >(AudioSystem::getDeviceConnectionState)) {
> + return AudioSystem::getDeviceConnectionState(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET, "") ==
> + AUDIO_POLICY_DEVICE_STATE_AVAILABLE ? true : false;
While we're at it, remove ? true : false since the == comparison does that for us already.
@@ +61,5 @@
> + >(AudioSystem::getDeviceConnectionState)) {
> + return AudioSystem::getDeviceConnectionState(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET, "") ==
> + AUDIO_POLICY_DEVICE_STATE_AVAILABLE ? true : false;
> + } else {
> + return false;
Remove the else - we can just return false;
@@ +324,5 @@
> AudioManager::SetForceForUse(int32_t aUsage, int32_t aForce)
> {
> status_t status = 0;
> +
> + if (IsBtScoOn() == true && aUsage == nsIAudioManager::USE_COMMUNICATION
Comparing against true is unnecessary, especially since that function returns a boolean.
Make sure you put && at the end of lines instead of the beginning.
Avoid any trailing whitespace when adding code.
Attachment #680983 -
Flags: review?(mwu)
Updated•13 years ago
|
Hardware: x86_64 → All
![]() |
Assignee | |
Comment 4•13 years ago
|
||
Attachment #680983 -
Attachment is obsolete: true
Attachment #681815 -
Flags: review?(mwu)
Comment 5•13 years ago
|
||
Comment on attachment 681815 [details] [diff] [review]
bug-806262-fix.patch2
Review of attachment 681815 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/system/gonk/AudioManager.cpp
@@ +65,1 @@
> return false;
The indentation is off here.
@@ +310,5 @@
> AudioManager::SetForceForUse(int32_t aUsage, int32_t aForce)
> {
> status_t status = 0;
> +
> + if (IsDeviceOn(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET) && aUsage == nsIAudioManager::USE_COMMUNICATION &&
This line is a bit long. Put the aUsage == ... check on the next line and align everything with IsDeviceOn.
![]() |
Assignee | |
Comment 6•13 years ago
|
||
Attachment #681815 -
Attachment is obsolete: true
Attachment #681815 -
Flags: review?(mwu)
Attachment #681823 -
Flags: review?(mwu)
Comment 7•13 years ago
|
||
Comment on attachment 681823 [details] [diff] [review]
patch3
Review of attachment 681823 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good, thanks.
Note that the Mozilla coding style is {} for every if/while/for/etc. statement, even if it's not necessary. I don't care much for this but other reviewers do, and that appears to be the style in this file.
Attachment #681823 -
Flags: review?(mwu) → review+
![]() |
Assignee | |
Comment 8•13 years ago
|
||
add a=blocking-basecamp
![]() |
Assignee | |
Updated•13 years ago
|
Keywords: checkin-needed
Updated•13 years ago
|
Attachment #681823 -
Attachment is obsolete: true
Comment 9•13 years ago
|
||
Keywords: checkin-needed
Comment 10•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 11•13 years ago
|
||
status-firefox18:
--- → fixed
status-firefox19:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•