Android app启动流程:广播的发送scheduleBroadcastsLocked(7)

  • A+
所属分类:AMS

queue调用     scheduleBroadcastsLocked 函数进行广播发送的下一步工作。

public void scheduleBroadcastsLocked() {

if (mBroadcastsScheduled) {

return;

}

mHandler.sendMessage(mHandler.obtainMessage(BROADCAST_INTENT_MSG, this));

mBroadcastsScheduled = true;

}

 

 

private final class BroadcastHandler extends Handler {

public BroadcastHandler(Looper looper) {

super(looper, null, true);

}

 

@Override

public void handleMessage(Message msg) {

switch (msg.what) {

case BROADCAST_INTENT_MSG: {

processNextBroadcast(true);

} break;

.....

}

}

}

scheduleBroadcastsLocked  函数发送了消息,这个消息又调用了processNextBroadcast。

 

Android app启动流程:调用startProcessLocked的几种情况(1)

Android app启动流程:startProcessLocked函数分析(2)

Android app启动流程:Process.start(3)

Android app启动流程:startservice(4)

Android app启动流程:broadcast广播的注册(5)

Android app启动流程:广播的发送broadcastIntentLocked(6)

Android app启动流程:广播的发送scheduleBroadcastsLocked(7)

Android app启动流程:广播的发送processNextBroadcast(8)

Android app启动流程:关于FocusedStack的研究(9)

Android app启动流程:startActivityMayWait分析(10)

Android app启动流程:startActivityLocked分析(11)

Android app启动流程:Ams对activitystack和task的管理(12)

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: