PendingIntent.getBroadcast()和AlarmManager的权限

时间:2011-10-13 21:57:48

标签: android

有没有办法对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");

1 个答案:

答案 0 :(得分:1)

我不相信这是可能的,抱歉。无法在IntentPendingIntent上提供此权限。