有没有办法对AlarmManager广播的意图强制执行接收者权限?例如,我想这样做:
AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent("myapp.MY_ACTION");
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0);
am.setRepeating(AlarmManager.RTC_WAKEUP, now, MY_INTERVAL, pendingIntent);
但是使AlarmManager发送的广播的行为如下:
sendBroadcast(intent, "myapp.permission.RECEIVE_BROADCASTS");
答案 0 :(得分:1)
我不相信这是可能的,抱歉。无法在Intent
或PendingIntent
上提供此权限。