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

Unified Diff: mobile/android/base/java/org/adblockplus/browser/MoreSubscriptionsPreferenceGroup.java

Issue 29863604: Issue 6865 - Update ABP dependency to version 3.2 (Closed)
Patch Set: Removing allowed contexts Created Aug. 28, 2018, 5:08 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: mobile/android/base/java/org/adblockplus/browser/MoreSubscriptionsPreferenceGroup.java
===================================================================
--- a/mobile/android/base/java/org/adblockplus/browser/MoreSubscriptionsPreferenceGroup.java
+++ b/mobile/android/base/java/org/adblockplus/browser/MoreSubscriptionsPreferenceGroup.java
@@ -77,21 +77,21 @@
for (int i = 0; i < BUILTIN_TITLES.length; i++)
{
BUILTIN_URL_TO_INDEX.put(BUILTIN_LISTS[i * 2 + 1], Integer.valueOf(i));
}
IGNORED_URLS.add("https://easylist-downloads.adblockplus.org/exceptionrules.txt");
}
- private synchronized static void initRecommendedSubscriptions()
+ private synchronized static void initRecommendedSubscriptions(Context context)
{
if (recommendedSubscriptions == null)
{
- recommendedSubscriptions = SubscriptionContainer.create(false);
+ recommendedSubscriptions = SubscriptionContainer.create(context, false);
for (SubscriptionContainer.Subscription s : recommendedSubscriptions.getSubscriptions(false))
{
IGNORED_URLS.add(s.url);
}
}
}
@@ -140,22 +140,22 @@
super.onAttachedToActivity();
this.progressDialog = new ProgressDialog(this.getContext());
this.progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
this.progressDialog.setMessage(this.getContext().getString(R.string.abb_adblocking_waiting));
this.progressDialog.show();
- AddOnBridge.postToHandler(new Runnable()
+ ExtensionBridge.postToHandler(new Runnable()
{
@Override
public void run()
{
- initRecommendedSubscriptions();
+ initRecommendedSubscriptions(getContext());
MoreSubscriptionsPreferenceGroup.this.activeSubscriptions.refresh();
ThreadUtils.postToUiThread(new Runnable()
{
@Override
public void run()
{
MoreSubscriptionsPreferenceGroup.this.initEntries();
@@ -214,26 +214,26 @@
private void addNewSubscription(final String url)
{
this.progressDialog = new ProgressDialog(this.getContext());
this.progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
this.progressDialog
.setMessage(this.getContext().getString(R.string.abb_add_subscription_adding));
this.progressDialog.show();
- AddOnBridge.postToHandler(new Runnable()
+ ExtensionBridge.postToHandler(new Runnable()
{
@Override
public void run()
{
try
{
final Semaphore finished = new Semaphore(0);
- AddOnBridge.addSubscription(url, null, new AdblockPlusApiCallback()
+ ExtensionBridge.addSubscription(url, null, new AdblockPlusApiCallback()
{
@Override
public void onApiRequestSucceeded(GeckoBundle bundle)
{
finished.release();
}
@Override
@@ -277,17 +277,17 @@
private static class ActiveSubscriptionContainer implements AdblockPlusApiCallback
{
public final HashMap<String, String> enabledSubscriptions = new HashMap<String, String>();
private final Semaphore entriesReady = new Semaphore(0);
public void refresh()
{
- AddOnBridge.queryActiveSubscriptions(this);
+ ExtensionBridge.queryActiveSubscriptions(this);
this.entriesReady.acquireUninterruptibly();
}
@Override
public void onApiRequestSucceeded(GeckoBundle bundle)
{
try
{
@@ -325,21 +325,21 @@
{
if (preference instanceof CheckBoxPreference && newValue instanceof Boolean)
{
final CheckBoxPreference cbp = (CheckBoxPreference) preference;
final boolean enable = ((Boolean) newValue).booleanValue();
if (enable)
{
- AddOnBridge.addSubscription(cbp.getKey(), null, this);
+ ExtensionBridge.addSubscription(cbp.getKey(), null, this);
}
else
{
- AddOnBridge.removeSubscription(cbp.getKey(), this);
+ ExtensionBridge.removeSubscription(cbp.getKey(), this);
}
}
return true;
}
@Override
public void onApiRequestSucceeded(GeckoBundle bundle)
{

Powered by Google App Engine
This is Rietveld