diff options
author | Deven Patel <cdevenp@codeaurora.org> | 2016-03-07 10:44:34 -0800 |
---|---|---|
committer | Deven Patel <cdevenp@codeaurora.org> | 2016-03-07 10:55:20 -0800 |
commit | a29688ff347be4972133eb11ccecaf03b0d3445e (patch) | |
tree | 45dc8adb0d08a30bc542075042884cef831bcfdf /utils/loc_target.cpp | |
parent | fa7a874eb0586c7844fe3a4cb8d0063ce53464f0 (diff) | |
download | gps-a29688ff347be4972133eb11ccecaf03b0d3445e.tar.gz |
Revert "Merging m_master changes to oe_master".
This reverts commit 1aeb6bad84c0afd0e032c3d4d7e33959501e18f1
Change-Id: Iec0a96e7cdfe55ef5836c92a2ae1cce407f6cd5e
Diffstat (limited to 'utils/loc_target.cpp')
-rw-r--r-- | utils/loc_target.cpp | 62 |
1 files changed, 5 insertions, 57 deletions
diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index 30c040c..b5a6297 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012,2014, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -53,15 +53,11 @@ #define STR_SURF "Surf" #define STR_MTP "MTP" #define STR_APQ "apq" -#define STR_AUTO "auto" #define IS_STR_END(c) ((c) == '\0' || (c) == '\n' || (c) == '\r') #define LENGTH(s) (sizeof(s) - 1) #define GPS_CHECK_NO_ERROR 0 #define GPS_CHECK_NO_GPS_HW 1 -/* When system server is started, it uses 20 seconds as ActivityManager - * timeout. After that it sends SIGSTOP signal to process. - */ -#define QCA1530_DETECT_TIMEOUT 15 +#define QCA1530_DETECT_TIMEOUT 30 #define QCA1530_DETECT_PRESENT "yes" #define QCA1530_DETECT_PROGRESS "detect" @@ -103,7 +99,7 @@ static int read_a_line(const char * file_path, char * line, int line_size) */ static bool is_qca1530(void) { - static const char qca1530_property_name[] = "sys.qca1530"; + static const char qca1530_property_name[] = "persist.qca1530"; bool res = false; int ret, i; char buf[PROPERTY_VALUE_MAX]; @@ -146,34 +142,6 @@ static bool is_qca1530(void) return res; } -/*The character array passed to this function should have length - of atleast PROPERTY_VALUE_MAX*/ -void loc_get_target_baseband(char *baseband, int array_length) -{ - if(baseband && (array_length >= PROPERTY_VALUE_MAX)) { - property_get("ro.baseband", baseband, ""); - LOC_LOGD("%s:%d]: Baseband: %s\n", __func__, __LINE__, baseband); - } - else { - LOC_LOGE("%s:%d]: NULL parameter or array length less than PROPERTY_VALUE_MAX\n", - __func__, __LINE__); - } -} - -/*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) -{ - if(platform_name && (array_length >= PROPERTY_VALUE_MAX)) { - property_get("ro.board.platform", platform_name, ""); - LOC_LOGD("%s:%d]: Target 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) @@ -196,8 +164,7 @@ unsigned int loc_get_target(void) goto detected; } - loc_get_target_baseband(baseband, sizeof(baseband)); - + platform_lib_abstraction_property_get("ro.baseband", baseband, ""); if (!access(hw_platform, F_OK)) { read_a_line(hw_platform, rd_hw_platform, LINE_LEN); } else { @@ -208,13 +175,8 @@ unsigned int loc_get_target(void) } else { read_a_line(id_dep, rd_id, LINE_LEN); } - if( !memcmp(baseband, STR_AUTO, LENGTH(STR_AUTO)) ) - { - gTarget = TARGET_AUTO; - goto detected; - } - if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){ + if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){ if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) gTarget = TARGET_MPQ; @@ -245,17 +207,3 @@ detected: LOC_LOGD("HAL: %s returned %d", __FUNCTION__, gTarget); return gTarget; } - -/*Reads the property ro.lean to identify if this is a lean target - Returns: - 0 if not a lean and mean target - 1 if this is a lean and mean target -*/ -int loc_identify_lean_target() -{ - int ret = 0; - char lean_target[PROPERTY_VALUE_MAX]; - property_get("ro.lean", lean_target, ""); - LOC_LOGD("%s:%d]: lean target: %s\n", __func__, __LINE__, lean_target); - return !(strncmp(lean_target, "true", PROPERTY_VALUE_MAX)); -} |