Bug 1252650 - Support loading PushService immediately on Android; r=kitcambridge

Normally we delay-load PushService on session restore. However, we won't
have session restore when Gecko is running in background without GUI. So
we need a way to load PushService immediately.
This commit is contained in:
Jim Chen 2016-04-20 15:06:13 -04:00
parent 1a15cf64ef
commit c433e8ff00
2 changed files with 8 additions and 0 deletions

View File

@ -6,3 +6,6 @@ contract @mozilla.org/push/PushManager;1 {cde1d019-fad8-4044-b141-65fb4fb7a245}
component {daaa8d73-677e-4233-8acd-2c404bd01658} PushComponents.js
contract @mozilla.org/push/Service;1 {daaa8d73-677e-4233-8acd-2c404bd01658}
category app-startup PushServiceParent @mozilla.org/push/Service;1
# For immediate loading of PushService instead of delayed loading.
category android-push-service PushServiceParent @mozilla.org/push/Service;1

View File

@ -83,6 +83,11 @@ PushServiceBase.prototype = {
this._handleReady();
return;
}
if (topic === "android-push-service") {
// Load PushService immediately.
this._handleReady();
return;
}
},
_deliverSubscription(request, props) {