Android 7.0 来电,锁屏的时候是显示全屏界面,解锁的时候是显示的悬浮通知,是在哪里做判断处理的?

[复制链接]
查看11 | 回复2 | 2021-1-27 05:31:19 | 显示全部楼层 |阅读模式
如题,Android7.0中来电,锁屏的时候是显示全屏界面,解锁的时候是显示的悬浮通知,是在哪里做判断处理的?
分 -->
回复

使用道具 举报

千问 | 2021-1-27 05:31:19 | 显示全部楼层
是通过通知本身来处理的,在创建通知的时候,设置setCategory(Notification.CATEGORY_CALL)。
回复

使用道具 举报

千问 | 2021-1-27 05:31:19 | 显示全部楼层
这里闹钟与来电的全屏界面都是通过如下路径来触发全屏界面的
NotificationEntryManager.java
privatevoidaddNotificationInternal(StatusBarNotificationnotification,
NotificationListenerService.RankingMapranking)throwsInflationException{
Stringkey=notification.getKey();
...
try{
EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,
key);
//通过发送把来电或者闹钟通知的pendingintentsend来通知来电或者闹钟模块显示全屏界面,如此
notification.getNotification().fullScreenIntent.send();
shadeEntry.notifyFullScreenIntentLaunched();
mMetricsLogger.count("note_fullscreen",1);
}catch(PendingIntent.CanceledExceptione){
}
,更多的相关SystemUI文章,可以查看我的博客,送人玫瑰,手留余香。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行