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

Commit ca86050d authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6721158 from f6e70ee9 to sc-release

Change-Id: Ia28815382f510aa5d4e3521c4eecbda23675bee5
parents 0459aa3e f6e70ee9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -31,10 +31,12 @@ bool resolv_init(const ResolverNetdCallbacks* callbacks) {
    resolv_set_log_severity(android::base::WARNING);

    uint64_t buildVersionSdk = android::base::GetUintProperty<uint64_t>("ro.build.version.sdk", 0);
    uint64_t buildVersionPreviewSdk =
            android::base::GetUintProperty<uint64_t>("ro.build.version.preview_sdk", 0);
    uint64_t firstApiLevel =
            android::base::GetUintProperty<uint64_t>("ro.product.first_api_level", 0);
    using android::net::gApiLevel;
    gApiLevel = std::max(buildVersionSdk, firstApiLevel);
    gApiLevel = std::max(buildVersionSdk + !!buildVersionPreviewSdk, firstApiLevel);
    using android::net::gResNetdCallbacks;
    gResNetdCallbacks.check_calling_permission = callbacks->check_calling_permission;
    gResNetdCallbacks.get_network_context = callbacks->get_network_context;
+1 −1
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ char* DNSName::write(char* buffer, const char* buffer_end) const {
    for (size_t pos = 0; pos < name.size();) {
        size_t dot_pos = name.find('.', pos);
        if (dot_pos == std::string::npos) {
            // Sanity check, should never happen unless parseField is broken.
            // Soundness check, should never happen unless parseField is broken.
            LOG(ERROR) << "logic error: all names are expected to end with a '.'";
            return nullptr;
        }
+6 −6
Original line number Diff line number Diff line
@@ -469,7 +469,7 @@ TEST_F(ResolverTest, GetHostByName_localhost) {
    constexpr char name_ip6_dot[] = "ip6-localhost.";
    constexpr char name_ip6_fqdn[] = "ip6-localhost.example.com.";

    // Add a dummy nameserver which shouldn't receive any queries
    // Add a no-op nameserver which shouldn't receive any queries
    test::DNSResponder dns;
    StartDns(dns, {});
    ASSERT_TRUE(mDnsClient.SetResolversForNetwork());
@@ -518,7 +518,7 @@ TEST_F(ResolverTest, GetHostByName_localhost) {
}

TEST_F(ResolverTest, GetHostByName_numeric) {
    // Add a dummy nameserver which shouldn't receive any queries
    // Add a no-op nameserver which shouldn't receive any queries
    test::DNSResponder dns;
    StartDns(dns, {});
    ASSERT_TRUE(mDnsClient.SetResolversForNetwork());
@@ -699,7 +699,7 @@ TEST_F(ResolverTest, GetAddrInfoV4) {
}

TEST_F(ResolverTest, GetAddrInfo_localhost) {
    // Add a dummy nameserver which shouldn't receive any queries
    // Add a no-op nameserver which shouldn't receive any queries
    test::DNSResponder dns;
    StartDns(dns, {});
    ASSERT_TRUE(mDnsClient.SetResolversForNetwork());
@@ -2048,8 +2048,8 @@ int getAsyncResponse(int fd, int* rcode, uint8_t* buf, int bufLen) {
    if (revents & POLLIN) {
        int n = resNetworkResult(fd, rcode, buf, bufLen);
        // Verify that resNetworkResult() closed the fd
        char dummy;
        EXPECT_EQ(-1, read(fd, &dummy, sizeof dummy));
        char unused;
        EXPECT_EQ(-1, read(fd, &unused, sizeof unused));
        EXPECT_EQ(EBADF, errno);
        return n;
    }
@@ -5269,7 +5269,7 @@ class ResolverMultinetworkTest : public ResolverTest {
  private:
    // Use a different netId because this class inherits from the class ResolverTest which
    // always creates TEST_NETID in setup. It's incremented when CreateScopedNetwork() is called.
    // Note: Don't create more than 20 networks in the class since 51 is used for the dummy network.
    // Note: Don't create more than 20 networks in the class since 51 is used for the mock network.
    unsigned mNextNetId = 31;
};