Closed Bug 853782 Opened 13 years ago Closed 13 years ago

Notify receiving of WAP Push messages

Categories

(Core :: DOM: Device Interfaces, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24
blocking-b2g koi+
Tracking Status
firefox26 --- fixed

People

(Reporter: chucklee, Assigned: chucklee)

References

Details

(Whiteboard: [fixed-in-birch])

Attachments

(4 files, 5 obsolete files)

2.40 KB, patch
Details | Diff | Splinter Review
2.22 KB, text/x-patch
Details
5.51 KB, patch
Details | Diff | Splinter Review
14.74 KB, patch
vicamo
: review+
Details | Diff | Splinter Review
After WAP Push message is received(and decoded if its' content type is supported), web/system apps need to be notified with message data. several notifications need to be provided: system message, .addlistener() and .onreceive.
Whiteboard: RN5/29
Whiteboard: RN5/29 → RN6/14
Whiteboard: RN6/14 → RN6/18
In emulator, stringTable.slice() doesn't exist. But it passed xpcshell test. So get string data based on supported function.
Attachment #762517 - Flags: review?(vyang)
Test PDU : WBXML compressed SI emulator command : sms pdu 00400191F10024001010000000005A0605040B8423F0010603AEAF8202056A28656D61696C2F3132332F6162632E776D6C00596F7520686176652034206E657720656D61696C730045C60D0378797A008583000AC3071999062515231510C304199906300183120101 Expected system message content : message.contentType: text/vnd.wap.si message.content: <si><indication href="http://www.xyz.com/email/123/abc.wml" created="1999-06-25T15:23:15Z" si-expires="1999-06-30T00:00:00Z">You have 4 new emails</indication></si>
Test PDU : WBXML compressed SL emulator command : sms pdu 00400191F10024001010000000001F0605040B8423F0010603B0AF8203066A086F7265696C6C7900850A83008501 Expected system message content : message.contentType: text/vnd.wap.sl message.content: <sl href="http://www.oreilly.com/"/>
Use sms app to receive WAP Push system message, and dump content to logcat.
Comment on attachment 762514 [details] [diff] [review] 0001. Set content type of decoded wap push message. Review of attachment 762514 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/wappush/src/gonk/SiPduHelper.jsm @@ +99,5 @@ > } > > WBXML.PduHelper.parse(data, appToken, msg); > > + // Content is plain text now Please remove this line. Content-Type doesn't even exist before this patch. ::: dom/wappush/src/gonk/SlPduHelper.jsm @@ +54,5 @@ > } > > WBXML.PduHelper.parse(data, appToken, msg); > > + // Content is plain text now Ditto.
Attachment #762514 - Flags: review?(vyang) → review+
Comment on attachment 762515 [details] [diff] [review] 0002. Notify receiving of WAP Push by System Message. Review of attachment 762515 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/wappush/src/gonk/WapPushManager.js @@ +95,3 @@ > } else if (contentType === "text/vnd.wap.connectivity-xml" || > contentType === "application/vnd.wap.connectivity-wbxml") { > // TODO: Bug 869291 - Support Receiving WAP-Push-CP Please remove this |else-if| block and move that TODO line into |else|. Before bug 869291 is ready, CP is an unsupported type, isn't it? @@ +96,5 @@ > contentType === "application/vnd.wap.connectivity-wbxml") { > // TODO: Bug 869291 - Support Receiving WAP-Push-CP > } else { > // Unsupported type, provide raw data. > msg.content = data.array; Missing contentType for unsupported types.
Attachment #762515 - Flags: review?(vyang) → review+
Comment on attachment 762517 [details] [diff] [review] 0003. Fix runtime error due to no slice() function in emulator. Review of attachment 762517 [details] [diff] [review]: ----------------------------------------------------------------- Please correct the title. There is nothing related to the emulator itself. The reason you got a runtime error is because |data.array| is actually always a TypedArray. And the reason we still have similar code in |WSP.Octet.decodeMultiple| is the lack of some code clean-up to remove them. ::: dom/wappush/src/gonk/WbxmlPduHelper.jsm @@ +71,5 @@ > + let rangeData; > + if (stringTable.subarray) { > + rangeData = stringTable.subarray(start, end); > + } else if (stringTable.slice) { > + rangeData = stringTable.slice(start, end); You don't need all these tests and that unused |rangeData| variable. |stringTable| here is always a TypedArray.
Attachment #762517 - Flags: review?(vyang)
Change function arguments to address comment 7 and comment 8
Attachment #762514 - Attachment is obsolete: true
Attachment #763438 - Flags: review?(vyang)
Update patch for comment 8 is addressed in part 1.
Attachment #762515 - Attachment is obsolete: true
PDU get from worker is TypedArray, while PDU from xpcshell test case is array. So support both type until test cases are changed to use TypedArray.
Attachment #762517 - Attachment is obsolete: true
Attachment #763441 - Flags: review?(vyang)
Comment on attachment 763438 [details] [diff] [review] 0001. Set content type of wap push message. V2 Review of attachment 763438 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/wappush/src/gonk/WapPushManager.js @@ +79,5 @@ > * > * @see http://technical.openmobilealliance.org/tech/omna/omna-wsp-content-type.aspx > */ > let contentType = options.headers["content-type"].media; > + let msg = {}; This line may soon overwritten when the message is of a supported type. You may just declare a variable here. let msg; @@ +96,1 @@ > msg.content = data.array; msg = { ... };
Attachment #763438 - Flags: review?(vyang) → review+
Attachment #763441 - Flags: review?(vyang) → review+
It requires modification in test case per part 0001, so also correct the type of data PDU.
Attachment #763441 - Attachment is obsolete: true
Attachment #763487 - Flags: review?(vyang)
Attachment #763487 - Flags: review?(vyang) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Blocks: 891762
Blocks: 838062
Blocks: 891248
blocking-b2g: --- → koi+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: