mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Bug 793053 - Part 4: pref off product announcements by short-circuiting both broadcast receivers. r=trivial
This commit is contained in:
parent
ca1a363d61
commit
e4b01522f0
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user