forked from organicmaps/organicmaps
Merge pull request #1391 from trashkalmar/disable-tracker-logs
[android] fix: Disable GPS tracker logs in release.
This commit is contained in:
commit
67dde5ed82
2 changed files with 18 additions and 5 deletions
|
@ -65,7 +65,6 @@ android {
|
|||
buildConfigField 'String', 'SUPPORT_MAIL', '"android@maps.me"'
|
||||
buildConfigField 'String', 'REVIEW_URL', '"market://details?id=com.mapswithme.maps.pro"'
|
||||
buildConfigField 'int', 'RATING_THRESHOLD', '5'
|
||||
buildConfigField 'boolean', 'ALLOW_PREF_MAP_STYLE', 'false'
|
||||
}
|
||||
|
||||
sourceSets.main {
|
||||
|
@ -235,7 +234,6 @@ android {
|
|||
zipAlignEnabled true
|
||||
signingConfig signingConfigs.mapswithmeDebug
|
||||
android.sourceSets.debug.setRoot('flavors/debug')
|
||||
buildConfigField 'boolean', 'ALLOW_PREF_MAP_STYLE', 'true'
|
||||
}
|
||||
|
||||
release {
|
||||
|
@ -250,7 +248,6 @@ android {
|
|||
versionNameSuffix '-beta'
|
||||
signingConfig signingConfigs.mapswithme
|
||||
android.sourceSets.beta.setRoot('flavors/beta')
|
||||
buildConfigField 'boolean', 'ALLOW_PREF_MAP_STYLE', 'true'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.mapswithme.maps.location;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
|
@ -7,6 +8,7 @@ import android.content.Intent;
|
|||
import android.location.Location;
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.mapswithme.maps.BuildConfig;
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
import com.mapswithme.maps.background.AppBackgroundTracker;
|
||||
import com.mapswithme.util.concurrency.UiThread;
|
||||
|
@ -33,7 +35,8 @@ public final class TrackRecorder
|
|||
}
|
||||
};
|
||||
|
||||
private static final Logger sLogger = new FileLogger("/sdcard/MapsWithMe/gps-tracker.log");
|
||||
private static Boolean sEnableLogging;
|
||||
private static Logger sLogger;
|
||||
|
||||
private static final LocationHelper.LocationListener sLocationListener = new LocationHelper.LocationListener()
|
||||
{
|
||||
|
@ -203,9 +206,22 @@ public final class TrackRecorder
|
|||
});
|
||||
}
|
||||
|
||||
@SuppressLint("SdCardPath")
|
||||
static void log(String message)
|
||||
{
|
||||
sLogger.d(message);
|
||||
if (sEnableLogging == null)
|
||||
sEnableLogging = ("debug".equals(BuildConfig.BUILD_TYPE) || "beta".equals(BuildConfig.BUILD_TYPE));
|
||||
|
||||
if (!sEnableLogging)
|
||||
return;
|
||||
|
||||
synchronized (TrackRecorder.class)
|
||||
{
|
||||
if (sLogger == null)
|
||||
sLogger = new FileLogger("/sdcard/MapsWithMe/gps-tracker.log");
|
||||
|
||||
sLogger.d(message);
|
||||
}
|
||||
}
|
||||
|
||||
private static native void nativeSetEnabled(boolean enable);
|
||||
|
|
Loading…
Add table
Reference in a new issue