summaryrefslogtreecommitdiff
path: root/utils/loc_target.cpp
diff options
context:
space:
mode:
authorTushar Janefalkar <tusharj@codeaurora.org>2014-01-15 10:24:26 -0800
committerTushar Janefalkar <tusharj@codeaurora.org>2014-02-10 10:15:54 -0800
commit4460543e7d99864f2dee3b3b36fea3aeda34fedf (patch)
tree4472dd85ed2ed9564ce2105ee0bc4c94d3744619 /utils/loc_target.cpp
parent7e53be85c98149e6e21172edf2b5deb7768801ef (diff)
downloadgps-4460543e7d99864f2dee3b3b36fea3aeda34fedf.tar.gz
Add new utilities
This change makes modifications to existing utilities and adds a couple of new utilites to help with the launcher Change-Id: Ib65ffe8e60c7e4a824c5c362765df5dcba872424 CRs-fixed: 600179
Diffstat (limited to 'utils/loc_target.cpp')
-rw-r--r--utils/loc_target.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp
index a3ef6b3..e22e447 100644
--- a/utils/loc_target.cpp
+++ b/utils/loc_target.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 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
@@ -141,6 +141,34 @@ 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)
@@ -163,7 +191,8 @@ unsigned int loc_get_target(void)
goto detected;
}
- property_get("ro.baseband", baseband, "");
+ loc_get_target_baseband(baseband, sizeof(baseband));
+
if (!access(hw_platform, F_OK)) {
read_a_line(hw_platform, rd_hw_platform, LINE_LEN);
} else {