init: Add support "&&" operator in property triggers
"&&" operator can now be used to test the validity
of two of more properties.
For example:
on property:test.a=1 && property:test.b=1
setprop test.c 1
The above stub sets the test.c to 1 only when
both test.a=1 and test.b=1
(cherry-pick of 162f7d797c67019a7a3f08c3b0f0ffc91d548ddc.)
Change-Id: I72c19f7aa92231372a416193618ee6c7fd368141
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
diff --git a/init/parser.c b/init/parser.c
index 48e7aec..80bfb09 100644
--- a/init/parser.c
+++ b/init/parser.c
@@ -15,9 +15,10 @@
struct command *cmd;
struct listnode *node;
struct listnode *node2;
+ char name_str[256] = "";
struct socketinfo *si;
int n;
-
+
list_for_each(node, &service_list) {
svc = node_to_item(node, struct service, slist);
RAW("service %s\n", svc->name);
@@ -34,7 +35,11 @@
list_for_each(node, &action_list) {
act = node_to_item(node, struct action, alist);
- RAW("on %s\n", act->name);
+ RAW("on ");
+ build_triggers_string(name_str, sizeof(name_str), act);
+ RAW("%s", name_str);
+ RAW("\n");
+
list_for_each(node2, &act->commands) {
cmd = node_to_item(node2, struct command, clist);
RAW(" %p", cmd->func);