Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SMS Received in my SMS app and in Hangouts, although I call abortBroadcast()

I have an SMS blocker Android application developed myself which was working quite well capturing all the spams until recently Google updated its Hangouts app to work with SMSs.

The Problem: SMS is getting captured by both my app and hangouts! Even though the message is blocked by my app and stored in its private database, it is also present in the hangouts app and thus in the stock Messaging app at the same time.

Seems the abortBroadcast() isn't working any more. Everything was working perfectly before the Hangouts update.

I had also tried fiddling with android:priority but in vain.

like image 238
vineetdecoded Avatar asked Mar 22 '23 14:03

vineetdecoded


1 Answers

Hangouts uses the maximum possible priority (999 per the Intent-Filter docs) and therefore you cannot abort it on <4.4 releases. On 4.4+, only the default SMS app (blog post with details) can receive SMS notifications - users would need to set your app as the default SMS app for your app to function correctly (although it should function as expected if that happens).

like image 163
ianhanniballake Avatar answered Mar 24 '23 05:03

ianhanniballake