1. 通知播报流程分析: Android 中用 NotificationManager 处理通知事务,在构建 Notification 时,一般会传入一个音频地址给其中的 sound 字段进行播报,而播报的处理是通过启动 com.android.server.NotificationManagerService 这个服务来完成的,NotificationManagerService 排队处理 notifications,启动 android.media.AudioService 来获取 com.android.systemui.media.RingtonePlayer,然后实例化一个 com.android.systemui.media.NotificationPlayer 来异步播放 sound,流程图如下: