Commit Graph

14 Commits

Author SHA1 Message Date
Eran Messeri
203856e444 Private DNS: Add policy transparency
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
2018-11-09 13:33:16 +00:00
Eran Messeri
7ba739ba14 Private DNS: Extract host verification code
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
2018-10-15 11:53:38 +01:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
420f385a18 Fix a incorrect type cast for alert dialog
Change-Id: I2265c4510785f88ef7950cd29779848eb2e58dc4
Fixes: 111488148
Test: manual
2018-07-16 12:23:57 -07:00
tmfang
27c84de325 Settings Fragment Migration (Build pass app)
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
2018-07-11 18:24:51 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Erik Kline
e1a5ac804d Merge "Factor in PRIVATE_DNS_MODE_DEFAULTSETTING value" into pi-dev am: 5a0a7ef4bb
am: cf83539e1e

Change-Id: Ia06f5bef6d4103cf65a2c07d8dadecfa815080f7
2018-05-23 15:59:09 -07:00
Erik Kline
aee4396874 Factor in PRIVATE_DNS_MODE_DEFAULTSETTING value
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
2018-05-22 10:52:55 +09:00
Lei Yu
7c580997be Merge "Add cancel button for private dns dialog" into pi-dev am: 7fe599f542
am: ea1d9d17d1

Change-Id: I55cab617105d21ff42ed911e6b457ec662349811
2018-05-14 15:11:36 -07:00
Lei Yu
231fe615cc Add cancel button for private dns dialog
Also update the onclick method.

Change-Id: I69e92584e056a4d0a686153315b8df002d91e204
Fixes: 79479021
Test: RunSettingsRoboTests
2018-05-14 13:12:00 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Erik Kline
85c34077d3 Display Private DNS status in preference summary
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
2018-04-08 15:50:58 -07:00
Erik Kline
6c2ad0d62d Expressly forbid IP string literals as Private DNS hostnames
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
2018-04-04 00:42:19 -07:00
Chalard Jean
42405603c7 Move the Private DNS dialog back to the top level.
Bug: 64133961
Fixes: 74844869
Test: visual test and interaction
      also updated tests and checked they pass
Change-Id: I7c8d50e5941c2a7dd46014932bdace14dc222c80
2018-04-02 09:58:12 +00:00