As a result of Android KK Boot Press power key can not extinguish screen, must be later to extinguish screen problems looked under the KK Keyguard code, KK version of the Keyguard has been independent for a keyguard.apk, the specific process analysis, has long been the Great God blog;
http://blog.csdn.net/aaa2832/article/details/22181505 Process Analysis is very detailed, accurate, clear;
http://blog.csdn.net/zhubin215130/article/details/26371531 to the above blog supplement and the whole Keyguard class relationship;
To learn something:
1, began to contact policy, before always think why have this? Although it is not very understanding now;
2,PWM is derived from WMS, handling phone top-level logic, such as the screen, Status bar, Navigation bar, special key event interception and distribution (interceptkeybeforedispatching () and Interceptkeybeforequeueing ()), lock screen time and so on;
3, by the Keyguardservice.java service class as the module portal, the service class by instantiating a ikeyguardservice.stub for other classes Bindservice call, also do not have to do any processing, to the back of the Keyguard core class processing;
4, the above are for the system call, each module must be external interface, Keyguardmanager.java (/frameworks/base/core/java/android/app/ Keyguardmanager.java) is Keyguard external interface, by the source code note that third-party applications can call such lock and unlock, the external method is Disablekeyguard () and Reenablekeyguard ( );
1 /**2 * Class that can is used to lock and unlock the keyboard. Get An instance of this3 * Class by calling {@linkAndroid.content.context#getsystemservice (java.lang.String)}4 * with argument {@linkAndroid.content.context#keyguard_service}. the5 * Actual class to control the keyboard locking is6 * {@linkAndroid.app.KeyguardManager.KeyguardLock}.7 */
5,keyguard Module Logic Assistant class is mainly Keyguardviewmediator.java,keyguardviewmanager.java and Keyguardhostview.java, all transactions must go through these classes of scheduling, processing, display;
Android4.4 Keyguard