Last Comment Bug 771440 - B2G RIL: GET_IMSI and ICC IO cannot work on Otoro ICS
: B2G RIL: GET_IMSI and ICC IO cannot work on Otoro ICS
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: Trunk
: ARM Gonk (Firefox OS)
: -- normal (vote)
: mozilla17
Assigned To: Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
:
Mentors:
Depends on:
Blocks: 773068
  Show dependency treegraph
 
Reported: 2012-07-06 01:04 PDT by Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
Modified: 2012-07-31 19:20 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Part 1: GET_IMSI (856 bytes, patch)
2012-07-27 02:19 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
vicamo: review+
Details | Diff | Splinter Review
Part 2: ICC IO (6.41 KB, patch)
2012-07-27 02:26 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
no flags Details | Diff | Splinter Review
Part 1: GET_IMSI v2 (869 bytes, patch)
2012-07-29 21:16 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
no flags Details | Diff | Splinter Review
WID - Part 2 : ICC IO (7.57 KB, patch)
2012-07-29 21:18 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
no flags Details | Diff | Splinter Review
Part 1: GET_IMSI v2 (869 bytes, patch)
2012-07-31 03:20 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
no flags Details | Diff | Splinter Review
Part 2: Icc IO v2 (7.58 KB, patch)
2012-07-31 03:21 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
vicamo: review+
Details | Diff | Splinter Review

Description Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-06 01:04:18 PDT
GET_IMSI cannot work on Otoro ICS
I/Gecko   (  105): RIL Worker: Solicited response for request type 11, token 8, error 2
I/Gecko   (  105): RIL Worker: Handling parcel as REQUEST_GET_IMSI

I have tried to revert the patch for Bug 768428, it still cannot work, response for GET_IMSI never comes back.

Also Icc IO cannot work, either.
It fails in READ_RECORD 
I/Gecko   (  105): RIL Worker: We have at least one complete parcel.
I/Gecko   (  105): RIL Worker: Solicited response for request type 28, token 12, error 2
I/Gecko   (  105): RIL Worker: Handling parcel as REQUEST_SIM_IO
I/Gecko   (  105): RIL Worker: Parcel handler didn't consume whole parcel, 16 bytes left over
I
Comment 1 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-20 03:47:32 PDT
GET_IMSI needs the 'aid' got from GET_SIM_STATUS, 
(which we use null in ril_worker now)

Still debugging on SIM_IO problem,

from adb logcat -b radio

RIL_SIM_IO_Response: sw1=105 sw2=130 data=

to HEX : sw1 = 69, sw2 = 82, which is 'Security status not satisfied' from spec.
Comment 2 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-24 01:37:26 PDT
This bug is SIM-dependent,
when I use a T-Mobile SIM, 
both GET_IMSI and ICC_IO work fine, 
but it fails when I use a Emome SIM.
Comment 3 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-24 23:39:00 PDT
Continue to work ICC_IO part:
EF_MFBN: it fails in GET_RESPONSE
adb logcat -b radio

D/RILC    (  112): RIL_SIM_IO_Response: sw1=106 sw2=130 data=NULL
D/RILC    (  112): [RID 0] ReqList entries :
D/RILC    (  112):     RIL_REQUEST_SIM_IO (28), token id 13
D/RILC    (  112):     RIL_REQUEST_SIM_IO (28), token id 14
D/RILC    (  112):     RIL_REQUEST_GET_SIM_STATUS (1), token id 19
D/RILC    (  112): UI <--- RIL_REQUEST_SIM_IO (28) Complete --- RIL [RID 0, Token 12, Generic Failure, Len 12 ]

sw1=0x6a, sw2=0x82 --> File not found

other ICC_IO, EF_MSISDN, EF_AD, EF_UST all fail in READ_RECORD/BINARY part

D/RILC    (  112): RIL_SIM_IO_Response: sw1=105 sw2=130 data=
D/RILC    (  112): [RID 0] ReqList entries : Empty 
D/RILC    (  112): UI <--- RIL_REQUEST_SIM_IO (28) Complete --- RIL [RID 0, Token 20, Generic Failure, Len 12 ]

The result is even the same if I add the 'aid' parameter in REQUEST_SIM_IO
Comment 4 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-25 04:14:48 PDT
Hi MVines,
  I am wondering does the parameter in REQUEST_SIM_IO (RIL_SIM_IO_v6) has changed on Otoro ICS? Or do you know why I always get sw1 = 69, sw2 = 82 when doing READ_RECORD/BINARY in REQUEST_SIM_IO? I've tried three SIM cards(T-Mobile, Movistar and Emome), but only Emome fails in SIM_IO, other SIMs are fine.

Thanks
Comment 5 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-26 03:34:43 PDT
I can get the ICC IO working on my SIM with the pathId in SIM_IO set to MF_SIM("3f00") + DF_ADF("7fff") now.
Now try to find a way to tell from these SIM cards.

Thanks
Comment 6 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-27 02:19:24 PDT
Created attachment 646493 [details] [diff] [review]
Part 1: GET_IMSI

Hi, Vicamo
Could you review this patch for me ?
Thanks
Comment 7 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-27 02:26:14 PDT
Created attachment 646496 [details] [diff] [review]
Part 2: ICC IO

Hi, Vicamo
For ICC IO I change the PATH_ID to ADF, which can be found in TS 102.221 and TS 31.102. ADF means Application-specified DF.

