我的广播接收器定义如下:
<receiver android:name="stuff.BroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE"/>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
当应用程序在M上运行时,即使该应用程序已被授予电话组权限,我也偶尔会在有来电或设备启动时在日志中看到此内容。
W/BroadcastQueue﹕ Permission Denial: receiving Intent { act=android.intent.action.PHONE_STATE flg=0x10 (has extras) } to stuff/stuff.BroadcastReceiver requires android.permission.READ_PRIVILEGED_PHONE_STATE due to sender android (uid 1000)
10-20 12:59:28.014 10946-10946/stuff V/BroadcastReceiver﹕ onReceive()
虽然接收器确实执行了。