Bug 793053 - Part 4: pref off product announcements by short-circuiting both broadcast receivers. r=trivial

This commit is contained in:
Richard Newman 2012-10-26 17:38:01 -07:00
parent ca1a363d61
commit e4b01522f0
3 changed files with 12 additions and 1 deletions

View File

@ -24,9 +24,13 @@ public class AnnouncementsBroadcastReceiver extends BroadcastReceiver {
*/
@Override
public void onReceive(Context context, Intent intent) {
if (AnnouncementsConstants.DISABLED) {
return;
}
Intent service = new Intent(context, AnnouncementsBroadcastService.class);
service.putExtras(intent);
service.setAction(intent.getAction());
context.startService(service);
}
}
}

View File

@ -9,6 +9,9 @@ import org.mozilla.gecko.sync.GlobalConstants;
import android.app.AlarmManager;
public class AnnouncementsConstants {
// Not `final` so we have the option to turn this on at runtime with a magic addon.
public static boolean DISABLED = true;
public static final String GLOBAL_LOG_TAG = "GeckoAnnounce";
public static final String ACTION_ANNOUNCEMENTS_PREF = "org.mozilla.gecko.ANNOUNCEMENTS_PREF";

View File

@ -20,6 +20,10 @@ public class AnnouncementsStartReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (AnnouncementsConstants.DISABLED) {
return;
}
Logger.debug(LOG_TAG, "AnnouncementsStartReceiver.onReceive().");
Intent service = new Intent(context, AnnouncementsService.class);
context.startService(service);