视图
通知图标显示分析:
?
如上所述,所有的通知信息保存在了自定义view NotificationStackScrollLayout中,每个通知又被封装进了ExpandableNotificationRow中,其中主要保存信息内容的对象又是NotificationContentView,所以后续分析会涉及到这三个自定义view。
在SystemUI进程中对notification的处理流程如下:
?
?
源码分析
?
??
关键信息类
2. 获取NotificationChannel,如果为空提前结束通知的发送。
3. 创建StatusBarNotification,用于封装通知信息。
4. 创建NotificationRecord对象,封装了StatusBarNotification和一些其他的信息。
对应位置
- frameworks/base/core/java/android/app/Notification.java
- frameworks/base/core/java/android/app/NotificationManager.java
- frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java
- frameworks/base/core/java/android/service/notification/NotificationListenerService.java
- frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java
- frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
- frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java
- frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowInflaterTask.java
- frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java
- frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
- frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java
|