Implement xtra-daemon control via property
Default to false if the property is not set.
Device init scripts will need to be adapted to restart
loc_launcher service when property change is detected.
Change-Id: Icbda789cd2a9a3391f437af2c07fc5127f2f09ab
diff --git a/sdm845/utils/loc_cfg.cpp b/sdm845/utils/loc_cfg.cpp
index ad7aba2..4f9f729 100644
--- a/sdm845/utils/loc_cfg.cpp
+++ b/sdm845/utils/loc_cfg.cpp
@@ -85,6 +85,12 @@
const char LOC_PATH_XTWIFI_CONF[] = LOC_PATH_XTWIFI_CONF_STR;
const char LOC_PATH_QUIPC_CONF[] = LOC_PATH_QUIPC_CONF_STR;
+bool isXtraDaemonEnabled() {
+ bool enabled = property_get_bool("persist.sys.xtra-daemon.enabled", false);
+ LOC_LOGe("xtra-daemon enabled: %d\n", enabled);
+ return enabled;
+}
+
/*===========================================================================
FUNCTION loc_set_config_entry
@@ -797,6 +803,13 @@
continue;
}
+ if (strcmp(conf.proc_name, "xtra-daemon") == 0 && !isXtraDaemonEnabled()) {
+ LOC_LOGE("%s:%d]: Process xtra-daemon is disabled via property",
+ __func__, __LINE__);
+ child_proc[j].proc_status = DISABLED_FROM_CONF;
+ continue;
+ }
+
if(strcmp(conf.proc_status, "DISABLED") == 0) {
LOC_LOGD("%s:%d]: Process %s is disabled in conf file",
__func__, __LINE__, conf.proc_name);