Icccard. Java ---> simcard. Java ----> gsmphone. Java ------> phoneinterfacemanager. Java -------> simunlockscreen. Java -------> lockpatternkeyguardview. Java ------> keyguardupdatemonitor. Java
Keyguardviewmanager. Java ------> keyguardviewmediator. Java -------> phonewindowmanager. Java ------> windowmanagerservice. Java -------> serverthread. Java
Keyguardupdatemonitor. Java now has two icccard. States, representing the GNET and the CNET respectively, as shown below:
Private icccard. State msimstate = icccard. state. ready;
// Jmhghd 2010.12.21 add {
Private icccard. State msimstategsm = icccard. state. ready;
Private string mphonetype;
// Jmhghd end}
Through the broadcast issued by icccard. Java, the msimstate and msimstategsm statuses are set respectively. The problem now is how keyguardupdatemonitor makes these two different
And how to represent them in simunlockscreen and lockscreen.
Lockscreen gets the SIM card status through the onsimstatechanged () method. In a single card, simunlockscreen does not need to know the SIM card status. Once simunlockscreen
After initialization, it is confirmed that the SIM card has been locked. In the dual-card, simunlockscreen needs to know the status of the two cards and perform some processing.
Lockscreen has the following States for SIM cards:
/**
* Normal case (SIM card present, it's not locked)
*/
Normal (true ),
/**
* The SIM card is 'network locked '.
*/
Networklocked (true ),
/**
* The SIM card is missing.
*/
Simmissing (false ),
/**
* The SIM card is missing, and this is the device isn' t provisioned, so we don't let
* Them get past the screen.
*/
Simmissinglocked (false ),
/**
* The SIM card is Puk locked, meaning they 've entered the wrong SIM unlock code too encode
* Times.
*/
Simpuklocked (false ),
/**
* The SIM card is locked.
*/
Simlocked (true );
Now, if I want to add a representation of another card status, the two States will be more combined. The simple solution is that in the existing states,
Make a judgment on the two cards and update their status.
Add variable in keyguardupdatemonitor. Java
Mcurrectphonetype;
Mgsmphonetype;
Mcdmaphonetype;
Receive icccard. java broadcast and storage status. The problem with mcurrectphonetype is that many statuses have been updated on mcurrentphone receive. handlesimstatechange can only process the last one; the problem with mgsmphonetype and mcmaphonetype is that when both cards are pin-locked, unlocking one will change the other State.
When I recorded these ideas, another idea appeared in my mind, that is, from the bottom layer, controlling the status of the two cards. The above two paths are different, that is, they are not on the right.
Today, we have implemented a simple solution
The method handlesimstatechange () in keyguardupdatemonitor. Java accepts the broadcast of icccard. java. The difference between GNET and CNET is that the phone type is used as the intent parameter when broadcast is sent through icccard. Java, and then the intent is directly used as the parameter to pass handlesimstatechange (), and then the judgment is omitted.
The preceding parameters include mcurrectphonetype, mgsmphonetype, and mcmaphonetype.
After the machine is started, the status of the C card and G card will be queried. Once any card is locked by pin, the simunlockscreen will be initialized. java, so there is a problem, simunlockscreen has been initialized, the pin lock status of another card is set successfully, making simunlockscreen. the Java status is incorrect. To solve this problem, add a broadcast in keyguardupdatemonitor. Java and a receiver in simunlockscreen. Java, so that you can actively modify simunlockscreen. java.
Status
RIL
Icccardstatus
Icccardapplication
Icccard. java uses mphone in the mhandler method handlemessage. MCM. geticccardstatus (obtainmessage (event_get_icc_status_done); Call RIL. java, rIL. the message returned by Java is also in mhanlder. The processing flow is geticccardstatusdone (AR) ----> handleicccardstatus (icccardstatus) ar. result) ----------> geticccardstate ()
SIM card part
D/AT-GSM (1046): At> ate0q0v1
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> ate0q0v1
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> ats0 = 0
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> at + cmee = 1
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> at + CREG = 2
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> at + cgreg = 1
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> at + ccwa = 1
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> at + cmod = 0
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> at + cssn =
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> at + Colp = 0
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> at + CSCs = "hex"
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> at + cusd = 1
D/AT-GSM (1046): at <+ CME error: 11
D/AT-GSM (1046): At> at + cgerep =
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> at + cmgf = 0
D/AT-GSM (1046): at <OK
D/AT-GSM (1046): At> at + CPMS = "SM", "SM", "SM"
D/AT-GSM (1046): at <+ CPMS: 0, 0, 0, 0, 0
D/AT-CDMA (788): At> ate0v1
D/AT-CDMA (788): At> ate0v1
D/AT-CDMA (788): At> ate0v1
D/AT-CDMA (788): At> ate0v1
D/AT-CDMA (788): At> ate0v1
07:05:52 com. IBM. icu4jni. util. Resources createtimezonenamesfor
Info: loaded Time Zone names for zh_cn In 597 Ms.
D/AT-CDMA (788): At> ate0v1
D/AT-CDMA (788): At> ate0v1
D/AT-CDMA (788): At> ate0v1
D/AT-CDMA (788): At> at + cfun = 0
[2, 18.921508] [dprtty] BP mailbox is timeout.
[18.925811] GPIO-118 autorequested
D/AT-CDMA (788): at <ready
D/AT-CDMA (788): at <+ CREG: 0, 0
D/AT-CDMA (788): at <^ simst: 255
I/RIL-CDMA (788): onunsolicited simst: ^ simst: 255
E/RILC-CDMA (788): Unsupported Unsolicited Response Code 1032
D/AT-CDMA (788): at <^ simst: 1
I/RIL-CDMA (788): onunsolicited simst: ^ simst: 1
D/AT-CDMA (788): at <OK
D/AT-CDMA (788): at <OK
D/AT-CDMA (788): at <OK
D/AT-CDMA (788): at <OK
D/AT-CDMA (788): at <OK
D/AT-CDMA (788): at <o [18.976287] init: Starting 'bootanim'
D/AT-CDMA (788): at <OK
D/AT-CDMA (788): at <OK
D/AT-CDMA (788): at <OK
D/AT-CDMA (788): At> ate0v1
D/AT-CDMA (788): at <OK
D/AT-CDMA (788): At> ats0 = 0
D/AT-CDMA (788): at <OK
D/AT-CDMA (788): At> at + cmee = 2
D/AT-CDMA (788): at <OK
D/AT-CDMA (788): At> at + cmgf = 1
D/AT-CDMA (788): at <OK
D/AT-CDMA (788): At> at + CTA = 10
D/AT-CDMA (788): at <OK
UIM -------------------- lock
D/RILJ-CDMA (907): [0243]> set_facility_lock
D/RIL-CDMA (788): onrequest: set_facility_lock
D/AT-CDMA (788): At> at + clck = "SC", 1, "1234", 7
D/AT-CDMA (788): at <OK
D/RILJ-CDMA (907): [0243] <set_facility_lock {}
D/CDMA (907): [icccard] event_change_facility_lock_done: miccpinlocked = true
UIM --------------------- unlock
D/RILJ-CDMA (907): [0251]> set_facility_lock
D/RIL-CDMA (788): onrequest: set_facility_lock
D/AT-CDMA (788): At> at + clck = "SC", 0, "1234", 7
D/AT-CDMA (788): at <OK
D/RILJ-CDMA (907): [0251] <set_facility_lock {}
D/CDMA (907): [icccard] event_change_facility_lock_done: miccpinlocked = false
UIM ------------------- enter
D/RILJ-CDMA (907): [0021]> enter_sim_pin
D/RIL-CDMA (788): onrequest: enter_sim_pin
D/AT-CDMA (788): At> at ^ cpin = "1234"
D/AT-CDMA (788): at <OK
D/RIL-CDMA (788): Unlocking SIM card simstatus = 3, need sleep 10 s for modem init SIM card
Sim ------------------ lock
D/RILJ-GSM (907): [0318]> set_facility_lock
D/RIL-GSM (787): onrequest: set_facility_lock
D/RIL-GSM (787): ril_request_set_facility_lock .........................
D/AT-GSM (787): At> at + clck = "SC", 1, "1234", 7
D/AT-GSM (787): at <OK
D/RILJ-GSM (907): [0318] <set_facility_lock {}
D/GSM (907): [icccard] event_change_facility_lock_done: miccpinlocked = true
Sim ------------------ unlock
D/RILJ-GSM (907): [0319]> set_facility_lock
D/RIL-GSM (787): onrequest: set_facility_lock
D/RIL-GSM (787): ril_request_set_facility_lock .........................
D/AT-GSM (787): At> at + clck = "SC", 0, "1234", 7
D/AT-GSM (787): at <OK
D/RILJ-GSM (907): [0319] <set_facility_lock {}
D/GSM (907): [icccard] event_change_facility_lock_done: miccpinlocked = false
Sim ====================================== enter
D/RILJ-GSM (910): [0019]> enter_sim_pin
D/RIL-GSM (1063): onrequest: enter_sim_pin
D/AT-GSM (1063): At> at ^ cpin = 1234 --------------- >>> at ^ cpin = "1234"
D/AT-GSM (1063): at <+ CME error: 100
D/RILJ-GSM (910): [0019] <enter_sim_pin error: COM. Android. Internal. telephony. commandexception: password_incorrect
D/RILJ-GSM (910): [0020]> get_sim_status
D/RIL-GSM (1063): onrequest: get_sim_status
D/AT-GSM (1063): At> at + cpin?
D/AT-GSM (1063): at <+ cpin: SIM pin
D/AT-GSM (1063): at <OK
Query
At + cpin?
Puk right
D/rilj (99): [2, 0024]> enter_sim_puk
D/rild (33): onrequest: enter_sim_puk
D/at (33): At> at ^ cpin = "01153813", "1234"
D/at (33): at <OK
Puk Error
/Dev/dprtty0
/Dev/ttys0
^ Cpin: <code>, [<times>], <puk_times>, <pin_times>, <puk2_times>, <pin2_times>
Get_pin_puk_left_counts CDMA
D/RIL-CDMA (810): onrequest: get_pin_puk_left_counts
D/AT-CDMA (810): At> at ^ cpin?
D/RILJ-CDMA (1116): [0026] <registration_state {4, 0,-1,-1,-1, 0,-1,-1, 1, 0, -1, 0}
D/CDMA (1116): [cdmaservicestatetracker] Set CDMA roaming indicator to: 1. mcdmaroaming = false, isprlloaded = fa1
D/CDMA (1116): [cdmaservicestatetracker] poll servicestate done: oldss = [3 home null unknown CSS not su]
D/AT-CDMA (810): at <^ cpin: SIM pin, 3
D/AT-CDMA (810): at <OK
D/RIL-CDMA (810): At + cpin? Response [0] = 3
D/RIL-CDMA (810): At + cpin? Response [1] = 2
D/RIL-CDMA (810): At + cpin? Response [2] = 10
D/RIL-CDMA (810): At + cpin? Response [3] = 2
D/RIL-CDMA (810): At + cpin? Response [4] = 10
D/RIL-CDMA (810): At + cpin? Response [5] = 3
D/RILJ-CDMA (1116): [0027] <ril_request_get_pin_puk_left_counts {3, 2, 10, 2, 10, 3}
D/AT-GSM (809): at <OK
Get_pin_puk_left_counts GSM
>>>> At + epinc?
>>>> D/AT-GSM (809): at <+ epinc: 0, 3, 10, 10
D/AT-GSM (809): at <OK
Logcat-s keyguardupdatemonitor &
Logcat-s lockpatternkeyguardview &
Logcat-B radio-S CDMA &
Logcat-B radio-s GSM &
Logcat-s simunlockscreen &
Logcat-s keyguardviewmediator &
Logcat-s icccard &
Emulator-skin wvga800 &
Http://blog.csdn.net/ghd_214/article/details/6090120