Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to abort broadcast notification? (for a non Ordered Broadcast)

My application deals with Cell Broadcast messages, which is a non ordered broadcast. I want my application to receive this broadcast and kill the message notification of CB messages.

I've found out that SMS notification can be suppressed by using an intent filter with a priority tag as shown below

<receiver android:name="com.example.sis.xxyyReceiver" >
      <intent-filter android:priority="999">
         <action android:name="android.provider.Telephony.SMS_RECEIVED" >
         </action>
      </intent-filter>
</receiver>

So I've tried to do the same with CB messages like this

<intent-filter android:priority="100">
     <action android:name="android.provider.Telephony.CB_RECEIVED" >
     </action>
</intent-filter>

But it didn't work, and the log cat looks as follows

enter image description here

From my research and below comments, I've learned that non Ordered broadcasts cannot be aborted, So all I want to do is to suppress the notification (i.e CB_SMS alert and vibration) generated by CB message.

Can anyone help me with this aborting of non ordered broadcasts notification??

like image 532
Code Avatar asked Apr 24 '13 12:04

Code


1 Answers

You cannot abort regular broadcasts. Everybody who has registered a BraodcastReceiver for them will get them.

like image 199
CommonsWare Avatar answered Jan 02 '23 07:01

CommonsWare