Closed Bug 1133465 Opened 9 years ago Closed 9 years ago

[Flame][Settings]It will not prompt user to input SIM card's PIN code immediately after user turns on and turns off airplane mode.

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

ARM
Gonk (Firefox OS)
defect
Not set
major

Tracking

(blocking-b2g:2.2+, b2g-v2.1 unaffected, b2g-v2.2 verified, b2g-master verified)

VERIFIED FIXED
2.2 S9 (3apr)
blocking-b2g 2.2+
Tracking Status
b2g-v2.1 --- unaffected
b2g-v2.2 --- verified
b2g-master --- verified

People

(Reporter: liuke, Assigned: apastor)

References

Details

(Keywords: regression, Whiteboard: [systemsfe])

Attachments

(11 files)

Attached file logcat_1428.txt
[1.Description]:
[Flame][v3.0][Settings]After you change the SIM PIN code, turn on airplane mode, then turn off it, the PIN code box will not appear immediately.
Found time:
See attachment:

[2.Testing Steps]: 
Prerequisite: Insert one or two SIM Cards with both PIN codes enabled.
1.Press Power key and turn on airplane.
2.Press Power key and turn off airplane.

Note: If you lock screen, then unlock it, or launch an app, the PIN code box will appear.

[3.Expected Result]: 
2. It should prompt user to input SIM card’s PIN code immediately. 

[4.Actual Result]: 
2. It will not prompt user to input SIM card‘s PIN code immediately. 

[5.Reproduction build]: 
Build ID               20150215010209
Gaia Revision          f0b93e0668ef9565bd6f050b15b4f794d59feb65
Gaia Date              2015-02-13 13:13:27
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/e0cb32a0b1aa
Gecko Version          38.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150215.043133
Firmware Date          Sun Feb 15 04:31:43 EST 2015
Bootloader             L1TC000118D0

[6.Reproduction Frequency]: 
Always Recurrence,5/5

[7.TCID]: 
14361
Found time:14:28
See attachment:1428.mp4 and logcat_1428.txt
Attached video 1428.MP4
Hi, Lance,

May I have your help?
Can we have a branch check (v2.2 and v2.1)?

Thanks.
Flags: needinfo?(liuke)
(In reply to William Hsu [:whsu] from comment #3)
> Hi, Lance,
> 
> May I have your help?
> Can we have a branch check (v2.2 and v2.1)?
> 
> Thanks.

I can reproduced this bug on latest Flame 2.2 & 3.0, but can't reproduced it on latest 2.1.

Steps:
Prerequisite: Insert one or two SIM Cards with both PIN codes enabled.
1.Press Power key and turn on airplane.
2.Press Power key and turn off airplane.

Note: If you lock screen, then unlock it, or launch an app, the PIN code box will appear.

Expected Result: 
Flame 2.2 & 3.0: 2. It should prompt user to input SIM card's PIN code immediately. 

Actual Result: 
Flame 2.2 & 3.0: 2. It will not prompt user to input SIM card's PIN code immediately(Fail rate: 5/5). 
Flame 2.1: The input SIM card's PIN code page will pop up immediately(Fail rate: 0/5).

Flame 2.1 version:
Build ID               20150225001618
Gaia Revision          86af0ca427adad12c3109124f31bef2fd9614e47
Gaia Date              2015-02-24 02:22:26
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g34_v2_1/rev/a275f2c05ca6
Gecko Version          34.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150225.034947
Firmware Date          Wed Feb 25 03:49:58 EST 2015
Bootloader             L1TC000118D0

Flame 2.2 version:
Build ID               20150225002505
Gaia Revision          ca64f2fe145909f31af266b1730874051ba76c78
Gaia Date              2015-02-24 22:06:53
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/16804008c29f
Gecko Version          37.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150225.041814
Firmware Date          Wed Feb 25 04:18:25 EST 2015
Bootloader             L1TC000118D0

Flame 3.0 version:
Build ID               20150225010244
Gaia Revision          f6bfd854fe4746f21bc006eac145365e85f98808
Gaia Date              2015-02-24 21:10:44
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/0a8b3b67715a
Gecko Version          39.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150225.043702
Firmware Date          Wed Feb 25 04:37:14 EST 2015
Bootloader             L1TC00011880
QA Whiteboard: [MGSEI-Triage+]
Flags: needinfo?(liuke) → needinfo?(whsu)
Thanks.
It seems to be a v2.2 regression.

Nominate it. Bad user experience.
blocking-b2g: --- → 2.2?
Flags: needinfo?(whsu)
Keywords: regression
please check for regression window, thanks
Component: Gaia::Settings → Gaia::System
QA Contact: bzumwalt
Issue does not occur in latest Flame 2.2 and 3.0 nightly

With one SIM inserted (in slot 1 or 2) or two SIM cards inserted, all with SIM PINs, long pressing power to enable airplane mode, then again to disable airplane mode, always results in SIM PIN prompt appearing.

One odd thing, in Flame 3.0 build, if the user has two SIM cards with SIM PINs, enabling, then disabling airplane mode will only bring up SIM 2 SIM PIN prompt.

Leaving keywords as they are in case anyone else can still reproduce issue.

Device: Flame 2.2
Build ID: 20150303002527
Gaia: 3d188c414e30acc392253d5389a42352fcfbc183
Gecko: c89aad487aa5
Gonk: e7c90613521145db090dd24147afd5ceb5703190
Version: 37.0 (2.2)
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0

Device: Flame 3.0
Build ID: 20150303010233
Gaia: c8ed1085a67490a1ecd7f275e5de9487e1b93b1d
Gecko: 0b3c520002ad
Gonk: e7c90613521145db090dd24147afd5ceb5703190
Version: 39.0a1 (3.0)
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:39.0) Gecko/39.0 Firefox/39.0
QA Whiteboard: [MGSEI-Triage+] → [QAnalyst-Triage?][MGSEI-Triage+]
Flags: needinfo?(ktucker)
I was unable to reproduce this issue on the Flame 3.0 or Flame 2.2 latest Nightly builds.

