Closed Bug 819858 Opened 12 years ago Closed 12 years ago

Cannot get telephony channel change when calling

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-basecamp:+, firefox19 fixed, firefox20 fixed, b2g18 fixed)

RESOLVED FIXED
B2G C3 (12dec-1jan)
blocking-basecamp +
Tracking Status
firefox19 --- fixed
firefox20 --- fixed
b2g18 --- fixed

People

(Reporter: alive, Assigned: mchen)

References

Details

Attachments

(1 file, 3 obsolete files)

This is follow up of bug 811222 and bug 815445.

The audio-channel-changed event is expected to be got with 'telephony' when on a call.

This blocks bug 810780 but I had a workaround in gaia. Anyway this should be fixed.
This should be P1 bb+ due to blocking of a P1 bb+ bug (C2).
Anyone who can take this, please take this asap.
Attached patch v1 (obsolete) (deleted) — Splinter Review
1. The root cause of original code is that audio-change-event is triggered by AudioChannelService::UnregisterType(). But new API for telephony just changed the ref count of telephony channel but not do Register/UnregisterType(). So no event will be fired.

2. This patch tried to use AudioChannelAgent to instead of new APIs so this way will trigger the Register/UnregsiterType() then event will be fired.
Attachment #690344 - Flags: review?(amarchesini)
Comment on attachment 690344 [details] [diff] [review]
v1

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

::: dom/system/gonk/AudioManager.cpp
@@ +304,5 @@
>  
>    mPhoneState = aState;
> +
> +  if (aState == PHONE_STATE_IN_CALL) {
> +    mPhoneAudioAgent = do_CreateInstance("@mozilla.org/audiochannelagent;1");

What about:

if (aState == PHONE_STATE_IN_CALL) {
  if (!mPhoneAudioAgent) {
    mPhoneAudioAgent = do_CreateInstance("@mozilla.org/audiochannelagent;1");
    MOZ_ASSERT(mPhoneAudioAgent);
    // Telephony doesn't be paused by any other channels.
    mPhoneAudioAgent->Init(AUDIO_CHANNEL_TELEPHONY, nullptr);
  }

  // Telephony can always play.
  bool canPlay;
  mPhoneAudioAgent->StartPlaying(&canPlay);
} else if (mPhoneAudioAgent) {
  ...
}
Attachment #690344 - Flags: review?(amarchesini) → review+
blocking-basecamp: ? → +
Assignee: nobody → mchen
Attached patch patch CheckInVersion (obsolete) (deleted) — Splinter Review
Add reviewer and blocking-basecamp
Attachment #690344 - Attachment is obsolete: true
Attachment #691620 - Flags: review+
Attached patch patch CheckInVersion (obsolete) (deleted) — Splinter Review
Following comment.
Attachment #691620 - Attachment is obsolete: true
Attachment #691624 - Flags: review+
Attachment #691624 - Attachment is patch: true
Attached patch patch CheckInVersion (deleted) — Splinter Review
Removing blanking.
Attachment #691624 - Attachment is obsolete: true
Attachment #691628 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/7a2c761e196c
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Blocks: 868960
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: