Loading init/action.cpp +14 −11 Original line number Diff line number Diff line Loading @@ -180,21 +180,24 @@ void Action::ExecuteCommand(const Command& command) const { // It takes an optional (name, value) pair, which if provided must // be present in property_triggers_; it skips the check of the current // property value for this pair. bool Action::CheckPropertyTriggers(const std::string& name, const std::string& value) const { bool Action::CheckPropertyTriggers(const std::string& name, const std::string& value) const { if (property_triggers_.empty()) { return true; } bool found = name.empty(); for (const auto& [trigger_name, trigger_value] : property_triggers_) { if (trigger_name == name) { if (!name.empty()) { auto it = property_triggers_.find(name); if (it == property_triggers_.end()) { return false; } const auto& trigger_value = it->second; if (trigger_value != "*" && trigger_value != value) { return false; } else { found = true; } } else { } for (const auto& [trigger_name, trigger_value] : property_triggers_) { if (trigger_name != name) { std::string prop_value = android::base::GetProperty(trigger_name, ""); if (trigger_value == "*" && !prop_value.empty()) { continue; Loading @@ -202,7 +205,7 @@ bool Action::CheckPropertyTriggers(const std::string& name, if (trigger_value != prop_value) return false; } } return found; return true; } bool Action::CheckEvent(const EventTrigger& event_trigger) const { Loading Loading
init/action.cpp +14 −11 Original line number Diff line number Diff line Loading @@ -180,21 +180,24 @@ void Action::ExecuteCommand(const Command& command) const { // It takes an optional (name, value) pair, which if provided must // be present in property_triggers_; it skips the check of the current // property value for this pair. bool Action::CheckPropertyTriggers(const std::string& name, const std::string& value) const { bool Action::CheckPropertyTriggers(const std::string& name, const std::string& value) const { if (property_triggers_.empty()) { return true; } bool found = name.empty(); for (const auto& [trigger_name, trigger_value] : property_triggers_) { if (trigger_name == name) { if (!name.empty()) { auto it = property_triggers_.find(name); if (it == property_triggers_.end()) { return false; } const auto& trigger_value = it->second; if (trigger_value != "*" && trigger_value != value) { return false; } else { found = true; } } else { } for (const auto& [trigger_name, trigger_value] : property_triggers_) { if (trigger_name != name) { std::string prop_value = android::base::GetProperty(trigger_name, ""); if (trigger_value == "*" && !prop_value.empty()) { continue; Loading @@ -202,7 +205,7 @@ bool Action::CheckPropertyTriggers(const std::string& name, if (trigger_value != prop_value) return false; } } return found; return true; } bool Action::CheckEvent(const EventTrigger& event_trigger) const { Loading