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: fixed typo, now using official aa file Created March 30, 2017, 2:24 p.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..262598befb5475f9e9ec21a679c0c1fa268b8864 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.exceptionrules_minimal);
+
+ AdblockHelper
+ .get()
+ .init(this, true, AdblockHelper.PREFERENCE_NAME)
+ .preloadSubscriptions(AdblockHelper.PRELOAD_PREFERENCE_NAME, map);
}
}
« no previous file with comments | « libadblockplus-android-webviewapp/res/raw/exceptionrules_minimal.txt ('k') | libadblockplus-android/build.gradle » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld