Skip to content

Commit

Permalink
chiron: Implement xtra-daemon control via property
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mikeNG authored and BYZYB committed Jul 2, 2023
1 parent 05ea573 commit 946b8cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gps/utils/loc_cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ const char LOC_PATH_APDR_CONF[] = LOC_PATH_APDR_CONF_STR;
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_modem_emulator_enabled
Expand Down Expand Up @@ -810,6 +816,13 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p
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);
Expand Down
3 changes: 3 additions & 0 deletions rootdir/etc/init.qcom.rc
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ service vendor.time_daemon /vendor/bin/time_daemon
capabilities SYS_TIME
writepid /dev/cpuset/system-background/tasks

on property:persist.sys.xtra-daemon.enabled=*
restart vendor.loc_launcher

on property:ro.vendor.ril.mbn_copy_completed=1
write /data/vendor/radio/copy_complete 1

Expand Down

0 comments on commit 946b8cd

Please sign in to comment.