Android 10.0 屏蔽掉 SystemUI 的通知提示音

在10.0SystemUI 中有一些 高级别的通知 发出的时候 会首选悬浮在状态栏 上面 几秒钟消失 并且还会有 通知提示音 ,根据需求要求去掉悬浮通知 同时也去掉
通知提示音 这就要分析通知提示音是怎么发出来的

首先我们需要知道在SystemUI启动的时候会Start()一个媒体播放的类RingtonePlayer。
通知是通过RingtonePlayer 来播放通知声音
而 NotificationManagerService.java 中 负责管理通知声音的播放
frameworks\base\services\core\java\com\android\server\notification\NotificationManagerService.java

protected class PostNotificationRunnable implements Runnable { 
private final String key;
PostNotificationRunnable(String key) { 
this.key = key;
}
@Override
public void run
    原文作者:安卓兼职framework应用工程师
    原文地址: https://blog.csdn.net/baidu_41666295/article/details/124890600
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