B2G STKUI: Add suport for Timer Managerment

RESOLVED FIXED

Status

Firefox OS
Gaia::Settings
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: allstars, Assigned: frsela)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [u=commsapps-user c=stk p=0], [Sprint2])

Attachments

(1 attachment)

From Bug 804667 we add support for Timer Management in gecko side, this bug is created to handle Timer Management in gaia side.
(Reporter)

Updated

6 years ago
Depends on: 804667
blocking-b2g: --- → shira+
Whiteboard: [triaged:1/18]
Whiteboard: [triaged:1/18] → [mno11][triaged:1/18]
blocking-b2g: shira+ → ---
Whiteboard: [mno11][triaged:1/18]

Updated

5 years ago
Whiteboard: [u=commsapps-user c=stk p=0][Sprint2]

Updated

5 years ago
Assignee: nobody → frsela
Created attachment 784995 [details]
Added support for STK_CMD_TIMER_MANAGEMENT

Testing traces:

Creating two timers:

I/GeckoDump( 3279): [system] STK Proactive Command:{"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":{"timerId":1,"timerValue":5,"timerAction":0}}
I/GeckoDump( 3279): [system] STK_CMD_TIMER_MANAGEMENT:{"timerId":1,"timerValue":5,"timerAction":0}
I/GeckoDump( 3279): [system] sendStkResponse to command: {"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":{"timerId":1,"timerValue":5,"timerAction":0}}
I/GeckoDump( 3279): [system] sendStkResponse -- # response = {"timer":{"timerId":1,"timerValue":5,"timerAction":0},"resultCode":0}
I/GeckoDump( 3279): [system] STK Proactive Command:{"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":{"timerId":2,"timerValue":20,"timerAction":0}}
I/GeckoDump( 3279): [system] STK_CMD_TIMER_MANAGEMENT:{"timerId":2,"timerValue":20,"timerAction":0}
I/GeckoDump( 3279): [system] sendStkResponse to command: {"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":{"timerId":2,"timerValue":20,"timerAction":0}}
I/GeckoDump( 3279): [system] sendStkResponse -- # response = {"timer":{"timerId":2,"timerValue":20,"timerAction":0},"resultCode":0}

After 5 seconds, timer one is fired:

I/GeckoDump( 3279): [system] Timer expiration - 1

Quering timer 2 pending time:

I/GeckoDump( 3279): [system] STK Proactive Command:{"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":{"timerId":2,"timerValue":0,"timerAction":2}}
I/GeckoDump( 3279): [system] STK_CMD_TIMER_MANAGEMENT:{"timerId":2,"timerValue":0,"timerAction":2}
I/GeckoDump( 3279): [system] sendStkResponse to command: {"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":{"timerId":2,"timerValue":0,"timerAction":2}}
I/GeckoDump( 3279): [system] sendStkResponse -- # response = {"timer":{"timerId":2,"timerValue":11.014,"timerAction":2},"resultCode":0}


Stopping timer 2 before been fired

I/GeckoDump( 3279): [system] STK Proactive Command:{"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":{"timerId":2,"timerValue":0,"timerAction":1}}
I/GeckoDump( 3279): [system] STK_CMD_TIMER_MANAGEMENT:{"timerId":2,"timerValue":0,"timerAction":1}
I/GeckoDump( 3279): [system] sendStkResponse to command: {"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":{"timerId":2,"timerValue":0,"timerAction":1}}
I/GeckoDump( 3279): [system] sendStkResponse -- # response = {"timer":{"timerId":2,"timerValue":0,"timerAction":1},"resultCode":0}
Attachment #784995 - Flags: feedback?(allstars.chh)
(In reply to Fernando R. Sela [:frsela] from comment #1)
> Created attachment 784995 [details]
> Added support for STK_CMD_TIMER_MANAGEMENT
> 
> Testing traces:
> 
> Creating two timers:
> 
> I/GeckoDump( 3279): [system] STK Proactive
> Command:{"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":
> {"timerId":1,"timerValue":5,"timerAction":0}}
> I/GeckoDump( 3279): [system]
> STK_CMD_TIMER_MANAGEMENT:{"timerId":1,"timerValue":5,"timerAction":0}
> I/GeckoDump( 3279): [system] sendStkResponse to command:
> {"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":
> {"timerId":1,"timerValue":5,"timerAction":0}}
> I/GeckoDump( 3279): [system] sendStkResponse -- # response =
> {"timer":{"timerId":1,"timerValue":5,"timerAction":0},"resultCode":0}
> I/GeckoDump( 3279): [system] STK Proactive
> Command:{"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":
> {"timerId":2,"timerValue":20,"timerAction":0}}
> I/GeckoDump( 3279): [system]
> STK_CMD_TIMER_MANAGEMENT:{"timerId":2,"timerValue":20,"timerAction":0}
> I/GeckoDump( 3279): [system] sendStkResponse to command:
> {"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":
> {"timerId":2,"timerValue":20,"timerAction":0}}
> I/GeckoDump( 3279): [system] sendStkResponse -- # response =
> {"timer":{"timerId":2,"timerValue":20,"timerAction":0},"resultCode":0}
> 
> After 5 seconds, timer one is fired:
> 
> I/GeckoDump( 3279): [system] Timer expiration - 1
> 
> Quering timer 2 pending time:
> 
> I/GeckoDump( 3279): [system] STK Proactive
> Command:{"commandNumber":1,"typeOfCommand":39,"commandQualifier":0,"options":
> {"timerId":2,"timerValue":0,"timerAction":2}}
> I/GeckoDump( 3279): [system]
> STK_CMD_TIMER_MANAGEMENT:{"timerId":2,"timerValue":0,"timerAction":2}
> I/GeckoDump( 3279): [system] sendStkResponse to command:
> 

Are you sending a StkResponse here?
If the timer is expired,
you should call sendStkTimerExpiration.
(In reply to Yoshi Huang[:allstars.chh][:yoshi] from comment #2)

> Are you sending a StkResponse here?
> If the timer is expired,
> you should call sendStkTimerExpiration.

I call it here: https://github.com/mozilla-b2g/gaia/pull/11318/files#L1R355

Is when the timer expires only. On each command I respond it with StkResponse (seen in the loc as "sendStkResponse -- # response =" ;)
Comment on attachment 784995 [details]
Added support for STK_CMD_TIMER_MANAGEMENT

Mostly looks good to me,
except some lines should be usedless and should be removed. 
See comment on the github.
Attachment #784995 - Flags: feedback?(allstars.chh) → feedback+

Updated

5 years ago
Whiteboard: [u=commsapps-user c=stk p=0][Sprint2] → [u=commsapps-user c=stk p=0], [Sprint2]
(In reply to Yoshi Huang[:allstars.chh][:yoshi] from comment #4)
> Comment on attachment 784995 [details]
> Added support for STK_CMD_TIMER_MANAGEMENT
> 
> Mostly looks good to me,
> except some lines should be usedless and should be removed. 
> See comment on the github.

Nits fixed. Thanks Yoshi
Attachment #784995 - Flags: review?(timdream)
Attachment #784995 - Flags: review?(timdream) → review+
Rebased & landed: https://github.com/mozilla-b2g/gaia/commit/3c1d47a7eb0509c21788571b5478aba51936ec26
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.