Actual Results: The prompt for SIM pin showed up always when only one SIM was inserted.
	
Note: The results Brogan was seeing with 2 SIM inserted are already written as bug 1132397.
	
Environmental Variables:
Device: Flame 3.0
BuildID: 20150303010233
Gaia: c8ed1085a67490a1ecd7f275e5de9487e1b93b1d
Gecko: 0b3c520002ad
Gonk: e7c90613521145db090dd24147afd5ceb5703190
Version: 39.0a1 (3.0) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:39.0) Gecko/39.0 Firefox/39.0

Environmental Variables:
Device: Flame 2.2
BuildID: 20150303002527
Gaia: 3d188c414e30acc392253d5389a42352fcfbc183
Gecko: c89aad487aa5
Gonk: e7c90613521145db090dd24147afd5ceb5703190
Version: 37.0 (2.2) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0
I cannot reproduce this issue on the latest Flame 3.0 or Flame 2.2. 

I keep running into issue bug 1132397. I even flashed to the build the reporter was using but it always prompts me for SIM2 passcode. Also, the video appears to be corrupt. 

0/30 attempts

Build reporter used:

Environmental Variables:
Device: Flame 3.0 (Full Flash)(KK)(319mb)
BuildID: 20150215010209
Gaia: f0b93e0668ef9565bd6f050b15b4f794d59feb65
Gecko: e0cb32a0b1aa
Gonk: e7c90613521145db090dd24147afd5ceb5703190
Version: 38.0a1 (3.0) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:38.0) Gecko/38.0 Firefox/38.0

Latest:

Environmental Variables:

Device: Flame 3.0 (Full Flash)(KK)(319mb)
BuildID: 20150303010233
Gaia: c8ed1085a67490a1ecd7f275e5de9487e1b93b1d
Gecko: 0b3c520002ad
Gonk: e7c90613521145db090dd24147afd5ceb5703190
Version: 39.0a1 (3.0) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:39.0) Gecko/39.0 Firefox/39.0

Environmental Variables:

Device: Flame 2.2(Full Flash)(KK)(319mb)
BuildID: 20150303002527
Gaia: 3d188c414e30acc392253d5389a42352fcfbc183
Gecko: c89aad487aa5
Gonk: e7c90613521145db090dd24147afd5ceb5703190
Version: 37.0 (2.2) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0

Lance, can we get some more information here and a new video uploaded? We are not able to reproduce this issue. We have both SIMs inserted and pincode enabled on both. We are using the power menu to enable and disable airplane mode but we are always being prompted to enter SIM2 pincode. 

