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 29678590: Issue 6307 - Introduce external engine created callback (Closed)
Patch Set: Created Jan. 24, 2018, 12:46 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 8788335568e691afb73c6b74b3404df09742a5ac..fc5e2f83377dfa3e38ce7ae5ff3cc073930e46e3 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
@@ -19,6 +19,7 @@ package org.adblockplus.libadblockplus.android.webviewapp;
import android.content.Context;
+import org.adblockplus.libadblockplus.FilterEngine;
import org.adblockplus.libadblockplus.android.AdblockEngine;
import org.adblockplus.libadblockplus.android.AndroidWebRequestResourceWrapper;
import org.adblockplus.libadblockplus.android.settings.AdblockHelper;
@@ -28,6 +29,25 @@ import java.util.Map;
public class Application extends android.app.Application
{
+ private final Runnable onAdblockEngineCreated = new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ FilterEngine engine = AdblockHelper.get().getProvider().getEngine().getFilterEngine();
+ // put your Adblock FilterEngine init here
jens 2018/01/26 08:15:22 Should we provide some more information/context he
anton 2018/01/26 08:22:58 Acknowledged.
+ }
+ };
+
+ private final Runnable onAdblockEngineDisposed = new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ // put your Adblock FilterEngine deinit here
jens 2018/01/26 08:15:22 Should we provide some more information/context he
anton 2018/01/26 08:22:58 Acknowledged.
+ }
+ };
+
@Override
public void onCreate()
{
@@ -45,6 +65,8 @@ public class Application extends android.app.Application
AdblockHelper
.get()
.init(this, basePath, true, AdblockHelper.PREFERENCE_NAME)
- .preloadSubscriptions(AdblockHelper.PRELOAD_PREFERENCE_NAME, map);
+ .preloadSubscriptions(AdblockHelper.PRELOAD_PREFERENCE_NAME, map)
+ .addEngineCreatedCallback(onAdblockEngineCreated)
+ .addEngineDisposedCallback(onAdblockEngineDisposed);
}
}

Powered by Google App Engine
This is Rietveld