robolectric/robolectric — pull request #755 by mlavigne (2013-10-11 20:40:11+00:00)
Title: Add shadow support for registerReceiver with permission

Permission restriction has been added to registerReceiver / sendBroadcast.
Intents will only be broadcasted to receivers that has matching
permission. If null is provided then it will simply mean no permission
is required.

Posting the BroadcastReceiver on a provided Handler has also been
added. If you provide a Handler when registering your receiver that
receiver will be notified from that Handler. Otherwise the main
application Handler will be used.

Added necessary tests to exercise this new support.

This was an old pull request that I had done about 9 months ago which was originally differed because of Robolectric 2.0 was support to bring this support. Unfortunately currently Robolectric 2.+ doesn't support it.

I'm simply doing this pull request in case it would be wanted in now. I know it would be better to fix this without shadowing but my time was very limited on this so I thought it might be worth it regardless.