From 2685014bf7379ec19bbf516476af4549f40af611 Mon Sep 17 00:00:00 2001 From: Junyu Lai Date: Wed, 26 Feb 2025 13:25:11 +0800 Subject: [PATCH] Invoke tcpdump with -l Currently ConnectivityDiagnosticsCollector invokes tcpdump with -U, which would causes the collector failed to log ending packets due to packet buffering. Test: android.net.cts.TrafficStatsTest#testTrafficStatsForLocalhost Bug: 393471251 Change-Id: Ibe2977097bdeeef9546ce9c83b1dfd695c31f6d1 --- .../com/android/testutils/ConnectivityDiagnosticsCollector.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staticlibs/testutils/devicetests/com/android/testutils/ConnectivityDiagnosticsCollector.kt b/staticlibs/testutils/devicetests/com/android/testutils/ConnectivityDiagnosticsCollector.kt index 4b9429b34a..8a255c6447 100644 --- a/staticlibs/testutils/devicetests/com/android/testutils/ConnectivityDiagnosticsCollector.kt +++ b/staticlibs/testutils/devicetests/com/android/testutils/ConnectivityDiagnosticsCollector.kt @@ -224,7 +224,7 @@ class ConnectivityDiagnosticsCollector : BaseMetricListener() { // Echo the current pid, and replace it (with exec) with the tcpdump process, so the // tcpdump pid is known. writer.write( - "echo $$; exec su 0 tcpdump -n -i any -U -xx".encodeToByteArray() + "echo $$; exec su 0 tcpdump -n -i any -l -xx".encodeToByteArray() ) } val reader = FileReader(stdout.fileDescriptor).buffered()