为什么我的BroadcastReceive导致对M的READ_PRIVILEGED_PHONE_STATE拒绝?

时间:2015-10-20 20:01:18

标签: android android-permissions android-6.0-marshmallow

我的广播接收器定义如下:

  <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()

虽然接收器确实执行了。

0 个答案:

没有答案