RIL: no more "incoming" events after the first

RESOLVED FIXED in mozilla11

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: philikon, Assigned: philikon)

Tracking

Trunk
mozilla11
ARM
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Need to investigate what's happening here. Don't think this is the RIL since this was working fine before we added audio support. So likely culprit here is nsIAudioManager.
I misremembered: this isn't after making a call, this is after receiving a call. Investigating now.
Summary: Phone gets wedged after making one call → Phone gets wedged after receiving one call
And the phone doesn't really get wedged, it just doesn't bring up the "incoming call" screen again. Everything looks fine on audio, ril, etc... Pretty sure it's just a gaia issue due to the extremely rapid implementation.
Yes, I just looked at the radio logcat and indeed that stuff works fine. So either Gaia is broken (I just quickly hacked the "incoming" event listener in, so that may be broken). In that case we can close this bug as RESO/WFM and defer to the Gaia Github issue tracker. Or the DOM stuff is broken somehow and doesn't send the event, in which case we leave this bug open to fix that.
Looks like a RIL issue. Here's the logcat for when I call it for the first time and then immediately hang up when it's ringing:

I/Gecko   ( 2587): -*- TelephonyWorker component: Received message: {"type":"callstatechange","callState":"incoming","callIndex":1,"number":"xxx","name":null}
I/ServiceManager( 2563): (B2G) Returning fake true permission: android.permission.MODIFY_AUDIO_SETTINGS from uid=0 pid=2587
I/ServiceManager( 2563): (B2G) Returning fake true permission: android.permission.MODIFY_AUDIO_SETTINGS from uid=0 pid=2587
V/AudioHardwareYamaha( 2563): AudioHardware::setMode(mode=1)
D/AudioHardwareInterface( 2563): setMode(RINGTONE)
E/AudioHardwareYamaha( 2563): ### wbamrStatus = 0###
I/Gecko   ( 2587): -*- TelephonyWorker component: Received message: {"type":"callstatechange","callState":"disconnected","callIndex":1,"number":"4155256471","name":null}
I/ServiceManager( 2563): (B2G) Returning fake true permission: android.permission.MODIFY_AUDIO_SETTINGS from uid=0 pid=2587
I/ServiceManager( 2563): (B2G) Returning fake true permission: android.permission.MODIFY_AUDIO_SETTINGS from uid=0 pid=2587
V/AudioHardwareYamaha( 2563): AudioHardware::setMode(mode=0)
D/AudioHardwareInterface( 2563): setMode(NORMAL)

And now when I call it the subsequent times:

E/AudioHardwareYamaha( 2563): ### wbamrStatus = 0###
E/AudioHardwareYamaha( 2563): ### wbamrStatus = 0###
I/Gecko   ( 2587): -*- TelephonyWorker component: Received message: {"type":"callstatechange","callState":"disconnected","callIndex":1,"number":"4155256471","name":null}
I/ServiceManager( 2563): (B2G) Returning fake true permission: android.permission.MODIFY_AUDIO_SETTINGS from uid=0 pid=2587
I/ServiceManager( 2563): (B2G) Returning fake true permission: android.permission.MODIFY_AUDIO_SETTINGS from uid=0 pid=2587
V/AudioHardwareYamaha( 2563): AudioHardware::setMode(mode=0)
W/AudioPolicyManager( 2563): setPhoneState() setting same state 0
E/AudioHardwareYamaha( 2563): ### wbamrStatus = 0###
E/AudioHardwareYamaha( 2563): ### wbamrStatus = 0###
I/Gecko   ( 2587): -*- TelephonyWorker component: Received message: {"type":"callstatechange","callState":"disconnected","callIndex":1,"number":"4155256471","name":null}
I/ServiceManager( 2563): (B2G) Returning fake true permission: android.permission.MODIFY_AUDIO_SETTINGS from uid=0 pid=2587
I/ServiceManager( 2563): (B2G) Returning fake true permission: android.permission.MODIFY_AUDIO_SETTINGS from uid=0 pid=2587
V/AudioHardwareYamaha( 2563): AudioHardware::setMode(mode=0)
W/AudioPolicyManager( 2563): setPhoneState() setting same state 0

The TelephonyWorker isn't receiving the "incoming" message, which is sent by the RIL worker. Will look for a problem in the RIL worker's call state management.
Summary: Phone gets wedged after receiving one call → RIL: no more "incoming" events after the first
Created attachment 581031 [details] [diff] [review]
v1

Found the bug in the RIL. We weren't updating the call state correctly when a call disconnected. So when a new call came in, we still saw the old call and didn't send an event to the DOM thread. This fixes that.

I also noticed a bug in the UNSOLICITED_CALL_RING processing. The info data is only sent for CDMA, so let's disable that for now. (This is actually specified in ril.h, I must've overlooked it previously.)
Assignee: nobody → philipp
Status: NEW → ASSIGNED
Attachment #581031 - Flags: review?(kyle)
Comment on attachment 581031 [details] [diff] [review]
v1

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

Might want to put a space after the // stuff unless there's a //XXX prefix rule I don't know about, otherwise looks good.
Attachment #581031 - Flags: review?(kyle) → review+
Thanks, Kyle! The //XXX stuff is kind of a convention, depending on who you ask... and at any rate we want to clean those out sooner rather than later anyway ;)

Pushed: https://hg.mozilla.org/mozilla-central/rev/03cd6329e4f9
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
(In reply to Philipp von Weitershausen [:philikon] from comment #7)
> Thanks, Kyle! The //XXX stuff is kind of a convention, depending on who you
> ask... and at any rate we want to clean those out sooner rather than later
> anyway ;)

No, XXX was a convention but AFAIK it's forbidden now. We should use:
// TODO: explanation message, bug NUMBER.

IOW, those kind of comments should come with a filed bug.
(Assignee)

Updated

6 years ago
Component: DOM → DOM: Device Interfaces
QA Contact: general → device-interfaces
Version: unspecified → Trunk
You need to log in before you can comment on or make changes to this bug.