0

Is this completely and utterly impossible in android Kitkat since Google has made so many changes to the way messaging works? I have tried using broadcast receivers and abortBroadcast, but to no avail.

rakeshdas
  • 2,363
  • 5
  • 20
  • 28

1 Answers1

3

Is there any way to block SMS programmatically in Android KitKat?

No. Starting with KitKat, the SMS_RECEIVED broadcast cannot be aborted, so any app with the RECEIVE_SMS permission can still listen for it and retrieve the incoming message. If your app is the default app, it can choose not to write the message to the Provider, so it will not appear to any app querying the Provider for messages, but even the default app cannot abort the SMS_RECEIVED broadcast.

Mike M.
  • 38,532
  • 8
  • 99
  • 95
  • Is there any way to dismiss or silence the notification so the user can open up the messaging app at a later time to look at the texts later on? – rakeshdas Aug 31 '14 at 01:31
  • The user can disable Notifications for an app in Settings, but there is no API for reading or changing those settings. You could ask the user to do so, and open the Settings for them. As far as programmatically clearing Notifications posted by other apps, that would be a big no-no, since it would allow all sorts of malicious program behavior. – Mike M. Aug 31 '14 at 01:48
  • If one app sends out multiple notifications, are all of the notification ID's the same then? – rakeshdas Aug 31 '14 at 14:11
  • 1
    I have no idea. I've not done anything with that yet. Also, it is a completely different question from the one asked and answered here, and you should post a new one, so as not to "bury" that info in this unrelated topic. That is, so someone searching for that in the future can readily find it. – Mike M. Aug 31 '14 at 14:20