Closed Bug 850680 Opened 11 years ago Closed 11 years ago

B2G MMS: broadcast "sms-received" and "sms-sent" system messages

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22
blocking-b2g -
Tracking Status
firefox20 --- wontfix
firefox21 --- wontfix
firefox22 --- fixed
b2g18 + fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix

People

(Reporter: airpingu, Assigned: airpingu)

References

Details

(Whiteboard: [RIL_INTERFACE])

Attachments

(4 files, 6 obsolete files)

After receiving or sending an MMS message in MmsService.js, we need a way to broadcast an "mms-received" or "mms-sent" system message to the content side to launch the Notification and/or the Message App.

Not very sure if this is blocking any existing MMS user stories. Let PMs decide it.
Blocks: 840087, 840090
Assignee: nobody → gene.lian
Whiteboard: [LOE:L] [target 3/22]
Whiteboard: [LOE:L] [target 3/22] → [target 3/22]
Depends on: 852826
Need to decide the permission name for MMS first because the system message is only allowed to be broadcasted to the specific permission(s).
Blocks: 853376
No longer blocks: 853376
Depends on: 853384
Attached patch Part 1, code clean-up! (obsolete) — Splinter Review
Attachment #727617 - Flags: review?(vyang)
Attachment #727619 - Flags: review?(vyang)
Let's unite SMS and MMS in system messages as well.
Summary: B2G MMS: broadcast "mms-received" and "mms-sent" system messages → B2G MMS: broadcast "sms-received" and "sms-sent" system messages
Attachment #727619 - Flags: review?(vyang)
Attachment #727617 - Flags: review?(vyang)
Blocks: mms-p1
blocking-b2g: leo? → -
tracking-b2g18: --- → +
Need to fix bug 853725 first because we fail to read |nsIDOMMozMmsMessage.receivers| when preparing to send the system message.
Depends on: 853725
No longer depends on: 853384
Attached patch Part 1, code clean-up! V2 (obsolete) — Splinter Review
Attachment #727617 - Attachment is obsolete: true
Attachment #728112 - Flags: review?(vyang)
Attachment #728112 - Flags: feedback?(ctai)
Attachment #727619 - Attachment is obsolete: true
Attachment #728113 - Flags: review?(vyang)
Hi Alex,

I understand most of the MMS bugs are marked as leo- recently. However, I believe this one is the last one for leo-. Without this, we cannot launch the Notification, Costcontrol, Message app whenever an MMS is received or sent.

Nominate for leo+ again. Please feel free to let me know if you don't agree with me. Thanks! :)
blocking-b2g: - → leo?
Comment on attachment 728112 [details] [diff] [review]
Part 1, code clean-up! V2

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

::: dom/mobilemessage/src/ril/MobileMessageDatabaseService.js
@@ +1129,5 @@
>          aMessage.sender == undefined ||
>          (aMessage.type == "sms" && aMessage.messageClass == undefined) ||
>          (aMessage.type == "mms" && aMessage.delivery == undefined) ||
> +        (aMessage.type == "mms" && !Array.isArray(aMessage.deliveryStatus)) ||
> +        (aMessage.type == "mms" && !Array.isArray(aMessage.receivers)) ||

((aMessage.type == "sms") &&
 ((aMessage.delivery == undefined) ||
  !Array.isArray(aMessage.deliveryStatus) ||
  !Array.isArray(aMessage.receivers))) ||
Attachment #728112 - Flags: review?(vyang) → review+
Comment on attachment 728113 [details] [diff] [review]
Part 2, broadcast system messages, V2

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

::: dom/system/gonk/RadioInterfaceLayer.js
@@ +1635,5 @@
>                                                       DOM_MOBILE_MESSAGE_DELIVERY_SENT,
>                                                       options.sms.deliveryStatus,
>                                                       function notifyResult(rv, domMessage) {
>        // TODO bug 832140 handle !Components.isSuccessCode(rv)
> +      this.broadcastSmsSystemMessage("sms-sent", domMessage);      

nit: trailing ws
Attachment #728113 - Flags: review?(vyang) → review+
Thanks for the review! If you don't mind, I'd prefer writing them as:

if ((aMessage.type != "sms" && aMessage.type != "mms") ||
    (aMessage.type == "sms" && aMessage.messageClass == undefined) ||
    (aMessage.type == "mms" && (aMessage.delivery == undefined ||
                                !Array.isArray(aMessage.deliveryStatus) ||
                                !Array.isArray(aMessage.receivers))) ||
    aMessage.sender == undefined ||
    aMessage.timestamp == undefined) {
  if (aCallback) {
    aCallback.notify(Cr.NS_ERROR_FAILURE, null);
  }
  return;
}
Attachment #728112 - Attachment is obsolete: true
Attachment #728112 - Flags: feedback?(ctai)
Attachment #728146 - Flags: review+
Attachment #728146 - Attachment description: Part 1, code clean-up! V2.1 → Part 1, code clean-up! V2.1 (checked-in)
Attachment #728162 - Attachment description: Part 2, broadcast system messages, V2.1 → Part 2, broadcast system messages, V2.1 (checked-in)
Blocks: 843445
https://hg.mozilla.org/mozilla-central/rev/7ba21d4b0337
https://hg.mozilla.org/mozilla-central/rev/89f25483717a
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Without a clear idea of whether this blocks user stories I think we should leave this as tracked (non-blocking) but please go ahead with an uplift nomination and risk/reward assessment.  If any user stories do depend on this, please include those too.
blocking-b2g: leo? → -
Comment on attachment 728146 [details] [diff] [review]
Part 1, code clean-up! V2.1 (checked-in)

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): no
User impact if declined: no
Testing completed: no
Risk to taking this patch (and alternatives if risky): no
String or UUID changes made by this patch: no

