notification学习--持续更新中。。。
来源:互联网 发布:淘宝上的6s官换机真相 编辑:程序博客网 时间:2024/06/09 23:08
1. 应用通知管理
settings -> apps -> 选择某个应用 -》 进入应用信息界面,点击“通知” -> 可以看到该应用的通知,如下图:
图1
该界面对应settings的文件:AppNotificationSettings, 其状态的设置项调用NotificationManagerService的相关方法。
@Override public void setPackagePriority(String pkg, int uid, int priority) { checkCallerIsSystem(); mRankingHelper.setPackagePriority(pkg, uid, priority); savePolicyFile(); } @Override public int getPackagePriority(String pkg, int uid) { checkCallerIsSystem(); return mRankingHelper.getPackagePriority(pkg, uid); } @Override public void setPackagePeekable(String pkg, int uid, boolean peekable) { checkCallerIsSystem(); mRankingHelper.setPackagePeekable(pkg, uid, peekable); } @Override public boolean getPackagePeekable(String pkg, int uid) { checkCallerIsSystem(); return mRankingHelper.getPackagePeekable(pkg, uid); } 。。。。
并且写入到/data/system/notification_policy.xml中进行保存:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<notification-policy version="1">
<zen version="2" user="0">
<allow calls="true" repeatCallers="false" messages="false" reminders="true" events="true" callsFrom="1" messagesFrom="1" />
<automatic ruleId="2212c7138aaf49c1b997ce90c01c06c4" enabled="false" snoozing="false" name="周一至周五夜间" zen="3" component="android/com.android.server.notification.ScheduleConditionProvider" conditionId="condition://android/schedule?days=1.2.3.4.5&start=22.0&end=7.0" id="condition://android/schedule?days=1.2.3.4.5&start=22.0&end=7.0" summary="..." line1="..." line2="..." icon="0" state="0" flags="2" />
<automatic ruleId="7315962a6ab7404592e5245ba9781814" enabled="false" snoozing="false" name="周末" zen="3" component="android/com.android.server.notification.ScheduleConditionProvider" conditionId="condition://android/schedule?days=6.7&start=23.30&end=10.0" id="condition://android/schedule?days=6.7&start=23.30&end=10.0" summary="..." line1="..." line2="..." icon="0" state="0" flags="2" />
<automatic ruleId="33b5982469fd47b18a92607638a0458e" enabled="false" snoozing="false" name="活动" zen="3" component="android/com.android.server.notification.EventConditionProvider" conditionId="condition://android/event?userId=-10000&calendar=&reply=1" id="condition://android/event?userId=-10000&calendar=&reply=1" summary="..." line1="..." line2="..." icon="0" state="0" flags="2" />
</zen>
<ranking version="1">
<package name="com.baidu.BaiduMap" priority="2" peekable="true" uid="10090" />
<package name="com.qiyi.video" priority="2" peekable="true" uid="10092" />
<package name="com.tencent.qqpimsecure" uid="10100" />
</ranking>
</notification-policy>
图1中的界面也可以通过下拉通知栏长按某个应用的通知,然后点击感叹号图标进入(手机管家):
长按notification后notification切换到的视图是个viewStub,该viewStub嵌套在布局ExpandableNotificationRow对应的布局status_bar_notification_row中,并且设置setOnInflateListener监听
protected void onFinishInflate() { super.onFinishInflate(); mPublicLayout = (NotificationContentView) findViewById(R.id.expandedPublic); mPrivateLayout = (NotificationContentView) findViewById(R.id.expanded); mGutsStub = (ViewStub) findViewById(R.id.notification_guts_stub); mGutsStub.setOnInflateListener(new ViewStub.OnInflateListener() { @Override public void onInflate(ViewStub stub, View inflated) { mGuts = (NotificationGuts) inflated; mGuts.setClipTopAmount(getClipTopAmount()); mGuts.setActualHeight(getActualHeight()); mGutsStub = null; } });。。。。。
- notification学习--持续更新中。。。
- linux学习 持续更新中
- 学习笔记,持续更新中
- 裸机学习:持续更新中
- ACE学习笔记--持续更新中
- lua学习笔记(持续更新中)
- ACE学习笔记--持续更新中
- GIS 学习资料汇总 --- 持续更新中
- Oracle11G 系统参数学习(持续更新中)
- Sybase数据库学习笔记【持续更新中】
- linux 学习 持续更新中……
- 嵌入式学习网站(持续更新中)
- Mongo DB学习(持续更新中)
- linux学习感悟(持续更新中)
- 学习资料收集(持续更新中)
- Hadoop学习系列--持续更新中
- 学习网站梳理(持续更新中)
- python 学习笔记 持续更新中
- 1081. Rational Sum (20)
- 浅析Java中的final关键字
- 如何做加载状态的监听。
- exe注册成windows服务
- 《算法技术手册》相关笔记-第四章排序
- notification学习--持续更新中。。。
- iOS之新建xib无法通过拖动调整大小
- WebForm获取GET或者POST参数到实体的转换,ADO.NET数据集自动转换实体
- Android中View的事件分发机制——Android开发艺术探索笔记
- ORACLE里几种锁模式
- incredibuild 命令行 error D8037
- 欢迎使用CSDN-markdown编辑器
- 数据库应用-XML数据存储(XML Speicherung)-2
- c语言入门之项目4.3——利用for循环求1-1/2*2+1/2*2*2...-1/2*2*2*2到2的8次方