never enable analytics if Tor is enabled
This commit is contained in:
@@ -153,10 +153,10 @@ public class AnalyticsManager implements OnSharedPreferenceChangeListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void refreshSettings(Context context) {
|
public synchronized void refreshSettings(Context context) {
|
||||||
boolean analyticsHasConsent = Preferences.getPreferences(context).isAnalyticsHasConsent();
|
boolean shouldEnableAnalytics = shouldEnableAnalytics(context);
|
||||||
boolean analyticsEnabled = piwikTracker != null;
|
boolean analyticsEnabled = piwikTracker != null;
|
||||||
if (analyticsHasConsent != analyticsEnabled) {
|
if (shouldEnableAnalytics != analyticsEnabled) {
|
||||||
if (analyticsHasConsent) {
|
if (shouldEnableAnalytics) {
|
||||||
TrackerConfig trackerConfig;
|
TrackerConfig trackerConfig;
|
||||||
if (Constants.DEBUG) {
|
if (Constants.DEBUG) {
|
||||||
trackerConfig = new TrackerConfig("https://piwik.openkeychain.org/", 3, "OpenKeychainDebug");
|
trackerConfig = new TrackerConfig("https://piwik.openkeychain.org/", 3, "OpenKeychainDebug");
|
||||||
@@ -172,4 +172,9 @@ public class AnalyticsManager implements OnSharedPreferenceChangeListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean shouldEnableAnalytics(Context context) {
|
||||||
|
Preferences preferences = Preferences.getPreferences(context);
|
||||||
|
return preferences.isAnalyticsHasConsent() && !preferences.getUseTorProxy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user