I have run into this issue of defining permissions that are specific to intent-filters for a particular broadcast receiver. I was wondering how Android would resolve something below, and if there is a better way to do this.
<receiver android:name=".MyReceiver"
android:permission="com.permission.XY"
android:exported="true">
<intent-filter>
<action android:name="com.local.intent.ACT" />
</intent-filter>
</receiver>
<receiver android:name=".MyReceiver"
android:permission="com.permission.Z"
android:exported="true">
<intent-filter>
<action android:name="com.local.intent.SLOW_ACT" />
</intent-filter>
</receiver>
I am interested in knowing whether if both the above receiver tags are included in AndroidManifest, how it will be resolved by Android, and whether it will allow me to achieve what I intend, which is to enforce permission XY for ACT intent, and Z for SLOW_ACT. Note that it is the same receiver object for both.