We have also tried one sim in different slots but it didn't reproduce this issue either.
QA Whiteboard: [QAnalyst-Triage?][MGSEI-Triage+] → [QAnalyst-Triage+][MGSEI-Triage+]
Flags: needinfo?(ktucker) → needinfo?(liuke)
See Also: → 1132397
The bug still exist in Flame 2.2 and 3.0. I have verified it by CU and CMCC card, but now it only exists in CMCC card.

Prerequisite: Insert one CMCC SIM card with PIN codes enabled.
1.Press Power key and turn on airplane.
2.Press Power key and turn off airplane.

Note: If you lock screen, then unlock it, or launch an app, the PIN code box will appear.

Expected Result: 
2. It should prompt user to input SIM card’s PIN code immediately. 

Actual Result: 
2. It will not prompt user to input SIM card‘s PIN code immediately. 

Fail rate:2/5

See attachment:1557.mp4

Flame 2.2 version:
Build ID               20150304002529
Gaia Revision          8b4b3e4b7e7c308764f71542437fd60625ac6b75
Gaia Date              2015-03-03 15:01:17
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/2cb52b7cda5a
Gecko Version          37.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150304.042036
Firmware Date          Wed Mar  4 04:20:47 EST 2015
Bootloader             L1TC000118D0

Flame 3.0 version:
Build ID               20150304010324
Gaia Revision          3fc0ac309f5fb0c1fe82c12223b955a4efce27e6
Gaia Date              2015-03-03 21:58:43
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/c5b90c003be8
Gecko Version          39.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150304.041952
Firmware Date          Wed Mar  4 04:20:03 EST 2015
Bootloader             L1TC000118D0
Flags: needinfo?(liuke)
Attached video 1557.MP4
On our end Jayme, Kevin, and I were all using AT&T SIM cards to test. Is it possible this is carrier specific?
Thank you Lance for providing more information. It looks like we won't be able to reproduce this here on our end since we do not have that specific SIM card. Can you guys please get the regression window for this issue?
Flags: needinfo?(liuke)
Leaving as qa contact as per comment 13
QA Contact: bzumwalt
Evelyn, Tim, do you have access to a CMCC SIM card and can help out here?
Flags: needinfo?(timdream)
Flags: needinfo?(ehung)
Hi Peipei:
 Could you please help repo. this issue by using CMCC SIM on Flame 2.2 or 3.0, and upload log again?
I can not find too much useful information per current log we have.
(command: adb logcat -b radio -b main -v threadtime > /tmp/1133465.log)


Please also make sure gecko RIL log is enabled (for example: user_pref("ril.debugging.enabled", true);)

Thanks!!
Flags: needinfo?(pcheng)
Shawn will help from Gonk/Gecko side to verify if event has been dispatched to Gaia. Please ni me again if the event dispatch correctly but UI doesn't prompt. Thank you, Shawn.
Flags: needinfo?(timdream)
Flags: needinfo?(ehung)
Shawn, I tried 20 times using a CMCC SIM but was unable to reproduce this issue on Flame v3.0 latest build.


Lance, since you can reproduce this bug. Could you please enable RIL debug and provide the log again? 
ALso per comment 13, please also help get the regression window.

To enable RIL debugging, please following following steps:
# adb pull /system/b2g/defaults/pref/user.js
   Modify user.js file, to and make sure ril.debugging.enabled is true: pref('ril.debugging.enabled', true);
#   adb remount
#   adb push user.js /system/b2g/defaults/pref/user.js
#   adb shell reboot

Then run command: "adb logcat -b radio -b main -v threadtime > /tmp/1133465.log" to get the log. 


------------------------------------------------------------------------------
Test build:
Gaia-Rev        fea83511df9ccba64259346bc02ebf2c417a12c2
Gecko-Rev       https://hg.mozilla.org/mozilla-central/rev/eab4a81e4457
Build-ID        20150308160204
Version         39.0a1
Device-Name     flame
FW-Release      4.4.2
FW-Incremental  65
FW-Date         Mon Dec 15 18:51:29 CST 2014
Bootloader      L1TC000118D0
Flags: needinfo?(pcheng)
Ni Lance here to get info requested in comment #18. It's be pre-mature to block on this yet.
Flags: needinfo?
Flags: needinfo?
Similar to Bug 1138858? Is there something to do with the config "persist.radio.apm_sim_not_pwdn"?
https://bugzilla.mozilla.org/show_bug.cgi?id=1138858#c7
(In reply to Wesley Huang [:wesley_huang] (EPM) (NI me) from comment #20)
> Similar to Bug 1138858? Is there something to do with the config
> "persist.radio.apm_sim_not_pwdn"?
> https://bugzilla.mozilla.org/show_bug.cgi?id=1138858#c7

Sorry I have trouble with watching the video 1557.MP4 Lance uploaded. So I'd like to confirm the actual behaviour.

Lance, when you said "not prompt ... immediately", did it mean that "SIM PIN dialogue" will still pop out eventually but with few seconds delay? If so, then it doesn't sound like the same issue as bug 1138858.

Please provide us more debug messages - on top of master or latest v2.2 branch, you now can easily enable ril debug messages via |Settings app --> Developer --> Debug --> RIL output in ADB|.
Also, be sure to capture the log via |adb logcat -b radio -b main -v time| (time information means a lot in this bug). Thanks!
(In reply to KTucker [:KTucker] from comment #13)
> Thank you Lance for providing more information. It looks like we won't be
> able to reproduce this here on our end since we do not have that specific
> SIM card. Can you guys please get the regression window for this issue?

We have verified all the images on Inbound. But we found the older the image is, the lower reproduce rate the issue will have. We need to spend some time to confirm whether this issue really exists and now we are try to verify it with much older image. Thanks!
Flags: needinfo?(liuke)
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #21)
> (In reply to Wesley Huang [:wesley_huang] (EPM) (NI me) from comment #20)
> > Similar to Bug 1138858? Is there something to do with the config
> > "persist.radio.apm_sim_not_pwdn"?
> > https://bugzilla.mozilla.org/show_bug.cgi?id=1138858#c7
> 
> Sorry I have trouble with watching the video 1557.MP4 Lance uploaded. So I'd
> like to confirm the actual behaviour.
> 
> Lance, when you said "not prompt ... immediately", did it mean that "SIM PIN
> dialogue" will still pop out eventually but with few seconds delay? If so,
> then it doesn't sound like the same issue as bug 1138858.
> 
> Please provide us more debug messages - on top of master or latest v2.2
> branch, you now can easily enable ril debug messages via |Settings app -->
> Developer --> Debug --> RIL output in ADB|.
> Also, be sure to capture the log via |adb logcat -b radio -b main -v time|
> (time information means a lot in this bug). Thanks!

"not prompt ... immediately", it mean that if you do not launch app or lockscreen, the "SIM PIN dialogue" page still can't display.

Now, this bug still exists on latest Flame 2.2, Nexus_5 2.2 and Nexus_5 3.0, and we have cat RIL log of FLame 2.2, and upload it, please see it.

Steps:
Prerequisite: Insert one CMCC SIM card with PIN codes enabled.
1.Press Power key and turn on airplane.
2.Press Power key and turn off airplane.

Note: If you lock screen, then unlock it, or launch an app(this app must be Phone/Message/Contacts. If you launch other app, the page can't pop up), the PIN code box will appear.

Expected Result: 
2. It should prompt user to input SIM card’s PIN code immediately. 

Actual Result: 
2. It will not prompt user to input SIM card‘s PIN code immediately. 

Found time:14:23--14:25
See attachment: logcat_1424.txt and 1133465.log

Fail rate:
Flame 2.2: 1/30
Nexus 5: 5/5

Flame 2.2 version:
Build ID               20150312002501
Gaia Revision          572d60e0a440ee4af50bc6b6adad8876eadbdb4d
Gaia Date              2015-03-12 01:29:41
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/244e6ba3c20e
Gecko Version          37.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150312.040315
Firmware Date          Thu Mar 12 04:03:26 EDT 2015
Bootloader             L1TC000118D0

Nexus 5_2.2 version:
Build ID               20150312162502
Gaia Revision          572d60e0a440ee4af50bc6b6adad8876eadbdb4d
Gaia Date              2015-03-12 01:29:41
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/3db27b3c9298
Gecko Version          37.0
Device Name            hammerhead
Firmware(Release)      5.0
Firmware(Incremental)  eng.cltbld.20150312.200012
Firmware Date          Thu Mar 12 20:00:29 EDT 2015
Bootloader             HHZ12d

Nexus 5_3.0 version:
Build ID               20150312160232
Gaia Revision          eabe35cf054d47087b37c1ca7db8143717fbd7f3
Gaia Date              2015-03-12 18:01:49
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/42afc7ef5ccb
Gecko Version          39.0a1
Device Name            hammerhead
Firmware(Release)      5.0
Firmware(Incremental)  eng.cltbld.20150312.192453
Firmware Date          Thu Mar 12 19:25:12 EDT 2015
Bootloader             HHZ12d
Flags: needinfo?(htsai)
Attached file logcat_1424.txt
Attached file 1133465.log
I checked the logs and I also compared "cardstatechange" event sequences for the actual and expected cases, but I couldn't find something suspicious in RIL. 

Alexandre, I have impression that you have been working on SIM PIN dialogue racing issues. Do you think this is another symptom?
Flags: needinfo?(htsai) → needinfo?(lissyx+mozillians)
I have no idea. I have been fighting to get it investigated when I was reproducing it. Not my problem anymore, since people considered it was a non-existent problem.
Flags: needinfo?(lissyx+mozillians)
Did you had bug 976497 in mind ?
Flags: needinfo?(htsai)
***** [Log snippet: success case] *****
03-13 18:14:28.236 I/GeckoConsole(  208): Content JS LOG: XXX [SimLockManager][137.319] handling airplanemode-enabled 
03-13 18:14:28.716 I/Gecko   (  208): -*- RadioInterface[0]: Received message from worker: {"rilMessageType":"cardstatechange","cardState":4294967295,"rilMessageClientId":0}
03-13 18:14:28.716 I/Gecko   ( 1288): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":4294967295,"rilMessageClientId":0}}
03-13 18:14:28.746 I/Gecko   (  208): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":4294967295,"rilMessageClientId":0}}
03-13 18:14:28.806 I/GeckoConsole(  208): Content JS LOG: XXX [SimLockManager][137.925] handling simslot-cardstatechange 
03-13 18:14:28.806 W/GeckoConsole(  208): Content JS WARN: XXX [SimLockManager][137.926] unknown SIM card state for slot 1 
03-13 18:14:28.806 W/GeckoConsole(  208): Content JS WARN: XXX [SimLockManager][137.927] No SIM card in slot 2 
03-13 18:14:28.816 I/GeckoConsole(  208): Content JS LOG: XXX [SimLockManager][137.935] handling simslot-iccinfochange 
03-13 18:14:28.816 W/GeckoConsole(  208): Content JS WARN: XXX [SimLockManager][137.937] unknown SIM card state for slot 1 
03-13 18:14:28.816 W/GeckoConsole(  208): Content JS WARN: XXX [SimLockManager][137.937] No SIM card in slot 2 
03-13 18:14:32.916 I/Gecko   (  208): -*- RadioInterface[0]: Received message from worker: {"rilMessageType":"cardstatechange","cardState":0,"rilMessageClientId":0}
03-13 18:14:32.916 I/Gecko   ( 1288): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":0,"rilMessageClientId":0}}
03-13 18:14:32.936 I/Gecko   (  208): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":0,"rilMessageClientId":0}}

===== cardstate becomes "pin-required" and RIL sends out notification =====

03-13 18:14:33.106 I/Gecko   (  208): -*- RadioInterface[0]: Received message from worker: {"rilMessageType":"cardstatechange","cardState":2,"rilMessageClientId":0}
03-13 18:14:33.106 I/Gecko   ( 1288): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":2,"rilMessageClientId":0}}
03-13 18:14:33.126 I/Gecko   (  208): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":2,"rilMessageClientId":0}}

===== SimLockManager receives the notification and pops out the dialogue as expected =====

03-13 18:14:33.736 I/GeckoConsole(  208): Content JS LOG: XXX [SimLockManager][142.303] handling simslot-cardstatechange 
03-13 18:14:33.756 E/GeckoConsole(  208):     at SimLockSystemDialog.prototype.handleCardState/request.onerror (app://system.gaiamobile.org/js/sim_lock_system_dialog.js:220:6)


***** [Log snippet: failed case] *****
03-13 18:14:12.716 I/GeckoConsole(  208): Content JS LOG: XXX [SimLockManager][121.793] handling airplanemode-enabled 
03-13 18:14:15.306 I/Gecko   (  208): -*- RadioInterface[0]: Received message from worker: {"rilMessageType":"cardstatechange","cardState":4294967295,"rilMessageClientId":0}
03-13 18:14:15.306 I/Gecko   ( 1288): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":4294967295,"rilMessageClientId":0}}
03-13 18:14:15.326 I/Gecko   (  208): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":4294967295,"rilMessageClientId":0}}
03-13 18:14:15.386 I/GeckoConsole(  208): Content JS LOG: XXX [SimLockManager][124.511] handling simslot-cardstatechange 
03-13 18:14:15.386 W/GeckoConsole(  208): Content JS WARN: XXX [SimLockManager][124.512] unknown SIM card state for slot 1 
03-13 18:14:15.386 W/GeckoConsole(  208): Content JS WARN: XXX [SimLockManager][124.513] No SIM card in slot 2 
03-13 18:14:15.386 I/GeckoConsole(  208): Content JS LOG: XXX [SimLockManager][124.517] handling simslot-iccinfochange 
03-13 18:14:15.386 W/GeckoConsole(  208): Content JS WARN: XXX [SimLockManager][124.519] unknown SIM card state for slot 1 
03-13 18:14:15.386 W/GeckoConsole(  208): Content JS WARN: XXX [SimLockManager][124.520] No SIM card in slot 2 
03-13 18:14:21.336 I/Gecko   (  208): -*- RadioInterface[0]: Received message from worker: {"rilMessageType":"cardstatechange","cardState":0,"rilMessageClientId":0}
03-13 18:14:21.336 I/Gecko   ( 1288): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":0,"rilMessageClientId":0}}
03-13 18:14:21.406 I/Gecko   (  208): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":0,"rilMessageClientId":0}}

===== cardstate becomes "pin-required" and and RIL sends out notification =====
03-13 18:14:21.546 I/Gecko   (  208): -*- RadioInterface[0]: Received message from worker: {"rilMessageType":"cardstatechange","cardState":2,"rilMessageClientId":0}
03-13 18:14:21.546 I/Gecko   ( 1288): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":2,"rilMessageClientId":0}}
03-13 18:14:21.576 I/Gecko   (  208): -*- RILContentHelper: Received message 'RIL:CardStateChanged': {"clientId":0,"data":{"rilMessageType":"cardstatechange","cardState":2,"rilMessageClientId":0}}

===== No any SimLockManager messages shown =====
Flags: needinfo?(htsai)
RIL and SimLockManager debug messages: include success and failed cases
Alberto, can you reproduce and if so check if this is a gaia issue?
Flags: needinfo?(apastor)
(In reply to Alexandre LISSY :gerard-majax from comment #28)
> Did you had bug 976497 in mind ?

This issue is different from that.
In this bug, gecko detects the sim and recognizes the sim state correctly.
RIL sends the cardstate change event as expected, but somehow the event isn't received by SimLockManager...
mozilla-inbound regression window:

Last Working Environmental Variables:
Gaia-Rev        85c3579e91d99be47665e1e1d61f20e548cb04cb
Gecko-Rev       https://hg.mozilla.org/integration/b2g-inbound/rev/e4f547bcdf87
Build-ID        20141225000237
Version         37.0a1
Device-Name     flame
FW-Release      4.4.2
FW-Incremental  eng.cltbld.20150315.195030
FW-Date         Sun Mar 15 19:50:42 EDT 2015
Bootloader      L1TC000118D0

First Broken Environmental Variables:
Gaia-Rev        85c3579e91d99be47665e1e1d61f20e548cb04cb
Gecko-Rev       https://hg.mozilla.org/integration/b2g-inbound/rev/8f1c3e86aa20
Build-ID        20141225013630
Version         37.0a1
Device-Name     flame
FW-Release      4.4.2
FW-Incremental  eng.cltbld.20150315.195030
FW-Date         Sun Mar 15 19:50:42 EDT 2015
Bootloader      L1TC000118D0

Last Working gaia / First Broken gecko - Issue DOES occur
85c3579e91d99be47665e1e1d61f20e548cb04cb
Gecko-Rev       https://hg.mozilla.org/integration/b2g-inbound/rev/8f1c3e86aa20

First Broken gaia / Last Working gecko - Issue does NOT occur
Gaia-Rev        85c3579e91d99be47665e1e1d61f20e548cb04cb
Gecko-Rev       https://hg.mozilla.org/integration/b2g-inbound/rev/e4f547bcdf87
I cannot repro with latest 3.0 (Orange SIM).

If somebody that is reproing can apply this patch [1] and attach the adb logcat result, I can try to understand what's going on.

Thanks!

[1] https://github.com/albertopq/gaia/tree/debug-sim-pin
Flags: needinfo?(apastor)
The log includes several iterations. You could grep "handling airplanemode-enabled" for the start point of every single one.

The observation is the same as comment 30, i.e. RIL sent out the notification but SimLockManager wasn't received. Wondering if something went wrong in Icc DOM part.
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #36)
> Created attachment 8578633 [details]
> log (v2.2 based) with comment 35 debug patch applied
> 
> The log includes several iterations. You could grep "handling
> airplanemode-enabled" for the start point of every single one.
> 
> The observation is the same as comment 30, i.e. RIL sent out the
> notification but SimLockManager wasn't received. Wondering if something went
> wrong in Icc DOM part.

Sorry to insist, but are we sure SimLockManager was listening for events at that time? We already got several cases of race conditions that were this: everything is fine, except the event is fired a bit too early and the expected listener got a bit delayed. There was one case involving SimLockManager I think, that was triggered by upgrade path of the DOM WebApps code, delaying the applicationready event.
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #36)
> Created attachment 8578633 [details]
> log (v2.2 based) with comment 35 debug patch applied
> 
> The log includes several iterations. You could grep "handling
> airplanemode-enabled" for the start point of every single one.
> 
> The observation is the same as comment 30, i.e. RIL sent out the
> notification but SimLockManager wasn't received. Wondering if something went
> wrong in Icc DOM part.

Hi Bevis,
The bisection pointed out that bug 1087847 might be a cause. Could you please investigate further based on my observation? Thank you.
Flags: needinfo?(btseng)
(In reply to Alexandre LISSY :gerard-majax from comment #37)
> (In reply to Hsin-Yi Tsai [:hsinyi] from comment #36)
> > Created attachment 8578633 [details]
> > log (v2.2 based) with comment 35 debug patch applied
> > 
> > The log includes several iterations. You could grep "handling
> > airplanemode-enabled" for the start point of every single one.
> > 
> > The observation is the same as comment 30, i.e. RIL sent out the
> > notification but SimLockManager wasn't received. Wondering if something went
> > wrong in Icc DOM part.
> 
> Sorry to insist, but are we sure SimLockManager was listening for events at
> that time? We already got several cases of race conditions that were this:
> everything is fine, except the event is fired a bit too early and the
> expected listener got a bit delayed. There was one case involving
> SimLockManager I think, that was triggered by upgrade path of the DOM
> WebApps code, delaying the applicationready event.

That was bug 1090859
Flags: needinfo?(htsai)
(In reply to Alexandre LISSY :gerard-majax from comment #37)
> (In reply to Hsin-Yi Tsai [:hsinyi] from comment #36)
> > Created attachment 8578633 [details]
> > log (v2.2 based) with comment 35 debug patch applied
> > 
> > The log includes several iterations. You could grep "handling
> > airplanemode-enabled" for the start point of every single one.
> > 
> > The observation is the same as comment 30, i.e. RIL sent out the
> > notification but SimLockManager wasn't received. Wondering if something went
> > wrong in Icc DOM part.
> 
> Sorry to insist, but are we sure SimLockManager was listening for events at
> that time? 

I am not sure. I was just trying to write down my obesrvation so far.

> We already got several cases of race conditions that were this:
> everything is fine, except the event is fired a bit too early and the
> expected listener got a bit delayed. There was one case involving
> SimLockManager I think, that was triggered by upgrade path of the DOM
> WebApps code, delaying the applicationready event.
blocking-b2g: 2.2? → 2.2+
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #38)
> Hi Bevis,
> The bisection pointed out that bug 1087847 might be a cause. Could you
> please investigate further based on my observation? Thank you.

I'll look into this and update my finding later.
Assignee: nobody → btseng
Hi all,

After further analysis, I found the reason why SIMLockManager didn't received either 'iccinfochange' or 'cardstatechange' event from Icc:
1. When toggling airplane mode on/off, 'iccundetected' & 'iccdetected' events will be sent to indicate that Icc is removed and then added. [1]
2. In current implmentation of SIMSlot.update() will be invoked by SIMSlotManager to register Icc related events to the new Icc Object after 'iccdetected' is fired. [2]
3. In the implementation of SIMLockManager & SIMSlot, there seems to be an assumption that 'iccinfochange' or 'cardstatechange' will be fired after 'iccdetected'.
4. However, in Gecko, this is not true the events could be arrived in different order.

Hence, to fix this bug, similar to _handle_simslot-iccinfochange() in SimLockManager, we can have one more event 'simslot-updated' listened by SimLockManager to invoke showIfLocked(evt.detail.index).

[1] https://dxr.mozilla.org/mozilla-central/source/dom/icc/IccListener.cpp#99-131
[2] https://github.com/mozilla-b2g/gaia/blob/3093f1dda2d7fc53a6a5f980c032a8ecd1f25eaf/shared/js/simslot.js#L61
Flags: needinfo?(btseng)
Flags: needinfo?(htsai)
The root cause of this bug is that from API perspective, it is possible to have all icccardstate/iccinfo from MozIccManager after 'iccdetected'.

In Gaia's implementation, iccinfochange/icccardstatechange is expected to trigger SimLockManager to check whether SimLockScreen has to be displayed.

This is not always true and after the fix of bug 1087847 is included, this symptom becomes more obvious.

Hence, I'd like to propose this patch for Gaia's SimLockManager to check whether SIMLockScreen has to be displayed once a new IccObject is detected from SimSlot.
Hi Alberto,

Can you help us to improve this in SimLockManager?
Please see the proposed patch in comment 43.

Thanks!
Assignee: btseng → nobody
Flags: needinfo?(apastor)
Sure! I'll take a look. Thanks for the investigation!
Assignee: nobody → apastor
Flags: needinfo?(apastor)
Attachment #8580648 - Flags: review?(alive)
Comment on attachment 8580648 [details] [review]
[gaia] albertopq:1133465-airplane-sim > mozilla-b2g:master

LGTM
Attachment #8580648 - Flags: review?(alive) → review+
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Comment on attachment 8580648 [details] [review]
[gaia] albertopq:1133465-airplane-sim > mozilla-b2g:master

[Approval Request Comment]
[Bug caused by] (feature/regressing bug #): -
[User impact] if declined: sometimes, user won't see the sun pin dialog when enabling/disbling airplane mode
[Testing completed]: added unit tests 
[Risk to taking this patch] (and alternatives if risky): low risk. Just listening to a new event and checking if the dialog should be displayed
[String changes made]: none
Attachment #8580648 - Flags: approval-gaia-v2.2?(bbajaj)
Attachment #8580648 - Flags: approval-gaia-v2.2?(bbajaj) → approval-gaia-v2.2+
For some reason, git is giving me "bad object" errors when I try to cherry-pick this commit :(. Can you please post a v2.2 PR? Sorry for the hassle.
Flags: needinfo?(apastor)
Target Milestone: --- → 2.2 S9 (3apr)
(In reply to Autolander from comment #48)
> Pull request has landed in master:
> https://github.com/mozilla-b2g/gaia/commit/
> 12c4faaa354e824820884dcc2f38edbf47bea348

Hi Alberto,

I seems that there is something wrong in Autolander.
I cannot see this fix included in master branch. :(
https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/sim_lock_manager.js
Flags: needinfo?(apastor)
Weird... I just relanded it:

master: https://github.com/mozilla-b2g/gaia/commit/143c67962f74a9bb7a72c0f502743dfbe4138a5c

Thanks!
Flags: needinfo?(apastor)
This issue verified successfully on flame 2.2
FLame 2.2:
Build ID               20150326002504
Gaia Revision          e59ac067a1d22b7a72cbebc892ec652723f2a557
Gaia Date              2015-03-26 00:02:53
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/04b4b9d1faae
Gecko Version          37.0
Device Name            flame
Firmware(Release)      4.4.2
Reproduce rate 0/20
This issue verified successfully on flame3.0
Reproduce rate 0/20
Flame 3.0:
Build ID               20150327160203
Gaia Revision          9cc496cecc37d7a29f9279827cdf6e4891211f67
Gaia Date              2015-03-27 13:55:18
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/44e454b5e93b
Gecko Version          39.0a1
Device Name            flame
Firmware(Release)      4.4.2
Status: RESOLVED → VERIFIED
Whiteboard: [systemsfe]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: