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

Side by Side Diff: adblockplussbrowser/src/main/java/org/adblockplus/sbrowser/contentblocker/engine/Engine.java

Issue 29722618: Issue 6238 - Download/store notifications.json (Closed)
Patch Set: Created March 14, 2018, 1:34 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 .openRawResource(R.raw.exceptionrules)) 419 .openRawResource(R.raw.exceptionrules))
420 { 420 {
421 final Subscription exceptions = engine.subscriptions.add(Subscription 421 final Subscription exceptions = engine.subscriptions.add(Subscription
422 .create(engine.getPrefsDefault(SUBSCRIPTIONS_EXCEPTIONSURL)) 422 .create(engine.getPrefsDefault(SUBSCRIPTIONS_EXCEPTIONSURL))
423 .parseLines(readLines(exceptionsTxt))); 423 .parseLines(readLines(exceptionsTxt)));
424 exceptions.putMeta(Subscription.KEY_UPDATE_TIMESTAMP, "0"); 424 exceptions.putMeta(Subscription.KEY_UPDATE_TIMESTAMP, "0");
425 exceptions.setEnabled(true); 425 exceptions.setEnabled(true);
426 } 426 }
427 Log.d(TAG, "Added and enabled bundled exceptionslist"); 427 Log.d(TAG, "Added and enabled bundled exceptionslist");
428 428
429 // The Notification should be download every 24 hrs., no matter if its con tent changed or not.
430 final Subscription notification = engine.subscriptions.add(Subscription
431 .create(Notification.NOTIFICATION_URL));
432 notification.putMeta(Subscription.KEY_UPDATE_TIMESTAMP, "0");
433 notification.setEnabled(true);
434 Log.d(TAG, "Initialized Notification");
435
429 int additional = 0; 436 int additional = 0;
430 for (final Subscription sub : engine.defaultSubscriptions.createSubscripti ons()) 437 for (final Subscription sub : engine.defaultSubscriptions.createSubscripti ons())
431 { 438 {
432 if (!engine.subscriptions.hasSubscription(sub.getId())) 439 if (!engine.subscriptions.hasSubscription(sub.getId()))
433 { 440 {
434 additional++; 441 additional++;
435 engine.subscriptions.add(sub); 442 engine.subscriptions.add(sub);
436 } 443 }
437 } 444 }
438 445
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 { 798 {
792 void subscriptionUpdateRequested(boolean enabled); 799 void subscriptionUpdateRequested(boolean enabled);
793 void subscriptionUpdatedApplied(); 800 void subscriptionUpdatedApplied();
794 } 801 }
795 802
796 public interface SubscriptionAddedCallback 803 public interface SubscriptionAddedCallback
797 { 804 {
798 void subscriptionAdded(); 805 void subscriptionAdded();
799 } 806 }
800 } 807 }
OLDNEW

Powered by Google App Engine
This is Rietveld