OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 13 matching lines...) Expand all Loading... |
24 import java.util.HashMap; | 24 import java.util.HashMap; |
25 import java.util.List; | 25 import java.util.List; |
26 import java.util.Map; | 26 import java.util.Map; |
27 | 27 |
28 import org.adblockplus.sbrowser.contentblocker.engine.DefaultSubscriptionInfo; | 28 import org.adblockplus.sbrowser.contentblocker.engine.DefaultSubscriptionInfo; |
29 import org.adblockplus.sbrowser.contentblocker.engine.Engine; | 29 import org.adblockplus.sbrowser.contentblocker.engine.Engine; |
30 import org.adblockplus.sbrowser.contentblocker.engine.EngineManager; | 30 import org.adblockplus.sbrowser.contentblocker.engine.EngineManager; |
31 import org.adblockplus.sbrowser.contentblocker.engine.SubscriptionInfo; | 31 import org.adblockplus.sbrowser.contentblocker.engine.SubscriptionInfo; |
32 import org.adblockplus.adblockplussbrowser.R; | 32 import org.adblockplus.adblockplussbrowser.R; |
33 import org.adblockplus.sbrowser.contentblocker.preferences.MultilineCheckBoxPref
erence; | 33 import org.adblockplus.sbrowser.contentblocker.preferences.MultilineCheckBoxPref
erence; |
| 34 import org.adblockplus.sbrowser.contentblocker.util.SubscriptionUtils; |
34 | 35 |
35 import android.content.Context; | 36 import android.content.Context; |
36 import android.preference.Preference; | 37 import android.preference.Preference; |
37 import android.preference.PreferenceCategory; | 38 import android.preference.PreferenceCategory; |
38 import android.preference.Preference.OnPreferenceChangeListener; | 39 import android.preference.Preference.OnPreferenceChangeListener; |
39 import android.text.format.DateUtils; | 40 import android.text.format.DateUtils; |
40 import android.util.AttributeSet; | 41 import android.util.AttributeSet; |
41 import android.util.Log; | 42 import android.util.Log; |
42 | 43 |
43 public class MoreBlockingPreferenceCategory extends PreferenceCategory implement
s | 44 public class MoreBlockingPreferenceCategory extends PreferenceCategory implement
s |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 if (engine == null) | 208 if (engine == null) |
208 { | 209 { |
209 return moreBlockingPreferenceSubscriptions; | 210 return moreBlockingPreferenceSubscriptions; |
210 } | 211 } |
211 | 212 |
212 for (SubscriptionInfo sub : engine.getListedSubscriptions()) | 213 for (SubscriptionInfo sub : engine.getListedSubscriptions()) |
213 { | 214 { |
214 final DefaultSubscriptionInfo info = engine.getDefaultSubscriptionInfoForU
rl(sub.getUrl()); | 215 final DefaultSubscriptionInfo info = engine.getDefaultSubscriptionInfoForU
rl(sub.getUrl()); |
215 Integer resInt = URL_TO_RES_ID_MAP.get(sub.getUrl()); | 216 Integer resInt = URL_TO_RES_ID_MAP.get(sub.getUrl()); |
216 | 217 |
| 218 if (SubscriptionUtils.isNotificationSubscription(sub.getId())) |
| 219 { |
| 220 continue; |
| 221 } |
| 222 |
217 if (sub.getType() == SubscriptionInfo.Type.CUSTOM) | 223 if (sub.getType() == SubscriptionInfo.Type.CUSTOM) |
218 { | 224 { |
219 moreBlockingPreferenceSubscriptions.add(sub); | 225 moreBlockingPreferenceSubscriptions.add(sub); |
220 continue; | 226 continue; |
221 } | 227 } |
222 | 228 |
223 if (info != null && !info.isComplete() && sub.isEnabled()) | 229 if (info != null && !info.isComplete() && sub.isEnabled()) |
224 { | 230 { |
225 moreBlockingPreferenceSubscriptions.add(sub); | 231 moreBlockingPreferenceSubscriptions.add(sub); |
226 continue; | 232 continue; |
(...skipping 22 matching lines...) Expand all Loading... |
249 } | 255 } |
250 return true; | 256 return true; |
251 } | 257 } |
252 | 258 |
253 @Override | 259 @Override |
254 public void subscriptionAdded() | 260 public void subscriptionAdded() |
255 { | 261 { |
256 refreshEntries(); | 262 refreshEntries(); |
257 } | 263 } |
258 } | 264 } |
OLD | NEW |