Merge "init: Disable 'on' for non-Vendor APEXes" am: 8b3dff3e82

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2101572

Change-Id: I29039ae588c79e76e248e1a8627cbe5e14e8e708
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2022-05-24 13:53:05 +00:00 committed by Automerger Merge Worker
commit bff647cabd

View file

@ -142,6 +142,14 @@ Result<void> ActionParser::ParseSection(std::vector<std::string>&& 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<std::string, std::string> property_triggers;