Bug 934345 - Move NotificationHelper initialization to GeckoApp since it was being initialized twice when more than one process were active. r=wesj

This commit is contained in:
Federico Paolinelli 2013-11-11 11:17:02 -05:00
parent 4050ca433c
commit 20c1ae1d0a
3 changed files with 3 additions and 2 deletions

View File

@ -1293,6 +1293,7 @@ abstract public class GeckoApp
});
GeckoAppShell.setNotificationClient(makeNotificationClient());
NotificationHelper.init(getApplicationContext());
}
protected void initializeChrome() {

View File

@ -98,7 +98,6 @@ public class GeckoApplication extends Application {
public void onCreate() {
HardwareUtils.init(getApplicationContext());
Clipboard.init(getApplicationContext());
NotificationHelper.init(getApplicationContext());
GeckoLoader.loadMozGlue();
super.onCreate();
}

View File

@ -30,7 +30,7 @@ public final class NotificationHelper implements GeckoEventListener {
public static final String NOTIFICATION_ID = "NotificationHelper_ID";
private static final String LOGTAG = "GeckoNotificationManager";
private static final String HELPER_NOTIFICATION = "helperNotif";
private static final String HELPER_BROADCAST_ACTION = "helperBroadcastAction";
private static final String HELPER_BROADCAST_ACTION = AppConstants.ANDROID_PACKAGE_NAME + ".helperBroadcastAction";
// Attributes mandatory to be used while sending a notification from js.
private static final String TITLE_ATTR = "title";
@ -71,6 +71,7 @@ public final class NotificationHelper implements GeckoEventListener {
public static void init(Context context) {
if (mInstance != null) {
Log.w(LOGTAG, "NotificationHelper.init() called twice!");
return;
}
mInstance = new NotificationHelper();
mContext = context;