Launch platform specific processes
Launch processes based on whether the platform is vendor enhanced or not. Change-Id: I04c074023e631c4f5d1e16ac166612f323b7a868 CRs-Fixed: 2341030
This commit is contained in:
parent
18c99090be
commit
400c1e8b57
7 changed files with 49 additions and 14 deletions
|
@ -71,6 +71,7 @@ LOCAL_SHARED_LIBRARIES := \
|
||||||
libdl \
|
libdl \
|
||||||
libbase \
|
libbase \
|
||||||
libutils \
|
libutils \
|
||||||
|
libqti_vndfwk_detect \
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES += \
|
LOCAL_SHARED_LIBRARIES += \
|
||||||
libhwbinder \
|
libhwbinder \
|
||||||
|
|
|
@ -23,9 +23,17 @@
|
||||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||||
#include <hidl/LegacySupport.h>
|
#include <hidl/LegacySupport.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "vndfwk-detect.h"
|
||||||
|
}
|
||||||
|
|
||||||
using android::hardware::gnss::V1_0::IGnss;
|
using android::hardware::gnss::V1_0::IGnss;
|
||||||
using android::hardware::defaultPassthroughServiceImplementation;
|
using android::hardware::defaultPassthroughServiceImplementation;
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
return defaultPassthroughServiceImplementation<IGnss>();
|
if (!isRunningWithVendorEnhancedFramework()) {
|
||||||
|
return defaultPassthroughServiceImplementation<IGnss>();
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,7 @@ LOCAL_SHARED_LIBRARIES := \
|
||||||
libdl \
|
libdl \
|
||||||
libbase \
|
libbase \
|
||||||
libutils \
|
libutils \
|
||||||
|
libqti_vndfwk_detect \
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES += \
|
LOCAL_SHARED_LIBRARIES += \
|
||||||
libhwbinder \
|
libhwbinder \
|
||||||
|
|
|
@ -23,9 +23,17 @@
|
||||||
#include <android/hardware/gnss/1.1/IGnss.h>
|
#include <android/hardware/gnss/1.1/IGnss.h>
|
||||||
#include <hidl/LegacySupport.h>
|
#include <hidl/LegacySupport.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "vndfwk-detect.h"
|
||||||
|
}
|
||||||
|
|
||||||
using android::hardware::gnss::V1_1::IGnss;
|
using android::hardware::gnss::V1_1::IGnss;
|
||||||
using android::hardware::defaultPassthroughServiceImplementation;
|
using android::hardware::defaultPassthroughServiceImplementation;
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
return defaultPassthroughServiceImplementation<IGnss>();
|
if (!isRunningWithVendorEnhancedFramework()) {
|
||||||
|
return defaultPassthroughServiceImplementation<IGnss>();
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,8 @@ include $(CLEAR_VARS)
|
||||||
LOCAL_SHARED_LIBRARIES := \
|
LOCAL_SHARED_LIBRARIES := \
|
||||||
libutils \
|
libutils \
|
||||||
libcutils \
|
libcutils \
|
||||||
liblog
|
liblog \
|
||||||
|
libqti_vndfwk_detect
|
||||||
|
|
||||||
LOCAL_SRC_FILES += \
|
LOCAL_SRC_FILES += \
|
||||||
loc_log.cpp \
|
loc_log.cpp \
|
||||||
|
|
|
@ -48,6 +48,10 @@
|
||||||
#endif
|
#endif
|
||||||
#include "log_util.h"
|
#include "log_util.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "vndfwk-detect.h"
|
||||||
|
}
|
||||||
|
|
||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
*
|
*
|
||||||
* GLOBAL DATA DECLARATION
|
* GLOBAL DATA DECLARATION
|
||||||
|
@ -487,6 +491,7 @@ typedef struct {
|
||||||
char feature_supl_wifi[LOC_MAX_PARAM_STRING];
|
char feature_supl_wifi[LOC_MAX_PARAM_STRING];
|
||||||
char feature_wifi_supplicant_info[LOC_MAX_PARAM_STRING];
|
char feature_wifi_supplicant_info[LOC_MAX_PARAM_STRING];
|
||||||
char auto_platform[LOC_MAX_PARAM_STRING];
|
char auto_platform[LOC_MAX_PARAM_STRING];
|
||||||
|
unsigned int vendor_enhanced_process;
|
||||||
} loc_launcher_conf;
|
} loc_launcher_conf;
|
||||||
|
|
||||||
/* process configuration parameters */
|
/* process configuration parameters */
|
||||||
|
@ -509,15 +514,16 @@ static const loc_param_s_type loc_feature_conf_table[] = {
|
||||||
|
|
||||||
/* location process conf, e.g.: izat.conf Parameter spec table */
|
/* location process conf, e.g.: izat.conf Parameter spec table */
|
||||||
static const loc_param_s_type loc_process_conf_parameter_table[] = {
|
static const loc_param_s_type loc_process_conf_parameter_table[] = {
|
||||||
{"PROCESS_NAME", &conf.proc_name, NULL, 's'},
|
{"PROCESS_NAME", &conf.proc_name, NULL, 's'},
|
||||||
{"PROCESS_ARGUMENT", &conf.proc_argument, NULL, 's'},
|
{"PROCESS_ARGUMENT", &conf.proc_argument, NULL, 's'},
|
||||||
{"PROCESS_STATE", &conf.proc_status, NULL, 's'},
|
{"PROCESS_STATE", &conf.proc_status, NULL, 's'},
|
||||||
{"PROCESS_GROUPS", &conf.group_list, NULL, 's'},
|
{"PROCESS_GROUPS", &conf.group_list, NULL, 's'},
|
||||||
{"PREMIUM_FEATURE", &conf.premium_feature, NULL, 'n'},
|
{"PREMIUM_FEATURE", &conf.premium_feature, NULL, 'n'},
|
||||||
{"IZAT_FEATURE_MASK", &conf.loc_feature_mask, NULL, 'n'},
|
{"IZAT_FEATURE_MASK", &conf.loc_feature_mask, NULL, 'n'},
|
||||||
{"PLATFORMS", &conf.platform_list, NULL, 's'},
|
{"PLATFORMS", &conf.platform_list, NULL, 's'},
|
||||||
{"BASEBAND", &conf.baseband, NULL, 's'},
|
{"BASEBAND", &conf.baseband, NULL, 's'},
|
||||||
{"HARDWARE_TYPE", &conf.auto_platform, NULL, 's'},
|
{"HARDWARE_TYPE", &conf.auto_platform, NULL, 's'},
|
||||||
|
{"VENDOR_ENHANCED_PROCESS", &conf.vendor_enhanced_process, NULL, 'n'},
|
||||||
};
|
};
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
|
@ -758,6 +764,14 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((isRunningWithVendorEnhancedFramework() && conf.vendor_enhanced_process == 0) ||
|
||||||
|
(!isRunningWithVendorEnhancedFramework() && conf.vendor_enhanced_process != 0)) {
|
||||||
|
LOC_LOGD("%s:%d]: Process %s is disabled via vendor enhanced process check",
|
||||||
|
__func__, __LINE__, conf.proc_name);
|
||||||
|
child_proc[j].proc_status = DISABLED_VIA_VENDOR_ENHANCED_CHECK;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if(strcmp(conf.proc_status, "DISABLED") == 0) {
|
if(strcmp(conf.proc_status, "DISABLED") == 0) {
|
||||||
LOC_LOGD("%s:%d]: Process %s is disabled in conf file",
|
LOC_LOGD("%s:%d]: Process %s is disabled in conf file",
|
||||||
__func__, __LINE__, conf.proc_name);
|
__func__, __LINE__, conf.proc_name);
|
||||||
|
@ -871,7 +885,8 @@ int loc_read_process_conf(const char* conf_file_name, uint32_t * process_count_p
|
||||||
if((config_mask & CONFIG_MASK_TARGET_CHECK) &&
|
if((config_mask & CONFIG_MASK_TARGET_CHECK) &&
|
||||||
(config_mask & CONFIG_MASK_BASEBAND_CHECK) &&
|
(config_mask & CONFIG_MASK_BASEBAND_CHECK) &&
|
||||||
(config_mask & CONFIG_MASK_AUTOPLATFORM_CHECK) &&
|
(config_mask & CONFIG_MASK_AUTOPLATFORM_CHECK) &&
|
||||||
(child_proc[j].proc_status != DISABLED_FROM_CONF)) {
|
(child_proc[j].proc_status != DISABLED_FROM_CONF) &&
|
||||||
|
(child_proc[j].proc_status != DISABLED_VIA_VENDOR_ENHANCED_CHECK)) {
|
||||||
|
|
||||||
//Set args
|
//Set args
|
||||||
//The first argument passed through argv is usually the name of the
|
//The first argument passed through argv is usually the name of the
|
||||||
|
|
|
@ -84,7 +84,8 @@ typedef enum {
|
||||||
ENABLED,
|
ENABLED,
|
||||||
RUNNING,
|
RUNNING,
|
||||||
DISABLED,
|
DISABLED,
|
||||||
DISABLED_FROM_CONF
|
DISABLED_FROM_CONF,
|
||||||
|
DISABLED_VIA_VENDOR_ENHANCED_CHECK
|
||||||
} loc_process_e_status;
|
} loc_process_e_status;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
Loading…
Reference in a new issue