Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 { | 197 { |
198 Log.e(TAG, "Failed to parse json to request list with error: " + e.getMess age(), e); | 198 Log.e(TAG, "Failed to parse json to request list with error: " + e.getMess age(), e); |
199 } | 199 } |
200 return requestList; | 200 return requestList; |
201 } | 201 } |
202 | 202 |
203 private static void storeStringPref(String key, String value) | 203 private static void storeStringPref(String key, String value) |
204 { | 204 { |
205 final SharedPreferences.Editor editor = sharedPrefs.edit(); | 205 final SharedPreferences.Editor editor = sharedPrefs.edit(); |
206 editor.putString(key, value); | 206 editor.putString(key, value); |
207 editor.apply(); | 207 editor.commit(); |
anton
2017/10/10 12:19:43
this seems to be not lint change: apply returns im
diegocarloslima
2017/10/10 14:54:18
Actually this is a lint warning, but I agree with
anton
2017/10/12 05:50:17
okay, waiting for the next patch set to LGTM it
| |
208 } | 208 } |
209 | 209 |
210 public static boolean getBooleanFromJsObject(final NativeJSObject obj, final S tring name, | 210 public static boolean getBooleanFromJsObject(final NativeJSObject obj, final S tring name, |
211 final boolean defaultValue) | 211 final boolean defaultValue) |
212 { | 212 { |
213 try | 213 try |
214 { | 214 { |
215 return obj.getBoolean(name); | 215 return obj.getBoolean(name); |
216 } | 216 } |
217 catch (final Exception e) | 217 catch (final Exception e) |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
443 { | 443 { |
444 this.invokeSuccessCallback(jsObject); | 444 this.invokeSuccessCallback(jsObject); |
445 } | 445 } |
446 else | 446 else |
447 { | 447 { |
448 this.invokeFailureCallback(jsObject); | 448 this.invokeFailureCallback(jsObject); |
449 } | 449 } |
450 } | 450 } |
451 } | 451 } |
452 | 452 |
453 private static class AddOnEventListener implements BundleEventListener | 453 private static class AddOnEventListener implements BundleEventListener |
anton
2017/10/10 12:19:42
is it lint change too? seems to be not.
diegocarloslima
2017/10/10 14:54:18
Yeah, actually this was a deprecation warning in
anton
2017/10/12 05:50:17
Acknowledged.
| |
454 { | 454 { |
455 @Override | 455 @Override |
456 public void handleMessage(String event, GeckoBundle message, EventCallback c allback) | 456 public void handleMessage(String event, GeckoBundle message, EventCallback c allback) |
457 { | 457 { |
458 if (ON_FILTERS_LOAD_EVENT.equals(event)) | 458 if (ON_FILTERS_LOAD_EVENT.equals(event)) |
459 { | 459 { |
460 // The filters have been loaded by the extension. Given that, we can sen d all pending requests | 460 // The filters have been loaded by the extension. Given that, we can sen d all pending requests |
461 filtersLoaded = true; | 461 filtersLoaded = true; |
462 sendPendingRequests(); | 462 sendPendingRequests(); |
463 } | 463 } |
464 else if (ON_FILTERS_SAVE_EVENT.equals(event)) | 464 else if (ON_FILTERS_SAVE_EVENT.equals(event)) |
465 { | 465 { |
466 // All changes have been saved by the extension. That way, we can clear our list of | 466 // All changes have been saved by the extension. That way, we can clear our list of |
467 // pending requests | 467 // pending requests |
468 // See https://issues.adblockplus.org/ticket/2853 | 468 // See https://issues.adblockplus.org/ticket/2853 |
469 clearPendingRequests(); | 469 clearPendingRequests(); |
470 } | 470 } |
471 } | 471 } |
472 } | 472 } |
473 } | 473 } |
LEFT | RIGHT |