63 lines
2.0 KiB
Java
63 lines
2.0 KiB
Java
|
package o;
|
||
|
|
||
|
import android.net.ConnectivityManager;
|
||
|
import android.net.NetworkCapabilities;
|
||
|
import android.net.NetworkInfo;
|
||
|
|
||
|
/* renamed from: o.fPI, reason: case insensitive filesystem */
|
||
|
/* loaded from: classes5.dex */
|
||
|
public final class C13050fPI {
|
||
|
final ConnectivityManager d;
|
||
|
|
||
|
public C13050fPI(ConnectivityManager connectivityManager) {
|
||
|
this.d = connectivityManager;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public final String e() {
|
||
|
NetworkCapabilities networkCapabilities = this.d.getNetworkCapabilities(this.d.getActiveNetwork());
|
||
|
if (networkCapabilities == null) {
|
||
|
return "none";
|
||
|
}
|
||
|
if (networkCapabilities.hasTransport(1)) {
|
||
|
return "wifi";
|
||
|
}
|
||
|
if (networkCapabilities.hasTransport(3)) {
|
||
|
return "ethernet";
|
||
|
}
|
||
|
if (networkCapabilities.hasTransport(4)) {
|
||
|
return "vpn";
|
||
|
}
|
||
|
if (networkCapabilities.hasTransport(0)) {
|
||
|
return "mobile";
|
||
|
}
|
||
|
if (networkCapabilities.hasTransport(2)) {
|
||
|
return "bluetooth";
|
||
|
}
|
||
|
NetworkInfo activeNetworkInfo = this.d.getActiveNetworkInfo();
|
||
|
if (activeNetworkInfo != null && activeNetworkInfo.isConnected()) {
|
||
|
int type = activeNetworkInfo.getType();
|
||
|
if (type != 0) {
|
||
|
if (type != 1) {
|
||
|
if (type != 4 && type != 5) {
|
||
|
if (type != 6) {
|
||
|
if (type == 7) {
|
||
|
return "bluetooth";
|
||
|
}
|
||
|
if (type == 9) {
|
||
|
return "ethernet";
|
||
|
}
|
||
|
if (type == 17) {
|
||
|
return "vpn";
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return "wifi";
|
||
|
}
|
||
|
return "mobile";
|
||
|
}
|
||
|
return "none";
|
||
|
}
|
||
|
}
|