Merge "CTS: Only listen to wifi events when toggling wifi" into nyc-dev
diff --git a/tests/cts/net/src/android/net/cts/DnsTest.java b/tests/cts/net/src/android/net/cts/DnsTest.java
index c6a8962..8575c33 100644
--- a/tests/cts/net/src/android/net/cts/DnsTest.java
+++ b/tests/cts/net/src/android/net/cts/DnsTest.java
@@ -62,8 +62,8 @@
         try {
             addrs = InetAddress.getAllByName("www.google.com");
         } catch (UnknownHostException e) {}
-        assertTrue("[RERUN] DNS could not resolve www.gooogle.com. Check internet connection",
-            addrs.length != 0);
+        assertTrue("[RERUN] DNS could not resolve www.google.com. Check internet connection",
+                addrs.length != 0);
         boolean foundV4 = false, foundV6 = false;
         for (InetAddress addr : addrs) {
             if (addr instanceof Inet4Address) foundV4 = true;
@@ -71,11 +71,8 @@
             if (DBG) Log.e(TAG, "www.google.com gave " + addr.toString());
         }
 
-        // assertTrue(foundV4);
-        // assertTrue(foundV6);
-
         // We should have at least one of the addresses to connect!
-        assertTrue(foundV4 || foundV6);
+        assertTrue("www.google.com must have IPv4 and/or IPv6 address", foundV4 || foundV6);
 
         // Skip the rest of the test if the active network for watch is PROXY.
         // TODO: Check NetworkInfo type in addition to type name once ag/601257 is merged.
@@ -85,14 +82,17 @@
             return;
         }
 
+        // Clear test state so we don't get confused with the previous results.
+        addrs = new InetAddress[0];
+        foundV4 = foundV6 = false;
         try {
             addrs = InetAddress.getAllByName("ipv6.google.com");
         } catch (UnknownHostException e) {}
-        assertTrue(addrs.length != 0);
-        foundV6 = false;
+        assertTrue("[RERUN] DNS could not resolve ipv6.google.com, check the network supports IPv6",
+                addrs.length != 0);
         for (InetAddress addr : addrs) {
             assertFalse ("[RERUN] ipv6.google.com returned IPv4 address: " + addr.getHostAddress() +
-                    ", check your network's DNS connection", addr instanceof Inet4Address);
+                    ", check your network's DNS server", addr instanceof Inet4Address);
             foundV6 |= (addr instanceof Inet6Address);
             if (DBG) Log.e(TAG, "ipv6.google.com gave " + addr.toString());
         }
diff --git a/tests/cts/net/src/android/net/cts/TrafficStatsTest.java b/tests/cts/net/src/android/net/cts/TrafficStatsTest.java
index a8dd8ac..930c742 100755
--- a/tests/cts/net/src/android/net/cts/TrafficStatsTest.java
+++ b/tests/cts/net/src/android/net/cts/TrafficStatsTest.java
@@ -214,8 +214,6 @@
         long deltaRxOtherPackets = (totalRxPacketsAfter - totalRxPacketsBefore) - uidRxDeltaPackets;
         if (deltaTxOtherPackets > 0 || deltaRxOtherPackets > 0) {
             Log.i(LOG_TAG, "lingering traffic data: " + deltaTxOtherPackets + "/" + deltaRxOtherPackets);
-            // Make sure that not too many non-localhost packets are accounted for
-            assertTrue("too many non-localhost packets on the same UID", deltaTxOtherPackets + deltaRxOtherPackets < 20);
         }
 
         assertTrue("uidtxp: " + uidTxPacketsBefore + " -> " + uidTxPacketsAfter + " delta=" + uidTxDeltaPackets +