Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29505cb6 authored by Mike Yu's avatar Mike Yu
Browse files

Slightly improve isDoHEnabled()

DnsResolver doesn't need to check SDK level more than once.

Bug: 200763585
Test: built dnsresolver passed
Change-Id: I7e113a9b4d941dbe278fbeaa84953ac12a778de0
parent b39686b4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -62,7 +62,8 @@ inline bool isUserDebugBuild() {

inline bool isDoHEnabled() {
    // STOPSHIP(b/200763585): clean up it before T shipping.
    if (android::modules::sdklevel::IsAtLeastT()) return 1;
    static bool isAtLeastT = android::modules::sdklevel::IsAtLeastT();
    if (isAtLeastT) return 1;

    return android::net::Experiments::getInstance()->getFlag("doh", 0);
}