@Override public Intent registerReceiver(final BroadcastReceiver receiver, final IntentFilter filter,
												 final @Nullable String broadcastPermission, final @Nullable Handler scheduler) {
			if (receiver == null) {
				// Allow retrieving current sticky broadcast; this is safe since we
				// aren't actually registering a receiver.
				return super.registerReceiver(null, filter, broadcastPermission, scheduler);
			} else {
				throw new ReceiverCallNotAllowedException(
						"BroadcastReceiver components are not allowed to register to receive intents");
			}
		}
Mirror of the hidden Intent.FLAG_RECEIVER_EXCLUDE_BACKGROUND, since API level 24 (Android N)
library/src/main/java/com/oasisfeng/condom/CondomCore.java