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

Unified Diff: libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/AdblockSettingsStorage.java

Issue 29678581: Issue 6000 - Rename "libadblockplus-android" (Closed)
Patch Set: addressed comments Created Jan. 29, 2018, 11:04 a.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-settings/src/org/adblockplus/libadblockplus/android/settings/AdblockSettingsStorage.java
diff --git a/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/AdblockSettingsStorage.java b/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/AdblockSettingsStorage.java
deleted file mode 100644
index 306d4572a91d0c4a53965ff5363c7bbd28cea232..0000000000000000000000000000000000000000
--- a/libadblockplus-android-settings/src/org/adblockplus/libadblockplus/android/settings/AdblockSettingsStorage.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * This file is part of Adblock Plus <https://adblockplus.org/>,
- * Copyright (C) 2006-present eyeo GmbH
- *
- * Adblock Plus is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * Adblock Plus is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package org.adblockplus.libadblockplus.android.settings;
-
-import org.adblockplus.libadblockplus.android.AdblockEngine;
-import org.adblockplus.libadblockplus.android.ConnectionType;
-import org.adblockplus.libadblockplus.android.Subscription;
-
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * Settings storage base class
- */
-public abstract class AdblockSettingsStorage
-{
- /**
- * Load settings from the storage
- *
- * Warning: can return null if not saved yet
- * Warning: subscriptions can have `url` and `title` only to be identified among available in AdblockEngine
- * @return AdblockSettings instance or null
- */
- public abstract AdblockSettings load();
-
- /**
- * Save settings to the storage
- *
- * @param settings should be not null
- */
- public abstract void save(AdblockSettings settings);
-
- /**
- * Get default settings
- *
- * @param adblockEngine adblock engine
- * @return not null default settings
- */
- public static AdblockSettings getDefaultSettings(AdblockEngine adblockEngine)
- {
- AdblockSettings settings = new AdblockSettings();
-
- // read actual values from adblock engine
- settings.setAdblockEnabled(adblockEngine.isEnabled());
- settings.setAcceptableAdsEnabled(adblockEngine.isAcceptableAdsEnabled());
- String allowedConnectionTypeValue = adblockEngine.getFilterEngine().getAllowedConnectionType();
- settings.setAllowedConnectionType(ConnectionType.findByValue(allowedConnectionTypeValue));
-
- // we need to filter out exceptions subscription to show languages subscriptions only
- Subscription[] listedSubscriptions = adblockEngine.getListedSubscriptions();
- List<Subscription> subscriptionsWithoutAA = new LinkedList<Subscription>();
- String acceptableAdsURL = adblockEngine.getAcceptableAdsSubscriptionURL();
-
- for (Subscription eachListedSubscription : listedSubscriptions)
- {
- if (!eachListedSubscription.url.equals(acceptableAdsURL))
- {
- subscriptionsWithoutAA.add(eachListedSubscription);
- }
- }
-
- settings.setSubscriptions(subscriptionsWithoutAA);
-
- return settings;
- }
-}

Powered by Google App Engine
This is Rietveld