Skip to content

Commit 54c3808

Browse files
committed
change getNetWorkType util
1 parent 1af4573 commit 54c3808

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

VideoOS/VenvyLibrary/build.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 25
4+
compileSdkVersion 29
55
buildToolsVersion '25.0.3'
66
defaultConfig {
77
minSdkVersion 16
@@ -42,14 +42,14 @@ dependencies {
4242
compile project(':venvy_processor_annotation')
4343
annotationProcessor project(':venvy_processor_compiler')
4444
provided 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2'
45-
provided "com.squareup.okhttp3:okhttp:3.8.0"
46-
provided "com.facebook.fresco:fresco:1.8.0"
47-
provided "com.facebook.fresco:animated-gif:1.8.0"
48-
provided "com.facebook.fresco:animated-webp:1.8.0"
49-
provided "com.facebook.fresco:webpsupport:1.8.0"
50-
provided "com.github.bumptech.glide:glide:3.7.0"
51-
provided "com.just.agentweb:agentweb:4.1.2"
52-
// provided "com.github.bumptech.glide:glide:4.3.1"
53-
// compile 'com.videoli:venvy_processor_annotation:1.0.0'
54-
// annotationProcessor 'com.videoli:venvy_processor_compiler:1.0.1'
45+
provided 'com.squareup.okhttp3:okhttp:3.8.0'
46+
provided 'com.facebook.fresco:fresco:1.8.0'
47+
provided 'com.facebook.fresco:animated-gif:1.8.0'
48+
provided 'com.facebook.fresco:animated-webp:1.8.0'
49+
provided 'com.facebook.fresco:webpsupport:1.8.0'
50+
provided 'com.github.bumptech.glide:glide:3.7.0'
51+
provided 'com.just.agentweb:agentweb:4.1.2'
52+
// provided "com.github.bumptech.glide:glide:4.3.1"
53+
// compile 'com.videoli:venvy_processor_annotation:1.0.0'
54+
// annotationProcessor 'com.videoli:venvy_processor_compiler:1.0.1'
5555
}

VideoOS/VenvyLibrary/src/main/java/cn/com/venvy/common/utils/VenvyDeviceUtil.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ public static int getNetWorkType(Context context) {
390390
case TelephonyManager.NETWORK_TYPE_CDMA:
391391
case TelephonyManager.NETWORK_TYPE_1xRTT:
392392
case TelephonyManager.NETWORK_TYPE_IDEN: //api<8 : replace by 11
393+
case TelephonyManager.NETWORK_TYPE_GSM: // api<25: replace by 16
393394
strNetworkType = 2;
394395
break;
395396
case TelephonyManager.NETWORK_TYPE_UMTS:
@@ -398,15 +399,17 @@ public static int getNetWorkType(Context context) {
398399
case TelephonyManager.NETWORK_TYPE_HSDPA:
399400
case TelephonyManager.NETWORK_TYPE_HSUPA:
400401
case TelephonyManager.NETWORK_TYPE_HSPA:
401-
case TelephonyManager.NETWORK_TYPE_EVDO_B: //api<9 : replace by 14
402-
case TelephonyManager.NETWORK_TYPE_EHRPD: //api<11 : replace by 12
403-
case TelephonyManager.NETWORK_TYPE_HSPAP: //api<13 : replace by 15
402+
case TelephonyManager.NETWORK_TYPE_EVDO_B: // api< 9: replace by 12
403+
case TelephonyManager.NETWORK_TYPE_EHRPD: // api<11: replace by 14
404+
case TelephonyManager.NETWORK_TYPE_HSPAP: // api<13: replace by 15
405+
case TelephonyManager.NETWORK_TYPE_TD_SCDMA: // api<25: replace by 17
404406
strNetworkType = 3;
405407
break;
406-
case TelephonyManager.NETWORK_TYPE_LTE: //api<11 : replace by 13
408+
case TelephonyManager.NETWORK_TYPE_LTE: // api<11: replace by 13
409+
case TelephonyManager.NETWORK_TYPE_IWLAN: // api<25: replace by 18
407410
strNetworkType = 4;
408411
break;
409-
case 0x00000014:
412+
case TelephonyManager.NETWORK_TYPE_NR:// api<29: replace by 20
410413
strNetworkType = 5;
411414
break;
412415
}

0 commit comments

Comments
 (0)