diff --git a/init/action_parser.cpp b/init/action_parser.cpp index 52f6a1f3c..49fe24a43 100644 --- a/init/action_parser.cpp +++ b/init/action_parser.cpp @@ -142,6 +142,14 @@ Result ActionParser::ParseSection(std::vector&& args, action_subcontext = subcontext_; } + // We support 'on' for only Vendor APEXes from /{vendor, odm}. + // It is to prevent mainline modules from using 'on' triggers because events/properties are + // not stable for mainline modules. + // Note that this relies on Subcontext::PathMatchesSubcontext() to identify Vendor APEXes. + if (StartsWith(filename, "/apex/") && !action_subcontext) { + return Error() << "ParseSection() failed: 'on' is supported for only Vendor APEXes."; + } + std::string event_trigger; std::map property_triggers;