diff --git a/res/values/strings.xml b/res/values/strings.xml index 6c9846d8912..e28206da8fc 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -2622,6 +2622,8 @@ Used as your location when you make an emergency call over Wi\u2011Fi Learn more about Private DNS features + + On Setting managed by carrier diff --git a/src/com/android/settings/network/PrivateDnsPreferenceController.java b/src/com/android/settings/network/PrivateDnsPreferenceController.java index 47c3a95c9fd..84cae88f856 100644 --- a/src/com/android/settings/network/PrivateDnsPreferenceController.java +++ b/src/com/android/settings/network/PrivateDnsPreferenceController.java @@ -126,11 +126,7 @@ public class PrivateDnsPreferenceController extends BasePreferenceController case PRIVATE_DNS_MODE_OFF: return res.getString(R.string.private_dns_mode_off); case PRIVATE_DNS_MODE_OPPORTUNISTIC: - // TODO (b/79122154) : create a string specifically for this, instead of - // hijacking a string from notifications. This is necessary at this time - // because string freeze is in the past and this string has the right - // content at this moment. - return dnsesResolved ? res.getString(R.string.switch_on_text) + return dnsesResolved ? res.getString(R.string.private_dns_mode_on) : res.getString(R.string.private_dns_mode_opportunistic); case PRIVATE_DNS_MODE_PROVIDER_HOSTNAME: return dnsesResolved diff --git a/tests/robotests/src/com/android/settings/network/PrivateDnsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/PrivateDnsPreferenceControllerTest.java index 15fa5de8673..efb77eba402 100644 --- a/tests/robotests/src/com/android/settings/network/PrivateDnsPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/network/PrivateDnsPreferenceControllerTest.java @@ -213,7 +213,7 @@ public class PrivateDnsPreferenceControllerTest { when(lp.getValidatedPrivateDnsServers()).thenReturn(NON_EMPTY_ADDRESS_LIST); updateLinkProperties(lp); mController.updateState(mPreference); - verify(mPreference).setSummary(getResourceString(R.string.switch_on_text)); + verify(mPreference).setSummary(getResourceString(R.string.private_dns_mode_on)); reset(mPreference); lp = mock(LinkProperties.class);