Replace useTls with mode in PrivateDnsConfig
This change is necessary for DDR. `hostname` field used to be
set only in private DNS strict mode, and private DNS mode used
to be derived from both `useTls` and `hostname` fields. This
design make DoH name impossible to be passed from DnsManager to
DnsResolver, because `hostname` is always empty in off and
opportunistic mode.
In order to pass DoH name to DnsResolver in opportunistic mode,
replace `useTls` with `mode` so that `hostname` can be set to
any string in opportunistic mode.
Bug: 240259333
Test: NetworkStackTests and CtsNetTestCasesLatestSdk passed
with 1) old NetworkStack + new Tethering modules
2) new NetworkStack + old Tethering modules
Change-Id: I63186cd96b68c63f17797b1b79ec578cb75f8533
2 files changed