I have problem. After my application is installed, SMS broadcast is intercepted successfully . But after reboot, all intercepted SMS broadcast still popup in Notification Bar (from Standard Sms application)
Broadcastreceiver:
public class OwnSmsBroadcastextends BroadcastReceiver{
private static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
public void onReceive(Context context, Intent intent) {
final Bundle bundle = intent.getExtras();
if (intent.getAction().equals(SMS_RECEIVED)) {
abortBroadcast();
try {...
Manifest:
<receiver android:name=".OwnSmsBroadcast" android:permission="android.permission.BROADCAST_SMS">
<intent-filter android:priority="10000">
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
<action android:name="android.provider.Telephony.SMS_DELIVERED" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
Why after reboot all intercepted notofications popups?
Google Hangouts 2.0 causes problems with SMS_RECEIVED intents. The intent filter is set to the MAX_INTEGER value 2,147,483,647 - which exceeds your value of 10,000. The documentation says that PRIORITY should never exceed 1,000 (the highest value you should set it at is 999) and above that will result in "unpredictable behavior" - although, usually the higher the priority is the order used by Android.
To fix this either disable SMS in Hangouts or uninstall it.
FYI - SMS_DELIVERED is not valid until KitKat (v4.4+) but only the default SMS app will receive it. So it is not necessary unless you also implement several other features in order to be the default SMS app. In KitKat, SMS_RECEIVED is still broadcast so you will be notified, but you cannot abort it.