Merge "[ApnEditor] Create another string id for translation" into sc-dev

This commit is contained in:
Tom Hsu
2021-04-29 09:16:20 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 2 deletions

View File

@@ -3768,6 +3768,8 @@
<string name="apn_edit">Edit access point</string> <string name="apn_edit">Edit access point</string>
<!-- Edit access point label summary text when no value has been set --> <!-- Edit access point label summary text when no value has been set -->
<string name="apn_not_set">Not set</string> <string name="apn_not_set">Not set</string>
<!-- Edit access point label summary text when no value has been set for mvno value. [CHAR LIMIT=NONE]-->
<string name="apn_not_set_for_mvno">Not set</string>
<!-- Edit access point labels: A label the user can give to the APN to allow him to differentiate it from the others --> <!-- Edit access point labels: A label the user can give to the APN to allow him to differentiate it from the others -->
<string name="apn_name">Name</string> <string name="apn_name">Name</string>
<!-- Edit access point labels: The actual access point name--> <!-- Edit access point labels: The actual access point name-->

View File

@@ -632,7 +632,7 @@ public class ApnEditor extends SettingsPreferenceFragment
checkNull(bearerMultiDescription(mBearerMulti.getValues()))); checkNull(bearerMultiDescription(mBearerMulti.getValues())));
mMvnoType.setSummary( mMvnoType.setSummary(
checkNull(mvnoDescription(mMvnoType.getValue()))); checkNull(mvnoDescription(mMvnoType.getValue())));
mMvnoMatchData.setSummary(checkNull(mMvnoMatchData.getText())); mMvnoMatchData.setSummary(checkNullforMvnoValue(mMvnoMatchData.getText()));
// allow user to edit carrier_enabled for some APN // allow user to edit carrier_enabled for some APN
final boolean ceEditable = getResources().getBoolean( final boolean ceEditable = getResources().getBoolean(
R.bool.config_allow_edit_carrier_enabled); R.bool.config_allow_edit_carrier_enabled);
@@ -791,7 +791,7 @@ public class ApnEditor extends SettingsPreferenceFragment
} }
mMvnoType.setValue((String) newValue); mMvnoType.setValue((String) newValue);
mMvnoType.setSummary(mvno); mMvnoType.setSummary(mvno);
mMvnoMatchData.setSummary(checkNull(mMvnoMatchData.getText())); mMvnoMatchData.setSummary(checkNullforMvnoValue(mMvnoMatchData.getText()));
} else if (KEY_PASSWORD.equals(key)) { } else if (KEY_PASSWORD.equals(key)) {
mPassword.setSummary(starify(newValue != null ? String.valueOf(newValue) : "")); mPassword.setSummary(starify(newValue != null ? String.valueOf(newValue) : ""));
} else if (KEY_CARRIER_ENABLED.equals(key)) { } else if (KEY_CARRIER_ENABLED.equals(key)) {
@@ -1216,6 +1216,14 @@ public class ApnEditor extends SettingsPreferenceFragment
return TextUtils.isEmpty(value) ? sNotSet : value; return TextUtils.isEmpty(value) ? sNotSet : value;
} }
/**
* To make traslation be diversity, use another string id for MVNO value.
*/
private String checkNullforMvnoValue(String value) {
String notSetForMvnoValue = getResources().getString(R.string.apn_not_set_for_mvno);
return TextUtils.isEmpty(value) ? notSetForMvnoValue : value;
}
/** /**
* Returns null if the given string {@code value} equals to {@link #sNotSet}. This method * Returns null if the given string {@code value} equals to {@link #sNotSet}. This method
* should be used when convert a string value from preference to database. * should be used when convert a string value from preference to database.