Disable `QuicUdpSocketTest.ReadReceiveTimestamp` for android. Before cl/583036215, the test "passes" because `__ANDROID_API__`==19 and the test early returns. After cl/583036215, the test fails because `setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING, ..)` succeeds but future `recvmsg` on the same fd won't return a CMSG with type `SO_TIMESTAMPING`. It's unclear whether this is a Android emulator problem, or a Android problem. I'm also unclear whether there are external users that depend on the android behavior(if this is a emulator-only problem), let me know your thoughts please. PiperOrigin-RevId: 597645086
diff --git a/quiche/quic/core/quic_udp_socket.cc b/quiche/quic/core/quic_udp_socket.cc index c114985..4484678 100644 --- a/quiche/quic/core/quic_udp_socket.cc +++ b/quiche/quic/core/quic_udp_socket.cc
@@ -172,7 +172,7 @@ } bool QuicUdpSocketApi::EnableReceiveTimestamp(QuicUdpSocketFd fd) { -#if defined(__linux__) && (!defined(__ANDROID_API__) || __ANDROID_API__ >= 21) +#if defined(QUIC_UDP_SOCKET_SUPPORT_LINUX_TIMESTAMPING) int timestamping = SOF_TIMESTAMPING_RX_SOFTWARE | SOF_TIMESTAMPING_SOFTWARE; return 0 == setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING, ×tamping, sizeof(timestamping));
diff --git a/quiche/quic/core/quic_udp_socket_posix.inc b/quiche/quic/core/quic_udp_socket_posix.inc index a54793a..1cbf252 100644 --- a/quiche/quic/core/quic_udp_socket_posix.inc +++ b/quiche/quic/core/quic_udp_socket_posix.inc
@@ -39,7 +39,7 @@ constexpr int kIpv6RecvPacketInfo = IPV6_RECVPKTINFO; -#if defined(__linux__) && (!defined(__ANDROID_API__) || __ANDROID_API__ >= 21) +#if defined(__linux__) && !defined(__ANDROID_API__) #define QUIC_UDP_SOCKET_SUPPORT_LINUX_TIMESTAMPING 1 // This is the structure that SO_TIMESTAMPING fills into the cmsg header. // It is well-defined, but does not have a definition in a public header.