Closed Bug 1000485 Opened 6 years ago Closed 2 years ago

[meta] Streamline nsITelephonyService API

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(tracking-b2g:backlog)

RESOLVED WONTFIX
tracking-b2g backlog

People

(Reporter: mschwart, Unassigned)

References

Details

(Whiteboard: [grooming])

nsITelephonyProvider has redundant entries:

# boolean isActive is redundant with unsigned short callState
# conferenceCallStateChanged is redundant as it is just a reflection of the state for calls with conf=True
(In reply to Michael Schwartz [:m4] from comment #0)
> nsITelephonyProvider has redundant entries:
> 
> # boolean isActive is redundant with unsigned short callState

Agree we could think about removing this.

> # conferenceCallStateChanged is redundant as it is just a reflection of the
> state for calls with conf=True

Not exactly. This is used to notify that every conference participant has been visited. So that TelephonyDOM could know when is the correct time to dispatch conference state change event to gaia.
blocking-b2g: --- → backlog
(In reply to Hsin-Yi Tsai  [:hsinyi] from comment #1)
> (In reply to Michael Schwartz [:m4] from comment #0)
> > # conferenceCallStateChanged is redundant as it is just a reflection of the
> > state for calls with conf=True
> 
> Not exactly. This is used to notify that every conference participant has
> been visited. So that TelephonyDOM could know when is the correct time to
> dispatch conference state change event to gaia.

Ok, thanks; good to know.  If that's the case then it should be called conferenceCallStateChanged without a state parameter, right?

Also, the API is ambiguous about the usage of CallError ie. does it replace the CallStateChanged(DISCONNECTED) notification?  Seems like we should remove the DISCONNECTED state and swap out the corresponding callStateChanged notification or callError for callDisconnected(DisconnectCause).
Hsin-Yi, in addition to what M4 suggested, am wondering if we could also look into simplifying the number of messages exchanged between DOM and RIL. 

For example, currently if the state of two calls have changed (switch active and holding call), we end up sending two call state change notification for each of the call. But instead if we change the API to simply notify to DOM that the state of calls changed as a single API call and then gecko calls EnumerateCalls, which already exists, to get the states of all the calls in one go, the number of messages could be reduced. Let me know what you think?
Hi Michael and Anshul,

Thanks for the suggestions! I am overwhelmed by the blockers these days. Let me get back to you later. :)

Also loop BT dev. into CC, since BT is one consumer of nsITelephonyProvider.
Just adding to the list so we don't forget.  Seems like there is a requirement that calls is the DISCONNECTED state cannot have conf=True or the dialer gets stuck.  If that's the case, that should be incorporated as well.
See Also: → 1016849
OS: Mac OS X → Gonk (Firefox OS)
Hardware: x86 → ARM
Looks like the secondCall attribute of the telephony-call-ended message doesn't work well for cases where multiple calls are received.  For instance, we receive a CW call, they drop out, and then someone else calls.  Currently only the last call would be logged.
(In reply to Michael Schwartz [:m4] from comment #2)
> (In reply to Hsin-Yi Tsai  [:hsinyi] from comment #1)
> > (In reply to Michael Schwartz [:m4] from comment #0)
> > > # conferenceCallStateChanged is redundant as it is just a reflection of the
> > > state for calls with conf=True
> > 
> > Not exactly. This is used to notify that every conference participant has
> > been visited. So that TelephonyDOM could know when is the correct time to
> > dispatch conference state change event to gaia.
> 
> Ok, thanks; good to know.  If that's the case then it should be called
> conferenceCallStateChanged without a state parameter, right?
> 

IMO having a state parameter makes this interface more friendly. Otherwise, how could the API user know the conference state easily? 

> Also, the API is ambiguous about the usage of CallError ie. does it replace
> the CallStateChanged(DISCONNECTED) notification?  Seems like we should
> remove the DISCONNECTED state and swap out the corresponding
> callStateChanged notification or callError for
> callDisconnected(DisconnectCause).

Agree on this. "CallError" API is ambiguous and confusing. We already filed Bug 1043165 - [B2G] refine TelephonyCall.onerror API for the enhancement.
(In reply to Anshul from comment #3)
> Hsin-Yi, in addition to what M4 suggested, am wondering if we could also
> look into simplifying the number of messages exchanged between DOM and RIL. 
> 

Good idea. It sounds a nice improvement to me :) Thanks Anshul.

> For example, currently if the state of two calls have changed (switch active
> and holding call), we end up sending two call state change notification for
> each of the call. But instead if we change the API to simply notify to DOM
> that the state of calls changed as a single API call and then gecko calls
> EnumerateCalls, which already exists, to get the states of all the calls in
> one go, the number of messages could be reduced. Let me know what you think?
(In reply to Michael Schwartz [:m4] from comment #6)
> Looks like the secondCall attribute of the telephony-call-ended message
> doesn't work well for cases where multiple calls are received.  For
> instance, we receive a CW call, they drop out, and then someone else calls. 
> Currently only the last call would be logged.

You are right, current implementation is still limited... However, I am not sure how this bug is related to the cdma logging issue. At least from the proposals above I don't see how any of them could solve this issue. I believe we need to review the cdma implementation and its webapi again. How about keeping discussing the cdma issue on bug 1036305? Thank you!
Summary: Streamline nsITelephonyProvider API → Streamline nsITelephonyService API
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #9)
> (In reply to Michael Schwartz [:m4] from comment #6)
> > Looks like the secondCall attribute of the telephony-call-ended message
> > doesn't work well for cases where multiple calls are received.  For
> > instance, we receive a CW call, they drop out, and then someone else calls. 
> > Currently only the last call would be logged.
> 
> You are right, current implementation is still limited... However, I am not
> sure how this bug is related to the cdma logging issue. At least from the
> proposals above I don't see how any of them could solve this issue. I
> believe we need to review the cdma implementation and its webapi again. How
> about keeping discussing the cdma issue on bug 1036305? Thank you!
Hsin-Yi, M4 and I are simply using this bug to provide feedback on all the API related issues that we encounter. Think of this as a metabug for all such issues :).
Thanks for filing separate bugs for each of the issues that you agree on.
(In reply to Anshul from comment #10)
> (In reply to Hsin-Yi Tsai [:hsinyi] from comment #9)
> > (In reply to Michael Schwartz [:m4] from comment #6)
> > > Looks like the secondCall attribute of the telephony-call-ended message
> > > doesn't work well for cases where multiple calls are received.  For
> > > instance, we receive a CW call, they drop out, and then someone else calls. 
> > > Currently only the last call would be logged.
> > 
> > You are right, current implementation is still limited... However, I am not
> > sure how this bug is related to the cdma logging issue. At least from the
> > proposals above I don't see how any of them could solve this issue. I
> > believe we need to review the cdma implementation and its webapi again. How
> > about keeping discussing the cdma issue on bug 1036305? Thank you!
> Hsin-Yi, M4 and I are simply using this bug to provide feedback on all the
> API related issues that we encounter. Think of this as a metabug for all
> such issues :).

Oh, it's good to know. :) If it helps, feel free to change the bug title a bit to meet your needs; otherwise, I would still view it as a bug targeting on streamlining nsITelephonyService :P


> Thanks for filing separate bugs for each of the issues that you agree on.
Depends on: 1061089
Whiteboard: [grooming]
blocking-b2g: backlog → ---
Summary: Streamline nsITelephonyService API → [meta] Streamline nsITelephonyService API
No longer depends on: 1043165
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.