Clear all APF memory in testDropPingReply() in preparing stage

Modified testDropPingReply() to clear the entire APF memory instead of
only the first byte.  This addresses a known firmware issue with
handling programs smaller than 8 bytes.

Bug: 339147921
Test: TH
(cherry picked from https://android-review.googlesource.com/q/commit:e749694eb49fa74236d2388faeafd04c725fb461)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a6154578d261582be941f256c2eeeccd305aa65a)
Merged-In: I651dae8c9daac24b195196c03b54e69a757de8a7
Change-Id: I651dae8c9daac24b195196c03b54e69a757de8a7
diff --git a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
index d233fee..764f117 100644
--- a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
+++ b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
@@ -420,8 +420,7 @@
         assumeApfVersionSupportAtLeast(4)
 
         // clear any active APF filter
-        var gen = ApfV4Generator(4).addPass()
-        installProgram(gen.generate())
+        clearApfMemory()
         readProgram() // wait for install completion
 
         // Assert that initial ping does not get filtered.
@@ -435,7 +434,7 @@
         assertThat(packetReader.expectPingReply()).isEqualTo(data)
 
         // Generate an APF program that drops the next ping
-        gen = ApfV4Generator(4)
+        val gen = ApfV4Generator(4)
 
         // If not ICMPv6 Echo Reply -> PASS
         gen.addPassIfNotIcmpv6EchoReply()