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 0840fa3e182bd8896eae3fb937c1415504657cdb..2e37a01be44448cc35490cfd16ab7077a6c64377 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 |
@@ -42,6 +42,7 @@ public class AdblockHelper |
private static AdblockHelper _instance; |
private Context context; |
+ private String basePath; |
private boolean developmentBuild; |
private String preferenceName; |
private AdblockEngine engine; |
@@ -88,16 +89,29 @@ public class AdblockHelper |
/** |
* Init with context |
* @param context application context |
+ * @param basePath file system root to store files |
* @param developmentBuild debug or release? |
* @param preferenceName Shared Preferences name |
*/ |
- public void init(Context context, boolean developmentBuild, String preferenceName) |
+ public void init(Context context, String basePath, boolean developmentBuild, String preferenceName) |
{ |
this.context = context.getApplicationContext(); |
+ this.basePath = basePath; |
this.developmentBuild = developmentBuild; |
this.preferenceName = preferenceName; |
} |
+ /** |
+ * Init with context |
+ * @param context application context |
+ * @param developmentBuild debug or release? |
+ * @param preferenceName Shared Preferences name |
+ */ |
+ public void init(Context context, boolean developmentBuild, String preferenceName) |
anton
2017/02/16 11:43:44
for back compatibility. do we need it?
sergei
2017/03/13 08:49:23
Could it be marked as deprecated and I think we sh
anton
2017/03/13 09:16:32
It could be marked with @Deprecated java annotatio
|
+ { |
+ init(context, context.getCacheDir().getAbsolutePath(), developmentBuild, preferenceName); |
anton
2017/02/16 11:47:15
for back compatibility it's better to getCacheDir(
anton
2017/02/16 11:49:24
getDataDir is available starting api 24 only. prob
|
+ } |
+ |
private void createAdblock() |
{ |
Log.d(TAG, "Creating adblock engine ..."); |
@@ -111,8 +125,7 @@ public class AdblockHelper |
engine = AdblockEngine.create( |
AdblockEngine.generateAppInfo(context, developmentBuild), |
- context.getCacheDir().getAbsolutePath(), |
- true); // `true` as we need element hiding |
+ basePath, true); // `true` as we need element hiding |
Log.d(TAG, "AdblockHelper engine created"); |
AdblockSettings settings = storage.load(); |