Merge "Add a button to enable/disable Mobile Terminated SMS over IMS" into ics-factoryrom
This commit is contained in:
@@ -204,6 +204,14 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- SMS over IMS -->
|
||||||
|
<Button android:id="@+id/sms_over_ims"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:layout_marginTop="8dip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- SMSC -->
|
<!-- SMSC -->
|
||||||
<RelativeLayout android:layout_width="match_parent"
|
<RelativeLayout android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
@@ -40,8 +40,12 @@
|
|||||||
<!-- Phone Info screen. Button label to turn off the radio . Only shown in diagnostic screen, so precise translation is not needed. -->
|
<!-- Phone Info screen. Button label to turn off the radio . Only shown in diagnostic screen, so precise translation is not needed. -->
|
||||||
<string name="turn_off_radio">Turn off radio</string>
|
<string name="turn_off_radio">Turn off radio</string>
|
||||||
|
|
||||||
<!-- Phone info -->
|
<!-- Phone SMS over IMS on. Only shown in diagnostic screen, so precise translation is not needed. -->
|
||||||
<!-- Phone IMS registration required on. Only shown in diagnostic screen, so precise translation is not needed. -->
|
<string name="sms_over_ims_on">Turn on SMS over IMS</string>
|
||||||
|
<!-- Phone SMS over IMS off. Only shown in diagnostic screen, so precise translation is not needed. -->
|
||||||
|
<string name="sms_over_ims_off">Turn off SMS over IMS</string>
|
||||||
|
|
||||||
|
<!-- Phone SMS over IMS IMS registration required on. Only shown in diagnostic screen, so precise translation is not needed. -->
|
||||||
<string name="ims_reg_required_on">Turn on IMS registration required</string>
|
<string name="ims_reg_required_on">Turn on IMS registration required</string>
|
||||||
<!-- Phone IMS registration required off. Only shown in diagnostic screen, so precise translation is not needed. -->
|
<!-- Phone IMS registration required off. Only shown in diagnostic screen, so precise translation is not needed. -->
|
||||||
<string name="ims_reg_required_off">Turn off IMS registration required</string>
|
<string name="ims_reg_required_off">Turn off IMS registration required</string>
|
||||||
|
@@ -124,6 +124,7 @@ public class RadioInfo extends Activity {
|
|||||||
private EditText smsc;
|
private EditText smsc;
|
||||||
private Button radioPowerButton;
|
private Button radioPowerButton;
|
||||||
private Button imsRegRequiredButton;
|
private Button imsRegRequiredButton;
|
||||||
|
private Button smsOverImsButton;
|
||||||
private Button dnsCheckToggleButton;
|
private Button dnsCheckToggleButton;
|
||||||
private Button pingTestButton;
|
private Button pingTestButton;
|
||||||
private Button updateSmscButton;
|
private Button updateSmscButton;
|
||||||
@@ -286,6 +287,9 @@ public class RadioInfo extends Activity {
|
|||||||
imsRegRequiredButton = (Button) findViewById(R.id.ims_reg_required);
|
imsRegRequiredButton = (Button) findViewById(R.id.ims_reg_required);
|
||||||
imsRegRequiredButton.setOnClickListener(mImsRegRequiredHandler);
|
imsRegRequiredButton.setOnClickListener(mImsRegRequiredHandler);
|
||||||
|
|
||||||
|
smsOverImsButton = (Button) findViewById(R.id.sms_over_ims);
|
||||||
|
smsOverImsButton.setOnClickListener(mSmsOverImsHandler);
|
||||||
|
|
||||||
pingTestButton = (Button) findViewById(R.id.ping_test);
|
pingTestButton = (Button) findViewById(R.id.ping_test);
|
||||||
pingTestButton.setOnClickListener(mPingButtonHandler);
|
pingTestButton.setOnClickListener(mPingButtonHandler);
|
||||||
updateSmscButton = (Button) findViewById(R.id.update_smsc);
|
updateSmscButton = (Button) findViewById(R.id.update_smsc);
|
||||||
@@ -332,6 +336,7 @@ public class RadioInfo extends Activity {
|
|||||||
updateDataStats2();
|
updateDataStats2();
|
||||||
updatePowerState();
|
updatePowerState();
|
||||||
updateImsRegRequiredState();
|
updateImsRegRequiredState();
|
||||||
|
updateSmsOverImsState();
|
||||||
updateProperties();
|
updateProperties();
|
||||||
updateDnsCheckState();
|
updateDnsCheckState();
|
||||||
|
|
||||||
@@ -420,6 +425,18 @@ public class RadioInfo extends Activity {
|
|||||||
imsRegRequiredButton.setText(buttonText);
|
imsRegRequiredButton.setText(buttonText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isSmsOverImsEnabled() {
|
||||||
|
return SystemProperties.getBoolean(PROPERTY_SMS_OVER_IMS, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateSmsOverImsState() {
|
||||||
|
Log.d(TAG, "updateSmsOverImsState isSmsOverImsEnabled()=" + isSmsOverImsEnabled());
|
||||||
|
String buttonText = isSmsOverImsEnabled() ?
|
||||||
|
getString(R.string.sms_over_ims_off) :
|
||||||
|
getString(R.string.sms_over_ims_on);
|
||||||
|
smsOverImsButton.setText(buttonText);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void updateDnsCheckState() {
|
private void updateDnsCheckState() {
|
||||||
dnsCheckState.setText(phone.isDnsCheckDisabled() ?
|
dnsCheckState.setText(phone.isDnsCheckDisabled() ?
|
||||||
@@ -907,6 +924,18 @@ public class RadioInfo extends Activity {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static final String PROPERTY_SMS_OVER_IMS = "persist.radio.imsallowmtsms";
|
||||||
|
OnClickListener mSmsOverImsHandler = new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Log.d(TAG, String.format("toggle %s: currently %s",
|
||||||
|
PROPERTY_SMS_OVER_IMS, (isSmsOverImsEnabled() ? "on":"off")));
|
||||||
|
boolean newValue = !isSmsOverImsEnabled();
|
||||||
|
SystemProperties.set(PROPERTY_SMS_OVER_IMS, newValue ? "1":"0");
|
||||||
|
updateSmsOverImsState();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
OnClickListener mDnsCheckButtonHandler = new OnClickListener() {
|
OnClickListener mDnsCheckButtonHandler = new OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
phone.disableDnsCheck(!phone.isDnsCheckDisabled());
|
phone.disableDnsCheck(!phone.isDnsCheckDisabled());
|
||||||
|
Reference in New Issue
Block a user