Refactor HDMI related AIDL packages

Move CEC, EArc and the old "HDMI" package in to one common hdmi package
as cec, earc and connection.

Test: Build
Bug: 261729059

Change-Id: Ic657713e3a4078125e211bb0d337519a9192aaa1
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml
index 71afee3..c771ef4 100644
--- a/compatibility_matrices/compatibility_matrix.current.xml
+++ b/compatibility_matrices/compatibility_matrix.current.xml
@@ -716,23 +716,23 @@
         </interface>
     </hal>
     <hal format="aidl" optional="true">
-        <name>android.hardware.tv.cec</name>
+        <name>android.hardware.tv.hdmi.cec</name>
         <interface>
             <name>IHdmiCec</name>
             <instance>default</instance>
         </interface>
     </hal>
     <hal format="aidl" optional="true">
-        <name>android.hardware.tv.earc</name>
+        <name>android.hardware.tv.hdmi.earc</name>
         <interface>
             <name>IEArc</name>
             <instance>default</instance>
         </interface>
     </hal>
     <hal format="aidl" optional="true">
-        <name>android.hardware.tv.hdmi</name>
+        <name>android.hardware.tv.hdmi.connection</name>
         <interface>
-            <name>IHdmi</name>
+            <name>IHdmiConnection</name>
             <instance>default</instance>
         </interface>
     </hal>
