diff options
author | Dante Russo <drusso@codeaurora.org> | 2013-09-04 17:51:18 -0700 |
---|---|---|
committer | Dante Russo <drusso@codeaurora.org> | 2013-09-10 15:57:08 -0700 |
commit | 530086a52d862eb9bcf5fd86a56321d587529b9c (patch) | |
tree | c5251e424dc56fe1508df990612d469edb1b9591 /utils/loc_target.cpp | |
parent | 8946fedf67feba18bd7c9acd3b935bc4539133f2 (diff) | |
download | gps-530086a52d862eb9bcf5fd86a56321d587529b9c.tar.gz |
Fix ATL handling
Always register for ATL events reguardless of hw target
or MSA/MSB capabilities. For APQ target, do not handle
certain types of ATL events that it doen't support.
For APQ target, use only position mode of Standalone.
CRs-fixed: 533932
Change-Id: Icd626e3e7155d5c2ba871a343430e441924ce93c
Diffstat (limited to 'utils/loc_target.cpp')
-rw-r--r-- | utils/loc_target.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index d68d6c9..cd781c0 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -58,6 +58,7 @@ #define GPS_CHECK_NO_GPS_HW 1 static int gss_fd = 0; +static unsigned int gTarget = TARGET_UNKNOWN; static int read_a_line(const char * file_path, char * line, int line_size) { @@ -83,7 +84,8 @@ static int read_a_line(const char * file_path, char * line, int line_size) unsigned int get_target(void) { - unsigned int target = TARGET_DEFAULT; + if (gTarget != TARGET_UNKNOWN) + return gTarget; char hw_platform[] = "/sys/devices/soc0/hw_platform"; char id[] = "/sys/devices/soc0/soc_id"; @@ -111,9 +113,9 @@ unsigned int get_target(void) 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)]) ) - target = TARGET_MPQ; + gTarget = TARGET_MPQ; else - target = TARGET_APQ_SA; + gTarget = TARGET_APQ_SA; } else { if( (!memcmp(rd_hw_platform, STR_LIQUID, LENGTH(STR_LIQUID)) @@ -124,13 +126,13 @@ unsigned int get_target(void) && IS_STR_END(rd_hw_platform[LENGTH(STR_MTP)]))) { if (!read_a_line( mdm, rd_mdm, LINE_LEN)) - target = TARGET_MDM; + gTarget = TARGET_MDM; } else if( (!memcmp(rd_id, MSM8930_ID_1, LENGTH(MSM8930_ID_1)) && IS_STR_END(rd_id[LENGTH(MSM8930_ID_1)])) || (!memcmp(rd_id, MSM8930_ID_2, LENGTH(MSM8930_ID_2)) && IS_STR_END(rd_id[LENGTH(MSM8930_ID_2)])) ) - target = TARGET_MSM_NO_SSC; + gTarget = TARGET_MSM_NO_SSC; } - return target; + return gTarget; } |