zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

Android 11.0 系统framework发送悬浮通知的流程分析

Android流程系统 分析 发送 Framework 通知 11.0
2023-09-14 09:14:22 时间

1.前言


  在android11.0rom定制化开发中,在原生系统的systemui中,状态栏通知,和闹钟,wifi等悬浮通知也是很重要的,
悬浮通知也是系统通知的一种,也是在frameworks中发送出来的通知,接下来就分析下11.0中的悬浮通知的发送
流程,然后就可以实现自己自定义悬浮通知的相关功能的实现

2.系统framework发送悬浮通知的流程分析的核心类

frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/HeadsUpController.java
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java

3.系统framework发送悬浮通知的流程分析的核心功能分析和实现
3.1 StatusBar.java中关于对悬浮通知相关流程的监听

 /**
  * Master controller for all notifications-related work
  *
  * At the moment exposes a number of event-handler-esque methods; these are for historical reasons.
  * Once we migrate away from the need for such things, this class becom