michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: package org.mozilla.gecko.background.announcements; michael@0: michael@0: import org.mozilla.gecko.background.BackgroundService; michael@0: michael@0: import android.content.BroadcastReceiver; michael@0: import android.content.Context; michael@0: import android.content.Intent; michael@0: michael@0: /** michael@0: * Watch for notifications to start the announcements service. michael@0: * michael@0: * Some observations: michael@0: * michael@0: * "Also note that as of Android 3.0 the user needs to have started the michael@0: * application at least once before your application can receive michael@0: * android.intent.action.BOOT_COMPLETED events." michael@0: */ michael@0: public class AnnouncementsBroadcastReceiver extends BroadcastReceiver { michael@0: michael@0: /** michael@0: * Forward the intent to an IntentService to do background processing. michael@0: */ michael@0: @Override michael@0: public void onReceive(Context context, Intent intent) { michael@0: if (AnnouncementsConstants.DISABLED) { michael@0: return; michael@0: } michael@0: michael@0: BackgroundService.runIntentInService(context, intent, AnnouncementsBroadcastService.class); michael@0: } michael@0: }