Closed
Bug 921322
Opened 11 years ago
Closed 11 years ago
[B2G STK] Add "searchForNextTag" in StkProactiveCmdHelper
Categories
(Firefox OS Graveyard :: RIL, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: gwang, Assigned: gwang)
References
Details
Attachments
(2 files, 4 obsolete files)
2.46 KB,
patch
|
allstars.chh
:
review+
|
Details | Diff | Splinter Review |
2.45 KB,
patch
|
Details | Diff | Splinter Review |
In STK spec, some proactive command (ex. OPEN_CHANNEL) contains comprehension_tlvs with same tag. The old searchForTag function can not cover such case. We need to add a search function which can indicate the searching period. for example, function searchForTagPos(tag, ctlvs, startPoint, endPoint) and the return value should contain the tag position if found.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → gwang
FYI, Android has two functions for this, one is searchForTag and the other is searchForNextTag, which takes an Iterator. http://androidxref.com/4.3_r2.1/xref/frameworks/opt/telephony/src/java/com/android/internal/telephony/cat/CommandParamsFactory.java#244 http://androidxref.com/4.3_r2.1/xref/frameworks/opt/telephony/src/java/com/android/internal/telephony/cat/CommandParamsFactory.java#262
Assignee | ||
Comment 2•11 years ago
|
||
Add new function "searchForTagPos" in STKProactiveCmdHelper. Consider some tag locate in critical position, only searchForNext Tag may not suitable. I design the function which can indicate the detail period for search..
Attachment #811818 -
Flags: review?(allstars.chh)
Comment on attachment 811818 [details] [diff] [review] Improve searchForTagPos in STKProactiveCmdHelper Review of attachment 811818 [details] [diff] [review]: ----------------------------------------------------------------- Please write tests as well. I think I've said this many many times. ::: dom/system/gonk/ril_worker.js @@ +10238,5 @@ > return {url: s}; > }, > > + //Search for Tag by position. > + searchForTagPos: function searchForTagPos(tag, ctlvs, startPoint, endPoint) { Use a better and consistent naming please. You use 'Pos' in the function name, I think it stands for Position. However you use 'Point' in the arguments. Also I think when this function is called, endPoint is always be the length of the array. So it neccesary to have two more arguments? We are only interested in the next tag after the previous search, so Iterator seems to be a better way to do this. @@ +10240,5 @@ > > + //Search for Tag by position. > + searchForTagPos: function searchForTagPos(tag, ctlvs, startPoint, endPoint) { > + let ctlvInfo = { > + no: 0, no? @@ +10254,5 @@ > + if ((ctlvInfo.ctlv.tag & ~COMPREHENSIONTLV_FLAG_CR) == tag) { > + return ctlvInfo; > + } > + } > + return ctlvInfo; Is this ever correct? Have you ever tested it? If not found in the array, you returned the last element?
Attachment #811818 -
Flags: review?(allstars.chh) → review-
Assignee | ||
Updated•11 years ago
|
Status: NEW → UNCONFIRMED
Ever confirmed: false
Blocks: b2g-stk
Status: UNCONFIRMED → NEW
Component: DOM: Device Interfaces → RIL
Ever confirmed: true
Product: Core → Boot2Gecko
Version: Trunk → unspecified
Assignee | ||
Updated•11 years ago
|
Status: NEW → ASSIGNED
Summary: [B2G STK] Add "searchForTag by position" in StkProactiveCmdHelper → [B2G STK] Add "searchForNextTag" in StkProactiveCmdHelper
Assignee | ||
Comment 4•11 years ago
|
||
Try result: pass https://tbpl.mozilla.org/?tree=Try&rev=36c98deb10a8
Attachment #811818 -
Attachment is obsolete: true
Assignee | ||
Comment 5•11 years ago
|
||
Detail try result can be find here: https://secure.pub.build.mozilla.org/buildapi/self-serve/try/rev/36c98deb10a8
Assignee | ||
Updated•11 years ago
|
Attachment #821490 -
Flags: review?(allstars.chh)
Comment on attachment 821490 [details] [diff] [review] Add searchForNextTag in STKProactiveCmdHelper Review of attachment 821490 [details] [diff] [review]: ----------------------------------------------------------------- Can you add a test case for this? A xpcshell testfor iterator, a marionette with 2 AlphaIds in setUpCall.
Attachment #821490 -
Flags: review?(allstars.chh)
Assignee | ||
Comment 7•11 years ago
|
||
Attachment #821490 -
Attachment is obsolete: true
Assignee | ||
Comment 8•11 years ago
|
||
Assignee | ||
Comment 9•11 years ago
|
||
(In reply to Yoshi Huang[:allstars.chh][:yoshi] from comment #6) > Comment on attachment 821490 [details] [diff] [review] > Add searchForNextTag in STKProactiveCmdHelper > > Review of attachment 821490 [details] [diff] [review]: > ----------------------------------------------------------------- > > Can you add a test case for this? > A xpcshell testfor iterator, > a marionette with 2 AlphaIds in setUpCall. Xpcshell test already add in Part2. For marionette, there's many 2-alphaId setUpCall tests in "dom/icc/test/marionette". Try Result: https://tbpl.mozilla.org/?tree=Try&rev=bfe674926dee
Assignee | ||
Updated•11 years ago
|
Attachment #823915 -
Flags: review?(allstars.chh)
Assignee | ||
Updated•11 years ago
|
Attachment #823916 -
Flags: review?(allstars.chh)
Comment on attachment 823915 [details] [diff] [review] Part1: Add searchForNextTag in STKProactiveCmdHelper Review of attachment 823915 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/system/gonk/ril_worker.js @@ +10226,5 @@ > + return this.searchForNextTag(tag, iter); > + }, > + > + searchForNextTag: function searchForNextTag(tag, iter) { > + for (let ctlvInfo in iter ) { for (let [index, ctlv] in iter)
Attachment #823915 -
Flags: review?(allstars.chh)
Attachment #823916 -
Flags: review?(allstars.chh) → review+
Assignee | ||
Comment 11•11 years ago
|
||
The only change is "for (let [index, ctlv] in iter)" Try: https://tbpl.mozilla.org/?tree=Try&rev=522af0d6dd61
Attachment #823915 -
Attachment is obsolete: true
Attachment #827142 -
Flags: review?(allstars.chh)
Comment on attachment 827142 [details] [diff] [review] Part1: Add searchForNextTag in STKProactiveCmdHelper v2. Review of attachment 827142 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/system/gonk/ril_worker.js @@ +10226,5 @@ > + return this.searchForNextTag(tag, iter); > + }, > + > + searchForNextTag: function searchForNextTag(tag, iter) { > + for (let [index, ctlv] in iter ) { nit, remove the extra space after 'iter'
Attachment #827142 -
Flags: review?(allstars.chh) → review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
https://hg.mozilla.org/integration/b2g-inbound/rev/93c09adb48ab https://hg.mozilla.org/integration/b2g-inbound/rev/4d3a70ce5548
Keywords: checkin-needed
Comment 15•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/93c09adb48ab https://hg.mozilla.org/mozilla-central/rev/4d3a70ce5548
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•