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

Delta Between Two Patch Sets: libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/GeneralSettingsFragment.java

Issue 29379647: Issue 4948 - add possibility to not send data depending on connection properties (Closed)
Left Patch Set: after Sergei's comments minor clean-up Created March 15, 2017, 10:35 a.m.
Right Patch Set: updated dependency to binaries, updated comment for allowed connection type Created March 30, 2017, 2:12 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 else if (preference.getKey().equals(SETTINGS_FILTER_LISTS_KEY)) 211 else if (preference.getKey().equals(SETTINGS_FILTER_LISTS_KEY))
212 { 212 {
213 handleFilterListsChanged((Set<String>) newValue); 213 handleFilterListsChanged((Set<String>) newValue);
214 } 214 }
215 else if (preference.getKey().equals(SETTINGS_AA_ENABLED_KEY)) 215 else if (preference.getKey().equals(SETTINGS_AA_ENABLED_KEY))
216 { 216 {
217 handleAcceptableAdsEnabledChanged((Boolean) newValue); 217 handleAcceptableAdsEnabledChanged((Boolean) newValue);
218 } 218 }
219 else if (preference.getKey().equals(SETTINGS_ALLOWED_CONNECTION_TYPE_KEY)) 219 else if (preference.getKey().equals(SETTINGS_ALLOWED_CONNECTION_TYPE_KEY))
220 { 220 {
221 handleUpdatesConnectionTypeChanged((String) newValue); 221 handleAllowedConnectionTypeChanged((String) newValue);
222 } 222 }
223 else 223 else
224 { 224 {
225 // handle other values if changed 225 // handle other values if changed
226 // `false` for NOT update preference view state 226 // `false` for NOT update preference view state
227 return false; 227 return false;
228 } 228 }
229 229
230 // `true` for update preference view state 230 // `true` for update preference view state
231 return true; 231 return true;
232 } 232 }
233 233
234 private void handleUpdatesConnectionTypeChanged(String value) 234 private void handleAllowedConnectionTypeChanged(String value)
235 { 235 {
236 // update and save settings 236 // update and save settings
237 settings.setAllowedConnectionType(ConnectionType.findByValue(value)); 237 settings.setAllowedConnectionType(ConnectionType.findByValue(value));
238 provider.getAdblockSettingsStorage().save(settings); 238 provider.getAdblockSettingsStorage().save(settings);
239 239
240 // apply settings 240 // apply settings
241 allowedConnectionType.setValue(value); 241 allowedConnectionType.setValue(value);
242 provider.getAdblockEngine().getFilterEngine().setAllowedConnectionType(value ); 242 provider.getAdblockEngine().getFilterEngine().setAllowedConnectionType(value );
243 243
244 // signal event 244 // signal event
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 } 320 }
321 else 321 else
322 { 322 {
323 // should not be invoked as only 'wl' preference is subscribed for callbac k 323 // should not be invoked as only 'wl' preference is subscribed for callbac k
324 return false; 324 return false;
325 } 325 }
326 326
327 return true; 327 return true;
328 } 328 }
329 } 329 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld