robolectric/robolectric — pull request #1301 by karlicoss (2014-10-01 14:56:50+00:00)
Title: Basic support of ordered broadcasts

I've implemented some basic support of `sendOrderedBroadcast`, to be precise

* they are received by the corresponding receivers in the order of decreasing priority
* it is possible to `abortBroadcast`

Basically, the idea of implementation is following:

1. I create a `MutableBoolean abort`, shared among the receivers, receiving a certain broadcast.
2. Broadcast receivers are sorted in the order of decreasing priority and passed in that order to the corresponding loopers.
3. Once a broadcast receiver calls `abortBroadcast`, the `abort` variable is set to `true`.
4. A `ShadowBroadcaseReceiver`checks the `abort` flag before calling actual `onReceive`. If the flag is `true`, it does not call `onReceive` of the underlying receiver.

If you see any problem there, I'm free to discuss!