Use vendor record key when interacting with mVendorService

Bug: 387875371
Change-Id: Ie62ae44b88933ea1a12a2ec87c23a76c3180913c
Flag: EXEMPT bug fix
Test: Build and flash. Ensure the correct offload keys are sent to the vendorService
diff --git a/MdnsOffloadManagerService/src/com/android/tv/mdnsoffloadmanager/InterfaceOffloadManager.java b/MdnsOffloadManagerService/src/com/android/tv/mdnsoffloadmanager/InterfaceOffloadManager.java
index 8759883..efe2112 100644
--- a/MdnsOffloadManagerService/src/com/android/tv/mdnsoffloadmanager/InterfaceOffloadManager.java
+++ b/MdnsOffloadManagerService/src/com/android/tv/mdnsoffloadmanager/InterfaceOffloadManager.java
@@ -81,6 +81,17 @@
                 mOffloadIntentStore.getPassthroughIntentsForInterface(mNetworkInterface));
     }
 
+    void retrieveAndClearMetrics() {
+        if (!mIsNetworkAvailable) {
+            return;
+        }
+        if (!mOffloadWriter.isVendorServiceConnected()) {
+            Log.e(TAG, "Vendor service disconnected, cannot apply mDNS offload state");
+            return;
+        }
+        mOffloadWriter.retrieveAndClearMetrics(mCurrentOffloadKeys);
+    }
+
     private void clearProtocolResponses() {
         applyOffloadIntents(Collections.emptySet());
     }
diff --git a/MdnsOffloadManagerService/src/com/android/tv/mdnsoffloadmanager/MdnsOffloadManagerService.java b/MdnsOffloadManagerService/src/com/android/tv/mdnsoffloadmanager/MdnsOffloadManagerService.java
index df4b4d3..89bb3ec 100644
--- a/MdnsOffloadManagerService/src/com/android/tv/mdnsoffloadmanager/MdnsOffloadManagerService.java
+++ b/MdnsOffloadManagerService/src/com/android/tv/mdnsoffloadmanager/MdnsOffloadManagerService.java
@@ -462,7 +462,8 @@
                 if (Intent.ACTION_SCREEN_ON.equals(action)) {
                     Log.d(TAG, "SCREEN_ON");
                     mOffloadWriter.setOffloadState(false);
-                    mOffloadWriter.retrieveAndClearMetrics(mOffloadIntentStore.getRecordKeys());
+                    mInterfaceOffloadManagers.values().forEach(
+                            InterfaceOffloadManager::retrieveAndClearMetrics);
                 } else if (Intent.ACTION_SCREEN_OFF.equals(action)) {
                     Log.d(TAG, "SCREEN_OFF");
                     try {