0

1) In my app I need to block SMS app notifications on certain conditions. I've used abortBroadcast(). It's working fine except in my LG device. In LG device no SMS notification is shown but it also deletes the SMS from inbox. Any help is appreciated.

2) Can anyone suggest the equivalent of abortBroadcast() in Android 4.4?

Sadeshkumar Periyasamy
  • 4,848
  • 1
  • 26
  • 31
  • 1
    "Can anyone suggest the equivalent of abortBroadcast() in Android 4.4?" -- if there is one, it would represent a bug that would need to be fixed. "In LG device no SMS notification is shown but it also deletes the SMS from inbox" -- that would be the expected behavior of `abortBroadcast()`, as the default SMS client will not receive the message, so it will not appear in the inbox. – CommonsWare Jan 28 '14 at 17:49
  • but in some devices this sms is stored in inbox. – Sadeshkumar Periyasamy Jan 28 '14 at 17:51
  • 1
    "but in some devices this sms is stored in inbox" -- the only way that would occur is if the default SMS client's receiver had a higher priority than you, and they did not abort the broadcast (otherwise, you would not receive it). The priority of an SMS client is rather variable, though I would expect most that ship with devices to have the default priority, which is the lowest priority possible. – CommonsWare Jan 28 '14 at 17:52
  • My problem is that in some devices, whenever an sms is received, the user is able to reply via some pop-up widgets (my functionailty needs that). I've used the abortBroadcast() to avoid these pop-ups only. Since abortBroadcast() will not work in Android 4.4 can you please suggest an alternative to do that? – Sadeshkumar Periyasamy Jan 28 '14 at 17:56
  • 1
    "I've used the abortBroadcast() to avoid these pop-ups only" -- `abortBroadcast()` "avoids" anything with a lower priority than your app. The effects of this will vary widely by user, based on their device, chosen SMS client, and other SMS-aware apps. You have no way of assuring that you will interfere with all "pop-up widgets", as they may have a priority higher than yours. Hence, as far as I am concerned, your app is broken for all versions of Android -- it is just more broken on Android 4.4+. SMS blocking is now limited to being a feature of a full SMS client app. – CommonsWare Jan 28 '14 at 18:00
  • atleast can I block softkeyboard from showing up from launcher screen? This way the user will not be able to type SMS at least. Any way of doing this like reflection? – Sadeshkumar Periyasamy Jan 28 '14 at 18:09
  • I am not aware of a way that you can block the input method editor from another app. – CommonsWare Jan 28 '14 at 18:13
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/46271/discussion-between-sadeshkumar-periyasamy-and-commonsware) – Sadeshkumar Periyasamy Jan 28 '14 at 18:17

0 Answers0