diff --git a/tv/cec/aidl/Android.bp b/tv/cec/aidl/Android.bp
deleted file mode 100644
index 0b0e7cf..0000000
--- a/tv/cec/aidl/Android.bp
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (C) 2022 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package {
-    default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-aidl_interface {
-    name: "android.hardware.tv.cec",
-    vendor_available: true,
-    srcs: ["android/hardware/tv/cec/*.aidl"],
-    stability: "vintf",
-    backend: {
-        java: {
-            sdk_version: "module_current",
-        },
-    },
-}
diff --git a/tv/cec/aidl/OWNERS b/tv/cec/aidl/OWNERS
deleted file mode 100644
index d9c6783..0000000
--- a/tv/cec/aidl/OWNERS
+++ /dev/null
@@ -1,2 +0,0 @@
-# Bug component: 826094
-include platform/frameworks/base:/core/java/android/hardware/hdmi/OWNERS
\ No newline at end of file
diff --git a/tv/cec/aidl/TEST_MAPPING b/tv/cec/aidl/TEST_MAPPING
deleted file mode 100644
index ef4bee1..0000000
--- a/tv/cec/aidl/TEST_MAPPING
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "presubmit": [
-    {
-      "name": "VtsHalTvCecAidlTargetTest"
-    }
-  ]
-}
diff --git a/tv/cec/aidl/default/android.hardware.tv.cec-service.rc b/tv/cec/aidl/default/android.hardware.tv.cec-service.rc
deleted file mode 100644
index c79520c..0000000
--- a/tv/cec/aidl/default/android.hardware.tv.cec-service.rc
+++ /dev/null
@@ -1,5 +0,0 @@
-service vendor.cec-default /vendor/bin/hw/android.hardware.tv.cec-service
-    interface aidl android.hardware.tv.cec.IHdmiCec/default
-    class hal
-    user system
-    group system
diff --git a/tv/cec/aidl/vts/functional/Android.bp b/tv/cec/aidl/vts/functional/Android.bp
deleted file mode 100644
index 37fbaf0..0000000
--- a/tv/cec/aidl/vts/functional/Android.bp
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (C) 2022 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package {
-    default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-cc_test {
-    name: "VtsHalTvCecAidlTargetTest",
-    defaults: [
-        "VtsHalTargetTestDefaults",
-        "use_libaidlvintf_gtest_helper_static",
-    ],
-    srcs: ["VtsHalTvCecAidlTargetTest.cpp"],
-    static_libs: [
-        "android.hardware.tv.cec-V1-ndk",
-        "android.hardware.tv.hdmi-V1-ndk",
-    ],
-    shared_libs: [
-        "libbinder_ndk",
-    ],
-    test_suites: [
-        "general-tests",
-        "vts",
-    ],
-    disable_framework: true,
-}
diff --git a/tv/earc/aidl/default/android.hardware.tv.earc-service.rc b/tv/earc/aidl/default/android.hardware.tv.earc-service.rc
deleted file mode 100644
index 0d9063e..0000000
--- a/tv/earc/aidl/default/android.hardware.tv.earc-service.rc
+++ /dev/null
@@ -1,5 +0,0 @@
-service vendor.earc-default /vendor/bin/hw/android.hardware.tv.earc-service
-    interface aidl android.hardware.tv.earc.IEArc/default
-    class hal
-    user system
-    group system
diff --git a/tv/hdmi/aidl/default/Android.bp b/tv/hdmi/aidl/default/Android.bp
deleted file mode 100644
index 3e466a0..0000000
--- a/tv/hdmi/aidl/default/Android.bp
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (C) 2022 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package {
-    default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-cc_binary {
-    name: "android.hardware.tv.hdmi-service",
-    vintf_fragments: ["android.hardware.tv.hdmi-service.xml"],
-    relative_install_path: "hw",
-    vendor: true,
-    cflags: [
-        "-Wall",
-        "-Wextra",
-    ],
-    init_rc: ["android.hardware.tv.hdmi-service.rc"],
-    srcs: [
-        "serviceMock.cpp",
-        "HdmiMock.cpp",
-    ],
-    shared_libs: [
-        "libbinder_ndk",
-        "liblog",
-        "libbase",
-        "libutils",
-        "libhardware",
-        "libhidlbase",
-        "android.hardware.tv.hdmi-V1-ndk",
-    ],
-}
-
-cc_fuzz {
-    name: "android.hardware.tv.hdmi-service_fuzzer",
-    defaults: ["service_fuzzer_defaults"],
-    static_libs: [
-        "android.hardware.tv.hdmi-V1-ndk",
-        "liblog",
-    ],
-    srcs: [
-        "fuzzer.cpp",
-        "HdmiMock.cpp",
-    ],
-    fuzz_config: {
-        componentid: 826094,
-    },
-}
diff --git a/tv/hdmi/aidl/default/android.hardware.tv.hdmi-service.rc b/tv/hdmi/aidl/default/android.hardware.tv.hdmi-service.rc
deleted file mode 100644
index c926221..0000000
--- a/tv/hdmi/aidl/default/android.hardware.tv.hdmi-service.rc
+++ /dev/null
@@ -1,5 +0,0 @@
-service vendor.hdmi-default /vendor/bin/hw/android.hardware.tv.hdmi-service
-    interface aidl android.hardware.tv.hdmi.IHdmi/default
-    class hal
-    user system
-    group system
diff --git a/tv/hdmi/aidl/vts/functional/Android.bp b/tv/hdmi/aidl/vts/functional/Android.bp
deleted file mode 100644
index f9af58d..0000000
--- a/tv/hdmi/aidl/vts/functional/Android.bp
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (C) 2022 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package {
-    default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-cc_test {
-    name: "VtsHalTvHdmiAidlTargetTest",
-    defaults: [
-        "VtsHalTargetTestDefaults",
-        "use_libaidlvintf_gtest_helper_static",
-    ],
-    srcs: ["VtsHalTvHdmiAidlTargetTest.cpp"],
-    static_libs: [
-        "android.hardware.tv.hdmi-V1-ndk",
-    ],
-    shared_libs: [
-        "libbinder_ndk",
-    ],
-    test_suites: [
-        "general-tests",
-        "vts",
-    ],
-    disable_framework: true,
-}
diff --git a/tv/hdmi/aidl/Android.bp b/tv/hdmi/cec/aidl/Android.bp
similarity index 90%
rename from tv/hdmi/aidl/Android.bp
rename to tv/hdmi/cec/aidl/Android.bp
index d8c6e5f..1bd9e41 100644
--- a/tv/hdmi/aidl/Android.bp
+++ b/tv/hdmi/cec/aidl/Android.bp
@@ -17,9 +17,9 @@
 }
 
 aidl_interface {
-    name: "android.hardware.tv.hdmi",
+    name: "android.hardware.tv.hdmi.cec",
     vendor_available: true,
-    srcs: ["android/hardware/tv/hdmi/*.aidl"],
+    srcs: ["android/hardware/tv/hdmi/cec/*.aidl"],
     stability: "vintf",
     backend: {
         java: {
diff --git a/tv/hdmi/aidl/OWNERS b/tv/hdmi/cec/aidl/OWNERS
similarity index 100%
rename from tv/hdmi/aidl/OWNERS
rename to tv/hdmi/cec/aidl/OWNERS
diff --git a/tv/hdmi/cec/aidl/TEST_MAPPING b/tv/hdmi/cec/aidl/TEST_MAPPING
new file mode 100644
index 0000000..17d6bca
--- /dev/null
+++ b/tv/hdmi/cec/aidl/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+  "presubmit": [
+    {
+      "name": "VtsHalTvHdmiCecAidlTargetTest"
+    }
+  ]
+}
diff --git a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/AbortReason.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/AbortReason.aidl
similarity index 97%
rename from tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/AbortReason.aidl
rename to tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/AbortReason.aidl
index 7377d81..45b973a 100644
--- a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/AbortReason.aidl
+++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/AbortReason.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 @Backing(type="int") @VintfStability
 enum AbortReason {
   UNRECOGNIZED_MODE = 0,
diff --git a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/CecDeviceType.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecDeviceType.aidl
similarity index 97%
rename from tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/CecDeviceType.aidl
rename to tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecDeviceType.aidl
index 4d991cd..08dc1ee 100644
--- a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/CecDeviceType.aidl
+++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecDeviceType.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 @Backing(type="byte") @VintfStability
 enum CecDeviceType {
   INACTIVE = -1,
diff --git a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/CecLogicalAddress.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecLogicalAddress.aidl
similarity index 97%
rename from tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/CecLogicalAddress.aidl
rename to tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecLogicalAddress.aidl
index a36935b..1fc9fb7 100644
--- a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/CecLogicalAddress.aidl
+++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecLogicalAddress.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 @Backing(type="byte") @VintfStability
 enum CecLogicalAddress {
   TV = 0,
diff --git a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/CecMessage.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecMessage.aidl
similarity index 91%
rename from tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/CecMessage.aidl
rename to tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecMessage.aidl
index 5ce5ce8..9de07ec 100644
--- a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/CecMessage.aidl
+++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecMessage.aidl
@@ -31,11 +31,11 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 @VintfStability
 parcelable CecMessage {
-  android.hardware.tv.cec.CecLogicalAddress initiator;
-  android.hardware.tv.cec.CecLogicalAddress destination;
+  android.hardware.tv.hdmi.cec.CecLogicalAddress initiator;
+  android.hardware.tv.hdmi.cec.CecLogicalAddress destination;
   byte[] body;
   const int MAX_MESSAGE_BODY_LENGTH = 15;
 }
diff --git a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/CecMessageType.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecMessageType.aidl
similarity index 98%
rename from tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/CecMessageType.aidl
rename to tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecMessageType.aidl
index 61ebb94..31ca895 100644
--- a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/CecMessageType.aidl
+++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/CecMessageType.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 @Backing(type="int") @VintfStability
 enum CecMessageType {
   FEATURE_ABORT = 0,
diff --git a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/IHdmiCec.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/IHdmiCec.aidl
similarity index 85%
rename from tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/IHdmiCec.aidl
rename to tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/IHdmiCec.aidl
index cf8425e..0881489 100644
--- a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/IHdmiCec.aidl
+++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/IHdmiCec.aidl
@@ -31,17 +31,17 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 @VintfStability
 interface IHdmiCec {
-  android.hardware.tv.cec.Result addLogicalAddress(in android.hardware.tv.cec.CecLogicalAddress addr);
+  android.hardware.tv.hdmi.cec.Result addLogicalAddress(in android.hardware.tv.hdmi.cec.CecLogicalAddress addr);
   void clearLogicalAddress();
   void enableAudioReturnChannel(in int portId, in boolean enable);
   int getCecVersion();
   int getPhysicalAddress();
   int getVendorId();
-  android.hardware.tv.cec.SendMessageResult sendMessage(in android.hardware.tv.cec.CecMessage message);
-  void setCallback(in android.hardware.tv.cec.IHdmiCecCallback callback);
+  android.hardware.tv.hdmi.cec.SendMessageResult sendMessage(in android.hardware.tv.hdmi.cec.CecMessage message);
+  void setCallback(in android.hardware.tv.hdmi.cec.IHdmiCecCallback callback);
   void setLanguage(in String language);
   void enableWakeupByOtp(in boolean value);
   void enableCec(in boolean value);
diff --git a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/IHdmiCecCallback.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/IHdmiCecCallback.aidl
similarity index 93%
rename from tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/IHdmiCecCallback.aidl
rename to tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/IHdmiCecCallback.aidl
index 1918765..43fdfbd 100644
--- a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/IHdmiCecCallback.aidl
+++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/IHdmiCecCallback.aidl
@@ -31,8 +31,8 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 @VintfStability
 interface IHdmiCecCallback {
-  oneway void onCecMessage(in android.hardware.tv.cec.CecMessage message);
+  oneway void onCecMessage(in android.hardware.tv.hdmi.cec.CecMessage message);
 }
diff --git a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/Result.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/Result.aidl
similarity index 97%
rename from tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/Result.aidl
rename to tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/Result.aidl
index a5ba276..c6828ef 100644
--- a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/Result.aidl
+++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/Result.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 @Backing(type="byte") @VintfStability
 enum Result {
   SUCCESS = 0,
diff --git a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/SendMessageResult.aidl b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/SendMessageResult.aidl
similarity index 97%
rename from tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/SendMessageResult.aidl
rename to tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/SendMessageResult.aidl
index 58206c8..87b50c9 100644
--- a/tv/cec/aidl/aidl_api/android.hardware.tv.cec/current/android/hardware/tv/cec/SendMessageResult.aidl
+++ b/tv/hdmi/cec/aidl/aidl_api/android.hardware.tv.hdmi.cec/current/android/hardware/tv/hdmi/cec/SendMessageResult.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 @Backing(type="byte") @VintfStability
 enum SendMessageResult {
   SUCCESS = 0,
diff --git a/tv/cec/aidl/android/hardware/tv/cec/AbortReason.aidl b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/AbortReason.aidl
similarity index 95%
rename from tv/cec/aidl/android/hardware/tv/cec/AbortReason.aidl
rename to tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/AbortReason.aidl
index 3ae23ec..297094d 100644
--- a/tv/cec/aidl/android/hardware/tv/cec/AbortReason.aidl
+++ b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/AbortReason.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 
 /**
  * Operand description [Abort Reason]
diff --git a/tv/cec/aidl/android/hardware/tv/cec/CecDeviceType.aidl b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/CecDeviceType.aidl
similarity index 94%
rename from tv/cec/aidl/android/hardware/tv/cec/CecDeviceType.aidl
rename to tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/CecDeviceType.aidl
index 16dfbec..8727a1d 100644
--- a/tv/cec/aidl/android/hardware/tv/cec/CecDeviceType.aidl
+++ b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/CecDeviceType.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 
 @VintfStability
 @Backing(type="byte")
diff --git a/tv/cec/aidl/android/hardware/tv/cec/CecLogicalAddress.aidl b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/CecLogicalAddress.aidl
similarity index 95%
rename from tv/cec/aidl/android/hardware/tv/cec/CecLogicalAddress.aidl
rename to tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/CecLogicalAddress.aidl
index fbf5328..e7e08a6 100644
--- a/tv/cec/aidl/android/hardware/tv/cec/CecLogicalAddress.aidl
+++ b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/CecLogicalAddress.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 
 @VintfStability
 @Backing(type="byte")
diff --git a/tv/cec/aidl/android/hardware/tv/cec/CecMessage.aidl b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/CecMessage.aidl
similarity index 92%
rename from tv/cec/aidl/android/hardware/tv/cec/CecMessage.aidl
rename to tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/CecMessage.aidl
index b126045..14a1bc7 100644
--- a/tv/cec/aidl/android/hardware/tv/cec/CecMessage.aidl
+++ b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/CecMessage.aidl
@@ -14,9 +14,9 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 
-import android.hardware.tv.cec.CecLogicalAddress;
+import android.hardware.tv.hdmi.cec.CecLogicalAddress;
 
 @VintfStability
 parcelable CecMessage {
diff --git a/tv/cec/aidl/android/hardware/tv/cec/CecMessageType.aidl b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/CecMessageType.aidl
similarity index 98%
rename from tv/cec/aidl/android/hardware/tv/cec/CecMessageType.aidl
rename to tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/CecMessageType.aidl
index b544a91..becfea1 100644
--- a/tv/cec/aidl/android/hardware/tv/cec/CecMessageType.aidl
+++ b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/CecMessageType.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 
 @VintfStability
 @Backing(type="int")
diff --git a/tv/cec/aidl/android/hardware/tv/cec/IHdmiCec.aidl b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/IHdmiCec.aidl
similarity index 94%
rename from tv/cec/aidl/android/hardware/tv/cec/IHdmiCec.aidl
rename to tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/IHdmiCec.aidl
index dbf7139..577c377 100644
--- a/tv/cec/aidl/android/hardware/tv/cec/IHdmiCec.aidl
+++ b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/IHdmiCec.aidl
@@ -14,13 +14,13 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 
-import android.hardware.tv.cec.CecLogicalAddress;
-import android.hardware.tv.cec.CecMessage;
-import android.hardware.tv.cec.IHdmiCecCallback;
-import android.hardware.tv.cec.Result;
-import android.hardware.tv.cec.SendMessageResult;
+import android.hardware.tv.hdmi.cec.CecLogicalAddress;
+import android.hardware.tv.hdmi.cec.CecMessage;
+import android.hardware.tv.hdmi.cec.IHdmiCecCallback;
+import android.hardware.tv.hdmi.cec.Result;
+import android.hardware.tv.hdmi.cec.SendMessageResult;
 
 /**
  * HDMI-CEC HAL interface definition.
diff --git a/tv/cec/aidl/android/hardware/tv/cec/IHdmiCecCallback.aidl b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/IHdmiCecCallback.aidl
similarity index 91%
rename from tv/cec/aidl/android/hardware/tv/cec/IHdmiCecCallback.aidl
rename to tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/IHdmiCecCallback.aidl
index 4934a64..ef73dd7 100644
--- a/tv/cec/aidl/android/hardware/tv/cec/IHdmiCecCallback.aidl
+++ b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/IHdmiCecCallback.aidl
@@ -14,9 +14,9 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 
-import android.hardware.tv.cec.CecMessage;
+import android.hardware.tv.hdmi.cec.CecMessage;
 
 /**
  * Callbacks from the HAL implementation to notify the system of new events.
diff --git a/tv/cec/aidl/android/hardware/tv/cec/Result.aidl b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/Result.aidl
similarity index 95%
rename from tv/cec/aidl/android/hardware/tv/cec/Result.aidl
rename to tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/Result.aidl
index 3184c46..1b1cd08 100644
--- a/tv/cec/aidl/android/hardware/tv/cec/Result.aidl
+++ b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/Result.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 
 @VintfStability
 @Backing(type="byte")
diff --git a/tv/cec/aidl/android/hardware/tv/cec/SendMessageResult.aidl b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/SendMessageResult.aidl
similarity index 94%
rename from tv/cec/aidl/android/hardware/tv/cec/SendMessageResult.aidl
rename to tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/SendMessageResult.aidl
index 8cb98bc..8f609d5 100644
--- a/tv/cec/aidl/android/hardware/tv/cec/SendMessageResult.aidl
+++ b/tv/hdmi/cec/aidl/android/hardware/tv/hdmi/cec/SendMessageResult.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.cec;
+package android.hardware.tv.hdmi.cec;
 
 /**
  * error code used for send_message.
diff --git a/tv/cec/aidl/default/Android.bp b/tv/hdmi/cec/aidl/default/Android.bp
similarity index 79%
rename from tv/cec/aidl/default/Android.bp
rename to tv/hdmi/cec/aidl/default/Android.bp
index 5479601..ea4bb94 100644
--- a/tv/cec/aidl/default/Android.bp
+++ b/tv/hdmi/cec/aidl/default/Android.bp
@@ -17,15 +17,15 @@
 }
 
 cc_binary {
-    name: "android.hardware.tv.cec-service",
-    vintf_fragments: ["android.hardware.tv.cec-service.xml"],
+    name: "android.hardware.tv.hdmi.cec-service",
+    vintf_fragments: ["android.hardware.tv.hdmi.cec-service.xml"],
     relative_install_path: "hw",
     vendor: true,
     cflags: [
         "-Wall",
         "-Wextra",
     ],
-    init_rc: ["android.hardware.tv.cec-service.rc"],
+    init_rc: ["android.hardware.tv.hdmi.cec-service.rc"],
     srcs: [
         "serviceMock.cpp",
         "HdmiCecMock.cpp",
@@ -37,15 +37,15 @@
         "libutils",
         "libhardware",
         "libhidlbase",
-        "android.hardware.tv.cec-V1-ndk",
+        "android.hardware.tv.hdmi.cec-V1-ndk",
     ],
 }
 
 cc_fuzz {
-    name: "android.hardware.tv.cec-service_fuzzer",
+    name: "android.hardware.tv.hdmi.cec-service_fuzzer",
     defaults: ["service_fuzzer_defaults"],
     static_libs: [
-        "android.hardware.tv.cec-V1-ndk",
+        "android.hardware.tv.hdmi.cec-V1-ndk",
         "liblog",
     ],
     srcs: [
diff --git a/tv/cec/aidl/default/HdmiCecMock.cpp b/tv/hdmi/cec/aidl/default/HdmiCecMock.cpp
similarity index 98%
rename from tv/cec/aidl/default/HdmiCecMock.cpp
rename to tv/hdmi/cec/aidl/default/HdmiCecMock.cpp
index d8d655b..0212e7e 100644
--- a/tv/cec/aidl/default/HdmiCecMock.cpp
+++ b/tv/hdmi/cec/aidl/default/HdmiCecMock.cpp
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#define LOG_TAG "android.hardware.tv.cec"
+#define LOG_TAG "android.hardware.tv.hdmi.cec"
 #include <android-base/logging.h>
 #include <fcntl.h>
 #include <utils/Log.h>
@@ -28,6 +28,7 @@
 namespace android {
 namespace hardware {
 namespace tv {
+namespace hdmi {
 namespace cec {
 namespace implementation {
 
@@ -261,6 +262,7 @@
 
 }  // namespace implementation
 }  // namespace cec
+}  // namespace hdmi
 }  // namespace tv
 }  // namespace hardware
 }  // namespace android
diff --git a/tv/cec/aidl/default/HdmiCecMock.h b/tv/hdmi/cec/aidl/default/HdmiCecMock.h
similarity index 85%
rename from tv/cec/aidl/default/HdmiCecMock.h
rename to tv/hdmi/cec/aidl/default/HdmiCecMock.h
index 08f4d6f..aca0581 100644
--- a/tv/cec/aidl/default/HdmiCecMock.h
+++ b/tv/hdmi/cec/aidl/default/HdmiCecMock.h
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <aidl/android/hardware/tv/cec/BnHdmiCec.h>
+#include <aidl/android/hardware/tv/hdmi/cec/BnHdmiCec.h>
 #include <algorithm>
 #include <vector>
 
@@ -23,16 +23,17 @@
 namespace android {
 namespace hardware {
 namespace tv {
+namespace hdmi {
 namespace cec {
 namespace implementation {
 
-using ::aidl::android::hardware::tv::cec::BnHdmiCec;
-using ::aidl::android::hardware::tv::cec::CecLogicalAddress;
-using ::aidl::android::hardware::tv::cec::CecMessage;
-using ::aidl::android::hardware::tv::cec::IHdmiCec;
-using ::aidl::android::hardware::tv::cec::IHdmiCecCallback;
-using ::aidl::android::hardware::tv::cec::Result;
-using ::aidl::android::hardware::tv::cec::SendMessageResult;
+using ::aidl::android::hardware::tv::hdmi::cec::BnHdmiCec;
+using ::aidl::android::hardware::tv::hdmi::cec::CecLogicalAddress;
+using ::aidl::android::hardware::tv::hdmi::cec::CecMessage;
+using ::aidl::android::hardware::tv::hdmi::cec::IHdmiCec;
+using ::aidl::android::hardware::tv::hdmi::cec::IHdmiCecCallback;
+using ::aidl::android::hardware::tv::hdmi::cec::Result;
+using ::aidl::android::hardware::tv::hdmi::cec::SendMessageResult;
 
 #define CEC_MSG_IN_FIFO "/dev/cec_aidl_in_pipe"
 #define CEC_MSG_OUT_FIFO "/dev/cec_aidl_out_pipe"
@@ -89,6 +90,7 @@
 };
 }  // namespace implementation
 }  // namespace cec
+}  // namespace hdmi
 }  // namespace tv
 }  // namespace hardware
 }  // namespace android
diff --git a/tv/hdmi/cec/aidl/default/android.hardware.tv.hdmi.cec-service.rc b/tv/hdmi/cec/aidl/default/android.hardware.tv.hdmi.cec-service.rc
new file mode 100644
index 0000000..f4c9fcf
--- /dev/null
+++ b/tv/hdmi/cec/aidl/default/android.hardware.tv.hdmi.cec-service.rc
@@ -0,0 +1,5 @@
+service vendor.cec-default /vendor/bin/hw/android.hardware.tv.hdmi.cec-service
+    interface aidl android.hardware.tv.hdmi.cec.IHdmiCec/default
+    class hal
+    user system
+    group system
diff --git a/tv/cec/aidl/default/android.hardware.tv.cec-service.xml b/tv/hdmi/cec/aidl/default/android.hardware.tv.hdmi.cec-service.xml
similarity index 81%
rename from tv/cec/aidl/default/android.hardware.tv.cec-service.xml
rename to tv/hdmi/cec/aidl/default/android.hardware.tv.hdmi.cec-service.xml
index e68450d..d48565c 100644
--- a/tv/cec/aidl/default/android.hardware.tv.cec-service.xml
+++ b/tv/hdmi/cec/aidl/default/android.hardware.tv.hdmi.cec-service.xml
@@ -1,6 +1,6 @@
 <manifest version="1.0" type="device">
     <hal format="aidl">
-        <name>android.hardware.tv.cec</name>
+        <name>android.hardware.tv.hdmi.cec</name>
         <version>1</version>
         <interface>
             <name>IHdmiCec</name>
diff --git a/tv/cec/aidl/default/fuzzer.cpp b/tv/hdmi/cec/aidl/default/fuzzer.cpp
similarity index 93%
rename from tv/cec/aidl/default/fuzzer.cpp
rename to tv/hdmi/cec/aidl/default/fuzzer.cpp
index 9f6a9ac..33453dc 100644
--- a/tv/cec/aidl/default/fuzzer.cpp
+++ b/tv/hdmi/cec/aidl/default/fuzzer.cpp
@@ -18,7 +18,7 @@
 #include <fuzzer/FuzzedDataProvider.h>
 
 using android::fuzzService;
-using android::hardware::tv::cec::implementation::HdmiCecMock;
+using android::hardware::tv::hdmi::cec::implementation::HdmiCecMock;
 using ndk::SharedRefBase;
 
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
diff --git a/tv/cec/aidl/default/serviceMock.cpp b/tv/hdmi/cec/aidl/default/serviceMock.cpp
similarity index 90%
rename from tv/cec/aidl/default/serviceMock.cpp
rename to tv/hdmi/cec/aidl/default/serviceMock.cpp
index ab86c3f..cbf85e5 100644
--- a/tv/cec/aidl/default/serviceMock.cpp
+++ b/tv/hdmi/cec/aidl/default/serviceMock.cpp
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#define LOG_TAG "android.hardware.tv.cec-service-shim"
+#define LOG_TAG "android.hardware.tv.hdmi.cec-service-shim"
 
 #include <android-base/logging.h>
 #include <android/binder_manager.h>
@@ -23,7 +23,7 @@
 #include <utils/Log.h>
 #include "HdmiCecMock.h"
 
-using android::hardware::tv::cec::implementation::HdmiCecMock;
+using android::hardware::tv::hdmi::cec::implementation::HdmiCecMock;
 
 int main() {
     ABinderProcess_setThreadPoolMaxThreadCount(1);
diff --git a/tv/earc/aidl/vts/functional/Android.bp b/tv/hdmi/cec/aidl/vts/functional/Android.bp
similarity index 83%
copy from tv/earc/aidl/vts/functional/Android.bp
copy to tv/hdmi/cec/aidl/vts/functional/Android.bp
index 797547e..5c86d3f 100644
--- a/tv/earc/aidl/vts/functional/Android.bp
+++ b/tv/hdmi/cec/aidl/vts/functional/Android.bp
@@ -17,14 +17,15 @@
 }
 
 cc_test {
-    name: "VtsHalTvEArcAidlTargetTest",
+    name: "VtsHalTvHdmiCecAidlTargetTest",
     defaults: [
         "VtsHalTargetTestDefaults",
         "use_libaidlvintf_gtest_helper_static",
     ],
-    srcs: ["VtsHalTvEArcAidlTargetTest.cpp"],
+    srcs: ["VtsHalTvHdmiCecAidlTargetTest.cpp"],
     static_libs: [
-        "android.hardware.tv.earc-V1-ndk",
+        "android.hardware.tv.hdmi.cec-V1-ndk",
+        "android.hardware.tv.hdmi.connection-V1-ndk",
     ],
     shared_libs: [
         "libbinder_ndk",
diff --git a/tv/cec/aidl/vts/functional/AndroidTest.xml b/tv/hdmi/cec/aidl/vts/functional/AndroidTest.xml
similarity index 82%
rename from tv/cec/aidl/vts/functional/AndroidTest.xml
rename to tv/hdmi/cec/aidl/vts/functional/AndroidTest.xml
index 8604147..63e7763 100644
--- a/tv/cec/aidl/vts/functional/AndroidTest.xml
+++ b/tv/hdmi/cec/aidl/vts/functional/AndroidTest.xml
@@ -13,7 +13,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="Runs VtsHalTvCecAidlTargetTest.">
+<configuration description="Runs VtsHalTvHdmiCecAidlTargetTest.">
     <option name="test-suite-tag" value="apct" />
     <option name="test-suite-tag" value="apct-native" />
 
@@ -22,12 +22,12 @@
 
     <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
         <option name="cleanup" value="true" />
-        <option name="push" value="VtsHalTvCecAidlTargetTest->/data/local/tmp/VtsHalTvCecAidlTargetTest" />
+        <option name="push" value="VtsHalTvHdmiCecAidlTargetTest->/data/local/tmp/VtsHalTvHdmiCecAidlTargetTest" />
     </target_preparer>
 
     <test class="com.android.tradefed.testtype.GTest" >
         <option name="native-test-device-path" value="/data/local/tmp" />
-        <option name="module-name" value="VtsHalTvCecAidlTargetTest" />
+        <option name="module-name" value="VtsHalTvHdmiCecAidlTargetTest" />
         <option name="native-test-timeout" value="30m" />
     </test>
 </configuration>
diff --git a/tv/cec/aidl/vts/functional/VtsHalTvCecAidlTargetTest.cpp b/tv/hdmi/cec/aidl/vts/functional/VtsHalTvHdmiCecAidlTargetTest.cpp
similarity index 86%
rename from tv/cec/aidl/vts/functional/VtsHalTvCecAidlTargetTest.cpp
rename to tv/hdmi/cec/aidl/vts/functional/VtsHalTvHdmiCecAidlTargetTest.cpp
index 69c209f..a2fb0f8 100644
--- a/tv/cec/aidl/vts/functional/VtsHalTvCecAidlTargetTest.cpp
+++ b/tv/hdmi/cec/aidl/vts/functional/VtsHalTvHdmiCecAidlTargetTest.cpp
@@ -18,10 +18,10 @@
 
 #include <aidl/Gtest.h>
 #include <aidl/Vintf.h>
-#include <aidl/android/hardware/tv/cec/BnHdmiCec.h>
-#include <aidl/android/hardware/tv/cec/BnHdmiCecCallback.h>
-#include <aidl/android/hardware/tv/cec/CecDeviceType.h>
-#include <aidl/android/hardware/tv/hdmi/BnHdmi.h>
+#include <aidl/android/hardware/tv/hdmi/cec/BnHdmiCec.h>
+#include <aidl/android/hardware/tv/hdmi/cec/BnHdmiCecCallback.h>
+#include <aidl/android/hardware/tv/hdmi/cec/CecDeviceType.h>
+#include <aidl/android/hardware/tv/hdmi/connection/BnHdmiConnection.h>
 #include <android-base/logging.h>
 #include <android/binder_manager.h>
 #include <android/binder_process.h>
@@ -30,15 +30,15 @@
 #include <sstream>
 #include <vector>
 
-using ::aidl::android::hardware::tv::cec::BnHdmiCecCallback;
-using ::aidl::android::hardware::tv::cec::CecDeviceType;
-using ::aidl::android::hardware::tv::cec::CecLogicalAddress;
-using ::aidl::android::hardware::tv::cec::CecMessage;
-using ::aidl::android::hardware::tv::cec::IHdmiCec;
-using ::aidl::android::hardware::tv::cec::IHdmiCecCallback;
-using ::aidl::android::hardware::tv::cec::Result;
-using ::aidl::android::hardware::tv::cec::SendMessageResult;
-using ::aidl::android::hardware::tv::hdmi::HdmiPortInfo;
+using ::aidl::android::hardware::tv::hdmi::cec::BnHdmiCecCallback;
+using ::aidl::android::hardware::tv::hdmi::cec::CecDeviceType;
+using ::aidl::android::hardware::tv::hdmi::cec::CecLogicalAddress;
+using ::aidl::android::hardware::tv::hdmi::cec::CecMessage;
+using ::aidl::android::hardware::tv::hdmi::cec::IHdmiCec;
+using ::aidl::android::hardware::tv::hdmi::cec::IHdmiCecCallback;
+using ::aidl::android::hardware::tv::hdmi::cec::Result;
+using ::aidl::android::hardware::tv::hdmi::cec::SendMessageResult;
+using ::aidl::android::hardware::tv::hdmi::connection::HdmiPortInfo;
 using ::ndk::SpAIBinder;
 
 #define CEC_VERSION 0x05
diff --git a/tv/earc/aidl/Android.bp b/tv/hdmi/connection/aidl/Android.bp
similarity index 88%
rename from tv/earc/aidl/Android.bp
rename to tv/hdmi/connection/aidl/Android.bp
index 5db6032..b342c52 100644
--- a/tv/earc/aidl/Android.bp
+++ b/tv/hdmi/connection/aidl/Android.bp
@@ -17,9 +17,9 @@
 }
 
 aidl_interface {
-    name: "android.hardware.tv.earc",
+    name: "android.hardware.tv.hdmi.connection",
     vendor_available: true,
-    srcs: ["android/hardware/tv/earc/*.aidl"],
+    srcs: ["android/hardware/tv/hdmi/connection/*.aidl"],
     stability: "vintf",
     backend: {
         java: {
diff --git a/tv/hdmi/aidl/OWNERS b/tv/hdmi/connection/aidl/OWNERS
similarity index 100%
copy from tv/hdmi/aidl/OWNERS
copy to tv/hdmi/connection/aidl/OWNERS
diff --git a/tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/HdmiPortInfo.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl
similarity index 94%
rename from tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/HdmiPortInfo.aidl
rename to tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl
index 25c3be1..ac35c99 100644
--- a/tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/HdmiPortInfo.aidl
+++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl
@@ -31,10 +31,10 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.hdmi;
+package android.hardware.tv.hdmi.connection;
 @VintfStability
 parcelable HdmiPortInfo {
-  android.hardware.tv.hdmi.HdmiPortType type;
+  android.hardware.tv.hdmi.connection.HdmiPortType type;
   int portId;
   boolean cecSupported;
   boolean arcSupported;
diff --git a/tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/HdmiPortType.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/HdmiPortType.aidl
similarity index 97%
rename from tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/HdmiPortType.aidl
rename to tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/HdmiPortType.aidl
index af5f0f7..fc2d7e5 100644
--- a/tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/HdmiPortType.aidl
+++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/HdmiPortType.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.hdmi;
+package android.hardware.tv.hdmi.connection;
 @Backing(type="byte") @VintfStability
 enum HdmiPortType {
   INPUT = 0,
diff --git a/tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/HpdSignal.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/HpdSignal.aidl
similarity index 97%
rename from tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/HpdSignal.aidl
rename to tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/HpdSignal.aidl
index eef4025..697da29 100644
--- a/tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/HpdSignal.aidl
+++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/HpdSignal.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.hdmi;
+package android.hardware.tv.hdmi.connection;
 @Backing(type="byte") @VintfStability
 enum HpdSignal {
   HDMI_HPD_PHYSICAL = 0,
diff --git a/tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/IHdmi.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
similarity index 81%
rename from tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/IHdmi.aidl
rename to tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
index 809d392..98d1452 100644
--- a/tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/IHdmi.aidl
+++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
@@ -31,12 +31,12 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.hdmi;
+package android.hardware.tv.hdmi.connection;
 @VintfStability
-interface IHdmi {
-  android.hardware.tv.hdmi.HdmiPortInfo[] getPortInfo();
+interface IHdmiConnection {
+  android.hardware.tv.hdmi.connection.HdmiPortInfo[] getPortInfo();
   boolean isConnected(in int portId);
-  void setCallback(in android.hardware.tv.hdmi.IHdmiCallback callback);
-  void setHpdSignal(android.hardware.tv.hdmi.HpdSignal signal);
-  android.hardware.tv.hdmi.HpdSignal getHpdSignal();
+  void setCallback(in android.hardware.tv.hdmi.connection.IHdmiConnectionCallback callback);
+  void setHpdSignal(android.hardware.tv.hdmi.connection.HpdSignal signal);
+  android.hardware.tv.hdmi.connection.HpdSignal getHpdSignal();
 }
diff --git a/tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/IHdmiCallback.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnectionCallback.aidl
similarity index 94%
rename from tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/IHdmiCallback.aidl
rename to tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnectionCallback.aidl
index 05fe623..f9f6856 100644
--- a/tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/IHdmiCallback.aidl
+++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/IHdmiConnectionCallback.aidl
@@ -31,8 +31,8 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.hdmi;
+package android.hardware.tv.hdmi.connection;
 @VintfStability
-interface IHdmiCallback {
+interface IHdmiConnectionCallback {
   oneway void onHotplugEvent(in boolean connected, in int portId);
 }
diff --git a/tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/Result.aidl b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/Result.aidl
similarity index 97%
rename from tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/Result.aidl
rename to tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/Result.aidl
index b6b0eb3..93182c5 100644
--- a/tv/hdmi/aidl/aidl_api/android.hardware.tv.hdmi/current/android/hardware/tv/hdmi/Result.aidl
+++ b/tv/hdmi/connection/aidl/aidl_api/android.hardware.tv.hdmi.connection/current/android/hardware/tv/hdmi/connection/Result.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.hdmi;
+package android.hardware.tv.hdmi.connection;
 @VintfStability
 enum Result {
   SUCCESS = 0,
diff --git a/tv/hdmi/aidl/android/hardware/tv/hdmi/HdmiPortInfo.aidl b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl
similarity index 90%
rename from tv/hdmi/aidl/android/hardware/tv/hdmi/HdmiPortInfo.aidl
rename to tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl
index 2e2c858..c8a10d1 100644
--- a/tv/hdmi/aidl/android/hardware/tv/hdmi/HdmiPortInfo.aidl
+++ b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortInfo.aidl
@@ -14,9 +14,9 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.hdmi;
+package android.hardware.tv.hdmi.connection;
 
-import android.hardware.tv.hdmi.HdmiPortType;
+import android.hardware.tv.hdmi.connection.HdmiPortType;
 
 /**
  * HDMI port descriptor
diff --git a/tv/hdmi/aidl/android/hardware/tv/hdmi/HdmiPortType.aidl b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortType.aidl
similarity index 93%
rename from tv/hdmi/aidl/android/hardware/tv/hdmi/HdmiPortType.aidl
rename to tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortType.aidl
index 59c0d42..4ec58ee 100644
--- a/tv/hdmi/aidl/android/hardware/tv/hdmi/HdmiPortType.aidl
+++ b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HdmiPortType.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.hdmi;
+package android.hardware.tv.hdmi.connection;
 
 /**
  * HDMI port type.
diff --git a/tv/hdmi/aidl/android/hardware/tv/hdmi/HpdSignal.aidl b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HpdSignal.aidl
similarity index 94%
rename from tv/hdmi/aidl/android/hardware/tv/hdmi/HpdSignal.aidl
rename to tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HpdSignal.aidl
index 05963f2..554dcf6 100644
--- a/tv/hdmi/aidl/android/hardware/tv/hdmi/HpdSignal.aidl
+++ b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/HpdSignal.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.hdmi;
+package android.hardware.tv.hdmi.connection;
 
 /**
  * HPD (Hotplug Detection) Signal Types
diff --git a/tv/hdmi/aidl/android/hardware/tv/hdmi/IHdmi.aidl b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
similarity index 71%
rename from tv/hdmi/aidl/android/hardware/tv/hdmi/IHdmi.aidl
rename to tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
index 457234d..c8759f2 100644
--- a/tv/hdmi/aidl/android/hardware/tv/hdmi/IHdmi.aidl
+++ b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnection.aidl
@@ -14,17 +14,17 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.hdmi;
+package android.hardware.tv.hdmi.connection;
 
-import android.hardware.tv.hdmi.HdmiPortInfo;
-import android.hardware.tv.hdmi.HpdSignal;
-import android.hardware.tv.hdmi.IHdmiCallback;
+import android.hardware.tv.hdmi.connection.HdmiPortInfo;
+import android.hardware.tv.hdmi.connection.HpdSignal;
+import android.hardware.tv.hdmi.connection.IHdmiConnectionCallback;
 
 /**
- * HDMI HAL interface definition.
+ * HDMI Connection HAL interface definition.
  */
 @VintfStability
-interface IHdmi {
+interface IHdmiConnection {
     /**
      * Gets the hdmi port information of underlying hardware.
      *
@@ -48,13 +48,18 @@
      *        previously registered callback must be replaced with this one.
      *        setCallback(null) should deregister the callback.
      */
-    void setCallback(in IHdmiCallback callback);
+    void setCallback(in IHdmiConnectionCallback callback);
 
     /**
      * Method to set the HPD (Hot Plug Detection) signal the HAL should use for HPD signaling (e.g.
      * signaling EDID updates). By default, the HAL will use {@code HDMI_HPD_PHYSICAL} (the physical
      * hotplug signal). When set to {@code HDMI_HPD_STATUS_BIT} the HAL should use the HDP status
      * bit.
+     * @throws ServiceSpecificException with error code set to
+     *         {@code Result::FAILURE_NOT_SUPPORTED} if the signal type is not supported.
+     *         {@code Result::FAILURE_INVALID_ARGS} if the signal type is invalid.
+     *         {@code Result::FAILURE_UNKNOWN} if the signal type could not be set because of an
+     *                                         unknown failure.
      */
     void setHpdSignal(HpdSignal signal);
 
diff --git a/tv/hdmi/aidl/android/hardware/tv/hdmi/IHdmiCallback.aidl b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnectionCallback.aidl
similarity index 90%
rename from tv/hdmi/aidl/android/hardware/tv/hdmi/IHdmiCallback.aidl
rename to tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnectionCallback.aidl
index 51275b0..8b001fb 100644
--- a/tv/hdmi/aidl/android/hardware/tv/hdmi/IHdmiCallback.aidl
+++ b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/IHdmiConnectionCallback.aidl
@@ -14,13 +14,13 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.hdmi;
+package android.hardware.tv.hdmi.connection;
 
 /**
  * Callbacks from the HDMI HAL implementation to notify the system of new events.
  */
 @VintfStability
-oneway interface IHdmiCallback {
+oneway interface IHdmiConnectionCallback {
     /**
      * The callback function that must be called by HAL implementation to notify
      * the system of new hotplug event.
diff --git a/tv/hdmi/aidl/android/hardware/tv/hdmi/Result.aidl b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/Result.aidl
similarity index 96%
rename from tv/hdmi/aidl/android/hardware/tv/hdmi/Result.aidl
rename to tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/Result.aidl
index d2a1fef..edaa0a0 100644
--- a/tv/hdmi/aidl/android/hardware/tv/hdmi/Result.aidl
+++ b/tv/hdmi/connection/aidl/android/hardware/tv/hdmi/connection/Result.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.hdmi;
+package android.hardware.tv.hdmi.connection;
 
 /**
  * Result enum for return values. Used by the HDMI related AIDL.
diff --git a/tv/earc/aidl/default/Android.bp b/tv/hdmi/connection/aidl/default/Android.bp
similarity index 73%
copy from tv/earc/aidl/default/Android.bp
copy to tv/hdmi/connection/aidl/default/Android.bp
index 399f029..5e7e330 100644
--- a/tv/earc/aidl/default/Android.bp
+++ b/tv/hdmi/connection/aidl/default/Android.bp
@@ -17,18 +17,18 @@
 }
 
 cc_binary {
-    name: "android.hardware.tv.earc-service",
-    vintf_fragments: ["android.hardware.tv.earc-service.xml"],
+    name: "android.hardware.tv.hdmi.connection-service",
+    vintf_fragments: ["android.hardware.tv.hdmi.connection-service.xml"],
     relative_install_path: "hw",
     vendor: true,
     cflags: [
         "-Wall",
         "-Wextra",
     ],
-    init_rc: ["android.hardware.tv.earc-service.rc"],
+    init_rc: ["android.hardware.tv.hdmi.connection-service.rc"],
     srcs: [
         "serviceMock.cpp",
-        "EArcMock.cpp",
+        "HdmiConnectionMock.cpp",
     ],
     shared_libs: [
         "libbinder_ndk",
@@ -37,20 +37,20 @@
         "libutils",
         "libhardware",
         "libhidlbase",
-        "android.hardware.tv.earc-V1-ndk",
+        "android.hardware.tv.hdmi.connection-V1-ndk",
     ],
 }
 
 cc_fuzz {
-    name: "android.hardware.tv.earc-service_fuzzer",
+    name: "android.hardware.tv.hdmi.connection-service_fuzzer",
     defaults: ["service_fuzzer_defaults"],
     static_libs: [
-        "android.hardware.tv.earc-V1-ndk",
+        "android.hardware.tv.hdmi.connection-V1-ndk",
         "liblog",
     ],
     srcs: [
         "fuzzer.cpp",
-        "EArcMock.cpp",
+        "HdmiConnectionMock.cpp",
     ],
     fuzz_config: {
         componentid: 826094,
diff --git a/tv/hdmi/aidl/default/HdmiMock.cpp b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp
similarity index 81%
rename from tv/hdmi/aidl/default/HdmiMock.cpp
rename to tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp
index 7cd9bb7..db9f4c1 100644
--- a/tv/hdmi/aidl/default/HdmiMock.cpp
+++ b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.cpp
@@ -14,12 +14,12 @@
  * limitations under the License.
  */
 
-#define LOG_TAG "android.hardware.tv.hdmi"
+#define LOG_TAG "android.hardware.tv.hdmi.connection"
 #include <android-base/logging.h>
 #include <fcntl.h>
 #include <utils/Log.h>
 
-#include "HdmiMock.h"
+#include "HdmiConnectionMock.h"
 
 using ndk::ScopedAStatus;
 
@@ -27,20 +27,21 @@
 namespace hardware {
 namespace tv {
 namespace hdmi {
+namespace connection {
 namespace implementation {
 
-void HdmiMock::serviceDied(void* cookie) {
-    ALOGE("HdmiMock died");
-    auto hdmi = static_cast<HdmiMock*>(cookie);
+void HdmiConnectionMock::serviceDied(void* cookie) {
+    ALOGE("HdmiConnectionMock died");
+    auto hdmi = static_cast<HdmiConnectionMock*>(cookie);
     hdmi->mHdmiThreadRun = false;
 }
 
-ScopedAStatus HdmiMock::getPortInfo(std::vector<HdmiPortInfo>* _aidl_return) {
+ScopedAStatus HdmiConnectionMock::getPortInfo(std::vector<HdmiPortInfo>* _aidl_return) {
     *_aidl_return = mPortInfos;
     return ScopedAStatus::ok();
 }
 
-ScopedAStatus HdmiMock::isConnected(int32_t portId, bool* _aidl_return) {
+ScopedAStatus HdmiConnectionMock::isConnected(int32_t portId, bool* _aidl_return) {
     // Maintain port connection status and update on hotplug event
     if (portId <= mTotalPorts && portId >= 1) {
         *_aidl_return = mPortConnectionStatus[portId];
@@ -51,7 +52,8 @@
     return ScopedAStatus::ok();
 }
 
-ScopedAStatus HdmiMock::setCallback(const std::shared_ptr<IHdmiCallback>& callback) {
+ScopedAStatus HdmiConnectionMock::setCallback(
+        const std::shared_ptr<IHdmiConnectionCallback>& callback) {
     if (mCallback != nullptr) {
         mCallback = nullptr;
     }
@@ -67,7 +69,7 @@
     return ScopedAStatus::ok();
 }
 
-ScopedAStatus HdmiMock::setHpdSignal(HpdSignal signal) {
+ScopedAStatus HdmiConnectionMock::setHpdSignal(HpdSignal signal) {
     if (mHdmiThreadRun) {
         mHpdSignal = signal;
         return ScopedAStatus::ok();
@@ -77,18 +79,18 @@
     }
 }
 
-ScopedAStatus HdmiMock::getHpdSignal(HpdSignal* _aidl_return) {
+ScopedAStatus HdmiConnectionMock::getHpdSignal(HpdSignal* _aidl_return) {
     *_aidl_return = mHpdSignal;
     return ScopedAStatus::ok();
 }
 
-void* HdmiMock::__threadLoop(void* user) {
-    HdmiMock* const self = static_cast<HdmiMock*>(user);
+void* HdmiConnectionMock::__threadLoop(void* user) {
+    HdmiConnectionMock* const self = static_cast<HdmiConnectionMock*>(user);
     self->threadLoop();
     return 0;
 }
 
-int HdmiMock::readMessageFromFifo(unsigned char* buf, int msgCount) {
+int HdmiConnectionMock::readMessageFromFifo(unsigned char* buf, int msgCount) {
     if (msgCount <= 0 || !buf) {
         return 0;
     }
@@ -104,7 +106,7 @@
     return ret;
 }
 
-void HdmiMock::printEventBuf(const char* msg_buf, int len) {
+void HdmiConnectionMock::printEventBuf(const char* msg_buf, int len) {
     int i, size = 0;
     const int bufSize = MESSAGE_BODY_MAX_LENGTH * 3;
     // Use 2 characters for each byte in the message plus 1 space
@@ -117,7 +119,7 @@
     ALOGD("[halimp_aidl] %s, msg:%.*s", __FUNCTION__, size, buf);
 }
 
-void HdmiMock::handleHotplugMessage(unsigned char* msgBuf) {
+void HdmiConnectionMock::handleHotplugMessage(unsigned char* msgBuf) {
     bool connected = ((msgBuf[3]) & 0xf) > 0;
     int32_t portId = static_cast<uint32_t>(msgBuf[0] & 0xf);
 
@@ -140,7 +142,7 @@
     }
 }
 
-void HdmiMock::threadLoop() {
+void HdmiConnectionMock::threadLoop() {
     ALOGD("[halimp_aidl] threadLoop start.");
     unsigned char msgBuf[MESSAGE_BODY_MAX_LENGTH];
     int r = -1;
@@ -172,7 +174,7 @@
     ALOGD("[halimp_aidl] thread end.");
 }
 
-HdmiMock::HdmiMock() {
+HdmiConnectionMock::HdmiConnectionMock() {
     ALOGE("[halimp_aidl] Opening a virtual HDMI HAL for testing and virtual machine.");
     mCallback = nullptr;
     mPortInfos.resize(mTotalPorts);
@@ -188,6 +190,7 @@
 }
 
 }  // namespace implementation
+}  // namespace connection
 }  // namespace hdmi
 }  // namespace tv
 }  // namespace hardware
diff --git a/tv/hdmi/aidl/default/HdmiMock.h b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.h
similarity index 69%
rename from tv/hdmi/aidl/default/HdmiMock.h
rename to tv/hdmi/connection/aidl/default/HdmiConnectionMock.h
index 51abaff..b879e51 100644
--- a/tv/hdmi/aidl/default/HdmiMock.h
+++ b/tv/hdmi/connection/aidl/default/HdmiConnectionMock.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#include <aidl/android/hardware/tv/hdmi/BnHdmi.h>
-#include <aidl/android/hardware/tv/hdmi/Result.h>
+#include <aidl/android/hardware/tv/hdmi/connection/BnHdmiConnection.h>
+#include <aidl/android/hardware/tv/hdmi/connection/Result.h>
 #include <algorithm>
 #include <vector>
 
@@ -25,25 +25,27 @@
 namespace hardware {
 namespace tv {
 namespace hdmi {
+namespace connection {
 namespace implementation {
 
-using ::aidl::android::hardware::tv::hdmi::BnHdmi;
-using ::aidl::android::hardware::tv::hdmi::HdmiPortInfo;
-using ::aidl::android::hardware::tv::hdmi::HdmiPortType;
-using ::aidl::android::hardware::tv::hdmi::HpdSignal;
-using ::aidl::android::hardware::tv::hdmi::IHdmi;
-using ::aidl::android::hardware::tv::hdmi::IHdmiCallback;
-using ::aidl::android::hardware::tv::hdmi::Result;
+using ::aidl::android::hardware::tv::hdmi::connection::BnHdmiConnection;
+using ::aidl::android::hardware::tv::hdmi::connection::HdmiPortInfo;
+using ::aidl::android::hardware::tv::hdmi::connection::HdmiPortType;
+using ::aidl::android::hardware::tv::hdmi::connection::HpdSignal;
+using ::aidl::android::hardware::tv::hdmi::connection::IHdmiConnection;
+using ::aidl::android::hardware::tv::hdmi::connection::IHdmiConnectionCallback;
+using ::aidl::android::hardware::tv::hdmi::connection::Result;
 
 #define HDMI_MSG_IN_FIFO "/dev/hdmi_in_pipe"
 #define MESSAGE_BODY_MAX_LENGTH 4
 
-struct HdmiMock : public BnHdmi {
-    HdmiMock();
+struct HdmiConnectionMock : public BnHdmiConnection {
+    HdmiConnectionMock();
 
     ::ndk::ScopedAStatus getPortInfo(std::vector<HdmiPortInfo>* _aidl_return) override;
     ::ndk::ScopedAStatus isConnected(int32_t portId, bool* _aidl_return) override;
-    ::ndk::ScopedAStatus setCallback(const std::shared_ptr<IHdmiCallback>& callback) override;
+    ::ndk::ScopedAStatus setCallback(
+            const std::shared_ptr<IHdmiConnectionCallback>& callback) override;
     ::ndk::ScopedAStatus setHpdSignal(HpdSignal signal) override;
     ::ndk::ScopedAStatus getHpdSignal(HpdSignal* _aidl_return) override;
 
@@ -57,7 +59,7 @@
 
   private:
     static void serviceDied(void* cookie);
-    std::shared_ptr<IHdmiCallback> mCallback;
+    std::shared_ptr<IHdmiConnectionCallback> mCallback;
 
     // Variables for the virtual HDMI hal impl
     std::vector<HdmiPortInfo> mPortInfos;
@@ -79,6 +81,7 @@
     ::ndk::ScopedAIBinder_DeathRecipient mDeathRecipient;
 };
 }  // namespace implementation
+}  // namespace connection
 }  // namespace hdmi
 }  // Namespace tv
 }  // namespace hardware
diff --git a/tv/hdmi/connection/aidl/default/android.hardware.tv.hdmi.connection-service.rc b/tv/hdmi/connection/aidl/default/android.hardware.tv.hdmi.connection-service.rc
new file mode 100644
index 0000000..9e37e61
--- /dev/null
+++ b/tv/hdmi/connection/aidl/default/android.hardware.tv.hdmi.connection-service.rc
@@ -0,0 +1,5 @@
+service vendor.hdmi-default /vendor/bin/hw/android.hardware.tv.hdmi.connection-service
+    interface aidl android.hardware.tv.hdmi.connection.IHdmiConnection/default
+    class hal
+    user system
+    group system
diff --git a/tv/hdmi/aidl/default/android.hardware.tv.hdmi-service.xml b/tv/hdmi/connection/aidl/default/android.hardware.tv.hdmi.connection-service.xml
similarity index 66%
rename from tv/hdmi/aidl/default/android.hardware.tv.hdmi-service.xml
rename to tv/hdmi/connection/aidl/default/android.hardware.tv.hdmi.connection-service.xml
index a03c199..144fef1 100644
--- a/tv/hdmi/aidl/default/android.hardware.tv.hdmi-service.xml
+++ b/tv/hdmi/connection/aidl/default/android.hardware.tv.hdmi.connection-service.xml
@@ -1,9 +1,9 @@
 <manifest version="1.0" type="device">
     <hal format="aidl">
-        <name>android.hardware.tv.hdmi</name>
+        <name>android.hardware.tv.hdmi.connection</name>
         <version>1</version>
         <interface>
-            <name>IHdmi</name>
+            <name>IHdmiConnection</name>
             <instance>default</instance>
         </interface>
     </hal>
diff --git a/tv/hdmi/aidl/default/fuzzer.cpp b/tv/hdmi/connection/aidl/default/fuzzer.cpp
similarity index 83%
rename from tv/hdmi/aidl/default/fuzzer.cpp
rename to tv/hdmi/connection/aidl/default/fuzzer.cpp
index 06a2bc0..c5e33fa 100644
--- a/tv/hdmi/aidl/default/fuzzer.cpp
+++ b/tv/hdmi/connection/aidl/default/fuzzer.cpp
@@ -13,16 +13,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <HdmiMock.h>
+#include <HdmiConnectionMock.h>
 #include <fuzzbinder/libbinder_ndk_driver.h>
 #include <fuzzer/FuzzedDataProvider.h>
 
 using android::fuzzService;
-using android::hardware::tv::hdmi::implementation::HdmiMock;
+using android::hardware::tv::hdmi::connection::implementation::HdmiConnectionMock;
 using ndk::SharedRefBase;
 
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
-    auto hdmiAidl = SharedRefBase::make<HdmiMock>();
+    auto hdmiAidl = SharedRefBase::make<HdmiConnectionMock>();
 
     fuzzService(hdmiAidl->asBinder().get(), FuzzedDataProvider(data, size));
 
diff --git a/tv/hdmi/aidl/default/serviceMock.cpp b/tv/hdmi/connection/aidl/default/serviceMock.cpp
similarity index 74%
rename from tv/hdmi/aidl/default/serviceMock.cpp
rename to tv/hdmi/connection/aidl/default/serviceMock.cpp
index 1d8bf51..223c578 100644
--- a/tv/hdmi/aidl/default/serviceMock.cpp
+++ b/tv/hdmi/connection/aidl/default/serviceMock.cpp
@@ -14,23 +14,23 @@
  * limitations under the License.
  */
 
-#define LOG_TAG "android.hardware.tv.hdmi-service-shim"
+#define LOG_TAG "android.hardware.tv.hdmi.connection-service-shim"
 
 #include <android-base/logging.h>
 #include <android/binder_manager.h>
 #include <android/binder_process.h>
 #include <hidl/HidlTransportSupport.h>
 #include <utils/Log.h>
-#include "HdmiMock.h"
+#include "HdmiConnectionMock.h"
 
-using android::hardware::tv::hdmi::implementation::HdmiMock;
+using android::hardware::tv::hdmi::connection::implementation::HdmiConnectionMock;
 
 int main() {
     ABinderProcess_setThreadPoolMaxThreadCount(1);
     ABinderProcess_startThreadPool();
 
-    std::shared_ptr<HdmiMock> hdmiAidl = ndk::SharedRefBase::make<HdmiMock>();
-    const std::string instance = std::string() + HdmiMock::descriptor + "/default";
+    std::shared_ptr<HdmiConnectionMock> hdmiAidl = ndk::SharedRefBase::make<HdmiConnectionMock>();
+    const std::string instance = std::string() + HdmiConnectionMock::descriptor + "/default";
     binder_status_t status =
             AServiceManager_addService(hdmiAidl->asBinder().get(), instance.c_str());
     CHECK_EQ(status, STATUS_OK);
diff --git a/tv/earc/aidl/vts/functional/Android.bp b/tv/hdmi/connection/aidl/vts/functional/Android.bp
similarity index 85%
copy from tv/earc/aidl/vts/functional/Android.bp
copy to tv/hdmi/connection/aidl/vts/functional/Android.bp
index 797547e..fc8e2f7 100644
--- a/tv/earc/aidl/vts/functional/Android.bp
+++ b/tv/hdmi/connection/aidl/vts/functional/Android.bp
@@ -17,14 +17,14 @@
 }
 
 cc_test {
-    name: "VtsHalTvEArcAidlTargetTest",
+    name: "VtsHalTvHdmiConnectionAidlTargetTest",
     defaults: [
         "VtsHalTargetTestDefaults",
         "use_libaidlvintf_gtest_helper_static",
     ],
-    srcs: ["VtsHalTvEArcAidlTargetTest.cpp"],
+    srcs: ["VtsHalTvHdmiConnectionAidlTargetTest.cpp"],
     static_libs: [
-        "android.hardware.tv.earc-V1-ndk",
+        "android.hardware.tv.hdmi.connection-V1-ndk",
     ],
     shared_libs: [
         "libbinder_ndk",
diff --git a/tv/hdmi/connection/aidl/vts/functional/VtsHalTvHdmiConnectionAidlTargetTest.cpp b/tv/hdmi/connection/aidl/vts/functional/VtsHalTvHdmiConnectionAidlTargetTest.cpp
new file mode 100644
index 0000000..69f7ef5
--- /dev/null
+++ b/tv/hdmi/connection/aidl/vts/functional/VtsHalTvHdmiConnectionAidlTargetTest.cpp
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "Hdmi_Connection_hal_test"
+
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/tv/hdmi/connection/BnHdmiConnection.h>
+#include <aidl/android/hardware/tv/hdmi/connection/BnHdmiConnectionCallback.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <gtest/gtest.h>
+#include <log/log.h>
+#include <sstream>
+#include <vector>
+
+using ::aidl::android::hardware::tv::hdmi::connection::BnHdmiConnectionCallback;
+using ::aidl::android::hardware::tv::hdmi::connection::HdmiPortInfo;
+using ::aidl::android::hardware::tv::hdmi::connection::HdmiPortType;
+using ::aidl::android::hardware::tv::hdmi::connection::HpdSignal;
+using ::aidl::android::hardware::tv::hdmi::connection::IHdmiConnection;
+using ::aidl::android::hardware::tv::hdmi::connection::IHdmiConnectionCallback;
+using ::ndk::SpAIBinder;
+
+#define INCORRECT_VENDOR_ID 0x00
+#define TV_PHYSICAL_ADDRESS 0x0000
+
+// The main test class for TV HDMI Connection HAL.
+class HdmiConnectionTest : public ::testing::TestWithParam<std::string> {
+    static void serviceDied(void* /* cookie */) {
+        ALOGE("VtsHalTvHdmiConnectionAidlTargetTest died");
+    }
+
+  public:
+    void SetUp() override {
+        hdmiConnection = IHdmiConnection::fromBinder(
+                SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+        ASSERT_NE(hdmiConnection, nullptr);
+        ALOGI("%s: getService() for hdmiConnection is %s", __func__,
+              hdmiConnection->isRemote() ? "remote" : "local");
+
+        hdmiConnectionCallback = ::ndk::SharedRefBase::make<HdmiConnectionCallback>();
+        ASSERT_NE(hdmiConnectionCallback, nullptr);
+        hdmiConnectionDeathRecipient =
+                ndk::ScopedAIBinder_DeathRecipient(AIBinder_DeathRecipient_new(&serviceDied));
+        ASSERT_EQ(AIBinder_linkToDeath(hdmiConnection->asBinder().get(),
+                                       hdmiConnectionDeathRecipient.get(), 0),
+                  STATUS_OK);
+    }
+
+    class HdmiConnectionCallback : public BnHdmiConnectionCallback {
+      public:
+        ::ndk::ScopedAStatus onHotplugEvent(bool connected __unused, int32_t portId __unused) {
+            return ::ndk::ScopedAStatus::ok();
+        };
+    };
+
+    std::shared_ptr<IHdmiConnection> hdmiConnection;
+    std::shared_ptr<IHdmiConnectionCallback> hdmiConnectionCallback;
+    ::ndk::ScopedAIBinder_DeathRecipient hdmiConnectionDeathRecipient;
+};
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(HdmiConnectionTest);
+INSTANTIATE_TEST_SUITE_P(
+        PerInstance, HdmiConnectionTest,
+        testing::ValuesIn(android::getAidlHalInstanceNames(IHdmiConnection::descriptor)),
+        android::PrintInstanceNameToString);
+
+TEST_P(HdmiConnectionTest, SetCallback) {
+    ASSERT_TRUE(hdmiConnection->setCallback(::ndk::SharedRefBase::make<HdmiConnectionCallback>())
+                        .isOk());
+}
+
+TEST_P(HdmiConnectionTest, GetPortInfo) {
+    std::vector<HdmiPortInfo> ports;
+    ASSERT_TRUE(hdmiConnection->getPortInfo(&ports).isOk());
+
+    bool cecSupportedOnDevice = false;
+    for (size_t i = 0; i < ports.size(); ++i) {
+        EXPECT_TRUE((ports[i].type == HdmiPortType::OUTPUT) ||
+                    (ports[i].type == HdmiPortType::INPUT));
+        if (ports[i].portId == 0) {
+            ALOGW("%s: Port id should start from 1", __func__);
+        }
+        cecSupportedOnDevice = cecSupportedOnDevice | ports[i].cecSupported;
+    }
+    EXPECT_NE(cecSupportedOnDevice, false) << "At least one port should support CEC";
+}
+
+TEST_P(HdmiConnectionTest, IsConnected) {
+    std::vector<HdmiPortInfo> ports;
+    ASSERT_TRUE(hdmiConnection->getPortInfo(&ports).isOk());
+    for (size_t i = 0; i < ports.size(); ++i) {
+        bool connected;
+        ASSERT_TRUE(hdmiConnection->isConnected(ports[i].portId, &connected).isOk());
+    }
+}
+
+TEST_P(HdmiConnectionTest, HdpSignal) {
+    HpdSignal originalSignal;
+    HpdSignal signal = HpdSignal::HDMI_HPD_STATUS_BIT;
+    HpdSignal readSignal;
+    ASSERT_TRUE(hdmiConnection->getHpdSignal(&originalSignal).isOk());
+    ASSERT_TRUE(hdmiConnection->setHpdSignal(signal).isOk());
+    ASSERT_TRUE(hdmiConnection->getHpdSignal(&readSignal).isOk());
+    EXPECT_EQ(readSignal, signal);
+    signal = HpdSignal::HDMI_HPD_PHYSICAL;
+    ASSERT_TRUE(hdmiConnection->setHpdSignal(signal).isOk());
+    ASSERT_TRUE(hdmiConnection->getHpdSignal(&readSignal).isOk());
+    EXPECT_EQ(readSignal, signal);
+    ASSERT_TRUE(hdmiConnection->setHpdSignal(originalSignal).isOk());
+}
diff --git a/tv/earc/aidl/Android.bp b/tv/hdmi/earc/aidl/Android.bp
similarity index 84%
copy from tv/earc/aidl/Android.bp
copy to tv/hdmi/earc/aidl/Android.bp
index 5db6032..d76cc1b 100644
--- a/tv/earc/aidl/Android.bp
+++ b/tv/hdmi/earc/aidl/Android.bp
@@ -17,9 +17,10 @@
 }
 
 aidl_interface {
-    name: "android.hardware.tv.earc",
+    name: "android.hardware.tv.hdmi.earc",
     vendor_available: true,
-    srcs: ["android/hardware/tv/earc/*.aidl"],
+    srcs: ["android/hardware/tv/hdmi/earc/*.aidl"],
+    imports: ["android.hardware.tv.hdmi.connection-V1"],
     stability: "vintf",
     backend: {
         java: {
diff --git a/tv/earc/aidl/OWNERS b/tv/hdmi/earc/aidl/OWNERS
similarity index 100%
rename from tv/earc/aidl/OWNERS
rename to tv/hdmi/earc/aidl/OWNERS
diff --git a/tv/earc/aidl/aidl_api/android.hardware.tv.earc/current/android/hardware/tv/earc/IEArc.aidl b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArc.aidl
similarity index 90%
rename from tv/earc/aidl/aidl_api/android.hardware.tv.earc/current/android/hardware/tv/earc/IEArc.aidl
rename to tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArc.aidl
index 552bb46..1ea7df7 100644
--- a/tv/earc/aidl/aidl_api/android.hardware.tv.earc/current/android/hardware/tv/earc/IEArc.aidl
+++ b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArc.aidl
@@ -31,12 +31,12 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.earc;
+package android.hardware.tv.hdmi.earc;
 @VintfStability
 interface IEArc {
   void setEArcEnabled(in boolean enabled);
   boolean isEArcEnabled();
-  void setCallback(in android.hardware.tv.earc.IEArcCallback callback);
-  android.hardware.tv.earc.IEArcStatus getState(in int portId);
+  void setCallback(in android.hardware.tv.hdmi.earc.IEArcCallback callback);
+  android.hardware.tv.hdmi.earc.IEArcStatus getState(in int portId);
   byte[] getLastReportedAudioCapabilities(in int portId);
 }
diff --git a/tv/earc/aidl/aidl_api/android.hardware.tv.earc/current/android/hardware/tv/earc/IEArcCallback.aidl b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArcCallback.aidl
similarity index 92%
rename from tv/earc/aidl/aidl_api/android.hardware.tv.earc/current/android/hardware/tv/earc/IEArcCallback.aidl
rename to tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArcCallback.aidl
index ef99824..1730dcf 100644
--- a/tv/earc/aidl/aidl_api/android.hardware.tv.earc/current/android/hardware/tv/earc/IEArcCallback.aidl
+++ b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArcCallback.aidl
@@ -31,9 +31,9 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.earc;
+package android.hardware.tv.hdmi.earc;
 @VintfStability
 interface IEArcCallback {
-  oneway void onStateChange(in android.hardware.tv.earc.IEArcStatus status, in int portId);
+  oneway void onStateChange(in android.hardware.tv.hdmi.earc.IEArcStatus status, in int portId);
   oneway void onCapabilitiesReported(in byte[] rawCapabilities, in int portId);
 }
diff --git a/tv/earc/aidl/aidl_api/android.hardware.tv.earc/current/android/hardware/tv/earc/IEArcStatus.aidl b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArcStatus.aidl
similarity index 97%
rename from tv/earc/aidl/aidl_api/android.hardware.tv.earc/current/android/hardware/tv/earc/IEArcStatus.aidl
rename to tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArcStatus.aidl
index 729c657..29d4ea9 100644
--- a/tv/earc/aidl/aidl_api/android.hardware.tv.earc/current/android/hardware/tv/earc/IEArcStatus.aidl
+++ b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/IEArcStatus.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.earc;
+package android.hardware.tv.hdmi.earc;
 @Backing(type="byte") @VintfStability
 enum IEArcStatus {
   STATUS_IDLE = 0,
diff --git a/tv/earc/aidl/aidl_api/android.hardware.tv.earc/current/android/hardware/tv/earc/Result.aidl b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/Result.aidl
similarity index 97%
rename from tv/earc/aidl/aidl_api/android.hardware.tv.earc/current/android/hardware/tv/earc/Result.aidl
rename to tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/Result.aidl
index 3679d3b..b248f41 100644
--- a/tv/earc/aidl/aidl_api/android.hardware.tv.earc/current/android/hardware/tv/earc/Result.aidl
+++ b/tv/hdmi/earc/aidl/aidl_api/android.hardware.tv.hdmi.earc/current/android/hardware/tv/hdmi/earc/Result.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.tv.earc;
+package android.hardware.tv.hdmi.earc;
 @VintfStability
 enum Result {
   SUCCESS = 0,
diff --git a/tv/earc/aidl/android/hardware/tv/earc/IEArc.aidl b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArc.aidl
similarity index 75%
rename from tv/earc/aidl/android/hardware/tv/earc/IEArc.aidl
rename to tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArc.aidl
index bb8dabf..a2dde6a 100644
--- a/tv/earc/aidl/android/hardware/tv/earc/IEArc.aidl
+++ b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArc.aidl
@@ -14,10 +14,10 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.earc;
+package android.hardware.tv.hdmi.earc;
 
-import android.hardware.tv.earc.IEArcCallback;
-import android.hardware.tv.earc.IEArcStatus;
+import android.hardware.tv.hdmi.earc.IEArcCallback;
+import android.hardware.tv.hdmi.earc.IEArcStatus;
 
 /**
  * eARC HAL interface definition
@@ -30,11 +30,13 @@
      * updates with IEArcCallback callbacks. If disabled, the driver and HAL shall not attempt to
      * establish an eARC connection and shall not send any IEArcCallback callbacks to the Android
      * framework.
-     * The error status is set to
-     *         {@code SUCCESS} if the setting could be changed to the value passed.
-     *         {@code FAILURE_NOT_SUPPORTED} if the setting is not supported.
-     *         {@code FAILURE_INVALID_ARGS} if the setting value is invalid.
-     *         {@code FAILURE_UNKNOWN} if there was an unknown failure.
+     * @throws ServiceSpecificException with error code set to
+     *         {@code Result::FAILURE_NOT_SUPPORTED} if the eARC enabled setting could not be set
+     *                                               because this is not supported.
+     *         {@code Result::FAILURE_INVALID_ARGS} if the eARC enabled setting could not be set
+     *                                              because the method argument is invalid.
+     *         {@code Result::FAILURE_UNKNOWN} if the eARC enabled setting could not be set because
+     *                                         there was an unknown failure.
      */
     void setEArcEnabled(in boolean enabled);
 
diff --git a/tv/earc/aidl/android/hardware/tv/earc/IEArcCallback.aidl b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcCallback.aidl
similarity index 95%
rename from tv/earc/aidl/android/hardware/tv/earc/IEArcCallback.aidl
rename to tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcCallback.aidl
index c70191f..a11924b 100644
--- a/tv/earc/aidl/android/hardware/tv/earc/IEArcCallback.aidl
+++ b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcCallback.aidl
@@ -14,9 +14,9 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.earc;
+package android.hardware.tv.hdmi.earc;
 
-import android.hardware.tv.earc.IEArcStatus;
+import android.hardware.tv.hdmi.earc.IEArcStatus;
 
 /**
  * eARC HAL callback methods
diff --git a/tv/earc/aidl/android/hardware/tv/earc/IEArcStatus.aidl b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcStatus.aidl
similarity index 95%
rename from tv/earc/aidl/android/hardware/tv/earc/IEArcStatus.aidl
rename to tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcStatus.aidl
index ecb1c85..de1aaf1 100644
--- a/tv/earc/aidl/android/hardware/tv/earc/IEArcStatus.aidl
+++ b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/IEArcStatus.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.earc;
+package android.hardware.tv.hdmi.earc;
 
 /**
  * eARC HAL connection states
diff --git a/tv/earc/aidl/android/hardware/tv/earc/Result.aidl b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/Result.aidl
similarity index 96%
rename from tv/earc/aidl/android/hardware/tv/earc/Result.aidl
rename to tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/Result.aidl
index 054518a..268610d 100644
--- a/tv/earc/aidl/android/hardware/tv/earc/Result.aidl
+++ b/tv/hdmi/earc/aidl/android/hardware/tv/hdmi/earc/Result.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.tv.earc;
+package android.hardware.tv.hdmi.earc;
 
 /**
  * Result enum for return values. Used by the HDMI related AIDL.
diff --git a/tv/earc/aidl/default/Android.bp b/tv/hdmi/earc/aidl/default/Android.bp
similarity index 79%
rename from tv/earc/aidl/default/Android.bp
rename to tv/hdmi/earc/aidl/default/Android.bp
index 399f029..5d56c2a 100644
--- a/tv/earc/aidl/default/Android.bp
+++ b/tv/hdmi/earc/aidl/default/Android.bp
@@ -17,15 +17,15 @@
 }
 
 cc_binary {
-    name: "android.hardware.tv.earc-service",
-    vintf_fragments: ["android.hardware.tv.earc-service.xml"],
+    name: "android.hardware.tv.hdmi.earc-service",
+    vintf_fragments: ["android.hardware.tv.hdmi.earc-service.xml"],
     relative_install_path: "hw",
     vendor: true,
     cflags: [
         "-Wall",
         "-Wextra",
     ],
-    init_rc: ["android.hardware.tv.earc-service.rc"],
+    init_rc: ["android.hardware.tv.hdmi.earc-service.rc"],
     srcs: [
         "serviceMock.cpp",
         "EArcMock.cpp",
@@ -37,15 +37,15 @@
         "libutils",
         "libhardware",
         "libhidlbase",
-        "android.hardware.tv.earc-V1-ndk",
+        "android.hardware.tv.hdmi.earc-V1-ndk",
     ],
 }
 
 cc_fuzz {
-    name: "android.hardware.tv.earc-service_fuzzer",
+    name: "android.hardware.tv.hdmi.earc-service_fuzzer",
     defaults: ["service_fuzzer_defaults"],
     static_libs: [
-        "android.hardware.tv.earc-V1-ndk",
+        "android.hardware.tv.hdmi.earc-V1-ndk",
         "liblog",
     ],
     srcs: [
diff --git a/tv/earc/aidl/default/EArcMock.cpp b/tv/hdmi/earc/aidl/default/EArcMock.cpp
similarity index 97%
rename from tv/earc/aidl/default/EArcMock.cpp
rename to tv/hdmi/earc/aidl/default/EArcMock.cpp
index 9bccc18..3578999 100644
--- a/tv/earc/aidl/default/EArcMock.cpp
+++ b/tv/hdmi/earc/aidl/default/EArcMock.cpp
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#define LOG_TAG "android.hardware.tv.earc"
+#define LOG_TAG "android.hardware.tv.hdmi.earc"
 #include <android-base/logging.h>
 #include <fcntl.h>
 #include <utils/Log.h>
@@ -26,6 +26,7 @@
 namespace android {
 namespace hardware {
 namespace tv {
+namespace hdmi {
 namespace earc {
 namespace implementation {
 
@@ -114,6 +115,7 @@
 
 }  // namespace implementation
 }  // namespace earc
+}  // namespace hdmi
 }  // namespace tv
 }  // namespace hardware
 }  // namespace android
diff --git a/tv/earc/aidl/default/EArcMock.h b/tv/hdmi/earc/aidl/default/EArcMock.h
similarity index 82%
rename from tv/earc/aidl/default/EArcMock.h
rename to tv/hdmi/earc/aidl/default/EArcMock.h
index 9081950..fc4c828 100644
--- a/tv/earc/aidl/default/EArcMock.h
+++ b/tv/hdmi/earc/aidl/default/EArcMock.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#include <aidl/android/hardware/tv/earc/BnEArc.h>
-#include <aidl/android/hardware/tv/earc/Result.h>
+#include <aidl/android/hardware/tv/hdmi/earc/BnEArc.h>
+#include <aidl/android/hardware/tv/hdmi/earc/Result.h>
 #include <algorithm>
 #include <vector>
 
@@ -24,14 +24,15 @@
 namespace android {
 namespace hardware {
 namespace tv {
+namespace hdmi {
 namespace earc {
 namespace implementation {
 
-using ::aidl::android::hardware::tv::earc::BnEArc;
-using ::aidl::android::hardware::tv::earc::IEArc;
-using ::aidl::android::hardware::tv::earc::IEArcCallback;
-using ::aidl::android::hardware::tv::earc::IEArcStatus;
-using ::aidl::android::hardware::tv::earc::Result;
+using ::aidl::android::hardware::tv::hdmi::earc::BnEArc;
+using ::aidl::android::hardware::tv::hdmi::earc::IEArc;
+using ::aidl::android::hardware::tv::hdmi::earc::IEArcCallback;
+using ::aidl::android::hardware::tv::hdmi::earc::IEArcStatus;
+using ::aidl::android::hardware::tv::hdmi::earc::Result;
 
 struct EArcMock : public BnEArc {
     EArcMock();
@@ -69,6 +70,7 @@
 };
 }  // namespace implementation
 }  // namespace earc
+}  // Namespace hdmi
 }  // Namespace tv
 }  // namespace hardware
 }  // namespace android
diff --git a/tv/hdmi/earc/aidl/default/android.hardware.tv.hdmi.earc-service.rc b/tv/hdmi/earc/aidl/default/android.hardware.tv.hdmi.earc-service.rc
new file mode 100644
index 0000000..53bec04
--- /dev/null
+++ b/tv/hdmi/earc/aidl/default/android.hardware.tv.hdmi.earc-service.rc
@@ -0,0 +1,5 @@
+service vendor.earc-default /vendor/bin/hw/android.hardware.tv.hdmi.earc-service
+    interface aidl android.hardware.tv.hdmi.earc.IEArc/default
+    class hal
+    user system
+    group system
diff --git a/tv/earc/aidl/default/android.hardware.tv.earc-service.xml b/tv/hdmi/earc/aidl/default/android.hardware.tv.hdmi.earc-service.xml
similarity index 81%
rename from tv/earc/aidl/default/android.hardware.tv.earc-service.xml
rename to tv/hdmi/earc/aidl/default/android.hardware.tv.hdmi.earc-service.xml
index 4d66d98..6f8d03d 100644
--- a/tv/earc/aidl/default/android.hardware.tv.earc-service.xml
+++ b/tv/hdmi/earc/aidl/default/android.hardware.tv.hdmi.earc-service.xml
@@ -1,6 +1,6 @@
 <manifest version="1.0" type="device">
     <hal format="aidl">
-        <name>android.hardware.tv.earc</name>
+        <name>android.hardware.tv.hdmi.earc</name>
         <version>1</version>
         <interface>
             <name>IEArc</name>
diff --git a/tv/earc/aidl/default/fuzzer.cpp b/tv/hdmi/earc/aidl/default/fuzzer.cpp
similarity index 93%
rename from tv/earc/aidl/default/fuzzer.cpp
rename to tv/hdmi/earc/aidl/default/fuzzer.cpp
index 5036853..25264ae 100644
--- a/tv/earc/aidl/default/fuzzer.cpp
+++ b/tv/hdmi/earc/aidl/default/fuzzer.cpp
@@ -18,7 +18,7 @@
 #include <fuzzer/FuzzedDataProvider.h>
 
 using android::fuzzService;
-using android::hardware::tv::earc::implementation::EArcMock;
+using android::hardware::tv::hdmi::earc::implementation::EArcMock;
 using ndk::SharedRefBase;
 
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
diff --git a/tv/earc/aidl/default/serviceMock.cpp b/tv/hdmi/earc/aidl/default/serviceMock.cpp
similarity index 90%
rename from tv/earc/aidl/default/serviceMock.cpp
rename to tv/hdmi/earc/aidl/default/serviceMock.cpp
index 1ea7262..0878e76 100644
--- a/tv/earc/aidl/default/serviceMock.cpp
+++ b/tv/hdmi/earc/aidl/default/serviceMock.cpp
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#define LOG_TAG "android.hardware.tv.earc-service-shim"
+#define LOG_TAG "android.hardware.tv.hdmi.earc-service-shim"
 
 #include <android-base/logging.h>
 #include <android/binder_manager.h>
@@ -23,7 +23,7 @@
 #include <utils/Log.h>
 #include "EArcMock.h"
 
-using android::hardware::tv::earc::implementation::EArcMock;
+using android::hardware::tv::hdmi::earc::implementation::EArcMock;
 
 int main() {
     ABinderProcess_setThreadPoolMaxThreadCount(1);
diff --git a/tv/earc/aidl/vts/functional/Android.bp b/tv/hdmi/earc/aidl/vts/functional/Android.bp
similarity index 87%
rename from tv/earc/aidl/vts/functional/Android.bp
rename to tv/hdmi/earc/aidl/vts/functional/Android.bp
index 797547e..36fbf56 100644
--- a/tv/earc/aidl/vts/functional/Android.bp
+++ b/tv/hdmi/earc/aidl/vts/functional/Android.bp
@@ -17,14 +17,14 @@
 }
 
 cc_test {
-    name: "VtsHalTvEArcAidlTargetTest",
+    name: "VtsHalTvHdmiEArcAidlTargetTest",
     defaults: [
         "VtsHalTargetTestDefaults",
         "use_libaidlvintf_gtest_helper_static",
     ],
-    srcs: ["VtsHalTvEArcAidlTargetTest.cpp"],
+    srcs: ["VtsHalTvHdmiEArcAidlTargetTest.cpp"],
     static_libs: [
-        "android.hardware.tv.earc-V1-ndk",
+        "android.hardware.tv.hdmi.earc-V1-ndk",
     ],
     shared_libs: [
         "libbinder_ndk",
diff --git a/tv/earc/aidl/vts/functional/VtsHalTvEArcAidlTargetTest.cpp b/tv/hdmi/earc/aidl/vts/functional/VtsHalTvHdmiEArcAidlTargetTest.cpp
similarity index 88%
rename from tv/earc/aidl/vts/functional/VtsHalTvEArcAidlTargetTest.cpp
rename to tv/hdmi/earc/aidl/vts/functional/VtsHalTvHdmiEArcAidlTargetTest.cpp
index 12f48c3..3cd8577 100644
--- a/tv/earc/aidl/vts/functional/VtsHalTvEArcAidlTargetTest.cpp
+++ b/tv/hdmi/earc/aidl/vts/functional/VtsHalTvHdmiEArcAidlTargetTest.cpp
@@ -18,9 +18,9 @@
 
 #include <aidl/Gtest.h>
 #include <aidl/Vintf.h>
-#include <aidl/android/hardware/tv/earc/BnEArcCallback.h>
-#include <aidl/android/hardware/tv/earc/IEArc.h>
-#include <aidl/android/hardware/tv/earc/IEArcStatus.h>
+#include <aidl/android/hardware/tv/hdmi/earc/BnEArcCallback.h>
+#include <aidl/android/hardware/tv/hdmi/earc/IEArc.h>
+#include <aidl/android/hardware/tv/hdmi/earc/IEArcStatus.h>
 #include <android-base/logging.h>
 #include <android/binder_manager.h>
 #include <android/binder_process.h>
@@ -29,10 +29,10 @@
 #include <sstream>
 #include <vector>
 
-using ::aidl::android::hardware::tv::earc::BnEArcCallback;
-using ::aidl::android::hardware::tv::earc::IEArc;
-using ::aidl::android::hardware::tv::earc::IEArcCallback;
-using ::aidl::android::hardware::tv::earc::IEArcStatus;
+using ::aidl::android::hardware::tv::hdmi::earc::BnEArcCallback;
+using ::aidl::android::hardware::tv::hdmi::earc::IEArc;
+using ::aidl::android::hardware::tv::hdmi::earc::IEArcCallback;
+using ::aidl::android::hardware::tv::hdmi::earc::IEArcStatus;
 using ::ndk::SpAIBinder;
 
 // The main test class for TV EARC HAL.