diff options
author | Madhanraj Chelladurai <mchellad@codeaurora.org> | 2016-03-17 11:58:51 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-04-27 23:43:17 -0700 |
commit | edc2a648b3525006eded5d99091c248268425011 (patch) | |
tree | 59950fad7d735a8843486e5533c9fb3198781e65 /utils | |
parent | 1fb9826d91360a2105241a368914eaab9b86151f (diff) | |
download | gps-edc2a648b3525006eded5d99091c248268425011.tar.gz |
gps: include support to check hardware type property
automotive platform introduced a new android property called
ro.hardware.type to detect automotive platform for the
purpose of having automotive specific features.
Added changes in loc_target to detect auto platform.
Change-Id: Ib886b96b2e95dafc151bead041e5fc3d6740c468
CRs-Fixed: 992647
Diffstat (limited to 'utils')
-rw-r--r-- | utils/loc_target.cpp | 20 | ||||
-rw-r--r-- | utils/loc_target.h | 4 |
2 files changed, 23 insertions, 1 deletions
diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 30c040c..92bdca6 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -174,6 +174,20 @@ void loc_get_platform_name(char *platform_name, int array_length) } } +/*The character array passed to this function should have length + of atleast PROPERTY_VALUE_MAX*/ +void loc_get_auto_platform_name(char *platform_name, int array_length) +{ + if(platform_name && (array_length >= PROPERTY_VALUE_MAX)) { + property_get("ro.hardware.type", platform_name, ""); + LOC_LOGD("%s:%d]: Autoplatform name: %s\n", __func__, __LINE__, platform_name); + } + else { + LOC_LOGE("%s:%d]: Null parameter or array length less than PROPERTY_VALUE_MAX\n", + __func__, __LINE__); + } +} + unsigned int loc_get_target(void) { if (gTarget != (unsigned int)-1) @@ -190,6 +204,7 @@ unsigned int loc_get_target(void) char rd_id[LINE_LEN]; char rd_mdm[LINE_LEN]; char baseband[LINE_LEN]; + char rd_auto_platform[LINE_LEN]; if (is_qca1530()) { gTarget = TARGET_QCA1530; @@ -208,7 +223,10 @@ unsigned int loc_get_target(void) } else { read_a_line(id_dep, rd_id, LINE_LEN); } - if( !memcmp(baseband, STR_AUTO, LENGTH(STR_AUTO)) ) + + /*check automotive platform*/ + loc_get_auto_platform_name(rd_auto_platform, sizeof(rd_auto_platform)); + if( !memcmp(rd_auto_platform, STR_AUTO, LENGTH(STR_AUTO)) ) { gTarget = TARGET_AUTO; goto detected; diff --git a/utils/loc_target.h b/utils/loc_target.h index 3bb3b5e..b76ed88 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -52,6 +52,10 @@ void loc_get_target_baseband(char *baseband, int array_length); /*The character array passed to this function should have length of atleast PROPERTY_VALUE_MAX*/ void loc_get_platform_name(char *platform_name, int array_length); +/*The character array passed to this function should have length + of atleast PROPERTY_VALUE_MAX*/ +void loc_get_auto_platform_name(char *platform_name, int array_length); + /*Reads the property ro.lean to identify if this is a lean target Returns: 0 if not a lean and mean target |