summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Keith <javelinanddart@gmail.com>2019-02-06 19:09:21 -0600
committerBruno Martins <bgcngm@gmail.com>2019-02-07 08:19:34 +0000
commit950336a92de583376aa89819609392a625e9ca1e (patch)
tree22e61602e1484fc6a2c2db1d468cd4eca93eb127
parent75ac2f2facf7d04ccaa0a9d9f166a7e4d8ddbf2e (diff)
downloadandroid_hardware_lineage_livedisplay-950336a92de583376aa89819609392a625e9ca1e.tar.gz
android_hardware_lineage_livedisplay-950336a92de583376aa89819609392a625e9ca1e.tar.bz2
android_hardware_lineage_livedisplay-950336a92de583376aa89819609392a625e9ca1e.zip
livedisplay: Fix racy init
* It turns out moving this to class main doesn't work as well as some had thought it would, so restore the previous logic to use class hal, and restart if the backend isn't up yet Change-Id: Ib8b417d89108dcf80d0d159e8d84e5327944b2a1
-rw-r--r--legacymm/service.cpp5
-rw-r--r--legacymm/vendor.lineage.livedisplay@2.0-service-legacymm.rc2
-rw-r--r--sdm/lineage.livedisplay@2.0-service-sdm.rc2
-rw-r--r--sdm/service.cpp5
-rw-r--r--sdm/vendor.lineage.livedisplay@2.0-service-sdm.rc2
5 files changed, 13 insertions, 3 deletions
diff --git a/legacymm/service.cpp b/legacymm/service.cpp
index dc37076..66d452f 100644
--- a/legacymm/service.cpp
+++ b/legacymm/service.cpp
@@ -92,6 +92,11 @@ int main() {
goto shutdown;
}
+ if (!cb->isSupported() && !dm->isSupported() && !pa->isSupported()) {
+ // Backend isn't ready yet, so restart and try again
+ goto shutdown;
+ }
+
configureRpcThreadpool(1, true /*callerWillJoin*/);
if (cb->isSupported()) {
diff --git a/legacymm/vendor.lineage.livedisplay@2.0-service-legacymm.rc b/legacymm/vendor.lineage.livedisplay@2.0-service-legacymm.rc
index 8656ffd..14b143d 100644
--- a/legacymm/vendor.lineage.livedisplay@2.0-service-legacymm.rc
+++ b/legacymm/vendor.lineage.livedisplay@2.0-service-legacymm.rc
@@ -1,4 +1,4 @@
service vendor.livedisplay-hal-2-0-legacymm /vendor/bin/hw/vendor.lineage.livedisplay@2.0-service-legacymm
- class main
+ class late_start
user system
group system
diff --git a/sdm/lineage.livedisplay@2.0-service-sdm.rc b/sdm/lineage.livedisplay@2.0-service-sdm.rc
index ca5eefc..3a21252 100644
--- a/sdm/lineage.livedisplay@2.0-service-sdm.rc
+++ b/sdm/lineage.livedisplay@2.0-service-sdm.rc
@@ -1,4 +1,4 @@
service livedisplay-hal-2-0-sdm /system/bin/hw/lineage.livedisplay@2.0-service-sdm
- class main
+ class late_start
user system
group system
diff --git a/sdm/service.cpp b/sdm/service.cpp
index f561ad9..bee3ef6 100644
--- a/sdm/service.cpp
+++ b/sdm/service.cpp
@@ -128,6 +128,11 @@ int main() {
goto shutdown;
}
+ if (!ab->isSupported() && !cb->isSupported() && !dm->isSupported() && !pa->isSupported()) {
+ // Backend isn't ready yet, so restart and try again
+ goto shutdown;
+ }
+
configureRpcThreadpool(1, true /*callerWillJoin*/);
if (ab->isSupported()) {
diff --git a/sdm/vendor.lineage.livedisplay@2.0-service-sdm.rc b/sdm/vendor.lineage.livedisplay@2.0-service-sdm.rc
index 1e66d30..861466b 100644
--- a/sdm/vendor.lineage.livedisplay@2.0-service-sdm.rc
+++ b/sdm/vendor.lineage.livedisplay@2.0-service-sdm.rc
@@ -1,4 +1,4 @@
service vendor.livedisplay-hal-2-0-sdm /vendor/bin/hw/vendor.lineage.livedisplay@2.0-service-sdm
- class main
+ class late_start
user system
group system