summaryrefslogtreecommitdiff
path: root/init/init.cpp
diff options
context:
space:
mode:
authorcaozhiyuan <cao.zhiyuan@zte.com.cn>2016-11-26 21:14:07 +0800
committerAlain Vongsouvanh <alainv@google.com>2016-11-30 09:51:38 -0800
commit876ad4571e2eab037a2537f7334220e249a78343 (patch)
tree4645680dfeb46a36a898f73783bdd0847817944a /init/init.cpp
parent79517d4f9f196bfd11388583e970d5c710951561 (diff)
init: Fix sync issue on property trigger.
This issue reproduces in the following senario. 1. ("", "") is added to queue; 2. property_triggers_enabled is set to 1; 3. user defined property is triggered, like sys.usb.config=adb; 4. ("sys.usb.config", "adb") is added to queue; 5. main loop interpret ("", "") and queue all current triggers to execution, so ("sys.usb.config", "adb") is queued for execution for the first time. 6. main loop interpret ("sys.usb.config", "adb"), it is queued for execution for a second time. The second time makes ASIT fail. (cherry pick from AOSP commit b104c502e1db80eda9751b0cba19e2e24fc0c3c0) Bug: http://b/28218187 Change-Id: I230e175e0dca8989f1e5bd812398da90082d0ec1 Signed-off-by: caozhiyuan <cao.zhiyuan@zte.com.cn>
Diffstat (limited to 'init/init.cpp')
-rw-r--r--init/init.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/init/init.cpp b/init/init.cpp
index 84da2b956..cd2d2e6ab 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -478,11 +478,17 @@ static void process_kernel_cmdline() {
if (qemu[0]) import_kernel_cmdline(true, import_kernel_nv);
}
+static int property_enable_triggers_action(const std::vector<std::string>& args)
+{
+ /* Enable property triggers. */
+ property_triggers_enabled = 1;
+ return 0;
+}
+
static int queue_property_triggers_action(const std::vector<std::string>& args)
{
+ ActionManager::GetInstance().QueueBuiltinAction(property_enable_triggers_action, "enable_property_trigger");
ActionManager::GetInstance().QueueAllPropertyTriggers();
- /* enable property triggers */
- property_triggers_enabled = 1;
return 0;
}