What exactly does FLAG_RECEIVER_FOREGROUND do when sending ordered broadcasts?
Does it actually speed up anything or does it simply tell the receiver that you have less time to do your stuff or I'll be angry?
It says:
If set, when sending a broadcast the recipient is allowed to run at foreground priority, with a shorter timeout interval. During normal broadcasts the receivers are not automatically hoisted out of the background priority class.
What does
with a shorter timeout interval
mean?
This raises the priority of the Thread
that is running the BroadcastReceiver
, which will allow it to get more CPU cycles than competing threads of lower priority. This may speed things up if there are a lot of competing threads.