Note: the part-1 patch is just for code clean-up. No risk to land.
Attachment #728146 - Flags: approval-mozilla-b2g18?
(In reply to Gene Lian [:gene] from comment #17)
> Testing completed: no
                     ^^ Sorry for the typo. This is "yes".
Comment on attachment 728162 [details] [diff] [review]
Part 2, broadcast system messages, V2.1 (checked-in)

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): no
User impact if declined: this bug/patch directly blocks two MMS User Stories: bug 840087 and bug 840090. Please see comment #9 for why it should be a leo+ in nature. When receiving or sending an MMS, we need to broadcast system messages to launch some related apps like:

  - Message App
  - Costcontrol App
  - Notification

Without the system message, we have no way to wake them up when they have been killed or doesn't run in the background.

Testing completed: yes
Risk to taking this patch (and alternatives if risky): low
String or UUID changes made by this patch: no
Attachment #728162 - Flags: approval-mozilla-b2g18?
Comment on attachment 728146 [details] [diff] [review]
Part 1, code clean-up! V2.1 (checked-in)

The two user stories are non-blocking, since this is low risk we can take the uplift now and get some bake time.
Attachment #728146 - Flags: approval-mozilla-b2g18? → approval-mozilla-b2g18+
Attachment #728162 - Flags: approval-mozilla-b2g18? → approval-mozilla-b2g18+
Attached patch [b2g18] Patch Part 2 (obsolete) — Splinter Review
Attached patch [b2g18] Patch Part 2 (obsolete) — Splinter Review
Attachment #730499 - Attachment is obsolete: true
Attachment #730509 - Attachment is obsolete: true
Whiteboard: [target 3/22] → [NO_UPLIFT]
Added [NO_UPLIFT] per recent commercial RIL compatibility issue. Waiting on further decision to keep the patch in b2g18 or to back it out.

------------------------------
If we really want to back them out, backing the following MMS bugs should be enough to make the commercial RIL compatible:

Bug 854422 - B2G MMS: should call .NotifyResponseTransaction() with MMS_PDU_STATUS_RETRIEVED after an MMS is retrieved under the RETRIEVAL_MODE_AUTOMATIC mode (a follow-up for bug 845643)
Bug 850680 - B2G MMS: broadcast "sms-received" and "sms-sent" system messages
Bug 850530 - B2G MMS: Use the same attribute name for delivery (s/state/delivery) like SMS
Bug 852911 - B2G MMS: fail to expose correct nsIDOMMozMmsMessage.attachments.
Bug 853725 - B2G MMS: fail to read nsIDOMMozMmsMessage.receivers for a received MMS (a follow-up of bug 849741).
Bug 853329 - B2G MMS: other Android phones cannot read attachments sent from FFOS
Bug 852471 - B2G MMS: provide nsIDOMMobileMessageManager interface (with sendMMS() first) (follow-up fix)
Bug 852460 - B2G MMS: provide nsIDOMMobileMessageManager.onreceived event (follow-up fix)
Bug 849741 - B2G MMS: provide nsIDOMMobileMessageManager.onreceived event
Bug 847756 - B2G MMS: provide nsIDOMMobileMessageManager.markMessageRead().
Bug 847736 - B2G MMS: provide nsIDOMMobileMessageManager.delete().
Bug 847738 - B2G MMS: provide nsIDOMMobileMessageManager.getMessage(). 
Bug 844431 - B2G MMS: provide nsIDOMMobileMessageManager interface (with sendMMS() first)
Bug 845643 - B2G MMS: Save retrieved MMS into database.
Following the previous comment, some more needs to back out:

Bug 792321 - Check max values of MMS parameters in sendRequest.
Bug 833291 - B2G SMS & MMS: getMessages it's not working with PhoneNumberJS
Bug 844429 - B2G SMS & MMS: move SMS codes into dom/mobilemessage to make it generic for MMS
Bug 839436 - B2G MMS: make DB be able to save MMS messages.
Whiteboard: [NO_UPLIFT] → [NO_UPLIFT][RIL_INTERFACE]
Confirming with Michael to see we should back out to Bug 839436 or just Bug 844431 (if we eventually decide to back out). Please see Bug 857632, comment #17.
Per off-line discussion with Michael, we decided not to back out the MMS bugs that have already been in mozilla-b2g18. Removing [NO_UPLIFT] to make the check-in status sync'ed.
Whiteboard: [NO_UPLIFT][RIL_INTERFACE] → [RIL_INTERFACE]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: