Closed Bug 1126221 Opened 10 years ago Closed 7 years ago

[FFOS7715 v2.1][Contacts]B2G RIL: need to handle semicolon and WILD characters when read adn number from sim card and write adn number to sim card

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
major

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: yanyan.an, Unassigned)

References

Details

(Whiteboard: [sprd399420])

Attachments

(2 files, 2 obsolete files)

For sim contact, for example,adn number may contain wild characters,we need to handle it.
bcdChars(@ril_worker.js) is "0123456789*#,;". According to 3GPP TS 51.011 V5.0.0 10.5.1, BCD Value 'A' is "*" char, BCD Value 'B' is "#" char, BCD Value 'C' is PAUSE, BCD Value 'D' is WILD char, BCD Value 'E' is WAIT char; So I suspect that bcdChars has problem. see blow discription: 1) (@ril_worker.js) bcdChars is "0123456789*#,;" bcdChars: "0123456789*#,;", semiOctetToBcdChar: function(semiOctet, supressException) { if (semiOctet >= 14) { if (supressException) { return ""; } else { throw new RangeError(); } } return this.bcdChars.charAt(semiOctet); }, 2)BCD Value Character/Meaning '0' -- "0" ... ... '9' -- "9" 'A' -- "*" 'B' -- "#" 'C' -- DTMF Control digit separator (TS 02.07 [3]) 'D' -- "Wild" value This will cause the MMI to prompt the user for a single digit (see TS 02.07 [3]). 'E' -- Expansion digit ("Shift Key"). It has the effect of adding '10' to the following digit. The following BCD digit will hence be interpreted in the range of '10'‑'1E'. The purpose of digits in this range is for further study. 'F' -- Endmark e.g. in case of an odd number of digits 3)See GSM 02.07 Version 5.0.0 [B.3.1 Abbreviated dialling] Abbreviated dialling The directory number or part of it is stored in the mobile station together with the abbreviated address. After retrieval the directory number may appear on the display. Abbreviated dialling numbers stored in the ME or SIM may contain wild characters. It is permitted to extend the number by adding digits (by means of the keypad, R interface or a second abbreviated, or fixed dialling, number (and/or subaddress)) when setting up a call. If wild characters are used to indicate missing digits, each wild character shall be replaced for network access or supplementary service operation, by a single digit entered at the keypad. The completed directory number is transmitted on the radio path.
Summary: B2G RIL: need to handle wild characters for ADN in the SIM → [FFOS7715 v2.1][Contacts]B2G RIL: need to handle wild characters for ADN in the SIM
[Testing Steps ]:A sim contact's number contain 'W' char for sim card. Insert the sim card to ffos phone, to import contact from sim card. [Expected Result ]:May import contact from sim card succussfully [Test Result ]:Stay on the 'importing contact from sim card...'page
First, See the late line log, in '989989838B247188E8C9', 'E' char corresponds to the semicolon ';' char. Second, In android platfrom, the semicolon ';' char represents WAIT 'W' char. Third, In firefox platfrom, when parse 'E' char in semiOctetToBcdChar, semiOctet >= 14 is true, then throw error. And, bcdChars are defined as "0123456789*#,;". So I suspect that bcdChars has problem, may should be add a char which represents WILD char. //radio log: (cmd=0xB2,efid=0x6F3A,path=3f007f10,187,4,28,(null),pin2=(null),aid=(null)) 01-20 12:03:50.050 144 599 D use-Rlog/RLOG-RIL: [w] onRequest: SIM_IO sState=4 01-20 12:03:50.050 144 599 D use-Rlog/RLOG-RIL: [w] channel1 state: '0' 01-20 12:03:50.050 144 599 D use-Rlog/RLOG-RIL: [w] get Channel ID '1' 01-20 12:03:50.050 144 599 D use-Rlog/RLOG-AT: [w] Channel1: AT> AT+CRSM=178,28474,187,4,28,0,"3f007f10" 01-20 12:03:50.050 144 207 D use-Rlog/RLOG-AT: [w] Channel1: AT< +CRSM: 144,0,48686262686A64656464FFFFFFFF0B81989989838B247188E8C9FFFF 01-20 12:03:50.050 144 207 D use-Rlog/RLOG-AT: [w] Channel1: AT< OK 01-20 12:03:50.050 144 599 D use-Rlog/RLOG-RILC: [w] [0258]< SIM_IO {sw1=0x90,sw2=0x0,48686262686A64656464FFFFFFFF0B81989989838B247188E8C9FFFF} //Android platform, sim contact's phone number format conversion are as follows. //read phone number from sim card /** returns 0 on invalid value */     private static char     bcdToChar(byte b) {         if (b < 0xa) {             return (char)('0' + b);         } else switch (b) {             case 0xa: return '*';             case 0xb: return '#';             case 0xc: return PAUSE;//Defined as 'P' char             case 0xd: return WILD;//Defined as 'N' char             case 0xe: return WAIT;//SPRD://Defined as 'W' char             default: return 0;         }     } //write number to sim card   private static int     charToBCD(char c) {         if (c >= '0' && c <= '9') {             return c - '0';         } else if (c == '*') {             return 0xa;         } else if (c == '#') {             return 0xb;         } else if (c == PAUSE) {             return 0xc;         } else if (c == WILD) {             return 0xd;         } else if (c == WAIT) {//SPRD:             return 0xe;         } else {             throw new RuntimeException ("invalid char for BCD " + c);         }     }
Attached file Gecko_Ril_Log.tar.gz (deleted) —
attach log
Summary: [FFOS7715 v2.1][Contacts]B2G RIL: need to handle wild characters for ADN in the SIM → [FFOS7715 v2.1][Contacts]B2G RIL: need to handle semicolon and WILD characters when read adn number from sim card and write adn number to sim card
According to Android primary design and 3GPP TS 51.011 V5.0.0 10.5.1, Abbreviated dialling numbers stored in the ME or SIM may contain wild characters First, when read and number from sim card, need to handle WILD char, conversion as follows: a is converted to *, b is converted to #, c is converted to comma ",", D is converted to N, e is converted to the semicolon ";". Second, when write and number to sim card, need to hand semicolon and WILD chars, conversion as follows: * is converted to a, # is converted to B, the comma "," is converted to C, N is converted to D, the semicolon ";" is converted to e Third, for ffos current implementation, semiOctetToBcdChar function does not process the WILD character; writeNumberWithLength function does not process the semicolon and WILD chars. //when read adn from sim card, does not process WILD char bcdChars: "0123456789*#,;", semiOctetToBcdChar: function(semiOctet, supressException) { if (semiOctet > 14) { if (supressException) { return ""; } else { throw new RangeError(); } } //when write adn number to sim card, does not handle semicolon and WILD chars writeNumberWithLength: function(number) { let GsmPDUHelper = this.context.GsmPDUHelper; if (number) { let numStart = number[0] == "+" ? 1 : 0; number = number.substring(0, numStart) + number.substring(numStart) .replace(/[^0-9*#,]/g, "") .replace(/\*/g, "a") .replace(/\#/g, "b") .replace(/\,/g, "c"); return this.bcdChars.charAt(semiOctet); },
I venture to suggest we should do the following modification: First, semiOctetToBcdChar function add to handle N char when read adn from sim card. According to Android primary design, WILD char is defined to 'N' char. bcdChars: "0123456789*#,N;", //add N char in bcdChars semiOctetToBcdChar: function(semiOctet, supressException) { if (semiOctet > 14) {//modify semiOctet >= 14 to semiOctet > 14 if (supressException) { return ""; } else { throw new RangeError(); } } return this.bcdChars.charAt(semiOctet); }, Second, writeNumberWithLength function add to handle the semicolon and N chars when write adn to sim card: writeNumberWithLength: function(number) { let GsmPDUHelper = this.context.GsmPDUHelper; if (number) { let numStart = number[0] == "+" ? 1 : 0; number = number.substring(0, numStart) + number.substring(numStart) .replace(/[^0-9*#,N;]/g, "") .replace(/\*/g, "a") .replace(/\#/g, "b") .replace(/\,/g, "c") .replace(/N/g, "d") //add to process N char .replace(/\;/g, "e"); //add to process semicolon char
Attached patch ril_worker_v2.patch (deleted) — Splinter Review
ril_worker_v1.patch is incomplete, please view ril_worker_v2.patch
this issue can cause creen hold while met WILD characters, following SPEC, pls help reviewed. thank you
Flags: needinfo?(vchen)
yanyan has achived patch to solve and add little function to store and load
Attachment #8556219 - Attachment is obsolete: true
Attachment #8556223 - Attachment is obsolete: true
clear vchen, waiting for 2.1s
Flags: needinfo?(vchen)
Blocks: 1157082
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: