How does the Sim box pop up?

Source: Internet
Author: User

This article resolves two questions
* How the SIM card asks is turned on.
* Add a call in a call why not pop up the SIM card box again

PS: Only consider the situation of the SIM card account, regardless of other accounts (SIP, etc.). how the SIM card asks is turned on. SIM card asking box popup condition

We know that the SIM card is new and displayed in the Selecphoneaccountdialogfragment.java, so how does it come to this step?
Track the process of making calls we know there's a line in the Internalresolveintent () method in Incallactivity.java
Call Pendingaccountselectioncall = Calllist.getinstance (). Getwaitingforaccountcall ();
What does this Pendingaccountselectioncall do?
If it is not empty, then there is a call of the pri_dial_wait state, then Selectphoneaccountdialogfragment.showaccountdialog () will be called to display a selection box.
Here we have a question, we still have to dial the phone when the calllist inside there is a call. set the status of call

If you are familiar with the MO process, then you should know that a complete MO process begins with dialer telecom and then to Incallui, and Incallactivity is in Incallui. So we infer that the state of this pri_dial_wait is set in Telecomm.
The tracking process found that there is a key call type method in Callsmanager.java Startoutgoingcall (), which has a variable to control whether to display the SIM card inquiry box needsaccountselection, Some of the code is as follows:

    Boolean needsaccountselection = Phoneaccounthandle = = null && accounts.size () > 1 &&
                ! Isemergencycall;
        LOG.I (This, "Voice needsaccountselection:" +needsaccountselection);
        if (needsaccountselection) {//This was the state
            where the user was expected to select a account
            call.setstate (Ca llstate.pre_dial_wait);
            Extras.putparcelablelist (Android.telecom.Call.AVAILABLE_PHONE_ACCOUNTS, ACCOUNTS);
        } else {
            call.setstate (callstate.connecting);
        }

If we don't have a SIM card with the default call selected, the phoneaccounthandle is null, so there's a calllist with a status of Pre_dial_wait. So when you go back to Incallactivity, you execute the code that displays the SIM card selector. why does adding a call to a call not eject the SIM card selection again?

From the previous analysis we know whether the pop-up SIM box key is there is no pre_dial_wait status of call, and the state of call is set to pre_dial_wait depends on the value of Needsaccountselection,
Boolean needsaccountselection = Phoneaccounthandle = = null && accounts.size () > 1 &&! Isemergencycall; The
obviously does not need to display the SIM card selection when Phoneaccounthandle is not NULL, we look up a piece of code

    if (Phoneaccounthandle = = null) {//No preset account, check if default exists that supports the URI Sche
            Me for the//handle.
                            Phoneaccounthandle Defaultaccounthandle = Mphoneaccountregistrar.getdefaultoutgoingphoneaccount (
            Scheme); Telephonymanager.multisimvariants msimconfig = Telephonymanager.getdefault (). Getmultisimconfiguration (
            );
                    if ((Msimconfig = = TelephonyManager.MultiSimVariants.DSDS) | | (Msimconfig = = TelephonyManager.MultiSimVariants.TSTS)) && (Mforegroundcall! = null) && (Mforegroundcall.isalive ())) {Default
            Accounthandle = Mforegroundcall.gettargetphoneaccount ();
            } if (Defaultaccounthandle! = null) {phoneaccounthandle = Defaultaccounthandle; }} call.settargetphoneaccount (Phoneaccounthandle);

If the phone is DSDS or tsts, the targetphoneaccount of Forgroundcall will be assigned to Phoneaccounthandle,phoneaccounthandle NOT NULL, There is no need to display the SIM box and then phoneaccounthandle to the new call Targetphoneaccount, At this point the targetphoneaccount of the new call is the same as the targetphoneaccount of the forgroundcall currently in existence.

So what the hell is phoneaccounthandle doing?

Ps:
* Dual Sim Dual Standby dual sim double standby single Pass
* Dsda-dual Sim Dual active dual SIM dual standby dual-pass
* Tsts-triple SIM Triple standby Three card three stay

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.