Closed Bug 1188761 Opened 10 years ago Closed 10 years ago

Fail to get SIM card status and Network status at very early stage of booting up

Categories

(Firefox OS Graveyard :: RIL, defect)

Unspecified
Gonk (Firefox OS)
defect
Not set
blocker

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: liweijia, Unassigned)

Details

Attachments

(1 file)

Attached file SIM-race-error.zip
Gaia 2.2 When a user boots up (or restarts) the device we check whether or not the SIM is present. However, it appears that right after bootup the sim card state is not yet available through the mozMobileConnection API, and as a result our sim checks fail. For the network we know at which possible time navigator.mozMobileConnections.voice.connected and navigator.mozMobileConnections.date.connected are available
(In reply to Viga from comment #0) > Created attachment 8640332 [details] > SIM-race-error.zip > > Gaia 2.2 > When a user boots up (or restarts) the device we check whether or not the > SIM is present. However, it appears that right after bootup the sim card > state is not yet available through the mozMobileConnection API, and as a > result our sim checks fail. > For the network we know at which possible time > navigator.mozMobileConnections.voice.connected and > navigator.mozMobileConnections.date.connected are available Hi Edgar, this is blocking our partner. Could you please help check this in a day or two? Thank you.
Hi Viga, When device boots up, it takes a short time to detect sim card, looks like you check card state before sim is detected. You could try to monitor `oniccchange` event [1] which will be fired once device detects the sim card. Thank you. [1] https://dxr.mozilla.org/mozilla-central/source/dom/webidl/MozMobileConnection.webidl#509-513
Flags: needinfo?(liweijia)
(In reply to Edgar Chen [:edgar][:echen] from comment #2) > Hi Viga, > > When device boots up, it takes a short time to detect sim card, looks like > you check card state before sim is detected. You could try to monitor > `oniccchange` event [1] which will be fired once device detects the sim card. > > Thank you. > > [1] > https://dxr.mozilla.org/mozilla-central/source/dom/webidl/ > MozMobileConnection.webidl#509-513 Can get synchronized api? Is the event emit when no sim card? I still need a timeout?
Flags: needinfo?(liweijia)
(In reply to Viga from comment #3) > Can get synchronized api? Is the event emit when no sim card? I still need a > timeout? No, it won't be emitted if no sim card detected. If you wanna do something when no sim card (popup some message maybe?), then yes, looks like you need a timeout. Thank you.
(In reply to Edgar Chen [:edgar][:echen] from comment #4) > (In reply to Viga from comment #3) > > Can get synchronized api? Is the event emit when no sim card? I still need a > > timeout? > > No, it won't be emitted if no sim card detected. If you wanna do something > when no sim card (popup some message maybe?), then yes, looks like you need > a timeout. Thank you. Yes, What's the possible timeout? Or how soon, the oniccchange emitted? BTW, I What's the difference of oniccchange and iccdetected? Which one is more accurate?
The event should be emitted pretty soon if having sim inserted [1]. It's hard to give a possible timeout, different hardware and ril implementation might have variant value. oniccchange and oniccdetected are both accurate and quite similar. For the usage, it depends on what kinds of information you wanna know, for example, in multi-sim if you wanna monitor specific sim slot, using oniccchange is easier. [1] It took around 5 sec on z3c with moz ril (booting up -> sim card detected).
Thank you very much!
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: