Skip to content

Commit

Permalink
Bug 955946 - Distinguish SIM/USIM getResponse p1/p2/p3 parameters. r=…
Browse files Browse the repository at this point in the history
…echen

Performing proper ICC_IO operations depends on the type of the SIM card.
For example, the Desire Z will work with FCP Template, so we need to
follow TS 102.221 table 11.2 to perform the proper request and get a FCP
Template. This is done when we write the ICC_IO command: we need to set
the p2/p3 fields depending on the SIM card type (SIM or USIM) so that
the proper behavior is triggered.
  • Loading branch information
Alexandre Lissy committed Sep 3, 2014
1 parent 7ffe984 commit a908635
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions dom/system/gonk/ril_consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,9 @@ this.ADN_MAX_NUMBER_DIGITS = 20;
// READ_RECORD mode, TS 102.221
this.READ_RECORD_ABSOLUTE_MODE = 4;

// TS 102.221 Table 11.2, return FCP template
this.GET_RESPONSE_FCP_TEMPLATE = 4;

// GET_RESPONSE mandatory response size for EF, see TS 51.011 clause 9,
// 'Response data in case of an EF.'
this.GET_RESPONSE_EF_SIZE_BYTES = 15;
Expand Down
18 changes: 16 additions & 2 deletions dom/system/gonk/ril_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -12673,6 +12673,7 @@ ICCIOHelperObject.prototype = {
options.callback = function callback(options) {
options.callback = cb;
options.command = ICC_COMMAND_READ_BINARY;
options.p2 = 0x00;
options.p3 = options.fileSize;
this.context.RIL.iccIO(options);
}.bind(this);
Expand All @@ -12693,8 +12694,21 @@ ICCIOHelperObject.prototype = {
throw new Error("Unknown pathId for " + options.fileId.toString(16));
}
options.p1 = 0; // For GET_RESPONSE, p1 = 0
options.p2 = 0; // For GET_RESPONSE, p2 = 0
options.p3 = GET_RESPONSE_EF_SIZE_BYTES;
switch (this.context.RIL.appType) {
case CARD_APPTYPE_USIM:
options.p2 = GET_RESPONSE_FCP_TEMPLATE;
options.p3 = 0x00;
break;
// For RUIM, CSIM and ISIM, cf bug 955946: keep the old behavior
case CARD_APPTYPE_RUIM:
case CARD_APPTYPE_CSIM:
case CARD_APPTYPE_ISIM:
// For SIM, this is what we want
case CARD_APPTYPE_SIM:
options.p2 = 0x00;
options.p3 = GET_RESPONSE_EF_SIZE_BYTES;
break;
}
this.context.RIL.iccIO(options);
},

Expand Down

0 comments on commit a908635

Please sign in to comment.