Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/SharedPrefsStorage.java

Issue 29379647: Issue 4948 - add possibility to not send data depending on connection properties (Closed)
Patch Set: felix's comments Created March 24, 2017, 9:46 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/SharedPrefsStorage.java
diff --git a/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/SharedPrefsStorage.java b/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/SharedPrefsStorage.java
index e3a9b6951b11103c8c3d8c2fe27ca3809d803f5c..a7a49972a7789176f710922b2e961a2a6178d028 100644
--- a/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/SharedPrefsStorage.java
+++ b/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/SharedPrefsStorage.java
@@ -37,6 +37,7 @@ public class SharedPrefsStorage extends AdblockSettingsStorage
private static final String SETTINGS_SUBSCRIPTION_TITLE_KEY = "title";
private static final String SETTINGS_WL_DOMAINS_KEY = "whitelisted_domains";
private static final String SETTINGS_WL_DOMAIN_KEY = "domain";
+ private static final String SETTINGS_ALLOWED_CONNECTION_TYPE_KEY = "allowed_connection_type";
private SharedPreferences prefs;
private boolean commit = true;
@@ -73,6 +74,8 @@ public class SharedPrefsStorage extends AdblockSettingsStorage
AdblockSettings settings = new AdblockSettings();
settings.setAdblockEnabled(prefs.getBoolean(SETTINGS_ENABLED_KEY, true));
settings.setAcceptableAdsEnabled(prefs.getBoolean(SETTINGS_AA_ENABLED_KEY, true));
+ String connectionType = prefs.getString(SETTINGS_ALLOWED_CONNECTION_TYPE_KEY, null);
+ settings.setAllowedConnectionType(ConnectionType.findByValue(connectionType));
loadSubscriptions(settings);
loadWhitelistedDomains(settings);
@@ -149,6 +152,11 @@ public class SharedPrefsStorage extends AdblockSettingsStorage
.putBoolean(SETTINGS_ENABLED_KEY, settings.isAdblockEnabled())
.putBoolean(SETTINGS_AA_ENABLED_KEY, settings.isAcceptableAdsEnabled());
+ if (settings.getAllowedConnectionType() != null)
+ {
+ editor.putString(SETTINGS_ALLOWED_CONNECTION_TYPE_KEY, settings.getAllowedConnectionType().getValue());
+ }
+
saveSubscriptions(settings, editor);
saveWhitelistedDomains(settings, editor);

Powered by Google App Engine
This is Rietveld