diff --git a/service/src/com/android/car/hal/VmsHalService.java b/service/src/com/android/car/hal/VmsHalService.java
index eaaecc2..1f6c2e2 100644
--- a/service/src/com/android/car/hal/VmsHalService.java
+++ b/service/src/com/android/car/hal/VmsHalService.java
@@ -39,6 +39,7 @@
 import android.hardware.automotive.vehicle.V2_0.VmsMessageWithLayerAndPublisherIdIntegerValuesIndex;
 import android.hardware.automotive.vehicle.V2_0.VmsMessageWithLayerIntegerValuesIndex;
 import android.hardware.automotive.vehicle.V2_0.VmsOfferingMessageIntegerValuesIndex;
+import android.hardware.automotive.vehicle.V2_0.VmsPublisherInformationIntegerValuesIndex;
 import android.os.Handler;
 import android.os.HandlerThread;
 import android.os.IBinder;
@@ -315,6 +316,11 @@
                     case VmsMessageType.UNSUBSCRIBE_TO_PUBLISHER:
                         handleUnsubscribeFromPublisherEvent(vec);
                         break;
+                    case VmsMessageType.PUBLISHER_ID_REQUEST:
+                        handlePublisherIdRequest(toByteArray(v.value.bytes));
+                        break;
+                    case VmsMessageType.PUBLISHER_INFORMATION_REQUEST:
+                        handlePublisherInfoRequest(vec);
                     case VmsMessageType.OFFERING:
                         handleOfferingEvent(vec);
                         break;
