Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

android broadcast queue questions

OP brian722

11th January 2014, 01:16 PM   |  #1  
OP Junior Member
Thanks Meter: 0
 
3 posts
Join Date:Joined: Nov 2013
hi all :

recently i am looking at ActivityManagerservice.java . i am very interesting the flag( Intent.FLAG_RECEIVER_FOREGROUND) . why add the flag.
i found android developer website . it explained that Intent.FLAG_RECEIVER_FOREGROUND .(if set . sending broadcast that receipent can be allowed to foreground priority . short timeout interval )

i know that android broadcast queue contain two queue . one is foreground queue (foreground priority). another is background( normal priority) .

my question is the following :
1. why need add the flag (Intent.FLAG_RECEIVER_FOREGROUND)
2. what mean foreground priority ? i donot understand
3. in broadcast ACTION_CONFIGURATION_CHANGED . wheather we must add the intent flag (Intent.FLAG_RECEIVER_FOREGROUND)


Intent intent = new Intent(Intent.ACTION_CONFIGURATION_CHANGED);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ON LY
| Intent.FLAG_RECEIVER_REPLACE_PENDING
| Intent.FLAG_RECEIVER_FOREGROUND);
broadcastIntentLocked(null, null, intent, null, null, 0, null, null,
null, AppOpsManager.OP_NONE, false, false, MY_PID,
Process.SYSTEM_UID, UserHandle.USER_ALL);

any advices are welcomed . i wish we can learn more . more deep-dive . t
thks
brian
Last edited by brian722; 11th January 2014 at 01:21 PM. Reason: spell error
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes