Skip to content

Commit b97c834

Browse files
committed
Minor fix
1 parent 741e9da commit b97c834

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

adguard_cb/src/main/java/com/adguard/android/commons/BrowserUtils.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/**
22
* This file is part of Adguard Content Blocker (https://github.com/AdguardTeam/ContentBlocker).
33
* Copyright © 2016 Performix LLC. All rights reserved.
4-
* <p/>
4+
* <p>
55
* Adguard Content Blocker is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by the
77
* Free Software Foundation, either version 3 of the License, or (at your option)
88
* any later version.
9-
* <p/>
9+
* <p>
1010
* Adguard Content Blocker is distributed in the hope that it will be useful,
1111
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1212
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13-
* <p/>
13+
* <p>
1414
* You should have received a copy of the GNU General Public License along with
1515
* Adguard Content Blocker. If not, see <http://www.gnu.org/licenses/>.
1616
*/
@@ -47,11 +47,12 @@ public class BrowserUtils {
4747
public static final String SAMSUNG_BROWSER_PACKAGE = "com.sec.android.app.sbrowser";
4848
public static final String SAMSUNG_CONTENT_BLOCKER_ACTION = "com.samsung.android.sbrowser.contentBlocker.ACTION_SETTING";
4949
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+
5151
public static final String SAMSUNG_PACKAGE_PREFIX = "com.sec.";
52+
5253
public static final String REFERRER = "adguard1";
5354

54-
private static final List<String> yandexBrowserPackageList = new ArrayList<>();
55+
private static final List<String> yandexBrowserPackageList = new ArrayList<>();
5556

5657
static {
5758
yandexBrowserPackageList.add("com.yandex.browser");
@@ -179,13 +180,10 @@ public static void showBrowserInstallDialog(final Context context) {
179180
@Override
180181
public boolean onTouch(View v, MotionEvent event) {
181182
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);
189187
}
190188
return false;
191189
}
@@ -230,9 +228,11 @@ public static void startYandexBrowser(Context context) {
230228
}
231229

232230
public static void startSamsungBrowser(Context context) {
233-
ComponentName component = getSamsungBrowser(context);
231+
ComponentName componentName = getSamsungBrowser(context);
234232

235-
startBrowser(context, component);
233+
if (componentName != null) {
234+
startBrowser(context, componentName);
235+
}
236236
}
237237

238238
public static void startBrowser(Context context, ComponentName component) {

0 commit comments

Comments
 (0)