summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushar Janefalkar <tusharj@codeaurora.org>2015-03-02 13:51:16 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-03-19 17:33:06 -0700
commit7d367d0e62b59ec820a55d0c52ec9961d87c6d0d (patch)
tree9230323126bbd52877cba8f0b9cb16ecd5b5facb
parentc9b3856769cbcde712c3fd08e3063619e7f73aba (diff)
downloadgps-7d367d0e62b59ec820a55d0c52ec9961d87c6d0d.tar.gz
Add utility to identify lean targets
This utility reads ro.lean system property and returns a 1 if the property is set to true and returns 0 otherwise. Change-Id: I52a8396ee085d44b90d8416131f27b0b1a46575e CRs-fixed: 801990
-rw-r--r--utils/loc_target.cpp14
-rw-r--r--utils/loc_target.h5
2 files changed, 19 insertions, 0 deletions
diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp
index f829d51..08f5584 100644
--- a/utils/loc_target.cpp
+++ b/utils/loc_target.cpp
@@ -244,3 +244,17 @@ 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));
+}
diff --git a/utils/loc_target.h b/utils/loc_target.h
index 873ddfc..3bb3b5e 100644
--- a/utils/loc_target.h
+++ b/utils/loc_target.h
@@ -52,6 +52,11 @@ 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);
+/*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();
/* Please remember to update 'target_name' in loc_log.cpp,
if do any changes to this enum. */