Apply PrivateDnsValidationObserver to DnsTlsDispatcher

Also aligh the life time of DnsTlsDispatcher with
PrivateDnsConfiguration's so that the DnsTlsDispatcher won't miss
any notification.

Bug: 79727473
Test: cd packages/modules/DnsResolver && atest with the flag on/off
Change-Id: Iaf1c809b79373b6846e6535aa6f0c619f430898c
diff --git a/PrivateDnsConfiguration.h b/PrivateDnsConfiguration.h
index 4a32def..3ed62b7 100644
--- a/PrivateDnsConfiguration.h
+++ b/PrivateDnsConfiguration.h
@@ -86,6 +86,8 @@
         }
     };
 
+    void setObserver(PrivateDnsValidationObserver* observer);
+
   private:
     typedef std::map<ServerIdentity, DnsTlsServer> PrivateDnsTracker;
     typedef std::set<DnsTlsServer, AddressComparator> ThreadTracker;
@@ -114,7 +116,6 @@
     // Any pending validation threads will continue running because we have no way to cancel them.
     std::map<unsigned, PrivateDnsTracker> mPrivateDnsTransports GUARDED_BY(mPrivateDnsLock);
 
-    void setObserver(PrivateDnsValidationObserver* observer);
     void notifyValidationStateUpdate(const std::string& serverIp, Validation validation,
                                      uint32_t netId) const REQUIRES(mPrivateDnsLock);