Move hals.conf into prebuilt_etc

Bug: 154346346
Test: atest SensorsBootCheck
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I35d9485da9ab24a326f384cde6c5028b8356866e
diff --git a/sensors/Android.bp b/sensors/Android.bp
index f6040f0..291f025 100644
--- a/sensors/Android.bp
+++ b/sensors/Android.bp
@@ -14,6 +14,14 @@
  * limitations under the License.
  */
 
+prebuilt_etc {
+    name: "android.hardware.sensors@2.1-impl.ranchu.etc",
+    vendor: true,
+    sub_dir: "sensors",
+    filename: "hals.conf",
+    src: "hals.conf"
+}
+
 cc_library_shared {
     name: "android.hardware.sensors@2.1-impl.ranchu",
     vendor: true,
@@ -41,4 +49,5 @@
         "-DLOG_TAG=\"android.hardware.sensors@2.1-impl.ranchu\"",
         "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION",
     ],
+    required: ["android.hardware.sensors@2.1-impl.ranchu.etc"],
 }
diff --git a/vendor.mk b/vendor.mk
index 57fa76f..b2df280 100644
--- a/vendor.mk
+++ b/vendor.mk
@@ -111,12 +111,6 @@
 PRODUCT_PACKAGES += \
     android.hardware.sensors@2.1-service.multihal \
     android.hardware.sensors@2.1-impl.ranchu
-# TODO(rkir):
-# add a soong namespace and move this into a.h.sensors@2.1-impl.ranchu
-# as prebuilt_etc. For now soong_namespace causes a build break because the fw
-# refers to our wifi HAL in random places.
-PRODUCT_COPY_FILES += \
-    device/generic/goldfish/sensors/hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/hals.conf
 endif
 
 PRODUCT_PACKAGES += \