Closed Bug 863660 Opened 11 years ago Closed 11 years ago

SimplePush: Make push enable/disable restartless

Categories

(Firefox OS Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nsm, Assigned: nsm)

References

Details

(Whiteboard: [fixed-in-birch])

Attachments

(1 file, 1 obsolete file)

Not a immediate requirement for b2g 1.1, but would be nice to have in the version after that.

Disabling push or enabling it requires a device restart after toggling the preference.
settings or shell.js could monitor the services.push.enabled pref.
On further thought, it makes more sense to have 'enable/disable' for the user mean whether the network connection is active or not. The push service will always be loaded even if push is disabled in the UX.

Patch coming up.
Attached patch Toggle connection based on pref. (obsolete) — Splinter Review
pref is services.push.connection.enabled.
Assignee: nobody → nsm.nikhil
Attachment #752994 - Flags: review?(doug.turner)
Comment on attachment 752994 [details] [diff] [review]
Toggle connection based on pref.

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

Dumb question - Why do we want the push service to be loaded even if push is disabled?
Comment on attachment 752994 [details] [diff] [review]
Toggle connection based on pref.

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

Dumb question - Why do we want the push service to be loaded even if push is disabled?  r- until I get an answer.
Attachment #752994 - Flags: review?(doug.turner) → review-
I think local operations like registrations() and unregister() should still succeed.
This pref is for the user's point of view. That is, conserve battery life by keeping connections and alarms shut. The logic to watch the pref could be moved out into the component in bug 871372, but do we really need the optimization until PushService is causing problems by just being enabled.

That said Push.js should also be checking the connection pref and error the register() call immediately.
Add immediate NetworkError to push.register()
Attachment #752994 - Attachment is obsolete: true
Attachment #759503 - Flags: review?(doug.turner)
Attachment #759503 - Flags: review?(doug.turner) → review+
https://hg.mozilla.org/mozilla-central/rev/c55b4e2fa1be
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Just a note that patches in bug 857464 will rename services.push.connection.enabled to services.push.userEnabled instead.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: