From f7717f5a4f5200b0c413bbecb6fbf69df9bccdfc Mon Sep 17 00:00:00 2001 From: Mike Yu Date: Tue, 24 Nov 2020 17:31:12 +0800 Subject: Remove validation threads tracking in PrivateDnsConfiguration The validation threads tracking is not necessary since DnsTlsServer itself can provide sufficient information to PrivateDnsConfiguration to decide if a validation should start. This change comprises: [1] Remove mPrivateDnsValidateThreads and related functions [2] Extend DnsTlsServer to tell if it is a present server for a network. [3] PrivateDnsConfiguration reserves every DnsTlsServer object until being set to OFF mode or the network is destroyed. Make use of [2] to determine which servers should be active for the network. [4] DnsTlsServers with identical IP address but different private DNS provider hostname are treated as different servers, and thus they have their own validation thread. [5] Add a new state, Validation::success_but_expired, which is used to determine if a server which had passed the validation should be revalidated again. [6] To fit in with [4], some related tests are modified. Bug: 79727473 Test: cd packages/modules/DnsResolver && atest Change-Id: I78afce543ea05be39c36d268576824e9ec798b12 --- ResolverController.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ResolverController.cpp') diff --git a/ResolverController.cpp b/ResolverController.cpp index 051f095c..b7ac8eb4 100644 --- a/ResolverController.cpp +++ b/ResolverController.cpp @@ -70,6 +70,8 @@ constexpr const char* validationStatusToString(Validation value) { return "in_process"; case Validation::success: return "success"; + case Validation::success_but_expired: + return "success_but_expired"; case Validation::fail: return "fail"; case Validation::unknown_server: -- cgit v1.2.3