• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Android custom broadcast receiver permissions

 
Brendon McCullum
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In view of the security model in Android, I'm trying out custom permissions.
I'm trying out to enforce broadcaster permissions in my application. The scenario is that I have an activity A, which triggers a broadcasts like this (with a permission) :



In this activity A, I register a receiver in onCreate like this :



The receiver is defined as a private variable in the activity A as :


I expect the receiver to receive the broadcast as it has the required permissions that it needs. But it doesn't receive the broadcast sent out by the activity. There could be arguments on why I'm not using LocalBroadcastManager, but my motive is to figure out why this method isn't working as expected.

I have not declared my receiver in manifest and registering it dynamically only. All the above code is from a single activity within the same application. So there's no IPC involved here, just a simple example to check out the permissions. Any help would be appreciated.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic