When the Private DNS setting is disabled via a user restriction, show
information to the user explaining that they cannot change this setting
due to IT admin policy.
Testing steps:
* Installed & configured TestDPC on the device.
* Made sure that the Private DNS setting is usable.
* Set the user restriction via TestDPC ("User Restrictions" -> "Disallow
config Private DNS").
* Navigated to Settings -> Network & Internet -> Advanced
* Observed that Private DNS is greyed out and the Restricted icon is
showing.
* Observed that when tapping either the icon or the greyed-out text I
get a dialog with policy information.
Implementation notes:
I have not utilized the existing RestrictedPreference as the Private DNS
mode preference extends CustomDialogPreferenceCompat.
I have also not utilized the RestrictedPreferenceHelper as it modifies
the summary shown for the preference. This preference has its own
summary (showing the current state of Private DNS configuration) which I
did not want to override.
Bug: 112982691
Test: Manual, see above.
Change-Id: I9b7496b5b2cbb26012d889369f2199239cd2e00f
Since Private DNS host may now be set by the admin via the
DevicePolicyManager, extract the verification code to the
ConnectivityManager so it can be used both from Settings and framework
code.
Bug: 112982691
Test: See cts tests.
Change-Id: Ic091e4714f8d3f9f28042bc825cf57c991504f27
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
This patch focused on fixing compile errors and some runtime errors.
Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
This setting can be used to change the in-code default.
Test: as follows
- built, flashed, booted
- make -j50 RunSettingsRoboTests ROBOTEST_FILTER=PrivateDnsModeDialogPreferenceTest passes
- make -j50 RunSettingsRoboTests ROBOTEST_FILTER=PrivateDnsPreferenceControllerTest passes
Bug: 79719289
Change-Id: I27e5fb9cc66dde1df72395c22179bca3f62ef782
Also: fix a bug where the actual current mode is not read correctly
from settings on initialization.
Test: as follows
- built, flashed, booted
- manual test behaves as expected
- make -j50 RunSettingsRoboTests ROBOTEST_FILTER=PrivateDnsModeDialogPreferenceTest passes
- make -j50 RunSettingsRoboTests ROBOTEST_FILTER=PrivateDnsPreferenceControllerTest passes
Bug: 34953048
Bug: 64133961
Change-Id: I0b845b3894a47b837abf5de273d1ada642ef5a23
For obvious bootstrapping reasons, DNS settings have always used
IP address string literals in input fields.
However, since we can use the network-assigned nameservers to bootstrap
our way to multiple IP addresses of multiple families (!), hostnames
provide a clear simplicity and future-proofing advantage.
Permitting IP address literals means not only making sure that we can
validate X.509v3 certificates for IP addresses, but coping with the
inevitable broken configurations where users may have configured IPv4
addresses but no IPv6 addresses. This will unnecessarily complicate
life on IPv6-only networks.
=)
Test: as follows
- built
- flashed
- booted
- tried to enter IP string literals
- make -j50 RunSettingsRoboTests ROBOTEST_FILTER=PrivateDnsModeDialogPreferenceTest
Bug: 34953048
Bug: 64133961
Bug: 73641539
Change-Id: I7a58e86ed640ff5600906fb3d8cb9a2c75598831
Bug: 64133961
Fixes: 74844869
Test: visual test and interaction
also updated tests and checked they pass
Change-Id: I7c8d50e5941c2a7dd46014932bdace14dc222c80