Closed Bug 946603 Opened 11 years ago Closed 10 years ago

[Fugu][B2G] REQUEST_ENTER_SIM_PIN responses retryCount with '-1' when passing a wrong pin

Categories

(Firefox OS Graveyard :: Vendcom, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: edgar, Unassigned)

References

Details

(Whiteboard: POVB, dsdsrun1.3-1)

Attachments

(6 files, 1 obsolete file)

* Reproduce Steps:
1. Insert a sim card in fugu with pin lock enabled.
2. Enter a wrong pin.
3. Check the response of REQUEST_ENTER_SIM_PIN [1].

* Expected Result:
Get correct remaining retry count.

* Actual Result:
Always get -1.

[1] https://github.com/mozilla-b2g/platform_hardware_ril/blob/master/include/telephony/ril.h#L826
Attached file fugu_unlock_pin.log
12-05 16:22:17.640   106   235 I Gecko   : RIL Worker[0]: New outgoing parcel of type 2
12-05 16:22:17.640    99   138 I RILC    : [w] enter processCommandsCallback
12-05 16:22:17.640    99   138 I RILC    : [w] PCC  alloc one command p_record
12-05 16:22:17.640    99   299 D RILC    : [w] PCB request code 2 token 42
12-05 16:22:17.640    99   299 D RILC    : [w] [0042]> ENTER_SIM_PIN (1111,(null))
12-05 16:22:17.640    99   299 D RIL     : [w] onRequest: ENTER_SIM_PIN sState=3
12-05 16:22:17.640    99   299 D RIL     : [w] channel1 state: '0' 
12-05 16:22:17.640    99   299 D RIL     : [w] get Channel ID '1'
12-05 16:22:17.640    99   299 D AT      : [w] Channel1: AT> AT+CPIN=1111
12-05 16:22:17.640   106   235 I Gecko   : RIL Worker[0]: Outgoing parcel: 0,0,0,32,2,0,0,0,42,0,0,0,2,0,0,0,4,0,0,0,49,0,49,0,49,0,49,0,0,0,0,0,255,255,255,255
12-05 16:22:17.700    99   279 D AT      : [w] Channel0: AT< +ECIND: 3,2,1,1
12-05 16:22:17.700    99   279 D AT      : [w] Channel0: AT< +ECIND: 3,6,1
12-05 16:22:17.700    99   279 D AT      : [w] Channel1: AT< +CME ERROR: 16
12-05 16:22:17.700    99   299 D RILC    : [w] [0042]< ENTER_SIM_PIN fails by E_PASSWORD_INCORRECT
12-05 16:22:17.700    99   299 D RIL     : [w] put Channel ID '1'
12-05 16:22:17.700    99   299 I RILC    : [w] -->CommandThread [299] free one command

12-05 16:22:17.880   106   235 I Gecko   : RIL Worker[0]: Received 16 bytes.
12-05 16:22:17.880   106   235 I Gecko   : RIL Worker[0]: Already read 0
12-05 16:22:17.880   106   235 I Gecko   : RIL Worker[0]: New incoming parcel of size 12
12-05 16:22:17.880   106   235 I Gecko   : RIL Worker[0]: Parcel (size 12): 0,0,0,0,42,0,0,0,3,0,0,0
12-05 16:22:17.880   106   235 I Gecko   : RIL Worker[0]: We have at least one complete parcel.
12-05 16:22:17.880   106   235 I Gecko   : RIL Worker[0]: Solicited response for request type 2, token 42, error 3
12-05 16:22:17.880   106   235 I Gecko   : RIL Worker[0]: Handling parcel as REQUEST_ENTER_SIM_PIN
12-05 16:22:17.880   106   235 I Gecko   : RIL Worker[0]: Next parcel size unknown, going to sleep.
12-05 16:22:17.950   106   106 I Gecko   : -*- RadioInterface[0]: Received message from worker: {"lockType":"pin","pin":"1111","requestId":"id{1742db63-e8bc-43f6-a3b1-5b001217d07c}","rilMessageToken":7,"rilMessageType":"iccUnlockCardLock","rilRequestType":2,"rilRequestError":3,"success":false,"errorMsg":"IncorrectPassword","retryCount":-1}
Hi Sam, could you help to check this? Thanks.
Flags: needinfo?(sam.hua)
blocking-b2g: --- → fugu?
Hi Edgar
It is because:
1. Our modem uses RIL_REQUEST_GET_REMAIN_TIMES in sprd_ril.h instead of REQUEST_GET_UNLOCK_RETRY_COUNT
2. the response of REQUEST_SET_FACILITY_LOCK from modem don't contains the retryCount

we use a patch to fix this problem in the gecko and gaia now,until our modem fix it.
Flags: needinfo?(sam.hua)
(In reply to sam.hua from comment #3)
> Hi Edgar
> It is because:
> 1. Our modem uses RIL_REQUEST_GET_REMAIN_TIMES in sprd_ril.h instead of
> REQUEST_GET_UNLOCK_RETRY_COUNT
> 2. the response of REQUEST_SET_FACILITY_LOCK from modem don't contains the
> retryCount
> 
> we use a patch to fix this problem in the gecko and gaia now,until our modem
> fix it.

Hi Sam,

Thanks for you reply, but this bug is filed for 'REQUEST_ENTER_SIM_PIN' [1].
The response of 'REQUEST_ENTER_SIM_PIN' should contain the remaining retry, this is the standard android ril request which is defined in ril.h. (please see [1])

I think this should be fixed in RILC, maybe need to use AT+CPINR to get remaining retry then put it into response parcel of 'REQUEST_ENTER_SIM_PIN'. Something like [2]. How do you think?

Thank you.

[1] https://github.com/mozilla-b2g/platform_hardware_ril/blob/master/include/telephony/ril.h#L826
[2] https://github.com/mozilla-b2g/platform_hardware_ril/commit/da1d3d8516ea3027c53077b0faeae1bbf9779143
Talked with Ken, and it looks like POVB.
Whiteboard: POVB
Hi Edgar,
Should I change these followings?
REQUEST_ENTER_SIM_PIN
REQUEST_ENTER_SIM_PIN2
REQUEST_ENTER_SIM_PUK
REQUEST_ENTER_SIM_PUK2
RIL_REQUEST_SET_FACILITY_LOCK
(In reply to sam.hua from comment #8)
> Hi Edgar,
> Should I change these followings?
> REQUEST_ENTER_SIM_PIN
> REQUEST_ENTER_SIM_PIN2
> REQUEST_ENTER_SIM_PUK
> REQUEST_ENTER_SIM_PUK2
> RIL_REQUEST_SET_FACILITY_LOCK

Yes, and also
RIL_REQUEST_CHANGE_SIM_PIN
RIL_REQUEST_CHANGE_SIM_PIN2

Thank you
Needinfo to Steven. Could you check this issue with partner ?
Flags: needinfo?(styang)
Hi Sam,
According to comment 6 and above, seems you are working on this issue.
Is it possible for you to take this bug and resolve with a more standard format?
Flags: needinfo?(styang) → needinfo?(sam.hua)
Yes,I will add retry count in the response of error.
and I will add REQUEST_GET_UNLOCK_RETRY_COUNT in sprd_ril.h and its handler in RILC
Flags: needinfo?(sam.hua)
Sam, I suggest you attach the ril.so to bugzilla.
Whiteboard: POVB → POVB, dsdsrun1.3-1
blocking-b2g: fugu? → ---
Flags: needinfo?(sam.hua)
Attached file libreference-ril_sp.so (obsolete) —
new so
Flags: needinfo?(sam.hua)
Attached file libril_sp.so
Hi Edgar,

I just upload the two libs for pin retry count and the response of setFacilityLock/verifySIMPin.
I just tested it and it works well now,please check it in your side

I will check it in if no problem
(In reply to sam.hua from comment #16)
> Hi Edgar,
> 
> I just upload the two libs for pin retry count and the response of
> setFacilityLock/verifySIMPin.
> I just tested it and it works well now,please check it in your side
> 
> I will check it in if no problem

Cool, I will test it and get back to you later.
Thank you.
Flags: needinfo?(echen)
Attached file logcat_puk.txt
Hi Sam,

After apply libreference-ril_sp.so and libril_sp.so, the retryCount for PIN works good.
But retryCount for unlocking puk is always 0 if entering a wrong puk.
Could you help to check this? thank you.

====
12-12 18:59:04.780   106   106 I Gecko   : -*- RILContentHelper: Received message 'RIL:CardLockResult': {"clientId":0,"data":{"lockType":"puk","puk":"11111111","newPin":"1111","requestId":"id{5c958b66-a3c6-4df8-8826-f1af353f6cb5}","rilMessageToken":14,"rilMessageType":"iccUnlockCardLock","rilRequestType":3,"rilRequestError":3,"success":false,"errorMsg":"IncorrectPassword","retryCount":0}}
====
Flags: needinfo?(echen)
Hi Edgar,
I find the problem.
I will update the libreference-ril_sp.so later.

And now our modem supports four kinds retryCount;
SIM PIN
SIM PIN2
SIM PUK
SIM PUK2
Attachment #8346398 - Attachment is obsolete: true
Attached file libreference-ril_sp.so
The updated libreference-ril_sp.so
Edgar,
Would you verify the updated SO?
Flags: needinfo?(echen)
(In reply to sam.hua from comment #20)
> Created attachment 8347036 [details]
> libreference-ril_sp.so
> 
> The updated libreference-ril_sp.so

Hi Sam,

I have tested
- Unlock PIN Lock
- Unlock PUK Lock
- Enable/Disable PIN Lock
- Change PIN code

This .so works perfectly.

Thank you
Flags: needinfo?(echen)
I'll push these so to spreadtrum git repo.
Component: RIL → Vendcom
Close the per comment #22 and comment #23.
Thanks Sam and James.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Verified on Fugu, passed.

Gaia      a119a0692c24c5ed7c55bab838bae3ecdb9dbec9
Gecko     15ee4e78431b45922b41dea882464b0ccb6b4fac
BuildID   20140110174141
Version   28.0a2

(SIM 2 has problem to show the retry counter, will file another bug for it)
Status: RESOLVED → VERIFIED
See Also: 926351
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: