diff options
author | Nick Pelly <npelly@google.com> | 2011-06-17 15:44:30 -0700 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2011-06-20 12:15:26 -0700 |
commit | 23482d091c046310ef4c57f625c67e0d0e776500 (patch) | |
tree | f85e5093bdb737396cc4a231c5142478435445b8 /Linux_x86 | |
parent | 4b276c94d7a3286d8b73fdbd975053651b4cf989 (diff) | |
download | external_libnfc-nxp-23482d091c046310ef4c57f625c67e0d0e776500.zip external_libnfc-nxp-23482d091c046310ef4c57f625c67e0d0e776500.tar.gz external_libnfc-nxp-23482d091c046310ef4c57f625c67e0d0e776500.tar.bz2 |
Do not allow run-time LOW_LEVEL_TRACES on user builds.
Change-Id: Ie78432b46ded168c72b5f00dd05ea72287ab155d
Diffstat (limited to 'Linux_x86')
-rw-r--r-- | Linux_x86/phDal4Nfc.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Linux_x86/phDal4Nfc.c b/Linux_x86/phDal4Nfc.c index 1b6da83..d052477 100644 --- a/Linux_x86/phDal4Nfc.c +++ b/Linux_x86/phDal4Nfc.c @@ -121,17 +121,27 @@ static void phDal4Nfc_FillMsg (phDal4Nfc_Message_t *pDalMsg, phOsalN ------------------------------------------------------------------------------------*/ static void refresh_low_level_traces() { +#ifdef LOW_LEVEL_TRACES + low_level_traces = 1; + return; +#else + #ifdef ANDROID - char value[1]; + char value[PROPERTY_VALUE_MAX]; + + property_get("ro.debuggable", value, ""); + if (!value[0] || !atoi(value)) { + low_level_traces = 0; // user build, do not allow debug + return; + } + property_get("debug.nfc.LOW_LEVEL_TRACES", value, ""); if (value[0]) { - low_level_traces = atoi(value); - DAL_DEBUG("debug.nfc.LOW_LEVEL_TRACES = %X", low_level_traces); + low_level_traces = atoi(value) ? 1 : 0; + return; } #endif - -#ifdef LOW_LEVEL_TRACES - low_level_traces = 1; + low_level_traces = 0; #endif } |