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
This commit is contained in:
Andrew Lehmer
2018-02-23 12:28:07 -08:00
parent fc86925b41
commit 9ebb33ed13

View File

@@ -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