From 9ebb33ed1373677a40a17faf12700408ba97ee8e Mon Sep 17 00:00:00 2001 From: Andrew Lehmer Date: Fri, 23 Feb 2018 12:28:07 -0800 Subject: [PATCH] folio_daemon: start and stop with other services If sensorservice goes down while folio_daemon is running, folio_daemon will gracefully exit and restart. If sensorservice remains down while folio_daemon is starting, it will eventually crash due to the way the ASensorManager_getInstanceForPackage() API behaves (i.e., it will exit with a SIGABRT after five minutes of waiting). We can reduce the chance of this happening by ensuring folio_daemon is only started when its dependent services are explicitly started as well. Note that this cannot guarantee that folio_daemon will *never* crash due to SIGABRT, since there is no variant of ASensorManager_getInstanceForPackage() that allows for graceful handling of the service timeout. Events that negatively affect the availability of sensors are outside the control of folio_daemon. Bug: 73555660 Test: loaded on walleye and tested with `stop` and `start` commands Change-Id: I65e1b72745719f2540bff7cab8e556725486bcad --- init.hardware.rc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.hardware.rc b/init.hardware.rc index 60786f5a..cf57a2b4 100644 --- a/init.hardware.rc +++ b/init.hardware.rc @@ -504,6 +504,13 @@ service vendor.folio_daemon /system/bin/folio_daemon class late_start user system group system + disabled + +on property:init.svc.zygote=running + start vendor.folio_daemon + +on property:init.svc.zygote=stopped + stop vendor.folio_daemon service vendor.perfd /vendor/bin/perfd class main