4.3
One
Status bar Mobile Data shortcut switch: When you turn on airplane mode or power off, the mobile data state is the opposite of the previous, but moving the data switch from other parts of the system will not work like this.
Analyze the mobile data status update processing, find the place to change its value (find radio log), compare the rest of the system with the status bar on the bottom radio log of its operation to determine the difference; imitate the correct code processing place on the status bar mobile data switch to operate
1>: Mobile data is ultimately frameworks/opt/telephony-msim/frameworks/src/com/codeaurora/internal/telephony/ Msimphonefactory.java is assigned to the inside.
Settings.Global.putInt (Scontext.getcontentresolver (), Settings.Global.MOBILE_DATA, enabled 1:0);
RLOG.D (Log_tag, "set Mobile_data:" + enabled);
2>:LOG.W ("Quicksettingsmodel", New NullPointerException ());
3>:ADB logcat-b radio-v Time >d:radio.txt
Two
Mobile data switch in the settings:
Packages/apps/settings/settings. Java:
Mdataenabler = new Dataenabler (context, new Switch (context));
Implemented through Dataenabler.java, listening to the state and changing:
Private Oncheckedchangelistener mdataenabledlistener= New Oncheckedchangelistener () {
@Override
public void OnCheckedChanged (Compoundbutton buttonview, Boolean isChecked) {
mmobiledataenabled = mconnservice.getmobiledataenabled ();
if (mmobiledataenabled! = mswitch.ischecked ()) {
Mconnservice.setmobiledataenabled (isChecked);
for (int i = 0; i < max_phone_count_tri_sim;i++) {
Settings.Global.putInt (Mcontext.getcontentresolver (),
Settings.Global.MOBILE_DATA + I, isChecked? 1:0);
}
}
}
};
In addition, the insertion of the SIM card settings in the "Traffic usage" of the corresponding Activity:DataUsageSummary.java, which also has the mobile data switch assignment processing; Similar settings for the "mobile data" switch