diff --git a/tests/VmsPublisherClientSample/src/com/google/android/car/vms/publisher/VmsPublisherClientSampleService.java b/tests/VmsPublisherClientSample/src/com/google/android/car/vms/publisher/VmsPublisherClientSampleService.java
index 1677eaf..d414d08 100644
--- a/tests/VmsPublisherClientSample/src/com/google/android/car/vms/publisher/VmsPublisherClientSampleService.java
+++ b/tests/VmsPublisherClientSample/src/com/google/android/car/vms/publisher/VmsPublisherClientSampleService.java
@@ -30,8 +30,7 @@
  */
 public class VmsPublisherClientSampleService extends VmsPublisherClientService {
     public static final int PUBLISH_EVENT = 0;
-    public static final int TEST_LAYER_ID = 0;
-    public static final int TEST_LAYER_VERSION = 0;
+    public static final VmsLayer TEST_LAYER = new VmsLayer(0,0);
 
     private byte mCounter = 0;
     private AtomicBoolean mInitialized = new AtomicBoolean(false);
@@ -57,7 +56,7 @@
     public void onVmsSubscriptionChange(List<VmsLayer> layers, long sequence) {
         if (mInitialized.compareAndSet(false, true)) {
             for (VmsLayer layer : layers) {
-                if (layer.getId() == TEST_LAYER_ID && layer.getVersion() == TEST_LAYER_VERSION) {
+                if (layer.equals(TEST_LAYER)) {
                     mHandler.sendEmptyMessage(PUBLISH_EVENT);
                 }
             }
@@ -65,7 +64,7 @@
     }
 
     private void periodicPublish() {
-        publish(TEST_LAYER_ID, TEST_LAYER_VERSION, new byte[]{mCounter});
+        publish(TEST_LAYER, new byte[]{mCounter});
         ++mCounter;
         mHandler.sendEmptyMessageDelayed(PUBLISH_EVENT, 1000);
     }
diff --git a/tests/VmsSubscriberClientSample/src/com/google/android/car/vms/subscriber/VmsSubscriberClientSampleActivity.java b/tests/VmsSubscriberClientSample/src/com/google/android/car/vms/subscriber/VmsSubscriberClientSampleActivity.java
index 74b377a..4ee95a1 100644
--- a/tests/VmsSubscriberClientSample/src/com/google/android/car/vms/subscriber/VmsSubscriberClientSampleActivity.java
+++ b/tests/VmsSubscriberClientSample/src/com/google/android/car/vms/subscriber/VmsSubscriberClientSampleActivity.java
@@ -36,8 +36,7 @@
     private static final String TAG = "VmsSampleActivity";
     // The layer id and version should match the ones defined in
     // com.google.android.car.vms.publisher.VmsPublisherClientSampleService
-    public static final int TEST_LAYER_ID = 0;
-    public static final int TEST_LAYER_VERSION = 0;
+    public static final VmsLayer TEST_LAYER = new VmsLayer(0, 0);
 
     private Car mCarApi;
     private TextView mTextView;
@@ -91,7 +90,7 @@
         private void configureSubscriptions(VmsSubscriberManager vmsSubscriberManager) {
             try {
                 vmsSubscriberManager.setListener(mListener);
-                vmsSubscriberManager.subscribe(TEST_LAYER_ID, TEST_LAYER_VERSION);
+                vmsSubscriberManager.subscribe(TEST_LAYER);
             } catch (android.car.CarNotConnectedException e) {
                 Log.e(TAG, "Car is not connected!", e);
             }
@@ -101,7 +100,7 @@
     private final VmsSubscriberManager.VmsSubscriberClientListener mListener =
             new VmsSubscriberManager.VmsSubscriberClientListener() {
                 @Override
-                public void onVmsMessageReceived(int layerId, int layerVersion, byte[] payload) {
+                public void onVmsMessageReceived(VmsLayer layer, byte[] payload) {
                     mTextView.setText(String.valueOf(payload[0]));
                 }
 
diff --git a/tests/carservice_test/src/com/android/car/test/SimpleVmsPublisherClientService.java b/tests/carservice_test/src/com/android/car/test/SimpleVmsPublisherClientService.java
index 4d03759..96635f1 100644
--- a/tests/carservice_test/src/com/android/car/test/SimpleVmsPublisherClientService.java
+++ b/tests/carservice_test/src/com/android/car/test/SimpleVmsPublisherClientService.java
@@ -35,19 +35,7 @@
     @Override
     public void onVmsPublisherServiceReady() {
         // Publish a property that is going to be verified in the test.
-        publish(getLayerId(), getLayerVersion(), getPayload());
-    }
-
-    // methods exposed for testing.
-    static public int getLayerId() {
-        return 12;
-    }
-
-    static public int getLayerVersion() {
-        return 34;
-    }
-
-    static byte[] getPayload() {
-        return new byte[]{1, 1, 2, 3, 5, 8, 13};
+        publish(VmsPublisherClientServiceTest.MOCK_PUBLISHER_LAYER,
+                VmsPublisherClientServiceTest.PAYLOAD);
     }
 }
diff --git a/tests/carservice_test/src/com/android/car/test/VmsPublisherClientMockService.java b/tests/carservice_test/src/com/android/car/test/VmsPublisherClientMockService.java
index 5d36875..b6770f7 100644
--- a/tests/carservice_test/src/com/android/car/test/VmsPublisherClientMockService.java
+++ b/tests/carservice_test/src/com/android/car/test/VmsPublisherClientMockService.java
@@ -47,11 +47,8 @@
 
     private void publishIfNeeded(List<VmsLayer> layers) {
         for (VmsLayer layer : layers) {
-            if (layer.getId() == VmsPublisherSubscriberTest.LAYER_ID
-                    && layer.getVersion() == VmsPublisherSubscriberTest.LAYER_VERSION) {
-                publish(VmsPublisherSubscriberTest.LAYER_ID,
-                        VmsPublisherSubscriberTest.LAYER_VERSION,
-                        VmsPublisherSubscriberTest.PAYLOAD);
+            if (layer.equals(VmsPublisherSubscriberTest.LAYER)) {
+                publish(VmsPublisherSubscriberTest.LAYER, VmsPublisherSubscriberTest.PAYLOAD);
             }
         }
     }
diff --git a/tests/carservice_test/src/com/android/car/test/VmsPublisherClientServiceTest.java b/tests/carservice_test/src/com/android/car/test/VmsPublisherClientServiceTest.java
index 84f564d..c4b054a 100644
--- a/tests/carservice_test/src/com/android/car/test/VmsPublisherClientServiceTest.java
+++ b/tests/carservice_test/src/com/android/car/test/VmsPublisherClientServiceTest.java
@@ -19,6 +19,7 @@
 import android.annotation.ArrayRes;
 import android.car.VehicleAreaType;
 import android.car.annotation.FutureFeature;
+import android.car.vms.VmsLayer;
 import android.content.Context;
 import android.content.ContextWrapper;
 import android.content.pm.PackageManager;
@@ -48,6 +49,9 @@
     private static final String TAG = "VmsPublisherTest";
     private static final int MOCK_PUBLISHER_LAYER_ID = 12;
     private static final int MOCK_PUBLISHER_LAYER_VERSION = 34;
+    public static final VmsLayer MOCK_PUBLISHER_LAYER = new VmsLayer(MOCK_PUBLISHER_LAYER_ID,
+            MOCK_PUBLISHER_LAYER_VERSION);
+    public static final byte[] PAYLOAD = new byte[]{1, 1, 2, 3, 5, 8, 13};
 
     private HalHandler mHalHandler;
     // Used to block until the HAL property is updated in HalHandler.onPropertySet.
@@ -135,9 +139,9 @@
             payload[i] = rawValue.bytes.get(i);
         }
         assertEquals(VmsMessageType.DATA, messageType);
-        assertEquals(SimpleVmsPublisherClientService.getLayerId(), layerId);
-        assertEquals(SimpleVmsPublisherClientService.getLayerVersion(), layerVersion);
-        assertTrue(Arrays.equals(SimpleVmsPublisherClientService.getPayload(), payload));
+        assertEquals(MOCK_PUBLISHER_LAYER_ID, layerId);
+        assertEquals(MOCK_PUBLISHER_LAYER_VERSION, layerVersion);
+        assertTrue(Arrays.equals(PAYLOAD, payload));
     }
 
     private class HalHandler implements VehicleHalPropertyHandler {
diff --git a/tests/carservice_test/src/com/android/car/test/VmsPublisherSubscriberTest.java b/tests/carservice_test/src/com/android/car/test/VmsPublisherSubscriberTest.java
index b215ffb..401adb2 100644
--- a/tests/carservice_test/src/com/android/car/test/VmsPublisherSubscriberTest.java
+++ b/tests/carservice_test/src/com/android/car/test/VmsPublisherSubscriberTest.java
@@ -39,8 +39,9 @@
 
 @FutureFeature
 public class VmsPublisherSubscriberTest extends MockedCarTestBase {
-    public static final int LAYER_ID = 88;
-    public static final int LAYER_VERSION = 19;
+    private static final int LAYER_ID = 88;
+    private static final int LAYER_VERSION = 19;
+    public static final VmsLayer LAYER = new VmsLayer(LAYER_ID, LAYER_VERSION);
     public static final byte[] PAYLOAD = new byte[]{2, 3, 5, 7, 11, 13, 17};
 
     private HalHandler mHalHandler;
@@ -103,11 +104,10 @@
                 Car.VMS_SUBSCRIBER_SERVICE);
         TestListener listener = new TestListener();
         vmsSubscriberManager.setListener(listener);
-        vmsSubscriberManager.subscribe(LAYER_ID, LAYER_VERSION);
+        vmsSubscriberManager.subscribe(LAYER);
 
         assertTrue(mSubscriberSemaphore.tryAcquire(2L, TimeUnit.SECONDS));
-        assertEquals(LAYER_ID, listener.getLayerId());
-        assertEquals(LAYER_VERSION, listener.getLayerVersion());
+        assertEquals(LAYER, listener.getLayer());
         assertTrue(Arrays.equals(PAYLOAD, listener.getPayload()));
     }
 
@@ -115,17 +115,14 @@
     }
 
     private class TestListener implements VmsSubscriberManager.VmsSubscriberClientListener {
-        private int mLayerId;
-        private int mLayerVersion;
+        private VmsLayer mLayer;
         private byte[] mPayload;
 
         @Override
-        public void onVmsMessageReceived(int layerId, int layerVersion, byte[] payload) {
-            assertEquals(LAYER_ID, layerId);
-            assertEquals(LAYER_VERSION, layerVersion);
+        public void onVmsMessageReceived(VmsLayer layer, byte[] payload) {
+            assertEquals(LAYER, layer);
             assertTrue(Arrays.equals(PAYLOAD, payload));
-            mLayerId = layerId;
-            mLayerVersion = layerVersion;
+            mLayer = layer;
             mPayload = payload;
             mSubscriberSemaphore.release();
         }
@@ -137,12 +134,8 @@
             //  and update VmsPublisherClientMockService
         }
 
-        public int getLayerId() {
-            return mLayerId;
-        }
-
-        public int getLayerVersion() {
-            return mLayerVersion;
+        public VmsLayer getLayer() {
+            return mLayer;
         }
 
         public byte[] getPayload() {
diff --git a/tests/carservice_test/src/com/android/car/test/VmsSubscriberManagerTest.java b/tests/carservice_test/src/com/android/car/test/VmsSubscriberManagerTest.java
index 0a6563a..58a4c98 100644
--- a/tests/carservice_test/src/com/android/car/test/VmsSubscriberManagerTest.java
+++ b/tests/carservice_test/src/com/android/car/test/VmsSubscriberManagerTest.java
@@ -43,6 +43,8 @@
     private static final String TAG = "VmsSubscriberManagerTest";
     private static final int SUBSCRIPTION_LAYER_ID = 2;
     private static final int SUBSCRIPTION_LAYER_VERSION = 3;
+    private static final VmsLayer SUBSCRIPTION_LAYER = new VmsLayer(SUBSCRIPTION_LAYER_ID,
+            SUBSCRIPTION_LAYER_VERSION);
 
     private HalHandler mHalHandler;
     // Used to block until the HAL property is updated in HalHandler.onPropertySet.
@@ -72,7 +74,7 @@
                 Car.VMS_SUBSCRIBER_SERVICE);
         TestListener listener = new TestListener();
         vmsSubscriberManager.setListener(listener);
-        vmsSubscriberManager.subscribe(SUBSCRIPTION_LAYER_ID, SUBSCRIPTION_LAYER_VERSION);
+        vmsSubscriberManager.subscribe(SUBSCRIPTION_LAYER);
 
         // Inject a value and wait for its callback in TestListener.onVmsMessageReceived.
         VehiclePropValue v = VehiclePropValueBuilder.newBuilder(VehicleProperty.VEHICLE_MAP_SERVICE)
@@ -88,8 +90,7 @@
 
         getMockedVehicleHal().injectEvent(v);
         assertTrue(mSubscriberSemaphore.tryAcquire(2L, TimeUnit.SECONDS));
-        assertEquals(SUBSCRIPTION_LAYER_ID, listener.getLayerId());
-        assertEquals(SUBSCRIPTION_LAYER_VERSION, listener.getLayerVersion());
+        assertEquals(SUBSCRIPTION_LAYER, listener.getLayer());
         byte[] expectedPayload = {(byte) 0xa, (byte) 0xb};
         assertTrue(Arrays.equals(expectedPayload, listener.getPayload()));
     }
@@ -117,8 +118,7 @@
 
         getMockedVehicleHal().injectEvent(v);
         assertTrue(mSubscriberSemaphore.tryAcquire(2L, TimeUnit.SECONDS));
-        assertEquals(SUBSCRIPTION_LAYER_ID, listener.getLayerId());
-        assertEquals(SUBSCRIPTION_LAYER_VERSION, listener.getLayerVersion());
+        assertEquals(SUBSCRIPTION_LAYER, listener.getLayer());
         byte[] expectedPayload = {(byte) 0xa, (byte) 0xb};
         assertTrue(Arrays.equals(expectedPayload, listener.getPayload()));
     }
@@ -154,16 +154,13 @@
 
 
     private class TestListener implements VmsSubscriberClientListener{
-        private int mLayerId;
-        private int mLayerVersion;
+        private VmsLayer mLayer;
         private byte[] mPayload;
 
         @Override
-        public void onVmsMessageReceived(int layerId, int layerVersion, byte[] payload) {
-            Log.d(TAG, "onVmsMessageReceived: Layer: " + layerId +
-                    " Version: " + layerVersion + " Payload: " + payload);
-            mLayerId = layerId;
-            mLayerVersion = layerVersion;
+        public void onVmsMessageReceived(VmsLayer layer, byte[] payload) {
+            Log.d(TAG, "onVmsMessageReceived: layer: " + layer + " Payload: " + payload);
+            mLayer = layer;
             mPayload = payload;
             mSubscriberSemaphore.release();
         }
@@ -173,12 +170,8 @@
             Log.d(TAG, "onLayersAvailabilityChange: Layers: " + availableLayers);
         }
 
-        public int getLayerId() {
-            return mLayerId;
-        }
-
-        public int getLayerVersion() {
-            return mLayerVersion;
+        public VmsLayer getLayer() {
+            return mLayer;
         }
 
         public byte[] getPayload() {
diff --git a/tests/carservice_unit_test/src/com/android/car/VmsRoutingTest.java b/tests/carservice_unit_test/src/com/android/car/VmsRoutingTest.java
index 7a889e9..d9a395e 100644
--- a/tests/carservice_unit_test/src/com/android/car/VmsRoutingTest.java
+++ b/tests/carservice_unit_test/src/com/android/car/VmsRoutingTest.java
@@ -130,7 +130,7 @@
 
     class MockVmsListener extends IVmsSubscriberClient.Stub {
         @Override
-        public void onVmsMessageReceived(int layerId, int layerVersion, byte[] payload) {}
+        public void onVmsMessageReceived(VmsLayer layer, byte[] payload) {}
 
         @Override
         public void onLayersAvailabilityChange(List<VmsLayer> availableLayers) {}
