Android 广播原理分析

[Android]有序广播是如何实现有序循环(五)_淡淡的一片天空!-CSDN博客_android 有序广播处理BroadcastQueue是如何循环处理许多的广播?如何将一个Intent分发给所有的Receiver。https://blog.csdn.net/s394500839/article/details/77606753

 【再出发】Android11源码分析:静态广播是如何接收到消息的? - 掘金

 

我们按照下面思路来分析广播原理

1:所有静态广播Receiver 都是串行处理,(静态广播接收者属于在发送此广播时属于有序广播范畴)

2:动态广播 Receiver按照发送此广播时指定的方式 进行 串行或者并行分发

其中:如果是普通广播:那么通过 并行方式分发

         如果是 有序广播(sendOrderxxxx):那么通过 串行方式分发

3:Android系统在处理广播时:动态广播接收者 优先于 静态广播接收者 收到

4:广播分发处理关键类:BroadcastQueue/ BroadcastRecord

292921

03-02 15:54:32.073   379   449 W BroadcastQueue: Timeout of broadcast BroadcastRecord{5b337ab u0 AUTONAVI_STANDARD_BROADCAST_SEND} - receiver=android.os.BinderProxy@186fe08, started 60001ms ago
03-02 15:54:32.073   379   449 W BroadcastQueue: Receiver during timeout: ResolveInfo{a10c9a1 com.iflytek.cutefly.speechclient.hmi/com.iflytek.auto.speechclient.sdk.naviadapter.handle.NaviMessageReceiver m=0x108000}

5: 相关问题

2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver: BroadcastReceiver trying to return result during a non-ordered broadcast
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver: java.lang.RuntimeException: BroadcastReceiver trying to return result during a non-ordered broadcast
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver:     at android.content.BroadcastReceiver.checkSynchronousHint(BroadcastReceiver.java:785)
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver:     at android.content.BroadcastReceiver.setResultCode(BroadcastReceiver.java:551)
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver:     at com.android.providers.remindercalendar.CalendarProviderBroadcastReceiver.onReceive(CalendarProviderBroadcastReceiver.java:36)
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver:     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2766)
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver:     at android.app.ActivityThread.-wrap14(ActivityThread.java)
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1441)
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver:     at android.os.Handler.dispatchMessage(Handler.java:102)
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver:     at android.os.Looper.loop(Looper.java:148)
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver:     at android.app.ActivityThread.main(ActivityThread.java:5498)
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver:     at java.lang.reflect.Method.invoke(Native Method)
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
2022-04-25 11:17:00.048  1217  1217 E BroadcastReceiver:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值