Index: libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/AdblockHelper.java |
diff --git a/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/AdblockHelper.java b/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/AdblockHelper.java |
index 21ff3dc51aa0584b9fd46cb0b4ec1cf0c93823a9..a651d03004b7cfed48ff02c42aba39d721788f51 100644 |
--- a/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/AdblockHelper.java |
+++ b/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/AdblockHelper.java |
@@ -22,12 +22,10 @@ import android.content.SharedPreferences; |
import android.util.Log; |
import org.adblockplus.libadblockplus.IsAllowedConnectionCallback; |
-import org.adblockplus.libadblockplus.UpdateCheckDoneCallback; |
import org.adblockplus.libadblockplus.android.AdblockEngine; |
import org.adblockplus.libadblockplus.android.AndroidWebRequestResourceWrapper; |
import org.adblockplus.libadblockplus.android.Utils; |
-import java.io.File; |
import java.util.Map; |
import java.util.concurrent.CountDownLatch; |
import java.util.concurrent.atomic.AtomicInteger; |
@@ -57,6 +55,8 @@ public class AdblockHelper |
private String settingsPreferenceName; |
private String preloadedPreferenceName; |
private Map<String, Integer> urlToResourceIdMap; |
+ private String application; |
+ private String applicationVersion; |
private AdblockEngine engine; |
private AdblockSettingsStorage storage; |
private CountDownLatch engineCreated; |
@@ -111,13 +111,19 @@ public class AdblockHelper |
* recommended because it can be cleared by the system. |
* @param developmentBuild debug or release? |
* @param preferenceName Shared Preferences name to store adblock settings |
+ * @param application Technical name of the platform the app is running on (not user visible). |
+ * @param applicationVersion Current version of the platform the app is running on. |
*/ |
- public AdblockHelper init(Context context, String basePath, boolean developmentBuild, String preferenceName) |
+ public AdblockHelper init(Context context, String basePath, |
+ boolean developmentBuild, String preferenceName, |
+ String application, String applicationVersion) |
{ |
this.context = context.getApplicationContext(); |
this.basePath = basePath; |
this.developmentBuild = developmentBuild; |
this.settingsPreferenceName = preferenceName; |
+ this.application = application; |
+ this.applicationVersion = applicationVersion; |
return this; |
} |
@@ -126,10 +132,11 @@ public class AdblockHelper |
* @param preferenceName Shared Preferences name to store intercepted requests stats |
* @param urlToResourceIdMap |
*/ |
- public void preloadSubscriptions(String preferenceName, Map<String, Integer> urlToResourceIdMap) |
+ public AdblockHelper preloadSubscriptions(String preferenceName, Map<String, Integer> urlToResourceIdMap) |
{ |
this.preloadedPreferenceName = preferenceName; |
this.urlToResourceIdMap = urlToResourceIdMap; |
+ return this; |
} |
private void createAdblock() |
@@ -146,7 +153,7 @@ public class AdblockHelper |
AdblockEngine.Builder builder = AdblockEngine |
.builder( |
- AdblockEngine.generateAppInfo(context, developmentBuild), |
+ AdblockEngine.generateAppInfo(context, developmentBuild, application, applicationVersion), |
basePath) |
.setIsAllowedConnectionCallback(isAllowedConnectionCallback) |
.enableElementHiding(true); |