Notifications通知到SystemUI(“Notifications 通知”拆解)

Notifications通知到SystemUI(“Notifications 通知”拆解),第1张

Notifications通知到SystemUI(“Notifications 通知”拆解) Notifications通知到SystemUI(“Notifications 通知”拆解)

android12-release

APP请求系统通知(“Notifications 通知”拆解)
SystemUI启动,及其SystemUIService启动


SystemUIService中StatusBar注册NotificationListener

com.android.systemui.statusbar.phone.StatusBar

SystemUI传递过来的Context
frameworks/base/core/java/android/service/notification/NotificationListenerService.java

mSystemContext = context : SystemUI传递过来的ContextgetNotificationInterface获取NotificationListenerService接口代理,经过binder调用mHandler = new MyHandler(context.getMainLooper()) 这个MyHandler运行在SystemUI进程noMan.registerListener向system_server进程中的NotificationListenerService注册监听器;APP请求系统通知(“Notifications 通知”拆解) 是NotificationListenerWrapper.onNotificationPosted过程是运行在SystemUI进程(即调用NotificationListenerService中NotificationListenerWrapper实例对象的onNotificationPosted())
NotificationEntryManager.java:SystemUI显示/更新Notification

APP请求系统通知(“Notifications 通知”拆解)通知到SystemUI监听
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java

frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java中注册

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5708779.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存