Android unlock screen Startup Process

Source: Internet
Author: User
  1. Start

The SIM card and status are obtained when the wireless module is initialized during startup. After Initialization is complete, call the VM. systemready () function to notify the corresponding lockscreen to unlock.

  1. In the hardware/RIL/reference-RIL/reference-ril.c:

Setradiostate (radio_state_sim_not_ready) is used to trigger the initialization of the wireless module.

Initialize the wireless module through staticvoid onradiopoweron.

First, pollsimstate (null) is used to poll the SIM card status.

The getsimstatus () function obtains the SIM card status.

2. After the system initialization is complete, the WM. systemready () function is called to trigger the unlock interface.

VM: windowmanagerservicewm = NULL;

Because WM is empty, call the function in windowmanagerservice:

Publicvoid systemready (){

Mpolicy. systemready ();

}

Mpolicy: Final windowmanagerpolicy mpolicy = policymanager. makenewwindowmanager ();

(The following files are in frameworks/policies/base/phone/COM/Android/Internal/policy/impl)

3. policymanager. makenewwindowmanager (), which calls the function in policymanagerer. Java:

Publicstatic windowmanagerpolicy makenewwindowmanager (){

Returnspolicy. makenewwindowmanager ();

}

4. spolicy. makenewwindowmanager calls the function in the file policy. Java:

Publicphonewindowmanager makenewwindowmanager (){

Returnnew phonewindowmanagerwv

}

5. phonewindowmanager inherits from windowmanagerpolicy

Mpolicy. systemready () finally calls the function in the file phonewindowmanager. Java:

Publicvoid systemready ();

Mkeyguardmediator. onsystemready ();

Dokeyguard ();

Showlocked ();

Messagemsg = mhandler. obtainmessage (show );

Mhandler. sendmessage (MSG );

Send the show message.

6. Public void handlemessage (Message MSG) processes the show message.

If MSG. What is equal to show, execute:

Handleshow ();

Privatevoid handleshow ()

...

Mcallback. onkeyguardshow ();

Mkeyguardviewmanag. Show ()

7. mkeyguardviewmanager. Show () calls the functions in the keyguardviewmanager. Java file:

Publicsynchronized void show ()

...

Mkeyguardview = mkeyguardviewproperties. createkeyguardview (mcontext, mupdatemonitor, this );

...

8. mkeyguardviewproperties. createkeyguardview

The function in the file lockpatternkeyguardviewproperties. Java is called:

Publickeyguardviewbase createkeyguardview (context,

Keyguardupdatemonitorupdatemonitor,

Keyguardwindowcontrollercontroller ){

Returnnew lockpatternkeyguardview (context, updatemonitor,

Mlockpatternutils, Controller );

}

9. New lockpatternkeyguardview calls the constructor of the lockpatternkeyguardview class:

Publiclockpatternkeyguardview (

Contextcontext,

Keyguardupdatemonitorupdatemonitor,

Lockpatternutilslockpatternutils,

Keyguardwindowcontrollercontroller)

...

Mlockscreen = createlockscreen ();

Addview (mlockscreen );

Finalunlockmode unlockmode = getunlockmode ();

Munlockscreen = createunlockscreenfor (unlockmode );

Munlockscreenmode = unlockmode;

Addview (munlockscreen );

Updatescreen (mmode );

Getunlockmode obtains the lock type. There are usually three types:

Enumunlockmode {

Pattern,

Sinpin,

Account

}

Createunlockscreenfor (unlockmode) calls the corresponding unlock screen based on the corresponding unlockmode.

  1. Press red to start

Click the end call key (red key) and follow the action:

Telephonymanager. action_phone_state_change and telephonymanager. extra_state_idle

Call frameworks/policies/base/phone/COM/Android/Internal/policy/impl/

Functions in keyguardviewmediator. Java:

Dokeyguard ();

Privatevoid showlocked (){

If (Debug) log. D (TAG, "showlocked ");

// Ensure we stay awake until we are finished displaying the keyguard

Mshowkeyguardwakelock. Acquire ();

Messagemsg = mhandler. obtainmessage (show );

Mhandler. sendmessage (MSG );

}

Send the show message.

Then go to step 6 of "Start Up.

  1. Other methods

  1. The SIM card status changes when the SIM card status is absent

// Only force lock screen in case of missing SIM if user hasn't gonethrough Setup Wizard

When the SIM card status is puk_required: that is, the input pin fails. (Call Puk to unlock the screen)

  1. The Set automatic lock time is out.

All are started through keyguardviewmediator. java.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.