Add Button to *#*#INFO#*#* for ims registration.
For testing add a button to toggle SystemProperty persist.radio.imsregrequired Bug: 5337311 Change-Id: Id2d8ffa4c67992245d80b0ccafb6ed719fa749cc
This commit is contained in:
@@ -196,6 +196,14 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- IMS registration required -->
|
||||||
|
<Button android:id="@+id/ims_reg_required"
|
||||||
|
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,6 +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 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>
|
||||||
|
<!-- 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>
|
||||||
|
|
||||||
<!-- Phone Info screen. Menu item label. Used for diagnostic info screens, precise translation isn't needed -->
|
<!-- Phone Info screen. Menu item label. Used for diagnostic info screens, precise translation isn't needed -->
|
||||||
<string name="radioInfo_menu_viewADN">View SIM address book</string>
|
<string name="radioInfo_menu_viewADN">View SIM address book</string>
|
||||||
<!-- Phone Info screen. Menu item label. Used for diagnostic info screens, precise translation isn't needed -->
|
<!-- Phone Info screen. Menu item label. Used for diagnostic info screens, precise translation isn't needed -->
|
||||||
|
@@ -123,6 +123,7 @@ public class RadioInfo extends Activity {
|
|||||||
private TextView dnsCheckState;
|
private TextView dnsCheckState;
|
||||||
private EditText smsc;
|
private EditText smsc;
|
||||||
private Button radioPowerButton;
|
private Button radioPowerButton;
|
||||||
|
private Button imsRegRequiredButton;
|
||||||
private Button dnsCheckToggleButton;
|
private Button dnsCheckToggleButton;
|
||||||
private Button pingTestButton;
|
private Button pingTestButton;
|
||||||
private Button updateSmscButton;
|
private Button updateSmscButton;
|
||||||
@@ -282,6 +283,9 @@ public class RadioInfo extends Activity {
|
|||||||
radioPowerButton = (Button) findViewById(R.id.radio_power);
|
radioPowerButton = (Button) findViewById(R.id.radio_power);
|
||||||
radioPowerButton.setOnClickListener(mPowerButtonHandler);
|
radioPowerButton.setOnClickListener(mPowerButtonHandler);
|
||||||
|
|
||||||
|
imsRegRequiredButton = (Button) findViewById(R.id.ims_reg_required);
|
||||||
|
imsRegRequiredButton.setOnClickListener(mImsRegRequiredHandler);
|
||||||
|
|
||||||
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);
|
||||||
@@ -327,6 +331,7 @@ public class RadioInfo extends Activity {
|
|||||||
updateDataStats();
|
updateDataStats();
|
||||||
updateDataStats2();
|
updateDataStats2();
|
||||||
updatePowerState();
|
updatePowerState();
|
||||||
|
updateImsRegRequiredState();
|
||||||
updateProperties();
|
updateProperties();
|
||||||
updateDnsCheckState();
|
updateDnsCheckState();
|
||||||
|
|
||||||
@@ -403,6 +408,19 @@ public class RadioInfo extends Activity {
|
|||||||
radioPowerButton.setText(buttonText);
|
radioPowerButton.setText(buttonText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isImsRegRequired() {
|
||||||
|
return SystemProperties.getBoolean(TelephonyProperties.PROPERTY_IMS_REG_REQUIRED, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateImsRegRequiredState() {
|
||||||
|
Log.d(TAG, "updateImsRegRequiredState isImsRegRequired()=" + isImsRegRequired());
|
||||||
|
String buttonText = isImsRegRequired() ?
|
||||||
|
getString(R.string.ims_reg_required_off) :
|
||||||
|
getString(R.string.ims_reg_required_on);
|
||||||
|
imsRegRequiredButton.setText(buttonText);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void updateDnsCheckState() {
|
private void updateDnsCheckState() {
|
||||||
dnsCheckState.setText(phone.isDnsCheckDisabled() ?
|
dnsCheckState.setText(phone.isDnsCheckDisabled() ?
|
||||||
"0.0.0.0 allowed" :"0.0.0.0 not allowed");
|
"0.0.0.0 allowed" :"0.0.0.0 not allowed");
|
||||||
@@ -877,6 +895,18 @@ public class RadioInfo extends Activity {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
OnClickListener mImsRegRequiredHandler = new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Log.d(TAG, String.format("toggle %s: currently %s",
|
||||||
|
TelephonyProperties.PROPERTY_IMS_REG_REQUIRED, (isImsRegRequired() ? "on":"off")));
|
||||||
|
boolean newValue = !isImsRegRequired();
|
||||||
|
SystemProperties.set(TelephonyProperties.PROPERTY_IMS_REG_REQUIRED,
|
||||||
|
newValue ? "1":"0");
|
||||||
|
updateImsRegRequiredState();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
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