At instruction, no frameworks interface is found to send at request, and the AT command is summarized by printing information:
At+eimsvoice:enable/disable IMS Voice Capability
+eimsvoice=<config>
<config>: integer
0 Disable IMS Voice capability
1 Enable IMS Voice capability
Note:this command should set from AP side while boot-up;
At runtime, AP side could set the command anytime, and IMS module'll apply the setting for next round of IMS Registratio N
Then the following print information, send ril_request_set_ims_enable request:
Onrequestimsswitch () of this send interface in the Imsservice.java class:
public void Onrequestimsswitch (int simidx, Boolean isimson) {
int phoneid = Getmaincapabilityphoneid ();
if (DBG) {
rlog.d (Log_tag, "Onrequestimsswitch simidx=" + simidx +
"isimson=" + Isimson + "maincapability id=" + Phoneid);
}
if (Mactivephoneid!= phoneid) {
Mactivephoneid = Phoneid;
}
if (Isimson) {if
(mimsstate!= phoneconstants.ims_state_enable) {//If it is off state
mimsriladapter.turnonims ( Mhandler.obtainmessage (Event_set_ims_enabled_done));
Mimsstate = phoneconstants.ims_state_enabling;
} else {
rlog.d (Log_tag, "Ims already enable and ignore to send at command.");
}
The Imsriladapter class encapsulates the message request and sends the RIL receiver via send ();
Imsintentreceiver broadcast receiver, print information according to log:
The Mimsintentreceiver broadcast receiver is defined in the Phonebase class:
Private Broadcastreceiver Mimsintentreceiver = new Broadcastreceiver () {@Override public void onrecei
ve (context context, Intent Intent) {rlog.d (Log_tag, "mimsintentreceiver:action" + intent.getaction ()); if (Intent.hasextra (imsmanager.extra_phone_id)) {int extraphoneid = Intent.getintextra (imsmanage
r.extra_phone_id, Subscriptionmanager.invalid_phone_index);
RLOG.D (Log_tag, "Mimsintentreceiver:extraphoneid =" + Extraphoneid);
if (Extraphoneid = = Subscriptionmanager.invalid_phone_index | |
Extraphoneid!= Getphoneid ()) {return; } synchronized (Phoneproxy.lockforradiotechnologychange) {//Receive broadcast AC
Tion_ims_service_up if (intent.getaction (). Equals (imsmanager.action_ims_service_up)) { ... mimsservicereAdy = true;
Updateimsphone ();
Imsmanager.updateimsserviceconfig (Mcontext, Mphoneid, false);
Receive broadcast Action_ims_service_down} else if (Intent.getaction (). Equals (Imsmanager.action_ims_service_down)) {
Mimsserviceready = false;
Updateimsphone (); }
}
}
};
The Updateimsphone () method is as follows:
protected void Updateimsphone () {RLOG.D (Log_tag, "Updateimsphone" + "mimsserviceready=" + MI
Msserviceready); if (Mimsserviceready && (mimsphone = null)) {//create Mimsphone Notifydataregstaterilradiotechno
logychanged Mimsphone = Phonefactory.makeimsphone (Mnotifier, this); Callmanager.getinstance (). Registerphone (Mimsphone); CallManager Add Phone Object mimsphone.registerforsilentredial (this, event_initiate_silent_red IAL, NULL); Registers a message that is processed by the class to process} else if (!mimsserviceready && (mimsphone!= null)) {Callmanager.getinsta
nCE (). Unregisterphone (Mimsphone);
Mimsphone.unregisterforsilentredial (this);
Mimsphone.dispose ();
Potential GC issue If someone keeps a reference to Imsphone. However:this change would make sure this such a reference does//not access functions through NULL POINter.
Mimsphone.removereferences ();
Mimsphone = null; Processing of event_initiate_silent_redial messages: Case EVENT_INITIATE_SILENT_REDIAL:RLOG.D (Log_tag, "Eve
NT Event_initiate_silent_redial Received ");
AR = (asyncresult) msg.obj;
if ((ar.exception = null) && (ar.result!= null)) {String dialstring = (string) Ar.result;
if (Textutils.isempty (dialstring)) return;
try {dialinternal (dialstring, NULL, videoprofile.state_audio_only, NULL);
catch (Callstateexception e) {rlog.e (Log_tag, "Silent Redial failed:" + e); }} break;
ServiceState service status, with the following printing information:
Vendor/mediatek/proprietary/frameworks/opt/tedongle/src/java/android/tedongle/servicestate.java
private void Setnullstate (int state) {
if (DBG) rlog.d (Log_tag, "[ServiceState] setnullstate=" + state);
Mvoiceregstate = State;
Mdataregstate = State;
Mvoiceroamingtype = roaming_type_not_roaming;
Mdataroamingtype = roaming_type_not_roaming;
.......
}
Setnullstate () The parameter passed in by this method is 3, and can be determined by the method call:
public void Setstateoff () {
setnullstate (state_power_off);
}
Definition of ServiceState:
/**
* Normal operation condition, the phone is registered
* With a operator either in the home network or in roaming.
*/
public static final int state_in_service = 0;
/**
* Phone is not registered with any operator, the phone
* Can is currently searching a new operator to register to, or not
* Searching to registration in all, or registration is denied, or radio
* signal is not available.
*/
public static final int state_out_of_service = 1;
/**
* The phone is registered and locked. Only emergency numbers are allowed. {@more}
*/
public static final int state_emergency_only = 2;
/**
* Radio of telephony is explicitly powered off.
*/
public static final int state_power_off = 3;
Registration message:
private void Registerindicationreceiver () {
if (DBG) log ("Registerindicationreceiver");
Intentfilter intentfilter = new Intentfilter ();
Intentfilter.addaction (imsmanager.action_ims_incoming_call_indication)//Registered call Notification
Mphone.getcontext (). Registerreceiver (Mindicationreceiver, intentfilter);
}
Notifydataregstaterilradiotechnologychanged:
In the Pollstatedone () method of the Gsmservicestatetracker class, Invoke Notifydataregstaterilradiotechnologychanged ():
if (hasdataregstatechanged | | hasrildataradiotechnologychanged) {notifydataregstaterilradiotechnology
Changed (); WLAN Judge if (Servicestate.ril_radio_technology_iwlan = = Mss.getrildataradiotechnolog
Y ()) {mphone.notifydataconnection (phone.reason_iwlan_available);
else {mphone.notifydataconnection (null); } protected void notifydataregstaterilradiotechnologychanged () {int rat = Mss.getrildataradiotech
Nology ();
int DRS = Mss.getdataregstate ();
if (DBG) log ("notifydataregstaterilradiotechnologychanged:drs=" + DRS + "rat=" + rat); Set the Telephonyproperties.property_data_network_type property Mphonebase.setsystemproperty (telephonyproperties.property_
Data_network_type, servicestate.rilradiotechnologytostring (rat)); Mdataregstateorratchangedregistrants.notifyresult (New Pair<integer, Integer> (DRS, rat)); }
Mdataregstateorratchangedregistrants the notification registration function: