Closed Bug 911895 Opened 9 years ago Closed 9 years ago

[WAP push] If press home button while reading wap push message, sender number and close button of the message are still on top blocking original notification bar.

Categories

(Firefox OS Graveyard :: Gaia, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:koi+)

VERIFIED FIXED
blocking-b2g koi+

People

(Reporter: echu, Assigned: gsvelto)

References

Details

(Whiteboard: [FT:RIL])

Attachments

(4 files, 1 obsolete file)

Attached file 13:33, 9/3.
After receive wap push message and open it, pressing home button can still see the sender number and close button of the message on top of the page, which also block original notification bar.

* Build Number                
Gaia:     9fb5802df60a9081846d704def01df814ed8fbd4
Gecko:    http://hg.mozilla.org/mozilla-central/rev/b6c29e434519
BuildID   20130901040215
Version   26.0a1

* Reproduce Steps

* Expected Result

* Actual Result

* Occurrence rate
Attached video video
* Reproduce Steps
1. Send a Wap push to DUT(via NowSMS)
2. open the message.
3. Press home key.

* Expected Result
Wap push message will hide the notification bar.

* Actual Result
sender number and close button remain on top of the page blocking notification bar.

* Occurrence rate
100%
blocking-b2g: --- → koi?
Blocks: 838062
blocking-b2g: koi? → koi+
Assignee: nobody → gsvelto
Whiteboard: [FT:RIL]
This patch detects when the attention screen is shrunk into the status-bar (which happens when the home button is pressed) and closes it instead. The patch also ensures that the entire application closes itself when the attention screen is dismissed.
Attachment #802367 - Flags: review?(21)
Attachment #802359 - Attachment description: Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/12082 → [PULL REQUEST] Close the WAP Push attention screen when the home button is pressed
Status: NEW → ASSIGNED
Comment on attachment 802367 [details] [diff] [review]
[PATCH] Close the WAP Push attention screen when the home button is pressed

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

::: apps/wappush/js/wappush.js
@@ +119,4 @@
>     * @param {Number} timestamp The message timestamp
>     */
>    displayWapPushMessage: function wpm_displayWapPushMessage(timestamp) {
> +    var self = this;

Let's declare that closer to where it is used.

@@ +156,5 @@
> +   * Closes the application, lets the event loop run once to ensure clean
> +   * termination of pending events.
> +   */
> +  close: function wpm_close() {
> +    window.setTimeout(function() { window.close(); }, 0);

nit: Some tends to omit the last parameter for this use case. It ends up beeing |window.setTimeout(window.close);|.
Attachment #802367 - Flags: review?(21) → review+
Merci :-)

(In reply to Vivien Nicolas (:vingtetun) (:21) from comment #5)
> Let's declare that closer to where it is used.

OK, I'll move it below.

> nit: Some tends to omit the last parameter for this use case. It ends up
> beeing |window.setTimeout(window.close);|.

Thanks for the tip. My C background always tells me to write out stuff explicitly :-)
Updated patch, r=vingtetun as per comment 5. I changed the |close()| function but couldn't move forward the declaration of |self| in |wpd_displayWapPushMessage()| because everything below it is just a big closure.
Attachment #802367 - Attachment is obsolete: true
Merged to master: https://github.com/mozilla-b2g/gaia/commit/256ec63034c0083c92d595d5eca1e2f3dc1eca13
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Verified on Buri
Gaia:     9ffd2899eb91388f7fc1ce6f7a895a6f5f922c05
Gecko:    http://hg.mozilla.org/mozilla-central/rev/a98569f21abe
BuildID   20130912040201
Version   26.0a1
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.