Closed Bug 1217285 Opened 9 years ago Closed 9 years ago

[IMS] support IMS fine-grained capabilities, such as wifi-calling or cellular

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(feature-b2g:2.2r+, b2g-v2.5 wontfix, b2g-v2.2r fixed, b2g-master wontfix)

RESOLVED FIXED
feature-b2g 2.2r+
Tracking Status
b2g-v2.5 --- wontfix
b2g-v2.2r --- fixed
b2g-master --- wontfix

People

(Reporter: hsinyi, Assigned: bevis)

References

Details

Attachments

(3 files, 3 obsolete files)

To meet the UI requirements, we need to expose fine-grained capabilities to gaia so that proper UI could be displayed based on the capability support.

My draft idea is that we add |supportedTypes| attribute to ImsRegHandler, just as what we do for mobileConnection.supportedNetworkTypes [1] [2].

In this way, vendor ImsService (the implementation of nsIImsRegHandler) is in charge to retrieving and passing the correct value. I think vendor could refer to [3] to get the idea of the actual implementation.

How do you think?

[1] https://dxr.mozilla.org/mozilla-central/source/dom/webidl/MozMobileConnection.webidl#116
[2] https://dxr.mozilla.org/mozilla-central/source/dom/mobileconnection/interfaces/nsIMobileConnectionService.idl#328
[3] https://dxr.mozilla.org/mozilla-central/source/dom/mobileconnection/gonk/MobileConnectionService.js?from=MobileConnectionService.js#516
Blocks: 1193609
No longer blocks: 1193609
feature-b2g: --- → 2.2r+
So far, the UI has to provide additional presentation if multiple bearers for IMS are available.

My idea is to have an attribute called |deviceCapabilities| as a dictionary in ImsRegHandler.webidl to list the optional IMS features built into the device:
> dictionary DeviceCapabilities {
>  boolean overCellular;
>  boolean overWifi;
>  ...
>  // we could add new optional capabilities like video calling, presence, etc in the future.
> };
> interface ImsRegHandler : EventTarget {
>   ...
>   // Contains the supported capabilities built into the device.
>   readonly attribute DeviceCapabilities deviceCapabilities;
>   ...
> }
In internal |nsIImsRegHander|, we can add |overCellularSupported|, |overWifiSupported|, etc.

Then, when the application accesses ImsRegHandler, all these capabilities will be collected during the initialization and will be returned when ImsRegHandler::deviceCapabilities is read.

With this design in mind, the application could display additional options like |preferredProfile| only if both |overCellular| and |overWifi| are supported.
(In reply to Bevis Tseng[:bevistseng][:btseng] from comment #1)
> So far, the UI has to provide additional presentation if multiple bearers
> for IMS are available.
> 
> My idea is to have an attribute called |deviceCapabilities| as a dictionary
> in ImsRegHandler.webidl to list the optional IMS features built into the
> device:
> > dictionary DeviceCapabilities {
> >  boolean overCellular;
> >  boolean overWifi;
> >  ...
> >  // we could add new optional capabilities like video calling, presence, etc in the future.
> > };
> > interface ImsRegHandler : EventTarget {
> >   ...
> >   // Contains the supported capabilities built into the device.
> >   readonly attribute DeviceCapabilities deviceCapabilities;
> >   ...
> > }
> In internal |nsIImsRegHander|, we can add |overCellularSupported|,
> |overWifiSupported|, etc.
> 
> Then, when the application accesses ImsRegHandler, all these capabilities
> will be collected during the initialization and will be returned when
> ImsRegHandler::deviceCapabilities is read.
> 
> With this design in mind, the application could display additional options
> like |preferredProfile| only if both |overCellular| and |overWifi| are
> supported.

Oh, yes, this proposal sounds even better! Dictionary usage is easier to use in feature detection :)
Hi Carol,

We would like to improve this according the approach in comment 1.
Do you have any concern on this change?
Flags: needinfo?(cyang)
Flags: needinfo?(cyang)
Hi Bevis/Hsinyi,

Since the capability information is static (i.e. display WiFi calling menu, display HD icon, etc), it seems this information does not need to be exposed dynamically via nsIImsRegHandler. Instead, this could be set as a custom prefs.js value. The amount of work in Gaia is the same. Instead of querying via nsIImsRegHandler, it could be a simple call to get the preference value:
> let wfcSupport = Services.prefs.getBoolPref(‘ui.support.wfc’);
> if (wfcSupport) {
>   //Display WiFi Calling menu
> }

OEMs/carriers can easily set this value in the custom prefs.js for the specific UI they expect.

If we were to implement this via nsIImsRegHandler, it would essentially be the same thing where we would report the device capabilities based on some static information for a particular carrier. It seems we could just take out the middleman here.

What do you think?
Flags: needinfo?(btseng)
Flags: needinfo?(htsai)
(In reply to Carol Yang [:cyang] from comment #4)
> Hi Bevis/Hsinyi,
> 
> Since the capability information is static (i.e. display WiFi calling menu,
> display HD icon, etc), it seems this information does not need to be exposed
> dynamically via nsIImsRegHandler. Instead, this could be set as a custom
> prefs.js value. The amount of work in Gaia is the same. Instead of querying
> via nsIImsRegHandler, it could be a simple call to get the preference value:
> > let wfcSupport = Services.prefs.getBoolPref(‘ui.support.wfc’);
> > if (wfcSupport) {
> >   //Display WiFi Calling menu
> > }
> 
> OEMs/carriers can easily set this value in the custom prefs.js for the
> specific UI they expect.
> 
> If we were to implement this via nsIImsRegHandler, it would essentially be
> the same thing where we would report the device capabilities based on some
> static information for a particular carrier. It seems we could just take out
> the middleman here.
>
> What do you think?

The preference-style customization was taken into consideration but was not adopted. :(
The reason is that if there is customization related to whether a feature in a Web API set cannot be access or not, there will be more expectation from the app developer that this restriction should be identified from the API itself instead of a separated preference.

So, in addition to the |deviceCapabilities|, the implementation shall reject the request according to the |deviceCapabilities|.
For example, if |overWifi| is false, these request2 shall be rejected: setPreferredProfile("wifi-preferred"), setPreferredProfile("wifi-only")
Flags: needinfo?(btseng)
Flags: needinfo?(htsai)
Assignee: nobody → btseng
Attached patch (v1) Part 1: Web API Change. (obsolete) — Splinter Review
Hi Edgar, Hsinyi,

May I have your review for the change in WebIDL part?

Thanks!
Attachment #8682296 - Flags: review?(htsai)
Attachment #8682296 - Flags: review?(echen)
Attached patch (v1) Part 2: XPCOM Change. (obsolete) — Splinter Review
Changes in XPCOM.
Attachment #8682297 - Flags: review?(echen)
Attached patch (v1) Part 3: Add Test Coverage. (obsolete) — Splinter Review
Add Test case coverage.
Attachment #8682298 - Flags: review?(echen)
Comment on attachment 8682296 [details] [diff] [review]
(v1) Part 1: Web API Change.

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

Looks good to me, thank you.

::: dom/webidl/ImsRegHandler.webidl
@@ +33,5 @@
> +   *
> +   * This provides the possibility to display the UI options according
> +   * to the capability of the device.
> +   * For example, the |wifi-preferred|, |wifi-only| of the preferred profiles
> +   * will be available in the UI only if |overWifi| is true.

I guess you forget revising the comments.
Attachment #8682296 - Flags: review?(echen) → review+
Comment on attachment 8682296 [details] [diff] [review]
(v1) Part 1: Web API Change.

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

::: dom/webidl/ImsRegHandler.webidl
@@ +33,5 @@
> +   *
> +   * This provides the possibility to display the UI options according
> +   * to the capability of the device.
> +   * For example, the |wifi-preferred|, |wifi-only| of the preferred profiles
> +   * will be available in the UI only if |overWifi| is true.

Thanks for catching this!
Attachment #8682297 - Flags: review?(echen) → review+
Attachment #8682298 - Flags: review?(echen) → review+
Attachment #8682296 - Flags: review?(htsai) → review+
revise API doc.
Attachment #8682296 - Attachment is obsolete: true
Attachment #8682918 - Flags: review+
Attachment #8682297 - Attachment is obsolete: true
Attachment #8682298 - Attachment is obsolete: true
Attachment #8682920 - Flags: review+
try server is green in comment 18.
Keywords: checkin-needed
Attachment #8682918 - Attachment description: Part 1: Web API Change. r=echen,htsai → Part 1: Web API Change. r=echen,htsai,a=2.2r+
Attachment #8682919 - Attachment description: Part 2: XPCOM Change. r=echen → Part 2: XPCOM Change. r=echen,a=2.2r+
Attachment #8682920 - Attachment description: Part 3: Add Test Coverage. r=echen → Part 3: Add Test Coverage. r=echen,a=2.2r+
Comment on attachment 8682918 [details] [diff] [review]
Part 1: Web API Change. r=echen,htsai,a=2.2r+

[Approval Request Comment]
Bug caused by (feature/regressing bug #): N/A
User impact if declined: N/A
Testing completed: Yes
Risk to taking this patch (and alternatives if risky): No.
String or UUID changes made by this patch:3e39360c-8133-11e5-9ce9-7f3effdb14fe
Attachment #8682918 - Flags: approval‑mozilla‑b2g37_v2_2r?
Comment on attachment 8682919 [details] [diff] [review]
Part 2: XPCOM Change. r=echen,a=2.2r+

[Approval Request Comment]
Bug caused by (feature/regressing bug #): N/A
User impact if declined: N/A
Testing completed: Yes
Risk to taking this patch (and alternatives if risky): No.
String or UUID changes made by this patch:3e39360c-8133-11e5-9ce9-7f3effdb14fe
Attachment #8682919 - Flags: approval‑mozilla‑b2g37_v2_2r?
Comment on attachment 8682920 [details] [diff] [review]
Part 3: Add Test Coverage. r=echen,a=2.2r+

[Approval Request Comment]
Bug caused by (feature/regressing bug #): N/A
User impact if declined: N/A
Testing completed: Yes
Risk to taking this patch (and alternatives if risky): No.
String or UUID changes made by this patch:3e39360c-8133-11e5-9ce9-7f3effdb14fe
Attachment #8682920 - Flags: approval‑mozilla‑b2g37_v2_2r?
Attachment #8682918 - Flags: approval‑mozilla‑b2g37_v2_2r?
Attachment #8682919 - Flags: approval‑mozilla‑b2g37_v2_2r?
Attachment #8682920 - Flags: approval‑mozilla‑b2g37_v2_2r?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: