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

Unified Diff: libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java

Issue 29389555: Issue 5010 - Allow to preload subscription files (Closed)
Patch Set: diego's suggestions 2 Created March 30, 2017, 10:26 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-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java
diff --git a/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java b/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java
index 3d6e4afa88c4a72199f2e8bb15542c9924749b68..19c0803ba3ca3d908af8925b7bc1b8f2d3d975df 100644
--- a/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java
+++ b/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/Application.java
@@ -17,8 +17,12 @@
package org.adblockplus.libadblockplus.android.webviewapp;
+import org.adblockplus.libadblockplus.android.AndroidWebRequestResourceWrapper;
import org.adblockplus.libadblockplus.android.settings.AdblockHelper;
+import java.util.HashMap;
+import java.util.Map;
+
public class Application extends android.app.Application
{
@Override
@@ -27,6 +31,16 @@ public class Application extends android.app.Application
super.onCreate();
// init Adblock
- AdblockHelper.get().init(this, true, AdblockHelper.PREFERENCE_NAME);
+
+ // provide preloaded subscriptions
+ Map<String, Integer> map = new HashMap<String, Integer>();
+ map.put(AndroidWebRequestResourceWrapper.EASYLIST, R.raw.easylist_min);
+ map.put(AndroidWebRequestResourceWrapper.EASYLIST_CHINESE, R.raw.easylist_min);
+ map.put(AndroidWebRequestResourceWrapper.ACCEPTABLE_ADS, R.raw.keypartner_whitelist);
+
+ AdblockHelper
+ .get()
+ .init(this, true, AdblockHelper.PREFERENCE_NAME)
+ .preloadSubscriptions(AdblockHelper.PRELOAD_PREFERENCE_NAME, map);
}
}
« no previous file with comments | « libadblockplus-android-webviewapp/res/raw/keypartner_whitelist.txt ('k') | libadblockplus-android/build.gradle » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld