Closed Bug 928773 Opened 11 years ago Closed 7 years ago

B2G STK: Move STK code out of ril_worker.js

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:-)

RESOLVED WONTFIX
blocking-b2g -

People

(Reporter: allstars.chh, Unassigned)

References

Details

Attachments

(3 files, 1 obsolete file)

We should move STK code in ril_worker to another file, called ril_stk.js... etc.
Assignee: nobody → gwang
Attachment #825786 - Attachment is obsolete: true
Comment on attachment 825808 [details] [diff] [review]
Part1:  Move stk code to ril_worker_stk.js

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

::: dom/system/gonk/ril_worker_stk.js
@@ +23,5 @@
> +  stkHandleCallSetup: function stkHandleCallSetup(options) {
> +     Buf.newParcel(REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM);
> +     Buf.writeInt32(1);
> +     Buf.writeInt32(options.hasConfirmed ? 1 : 0);
> +     Buf.sendParcel();

In this file, Buf, GsmPDUHelper, and RIL are actually from the worker.

You might also think the dependency here.
(In reply to Yoshi Huang[:allstars.chh][:yoshi] from comment #5)
> Comment on attachment 825808 [details] [diff] [review]
> Part1:  Move stk code to ril_worker_stk.js
> 
> Review of attachment 825808 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/system/gonk/ril_worker_stk.js
> @@ +23,5 @@
> > +  stkHandleCallSetup: function stkHandleCallSetup(options) {
> > +     Buf.newParcel(REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM);
> > +     Buf.writeInt32(1);
> > +     Buf.writeInt32(options.hasConfirmed ? 1 : 0);
> > +     Buf.sendParcel();
> 
> In this file, Buf, GsmPDUHelper, and RIL are actually from the worker.
> 
> You might also think the dependency here.

The modify is base on Bug 811754's attachment.
I'm trying to make ril_worker.js more clear, just leave:

Four function handler in RIL.
(In order to handle RIL function call from RadioInterfaceLayer)
>
sendStkTerminalResponse: function sendStkTerminalResponse(response) {   
  STK.sendStkTerminalResponse(response);                                    
},                                                                                      
sendStkMenuSelection: function sendStkMenuSelection(command) {         
  STK.sendStkMenuSelection(command);                                       
},                                                                                                                    
sendStkTimerExpiration: function sendStkTimerExpiration(command) {          
  STK.sendStkTimerExpiration(command);                                       
},                                                                                              
sendStkEventDownload: function sendStkEventDownload(command) {              
  STK.sendStkEventDownload(command);                
},

Four ril request and unsolicited command redirection.
RIL[REQUEST_STK_SEND_ENVELOPE_WITH_STATUS] = STK[REQUEST_STK_SEND_ENVELOPE_WITH_STATUS].bind(STK);
RIL[UNSOLICITED_STK_SESSION_END] = STK[UNSOLICITED_STK_SESSION_END].bind(STK);
RIL[UNSOLICITED_STK_PROACTIVE_COMMAND] = STK[UNSOLICITED_STK_PROACTIVE_COMMAND].bind(STK);
RIL[UNSOLICITED_STK_EVENT_NOTIFY] = STK[UNSOLICITED_STK_EVENT_NOTIFY].bind(STK);

Other stk related function are moved into STK.

Buf, GsmPDUHelper and few RIL function are also used in "StkProactiveCmdHelper and StkCommandParamsFactory" 
So I think they are more like utilities function, should be reasonable to separate them.
Assignee: gwang → nobody
Add this in backlog.
blocking-b2g: --- → backlog
blocking-b2g: backlog → -
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: