标签:android style blog http io color ar os java
这阵子由于 Android KK开机按power键不能灭屏,须过会儿才能灭屏 问题看了下KK Keyguard代码,KK版本的Keyguard已独立为一个Keyguard.apk,具体流程分析,早就有大神BLOG;
http://blog.csdn.net/aaa2832/article/details/22181505 流程分析得很详细,准确,清晰;
http://blog.csdn.net/zhubin215130/article/details/26371531 对上面BLOG的补充和整个Keyguard类之间的关系;
学到的东西:
1,开始接触Policy,以前总是觉得为什么要有这个?虽然现在也不是很理解;
2,PWM由WMS派生,处理phone顶层逻辑,像横竖屏,Status Bar、Navigation Bar,特殊按键事件的拦截和分发(interceptKeyBeforeDispatching()和interceptKeyBeforeQueueing()),锁屏时间等;
3,由KeyguardService.java服务类作为模块入口,服务类通过实例化了一个IKeyguardService.Stub供其他类bindservice时调用,也不用做任何处理,交由后面的Keyguard核心类处理;
4,以上都是为系统调用,每一个模块都要对外留接口,KeyguardManager.java(/frameworks/base/core/java/android/app/KeyguardManager.java)就是Keyguard对外的接口,由源码注释可知第三方应用可以调用此类lock and unlock,对外的方法为disableKeyguard()和reenableKeyguard();
1 /** 2 * Class that can be used to lock and unlock the keyboard. Get an instance of this 3 * class by calling {@link android.content.Context#getSystemService(java.lang.String)} 4 * with argument {@link android.content.Context#KEYGUARD_SERVICE}. The 5 * actual class to control the keyboard locking is 6 * {@link android.app.KeyguardManager.KeyguardLock}. 7 */
5,Keyguard模块逻辑助理类主要为KeyguardViewMediator.java,KeyguardViewManager.java和KeyguardHostView.java,一切事务处理都要经过这些类的调度,处理,显示;
标签:android style blog http io color ar os java
原文地址:http://www.cnblogs.com/han21912/p/4092428.html