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

Commit d2c01314 authored by Luke Huang's avatar Luke Huang
Browse files

Refine AIDL constant definition for TC_MODE_*

Address comments in AIDL API review before AIDL freezing.

Bug: 151074535
Bug: 133526962
Test: atest
Change-Id: Iaf5e233666b9a05a86d4951a751145a8e94cb94b
parent 6ae9616b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ interface IDnsResolver {
  const int DNS_RESOLVER_LOG_ERROR = 4;
  const int TC_MODE_DEFAULT = 0;
  const int TC_MODE_UDP_TCP = 1;
  const int TC_MODE_MAX = 2;
  const int TRANSPORT_UNKNOWN = -1;
  const int TRANSPORT_CELLULAR = 0;
  const int TRANSPORT_WIFI = 1;
+0 −2
Original line number Diff line number Diff line
@@ -177,11 +177,9 @@ interface IDnsResolver {
     *
     * TC_MODE_DEFAULT: resolver retries on TCP-only on each name server.
     * TC_MODE_UDP_TCP: resolver retries on TCP on the same server, falls back to UDP from next.
     * TC_MODE_MAX: any value smaller than TC_MODE_DEFAULT or greater than TC_MODE_MAX is invalid.
     */
    const int TC_MODE_DEFAULT = 0;
    const int TC_MODE_UDP_TCP = 1;
    const int TC_MODE_MAX = 2;

    /**
     * Values for {@code transportTypes} of {@code ResolverParamsParcel}. These values are
+3 −2
Original line number Diff line number Diff line
@@ -1643,8 +1643,9 @@ int resolv_set_nameservers(
    }

    if (experimentalOptions.tcMode < aidl::android::net::IDnsResolver::TC_MODE_DEFAULT ||
        experimentalOptions.tcMode >= aidl::android::net::IDnsResolver::TC_MODE_MAX) {
        LOG(WARNING) << __func__ << ": netid = " << netid << ", invalid TC mode";
        experimentalOptions.tcMode > aidl::android::net::IDnsResolver::TC_MODE_UDP_TCP) {
        LOG(WARNING) << __func__ << ": netid = " << netid
                     << ", invalid TC mode: " << experimentalOptions.tcMode;
        return -EINVAL;
    }
    netconfig->tc_mode = experimentalOptions.tcMode;