|
1 | 1 | /** |
2 | 2 | * This file is part of Adguard Content Blocker (https://github.com/AdguardTeam/ContentBlocker). |
3 | 3 | * Copyright © 2016 Performix LLC. All rights reserved. |
4 | | - * <p/> |
| 4 | + * <p> |
5 | 5 | * Adguard Content Blocker is free software: you can redistribute it and/or modify |
6 | 6 | * it under the terms of the GNU General Public License as published by the |
7 | 7 | * Free Software Foundation, either version 3 of the License, or (at your option) |
8 | 8 | * any later version. |
9 | | - * <p/> |
| 9 | + * <p> |
10 | 10 | * Adguard Content Blocker is distributed in the hope that it will be useful, |
11 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
12 | 12 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
13 | | - * <p/> |
| 13 | + * <p> |
14 | 14 | * You should have received a copy of the GNU General Public License along with |
15 | 15 | * Adguard Content Blocker. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | */ |
@@ -47,11 +47,12 @@ public class BrowserUtils { |
47 | 47 | public static final String SAMSUNG_BROWSER_PACKAGE = "com.sec.android.app.sbrowser"; |
48 | 48 | public static final String SAMSUNG_CONTENT_BLOCKER_ACTION = "com.samsung.android.sbrowser.contentBlocker.ACTION_SETTING"; |
49 | 49 | public static final String YANDEX_CONTENT_BLOCKER_ACTION = "com.yandex.browser.contentBlocker.ACTION_SETTING"; |
50 | | - public static final String SAMSUNG_BROWSER_ACTIVITY = "com.sec.android.app.sbrowser.SBrowserMainActivity"; |
| 50 | + |
51 | 51 | public static final String SAMSUNG_PACKAGE_PREFIX = "com.sec."; |
| 52 | + |
52 | 53 | public static final String REFERRER = "adguard1"; |
53 | 54 |
|
54 | | - private static final List<String> yandexBrowserPackageList = new ArrayList<>(); |
| 55 | + private static final List<String> yandexBrowserPackageList = new ArrayList<>(); |
55 | 56 |
|
56 | 57 | static { |
57 | 58 | yandexBrowserPackageList.add("com.yandex.browser"); |
@@ -179,13 +180,10 @@ public static void showBrowserInstallDialog(final Context context) { |
179 | 180 | @Override |
180 | 181 | public boolean onTouch(View v, MotionEvent event) { |
181 | 182 | int action = event.getActionMasked(); |
182 | | - if (action == MotionEvent.ACTION_DOWN) |
183 | | - { |
184 | | - ((CardView)v).setCardBackgroundColor(R.color.card_view_background_pressed); |
185 | | - } |
186 | | - else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_OUTSIDE) |
187 | | - { |
188 | | - ((CardView)v).setCardBackgroundColor(R.color.white); |
| 183 | + if (action == MotionEvent.ACTION_DOWN) { |
| 184 | + ((CardView) v).setCardBackgroundColor(R.color.card_view_background_pressed); |
| 185 | + } else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_OUTSIDE) { |
| 186 | + ((CardView) v).setCardBackgroundColor(R.color.white); |
189 | 187 | } |
190 | 188 | return false; |
191 | 189 | } |
@@ -230,9 +228,11 @@ public static void startYandexBrowser(Context context) { |
230 | 228 | } |
231 | 229 |
|
232 | 230 | public static void startSamsungBrowser(Context context) { |
233 | | - ComponentName component = getSamsungBrowser(context); |
| 231 | + ComponentName componentName = getSamsungBrowser(context); |
234 | 232 |
|
235 | | - startBrowser(context, component); |
| 233 | + if (componentName != null) { |
| 234 | + startBrowser(context, componentName); |
| 235 | + } |
236 | 236 | } |
237 | 237 |
|
238 | 238 | public static void startBrowser(Context context, ComponentName component) { |
|
0 commit comments