diff --git a/service-t/src/com/android/server/ethernet/EthernetTracker.java b/service-t/src/com/android/server/ethernet/EthernetTracker.java
index 4d3a653..f19f443 100644
--- a/service-t/src/com/android/server/ethernet/EthernetTracker.java
+++ b/service-t/src/com/android/server/ethernet/EthernetTracker.java
@@ -758,7 +758,7 @@
      * <interface name|mac address>;[Network Capabilities];[IP config];[Override Transport]}
      */
     private void parseEthernetConfig(String configString) {
-        final EthernetTrackerConfig config = new EthernetTrackerConfig(configString);
+        final EthernetConfigParser config = new EthernetConfigParser(configString);
         NetworkCapabilities nc;
         // Starting with Android B (API level 36), we provide default NetworkCapabilities
         // for Ethernet interfaces when no explicit capabilities are specified in the
@@ -1011,7 +1011,7 @@
     }
 
     @VisibleForTesting
-    static class EthernetTrackerConfig {
+    static class EthernetConfigParser {
         final String mIface;
         final List<Integer> mCaps;
         final String mIpConfig;
@@ -1067,8 +1067,8 @@
             }
         }
 
-        EthernetTrackerConfig(String configString) {
-            Objects.requireNonNull(configString, "EthernetTrackerConfig requires non-null config");
+        EthernetConfigParser(String configString) {
+            Objects.requireNonNull(configString, "EthernetConfigParser requires non-null config");
             final String[] tokens = configString.split(";", /* limit of tokens */ 4);
             mIface = tokens[0];
             mCaps = tokens.length > 1 ? parseCapabilities(tokens[1]) : Collections.emptyList();
diff --git a/tests/unit/java/com/android/server/ethernet/EthernetTrackerTest.java b/tests/unit/java/com/android/server/ethernet/EthernetTrackerTest.java
index 6ce7dbc..03fb505 100644
--- a/tests/unit/java/com/android/server/ethernet/EthernetTrackerTest.java
+++ b/tests/unit/java/com/android/server/ethernet/EthernetTrackerTest.java
@@ -46,7 +46,7 @@
 
 import androidx.test.filters.SmallTest;
 
-import com.android.server.ethernet.EthernetTracker.EthernetTrackerConfig;
+import com.android.server.ethernet.EthernetTracker.EthernetConfigParser;
 import com.android.testutils.DevSdkIgnoreRule;
 import com.android.testutils.DevSdkIgnoreRunner;
 import com.android.testutils.HandlerUtils;
@@ -291,20 +291,20 @@
         final String ipConfig = "";
         final String configString =
                 String.join(";", TEST_IFACE, configCapabilities, ipConfig, configTransports);
-        final EthernetTrackerConfig config = new EthernetTrackerConfig(configString);
+        final EthernetConfigParser config = new EthernetConfigParser(configString);
         assertEquals(
                 expectedNetworkCapabilities,
                 EthernetTracker.createNetworkCapabilities(config.mCaps, config.mTransport).build());
     }
 
     @Test
-    public void testCreateEthernetTrackerConfigReturnsCorrectValue() {
+    public void testCreateEthernetConfigParserReturnsCorrectValue() {
         final String capabilities = "2,4,6,8";
         final String ipConfig = "3";
         final String transport = "1";
         final String configString = String.join(";", TEST_IFACE, capabilities, ipConfig, transport);
 
-        final EthernetTrackerConfig config = new EthernetTrackerConfig(configString);
+        final EthernetConfigParser config = new EthernetConfigParser(configString);
 
         assertEquals(TEST_IFACE, config.mIface);
         assertThat(config.mCaps).containsExactly(2, 4, 6, 8);
@@ -313,30 +313,30 @@
     }
 
     @Test
-    public void testCreateEthernetTrackerConfig_withInvalidTransport() {
+    public void testCreateEthernetConfigParser_withInvalidTransport() {
         final String capabilities = "2";
         final String ipConfig = "3";
         final String transport = "100"; // Invalid transport type
         final String configString = String.join(";", TEST_IFACE, capabilities, ipConfig, transport);
 
-        final EthernetTrackerConfig config = new EthernetTrackerConfig(configString);
+        final EthernetConfigParser config = new EthernetConfigParser(configString);
         assertEquals(NetworkCapabilities.TRANSPORT_ETHERNET, config.mTransport);
     }
 
     @Test
-    public void testCreateEthernetTrackerConfig_withDisallowedTransport() {
+    public void testCreateEthernetConfigParser_withDisallowedTransport() {
         final String capabilities = "2";
         final String ipConfig = "3";
         final String transport = "4"; // TRANSPORT_VPN is not allowed
         final String configString = String.join(";", TEST_IFACE, capabilities, ipConfig, transport);
 
-        final EthernetTrackerConfig config = new EthernetTrackerConfig(configString);
+        final EthernetConfigParser config = new EthernetConfigParser(configString);
         assertEquals(NetworkCapabilities.TRANSPORT_ETHERNET, config.mTransport);
     }
 
     @Test
-    public void testCreateEthernetTrackerConfigThrowsNpeWithNullInput() {
-        assertThrows(NullPointerException.class, () -> new EthernetTrackerConfig(null));
+    public void testCreateEthernetConfigParserThrowsNpeWithNullInput() {
+        assertThrows(NullPointerException.class, () -> new EthernetConfigParser(null));
     }
 
     @Test
