firmware_handler: extract part responsible for running ext program to lib
As a preparation for upcoming commit, extract part which is responsible
for external program execution to libmodprobe so it can be later
re-used not only for firmware handler but also for dynamic module
options handler within libmodprobe.
RunExternalHandler is moved entirely to separate library with two
changes:
- Setting env needed previously by firmware handler was made generic and
now external handler can get envs_map containing pairs of env and its
value which needs to be set.
- "Firmware" was removed from one of the log since now it can be used in
different context (s/External Firmware Handler/External Handler/)
Bug: 335619610
Test: `atest CtsInitTestCases` passed, especially:
[105/129] ueventd_parser#ExternalFirmwareHandlers: PASSED (0ms)
[106/129] ueventd_parser#ExternalFirmwareHandlersDuplicate: PASSED (0ms)
Change-Id: Ie07cee763278f224bd3c0acfbe06c44eb36d0a81
diff --git a/libmodprobe/Android.bp b/libmodprobe/Android.bp
index 12906cc..78b4c83 100644
--- a/libmodprobe/Android.bp
+++ b/libmodprobe/Android.bp
@@ -13,6 +13,7 @@
vendor_ramdisk_available: true,
host_supported: true,
srcs: [
+ "exthandler.cpp",
"libmodprobe.cpp",
"libmodprobe_ext.cpp",
],
@@ -30,6 +31,7 @@
],
local_include_dirs: ["include/"],
srcs: [
+ "exthandler.cpp",
"libmodprobe_test.cpp",
"libmodprobe.cpp",
"libmodprobe_ext_test.cpp",