Android - SMS - intent-filters priority listing

时光总嘲笑我的痴心妄想 提交于 2020-01-07 05:41:20

问题


I was wondering if it is possible to find a list that includes all the receivers associated to a certain action.

For example I have the following receiver that executes everytime that an SMS is received:

<receiver android:name=".SmsReceiver" android:enabled="true">
    <intent-filter android:priority="101">
        <action android:name="android.provider.Telephony.SMS_RECEIVED" />
    </intent-filter>
</receiver>

So with the priority="101" it´s executed even before than the default message service in Android.

I would like to find all the intent-filter associated to a certail action, in this case "android.provider.Telephony.SMS_RECEIVED"

I tried to get into /data/data/com.android.provider.telephony/databases but no info is stored in ther.

It would be great if anybody could tell me where can I find that info, and even if it is possible.

Regards,

Pablo


回答1:


Use PackageManager and queryBroadcastReceivers() to find out all of the BroadcastReceivers that will respond to a given Intent. In your case, you would create an SMS_RECEIVED Intent.



来源:https://stackoverflow.com/questions/7447079/android-sms-intent-filters-priority-listing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!