I have a SMS listener that works well in versions prior to Oreo (API 26) but seems to be ignored in API 26. According to documentation, SMS_RECEIVED_ACTION
is exempted from the implicit broadcast limitations (link), so no changes should be needed.
Here is my listener:
public class SmsListener extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
(...)
}
}
I have this on the manifest:
<receiver android:name=".communication.SmsListener"
android:permission="android.permission.BROADCAST_SMS">
<intent-filter android:priority="1000">
<action android:name="android.provider.Telephony.SMS_RECEIVED"/>
</intent-filter>
</receiver>
And also set the permissions
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/>
Have tried with different sample projects like this as well and the outcome is the same, no SMS is captured in API 26.
Can someone provide me a working sample or help me figure out whether I have to change something or if there is a bug in API 26?