diff options
author | Dante Russo <drusso@codeaurora.org> | 2015-07-02 17:29:29 -0700 |
---|---|---|
committer | Dante Russo <drusso@codeaurora.org> | 2015-07-16 10:07:13 -0700 |
commit | 1b07337c5a12e0d11d84ea0378a15cdffd504e76 (patch) | |
tree | e68e45fa4fad625e712f2e4b604532d77e462343 | |
parent | e768ded5edde0232964f39895008bf46f12fbb7d (diff) | |
download | gps-1b07337c5a12e0d11d84ea0378a15cdffd504e76.tar.gz |
LCA additions to ULP and log_util defines.
1. Add two new ulp location sources (PIP and NLP)
ULP_LOCATION_IS_FROM_NLP to mark locations from NLP
ULP_LOCATION_IS_FROM_PIP to mark locations from PIP
2. Introduce a macro for printing exit log with error
CRs-Fixed: 694343
Change-Id: Ifa11803df2ed4fc249a5c339acfeeb5d89bf55d5
-rw-r--r-- | core/gps_extended_c.h | 5 | ||||
-rw-r--r-- | utils/loc_log.cpp | 1 | ||||
-rw-r--r-- | utils/log_util.h | 10 |
3 files changed, 14 insertions, 2 deletions
diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index f3edbd9..4cb9ede 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -64,7 +64,10 @@ extern "C" { #define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008 /** Positioin is from Hardware FLP */ #define ULP_LOCATION_IS_FROM_HW_FLP 0x0010 -#define ULP_LOCATION_IS_FROM_NLP 0x0020 +/** Position is from NLP */ +#define ULP_LOCATION_IS_FROM_NLP 0x0020 +/** Position is from PIP */ +#define ULP_LOCATION_IS_FROM_PIP 0x0040 #define ULP_MIN_INTERVAL_INVALID 0xffffffff diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index 18182b7..5500dea 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -51,6 +51,7 @@ const char FROM_MODEM[] = "<---"; const char TO_AFW[] = "<==="; const char EXIT_TAG[] = "Exiting"; const char ENTRY_TAG[] = "Entering"; +const char EXIT_ERROR_TAG[] = "Exiting with error"; /* Logging Mechanism */ loc_logger_s_type loc_logger; diff --git a/utils/log_util.h b/utils/log_util.h index 8ff6b5a..ffd5ca9 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -81,6 +81,8 @@ extern const char FROM_MODEM[]; extern const char TO_AFW[]; extern const char EXIT_TAG[]; extern const char ENTRY_TAG[]; +extern const char EXIT_ERROR_TAG[]; + /*============================================================================= * * MODULE EXPORTED FUNCTIONS @@ -157,12 +159,18 @@ else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); } } \ } while(0) - #define LOG_I(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGI, ID, WHAT, SPEC, VAL) #define LOG_V(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGV, ID, WHAT, SPEC, VAL) +#define LOG_E(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGE, ID, WHAT, SPEC, VAL) #define ENTRY_LOG() LOG_V(ENTRY_TAG, __func__, %s, "") #define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __func__, SPEC, VAL) +#define EXIT_LOG_WITH_ERROR(SPEC, VAL) \ + if (VAL != 0) { \ + LOG_E(EXIT_ERROR_TAG, __func__, SPEC, VAL); \ + } else { \ + LOG_V(EXIT_TAG, __func__, SPEC, VAL); \ + } // Used for logging callflow from Android Framework |