@@ -429,6 +435,57 @@
     }
 
     /**
+     * PUBLISHER_ID_REQUEST message format:
+     * <ul>
+     * <li>Message type
+     * <li>Publisher info (bytes)
+     * </ul>
+     *
+     * PUBLISHER_ID_RESPONSE message format:
+     * <ul>
+     * <li>Message type
+     * <li>Publisher ID
+     * </ul>
+     */
+    private void handlePublisherIdRequest(byte[] payload)
+            throws RemoteException {
+        if (DBG) Log.d(TAG, "Handling a publisher id request event");
+
+        VehiclePropValue vehicleProp = createVmsMessage(VmsMessageType.PUBLISHER_ID_RESPONSE);
+        // Publisher ID
+        vehicleProp.value.int32Values.add(mPublisherService.getPublisherId(payload));
+
+        setPropertyValue(vehicleProp);
+    }
+
+
+    /**
+     * PUBLISHER_INFORMATION_REQUEST message format:
+     * <ul>
+     * <li>Message type
+     * <li>Publisher ID
+     * </ul>
+     *
+     * PUBLISHER_INFORMATION_RESPONSE message format:
+     * <ul>
+     * <li>Message type
+     * <li>Publisher info (bytes)
+     * </ul>
+     */
+    private void handlePublisherInfoRequest(List<Integer> message)
+            throws RemoteException {
+        if (DBG) Log.d(TAG, "Handling a publisher info request event");
+        int publisherId = message.get(VmsPublisherInformationIntegerValuesIndex.PUBLISHER_ID);
+
+        VehiclePropValue vehicleProp =
+                createVmsMessage(VmsMessageType.PUBLISHER_INFORMATION_RESPONSE);
+        // Publisher Info
+        appendBytes(vehicleProp.value.bytes, mSubscriberService.getPublisherInfo(publisherId));
+
+        setPropertyValue(vehicleProp);
+    }
+
+    /**
      * OFFERING message format:
      * <ul>
      * <li>Message type
@@ -555,11 +612,7 @@
         message.add(publisherId);
 
         // Payload
-        ArrayList<Byte> messagePayload = vehicleProp.value.bytes;
-        messagePayload.ensureCapacity(payload.length);
-        for (byte b : payload) {
-            messagePayload.add(b);
-        }
+        appendBytes(vehicleProp.value.bytes, payload);
         return vehicleProp;
     }
 
@@ -713,6 +766,13 @@
         }
     }
 
+    private static void appendBytes(ArrayList<Byte> dst, byte[] src) {
+        dst.ensureCapacity(src.length);
+        for (byte b : src) {
+            dst.add(b);
+        }
+    }
+
     private static VmsLayer parseVmsLayerFromMessage(List<Integer> message) {
         return parseVmsLayerAtIndex(message,
                 VmsMessageWithLayerIntegerValuesIndex.LAYER_TYPE);
diff --git a/tests/carservice_unit_test/src/com/android/car/hal/VmsHalServiceTest.java b/tests/carservice_unit_test/src/com/android/car/hal/VmsHalServiceTest.java
index 603b329..baaab26 100644
--- a/tests/carservice_unit_test/src/com/android/car/hal/VmsHalServiceTest.java
+++ b/tests/carservice_unit_test/src/com/android/car/hal/VmsHalServiceTest.java
@@ -63,8 +63,7 @@
     private static final VmsLayer LAYER = new VmsLayer(LAYER_TYPE, LAYER_SUBTYPE, LAYER_VERSION);
     private static final int PUBLISHER_ID = 12345;
     private static final byte[] PAYLOAD = new byte[]{1, 2, 3, 4};
-    private static final List<Byte> PAYLOAD_AS_LIST = Arrays.asList(
-            new Byte[]{1, 2, 3, 4});
+    private static final List<Byte> PAYLOAD_AS_LIST = Arrays.asList(new Byte[]{1, 2, 3, 4});
 
     @Rule
     public MockitoRule mockito = MockitoJUnit.rule();
@@ -233,6 +232,68 @@
     }
 
     /**
+     * PUBLISHER_ID_REQUEST message format:
+     * <ul>
+     * <li>Message type
+     * <li>Publisher info (bytes)
+     * </ul>
+     *
+     * PUBLISHER_ID_RESPONSE message format:
+     * <ul>
+     * <li>Message type
+     * <li>Publisher ID
+     * </ul>
+     */
+    @Test
+    public void testHandlePublisherIdRequestEvent() throws Exception {
+        VehiclePropValue request = createHalMessage(
+                VmsMessageType.PUBLISHER_ID_REQUEST  // Message type
+        );
+        request.value.bytes.addAll(PAYLOAD_AS_LIST);
+
+        when(mPublisherService.getPublisherId(PAYLOAD)).thenReturn(PUBLISHER_ID);
+
+        VehiclePropValue response = createHalMessage(
+                VmsMessageType.PUBLISHER_ID_RESPONSE,  // Message type
+                PUBLISHER_ID                           // Publisher ID
+        );
+
+        sendHalMessage(request);
+        verify(mVehicleHal).set(response);
+    }
+
+    /**
+     * PUBLISHER_INFORMATION_REQUEST message format:
+     * <ul>
+     * <li>Message type
+     * <li>Publisher ID
+     * </ul>
+     *
+     * PUBLISHER_INFORMATION_RESPONSE message format:
+     * <ul>
+     * <li>Message type
+     * <li>Publisher info (bytes)
+     * </ul>
+     */
+    @Test
+    public void testHandlePublisherInformationRequestEvent() throws Exception {
+        VehiclePropValue request = createHalMessage(
+                VmsMessageType.PUBLISHER_INFORMATION_REQUEST,  // Message type
+                PUBLISHER_ID                                   // Publisher ID
+        );
+
+        when(mSubscriberService.getPublisherInfo(PUBLISHER_ID)).thenReturn(PAYLOAD);
+
+        VehiclePropValue response = createHalMessage(
+                VmsMessageType.PUBLISHER_INFORMATION_RESPONSE  // Message type
+        );
+        response.value.bytes.addAll(PAYLOAD_AS_LIST);
+
+        sendHalMessage(request);
+        verify(mVehicleHal).set(response);
+    }
+
+    /**
      * OFFERING message format:
      * <ul>
      * <li>Message type