Note that I didn't change the pathid for ADN and FDN because I found those SIM contacts can be only found through global contact, not through ADF contact.

I have tested this patch with Emome and T-Mobile SIM on Otoro and Galaxy-s2. And on emulator most of those ICC also work except the SIM contacts, which are not supported on emulator.

Thanks
Comment 8 Vicamo Yang [:vicamo][:vyang] 2012-07-27 08:58:00 PDT
Comment on attachment 646493 [details] [diff] [review]
Part 1: GET_IMSI

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

::: dom/system/gonk/ril_worker.js
@@ +1015,5 @@
>      }
>      let token = Buf.newParcel(REQUEST_GET_IMSI);
>      Buf.writeUint32(1);
> +    let iccStatus = this.iccStatus;
> +    Buf.writeString(iccStatus.apps[iccStatus.gsmUmtsSubscriptionAppIndex].aid);

Please use:

  let appIndex = this.iccStatus.gsmUmtsSubscriptionAppIndex;
  Buf.writeString(this.iccStatus.apps[appIndex].aid);

The first line will be modified into:

  let appIndex = GSM_SIM ? this.iccStatus.gsmUmtsSubscriptionAppIndex
                         : this.iccStatus.cdmaSubscriptionAppIndex;

when CDMA support is ready.
Comment 9 Vicamo Yang [:vicamo][:vyang] 2012-07-27 10:07:28 PDT
(In reply to Yoshi Huang[:yoshi][:allstars.chh] from comment #7)
> Created attachment 646496 [details] [diff] [review]
> Part 2: ICC IO
> 
> Hi, Vicamo
> For ICC IO I change the PATH_ID to ADF, which can be found in TS 102.221 and
> TS 31.102. ADF means Application-specified DF.
> 
> Note that I didn't change the pathid for ADN and FDN because I found those
> SIM contacts can be only found through global contact, not through ADF
> contact.
> 
> I have tested this patch with Emome and T-Mobile SIM on Otoro and Galaxy-s2.
> And on emulator most of those ICC also work except the SIM contacts, which
> are not supported on emulator.
> 
> Thanks

https://www.codeaurora.org/gitweb/quic/la/?p=platform/frameworks/base.git;a=commitdiff;h=de653d757f162833067fa15eea8efb12f2c9251a;hp=359e32a3c5abc77e17e71ff0fdc533faaafc3a93
Were it anything to do with this issue?

I also found that our iccIO() implementation differs from that in Android aosp/master, which always writes pin2 & aid, and in aosp/ics-mr1, which always writes pin2. I know little about SIM specification, but I can't really believe we should change PATH_ID. Neither AOSP nor CodeAurora does this.
Comment 10 Vicamo Yang [:vicamo][:vyang] 2012-07-27 10:08:01 PDT
Comment on attachment 646496 [details] [diff] [review]
Part 2: ICC IO

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

::: dom/system/gonk/ril_worker.js
@@ +990,3 @@
>      }
> +    let iccStatus = this.iccStatus;
> +    Buf.writeString(iccStatus.apps[iccStatus.gsmUmtsSubscriptionAppIndex].aid);

Same with the first patch.
Comment 11 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-29 21:16:03 PDT
Created attachment 647056 [details] [diff] [review]
Part 1: GET_IMSI v2

Address to vicamo's review comments.
Comment 12 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-29 21:18:50 PDT
Created attachment 647057 [details] [diff] [review]
WID - Part 2 : ICC IO

Update writing pin2/AID in iccIO
The path id in iccIO remains in discussion so I haven't updated it here.
Comment 13 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-31 02:48:47 PDT
Hi, Vicamo
I found CodeAurora also did the same thing as in my patch

http://bit.ly/MYIyVv
http://bit.ly/MYIvc6

But I didn't find those files in android tree.

How do you think?
Comment 14 Vicamo Yang [:vicamo][:vyang] 2012-07-31 03:08:26 PDT
(In reply to Yoshi Huang[:yoshi][:allstars.chh] from comment #13)
> Hi, Vicamo
> I found CodeAurora also did the same thing as in my patch
>   http://bit.ly/MYIyVv
>   http://bit.ly/MYIvc6
> But I didn't find those files in android tree. How do you think?

Great! That totally explains your work. I think I have no more questions about your patches. Thanks ;)

(Keep original url)
https://www.codeaurora.org/gitweb/quic/qrd-android/?p=platform/frameworks/base.git;a=blob;f=telephony/java/com/android/internal/telephony/UsimFileHandler.java;hb=refs/heads/ics_master_qrd_qs#l42
https://www.codeaurora.org/gitweb/quic/la/?p=platform/frameworks/base.git;a=blob;f=telephony/java/com/android/internal/telephony/UsimFileHandler.java;hb=refs/heads/ics#l42
Comment 15 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-31 03:20:27 PDT
Created attachment 647482 [details] [diff] [review]
Part 1: GET_IMSI v2

rebase.
Comment 16 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-07-31 03:21:39 PDT
Created attachment 647484 [details] [diff] [review]
Part 2: Icc IO v2

Rebase.
Comment 17 Vicamo Yang [:vicamo][:vyang] 2012-07-31 03:38:13 PDT
Comment on attachment 647484 [details] [diff] [review]
Part 2: Icc IO v2

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

Sweet!

Note You need to log in before you can comment on or make changes to this bug.