My app needs to receive SMS. So far it seems to work on real devices and emulators from Gingerbread to JellyBean. I'm now testing it in a KitKat emulator, and the Broadcast Receiver is not fired.
I'm registering a the receiver in the manifest using the classic sms action:
<receiver android:name=".receivers.MyReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
I've also added the SMS permission in the manifest:
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
I've read the blog post on SMS changes in KitKat, where they say this intent filter should still work:
Any filters for the SMS_RECEIVED_ACTION broadcast in existing apps will continue to work the same on Android 4.4, but only as an observer of new messages, because unless your app also receives the SMS_DELIVER_ACTION broadcast, you cannot write to the SMS Provider on Android 4.4.
Which is fine because I just need to listen for new messages, and I don't need my app to be the default SMS app nor modify the provider (This is a very simple app with no activities, only a receiver and a service that is called from the receiver).
The emulator is very laggy, so I think it might be a problem with the emulator only. Too bad I don't have any KitKat device to test it. For now I'm testing in KitKat using the DDMS telephony tab. I've added logging to the receiver but I don't see anything in logcat. There are no exceptions nor any other message that could indicate problems. It looks the receiver is not being notified, but on the other hand I've double-checked and the app is installed.
What could be going wrong?