ueventd: add support for driver section in ueventd.rc
Allow ueventd configuration to specify what to do with
devices based on driver. This responds to bind events and
treats them similarly to add events.
The format of the driver stanza is exactly the same as
that of the subsystem stanza.
Bug: 376900376
Test: set up cbc_mbim driver stanza and ensure it properly
creates and destroys device nodes when a USB device with
that driver appears and disappears or is bound and unbound
Change-Id: I31f5c91bd074d14075b74fe7beefaa6ac07a7ac9
diff --git a/init/ueventd_parser.cpp b/init/ueventd_parser.cpp
index 4395d88..097ef09 100644
--- a/init/ueventd_parser.cpp
+++ b/init/ueventd_parser.cpp
@@ -264,6 +264,8 @@
parser.AddSectionParser("import", std::make_unique<ImportParser>(&parser));
parser.AddSectionParser("subsystem",
std::make_unique<SubsystemParser>(&ueventd_configuration.subsystems));
+ parser.AddSectionParser("driver",
+ std::make_unique<SubsystemParser>(&ueventd_configuration.drivers));
using namespace std::placeholders;
parser.AddSingleLineParser(