Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | |
3 * Copyright (C) 2006-present eyeo GmbH | |
4 * | |
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 | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * Adblock Plus is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License | |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | |
16 */ | |
17 | |
18 package org.adblockplus.sbrowser.contentblocker.util; | |
19 | |
20 import android.content.Context; | |
21 import android.net.ConnectivityManager; | |
22 import android.net.NetworkInfo; | |
23 | |
24 public class ConnectivityUtils | |
25 { | |
26 public static boolean hasWifiConncetion(final Context context) | |
anton
2018/01/19 10:53:02
typo: `Conncetion`
jens
2018/01/19 11:00:28
Acknowledged.
| |
27 { | |
28 final ConnectivityManager connManager = (ConnectivityManager) context | |
29 .getSystemService(Context.CONNECTIVITY_SERVICE); | |
30 final NetworkInfo current = connManager.getActiveNetworkInfo(); | |
31 return current != null && current.getType() == ConnectivityManager.TYPE_WIFI ; | |
32 } | |
33 | |
34 public static boolean hasInternetConncetion(final Context context) | |
anton
2018/01/19 10:53:02
same here
jens
2018/01/19 11:00:28
Acknowledged.
| |
35 { | |
36 final ConnectivityManager connManager = (ConnectivityManager) context | |
37 .getSystemService(Context.CONNECTIVITY_SERVICE); | |
38 return connManager != null && connManager.getActiveNetworkInfo() != null; | |
39 } | |
40 } | |
OLD | NEW |