Add symlink to hwservicemanager
The binary has moved from /system to /system_ext to allow devices to
choose when to include it.
Unfortunately libhidlbase looks for /system/bin/hwservicemanager to
determine if it is present on the device. This library is available in
/vendor so it may not be updated to look in /system_ext when flashing
GSI or doing a system-only update.
So we add this symlink to keep backwards compatbililty.
Test: aosp_bramble_hwasan-userdebug boot test
Bug: 218588089
Change-Id: I74b2c25f484556c5fa91a3c9b175362c09d082e1
diff --git a/core/Makefile b/core/Makefile
index 46350f6..397b07d 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -3233,6 +3233,12 @@
ALL_DEFAULT_INSTALLED_MODULES += $(_systemext_symlink)
endif
+# Create symlink /system/bin/hwservicemanager -> /system/system_ext/bin/hwservicemanager
+# Old vendor libraries (like libhidlbase) may require /system/bin/hwservicemanager to be present
+$(call symlink-file,$(TARGET_OUT_SYSTEM_EXT)/bin/hwservicemanager,/system/system_ext/bin/hwservicemanager, $(TARGET_OUT)/bin/hwservicemanager)
+INTERNAL_SYSTEMIMAGE_FILES += \
+ $(TARGET_OUT)/bin/hwservicemanager
+
# -----------------------------------------------------------------
# system_dlkm partition image