Closed Bug 874744 Opened 11 years ago Closed 11 years ago

B2G RIL: Move card state related attribute/event from mozMobileConnection to mozIccManager

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: edgar, Assigned: edgar)

References

Details

(Whiteboard: RN6/7, fixed-in-birch)

Attachments

(4 files, 7 obsolete files)

2.98 KB, patch
allstars.chh
: review+
Details | Diff | Splinter Review
8.69 KB, patch
edgar
: review+
Details | Diff | Splinter Review
4.49 KB, patch
edgar
: review+
Details | Diff | Splinter Review
2.24 KB, patch
edgar
: review+
Details | Diff | Splinter Review
To have a more clear design for mozMobileConnection and mozIccManager, we plan to move all icc/sim-related stuff from mozMobileConnection to mozIccManager as RIL developers have discussed in [1].

This bug is filed for moving card state related attribute/event:
- readonly attribute DOMString cardState; [2]
- readonly attribute long retryCount; [3]
- [implicit_jscontext] attribute jsval oncardstatechange; [4] 

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=782603#c42
[2] https://mxr.mozilla.org/mozilla-central/source/dom/network/interfaces/nsIDOMMobileConnection.idl#50
[3] https://mxr.mozilla.org/mozilla-central/source/dom/network/interfaces/nsIDOMMobileConnection.idl#58
[4] https://mxr.mozilla.org/mozilla-central/source/dom/network/interfaces/nsIDOMMobileConnection.idl#372
Blocks: 874769
IDL Changes for card state related attribute/event
Comment on attachment 752666 [details] [diff] [review]
Part 1: Move card state related attribute/event from mozMobileConnection to mozIccManager (IDL), v1

Hi Jonas/Yoshi:

I would like to request review for interface changes first.

Thanks :)
Attachment #752666 - Flags: superreview?(jonas)
Attachment #752666 - Flags: review?(allstars.chh)
Comment on attachment 752666 [details] [diff] [review]
Part 1: Move card state related attribute/event from mozMobileConnection to mozIccManager (IDL), v1

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

I prefer we fix retryCount first, so we don't waste time on fixing wrong things.
Attachment #752666 - Flags: superreview?(jonas)
Attachment #752666 - Flags: review?(allstars.chh)
(In reply to Yoshi Huang[:allstars.chh][:yoshi] from comment #3)
> I prefer we fix retryCount first, so we don't waste time on fixing wrong
                                                               ^^^^^^^^^^^^^^  Sorry I didn't mean it's totally wrong, I mean it's incomplete.
> things.
(In reply to Yoshi Huang[:allstars.chh][:yoshi] from comment #4)
> (In reply to Yoshi Huang[:allstars.chh][:yoshi] from comment #3)
> > I prefer we fix retryCount first, so we don't waste time on fixing wrong
>                                                               
> ^^^^^^^^^^^^^^  Sorry I didn't mean it's totally wrong, I mean it's
> incomplete.
> > things.

Agree with you, let's focus on moving cardState and oncardstatechange in this bug first.
For retryCount, I will file a new bug and we can discuss there.
Thanks ,Yoshi.
Attachment #754322 - Flags: review?(allstars.chh)
Comment on attachment 754322 [details] [diff] [review]
Part 1: Move card state related attribute/event from mozMobileConnection to mozIccManager (IDL), v2

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

::: dom/icc/interfaces/nsIDOMIccManager.idl
@@ +279,5 @@
> +
> +  /**
> +   * Indicates the state of the device's ICC card.
> +   *
> +   * Possible values: null, 'unknown', 'absent', 'pinRequired', 'pukRequired',

There should be another bug discussing about the null and 'absent' state in IccManager, right?
Attachment #754322 - Flags: review?(allstars.chh) → review+
(In reply to Yoshi Huang[:allstars.chh][:yoshi] from comment #7)
> Comment on attachment 754322 [details] [diff] [review]
> Part 1: Move card state related attribute/event from mozMobileConnection to
> mozIccManager (IDL), v2
> 
> Review of attachment 754322 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/icc/interfaces/nsIDOMIccManager.idl
> @@ +279,5 @@
> > +
> > +  /**
> > +   * Indicates the state of the device's ICC card.
> > +   *
> > +   * Possible values: null, 'unknown', 'absent', 'pinRequired', 'pukRequired',
> 
> There should be another bug discussing about the null and 'absent' state in
> IccManager, right?

Yes, the possible values will have some changes for Multi-SIM implementation. (Will be discussing in another bug).
Thanks for your reminding.
Attachment #754322 - Flags: superreview?(jonas)
Whiteboard: RN5/29
Patch part3: RIL implementation changes.
This patch is for marionette tests of cardState.
The idea is switching airplane mode and checking the cardState and cardstatechange event.

Current emulator doesn't support airplane mode well. For example, even we turn off radio, the voice/data status is still connected. We need to correct the behavior of emulator first. I already have patches for that, will file a new bug.
Depends on: 877530
Whiteboard: RN5/29 → RN6/7
Depends on: 879666
Comment on attachment 754322 [details] [diff] [review]
Part 1: Move card state related attribute/event from mozMobileConnection to mozIccManager (IDL), v2

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

As long as the RIL owners are happy with this, I am :)
Attachment #754322 - Flags: superreview?(jonas) → superreview+
Attachment #755738 - Attachment is obsolete: true
Attachment #755748 - Attachment is obsolete: true
Attachment #755736 - Flags: review?(bugs)
Attachment #762553 - Flags: review?(allstars.chh)
Attachment #762564 - Flags: review?(allstars.chh)
Attachment #762553 - Flags: review?(allstars.chh) → review+
Comment on attachment 762564 [details] [diff] [review]
Part 4: Marionette tests for cardState, v2

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

::: dom/icc/tests/marionette/test_icc_card_state.js
@@ +8,5 @@
> +
> +let icc = navigator.mozIccManager;
> +ok(icc instanceof MozIccManager, "icc is instanceof " + icc.constructor);
> +
> +function setAirplaneMode(enabled) {

Common pattern is 'setXXXEnabled'

@@ +16,5 @@
> +  let obj = {
> +    "ril.radio.disabled": enabled
> +  };
> +
> +  ok(true, "set airplane mode to " + enabled);

I think there should be some log function for this.

@@ +48,5 @@
> +        icc.removeEventListener("cardstatechange", oncardstatechange);
> +        cleanUp();
> +        break;
> +    }
> +  });

I wouldn't suggest this kind of tests,
adding any 'case' would possibly break this test.

Either
- A simpler one, test on some particular cardState.
- wring a simple state machine for it
Attachment #762564 - Flags: review?(allstars.chh) → review-
Attachment #755736 - Flags: review?(bugs) → review+
Add waitCardStateChangedEvent() to wait a specific cardState. After got the expected value, trigger a callback.
Attachment #762564 - Attachment is obsolete: true
Attachment #763425 - Flags: review?(allstars.chh)
Attachment #763425 - Flags: review?(allstars.chh) → review+
Add r=allstars.chh and sr=sicking after r+ and sr+.
Attachment #754322 - Attachment is obsolete: true
Attachment #764007 - Flags: superreview+
Attachment #764007 - Flags: review+
Rebase
Attachment #762553 - Attachment is obsolete: true
Attachment #771644 - Flags: review+
Bug 874769 is already r+, we can land patches of gecko and gaia together.
Keywords: checkin-needed
Blocks: 979808
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: