Android-PIN process and flight mode process summary [Work Day 1]

Source: Internet
Author: User
Related logs of Radio:<Get_sim_status appstate_pin msimicccardproxy: action_sim_state_changed rease pin Log corresponding to logcat:
KeyguardUpdateMonitor:ACTION_SIM_STATE_CHANGEDKeyguardUpdateMonitor:handleSimStateChange:intentValue=PIN_REQUIMSimLockPatternKeyguardView:createUnlockScreenFor(SimPin);MSimLockPatternKeyguardView:Display SimUnlockScreen for sub:

 1. Process:Msimicccardproxy. Java send broadcast broadcaststickyintent (,) (reason = pin parameter) Accept Broadcast class:

  KeyguardUpdateMonitor.java   TelephonyIntents.ACTION_SIM_STATE_CHANGED    SimArgs.fromIntent(intent)  obtainMessage:MSG_SIM_STATE_CHANGED   //334 Line   handleSimStateChange((SimArgs) msg.obj);  //211 Line    onSimStateChanged(state, subscription);     KeyguardViewMediator.java      onSimStateChanged( , );        !isShowing()            doKeyguardLocked( )           resetStateLocked( )

2. Whether the PIN is selected in settings:

   IccLockSettings.java     getIccLockEnabled()     IccCardProxy.java       getIccLockEnabled()       mUiccApplication.getIccLockEnabled()         getPin1State()             mPin1State             return  true/false 

 3. Check the pin status: get_sim_status. query the status of the SIM card pin.<Get_sim_status icccardstatus {apptype_usim, appstate_pin, pin | = pinstate_enabled_not _} pin times, in the simunlockscreen. Java class:

     checkPin() atteptsRemaining = ITelephony.stub.asInterface(ServiceManager.                   checkService("phone")).getIccPin1RetryCount();                 mHeaderText.setText(displayMessage);

Number of remaining pin queries: + epinc: 2, 3, 10, 10 struct: + epinc: <pin1>, <pin2>, <puk1>, <puk2> returns the number of available times. About pin count: static final int pin_result_success = 0; phone. java static final int pin_password_incorrect = 1; static final int pin_general_failure = 2;4. Pin Puk input error query:Card 1 Card 2: At + cpin = "" pukcode: send command: command = at + epin1 = ""5. Set the available and unavailable PIN processIn the setting package

 IccLockSettings.java      tryChangeIccLockState()      UiccCardLockEnabled        setIccLockEnabled( , , )        RIL.java         setFacilityLockForApp( , , , , , )           lockString = (lockState) ? "1":"0";           rr.mp.writeString(lockString);

This lockstring is used to set the status to the RIL layer. Later, the upper framework layer checks the status, and the corresponding RIL layer returns the corresponding status.6. Disable the branch mode: When get_sim_status is checked, sub0 returns 10 parameters.Sub0 <get_sim_status icccardstate {cardstate_present, pinstate_unknown, num_1_1, gsm_id = 0 {apptype_usim, appstate_pin, pin1 = pinstate_enabled_not_verified cmda_id = 01, ism_id =-1} [sub0] sub1 <get_sim_status icccardstate {cardstate_present, pinstate_unknown, num_apps = 1, gsm_id = 0 {apptype_sim, appstate_pin}, CDMA _id = 8, ism_id =-1} [sub1] MTK cat, sub1 returns eight parameters to lock SIM card check: PIN selected status, reported status: appstate_ready, pin1 = pinstate_enabled_verieied pin Remove selected status: reported status: appstate_ready, pin1 = pinstate_disabled1. The flight mode class is located at the framework layer. The path is as follows:Framework/base/policy/src/COM/Android/Internal/policy/impl/globalaction. java has a changeairplanemodesystemsetting (Boolean on) method, which writes settings based on whether the on value is true or false. system. putint (mcontext. getcontentresolver (), settings. system. airplane_mode_on, on? 1-0); then send the broadcast:

 Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);           intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);           intent.putExtra("state", on);           mContext.sendBroadcast(intent);

2. Analysis of the Process of gray-free flight mode:

   PhoneWindowManager.java     mGlobalActions.showDialog(KeyguardShowing, isDeviceProvisioned());     GlobalActions.java       showDialog( , );          mAirplaneModeOn.updateState(mAirplaneState)          mAdapter.notifyDataSetChanged();     PhoneStateListener  mPhoneStateListener = new PhoneStateListener {         mAirplaneModeOn.updateState(mAirplaneState);         mAdapter.notifyDataSetChanged();    } 

After clicking it, it becomes unavailable. The status is changed by the phonestatelistener listener;

     onClick()      mAdapter.getItem(which).onPress();        changeStateFromPress(nowon);          ? State.TurningOn : State.TurningOff;

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.