Skip to content

Commit

Permalink
fix:网络类型中增加对5g的判断
Browse files Browse the repository at this point in the history
  • Loading branch information
gio-yanruixue authored and tianhui12 committed Nov 23, 2021
1 parent a851329 commit 9aeebb3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,15 @@ public static String getNetworkName(int type, int subType, String subtypeName) {
}
switch (subType) {
//如果是2g类型
case TelephonyManager.NETWORK_TYPE_GSM:
case TelephonyManager.NETWORK_TYPE_CDMA:
case TelephonyManager.NETWORK_TYPE_GPRS:
case TelephonyManager.NETWORK_TYPE_EDGE:
case TelephonyManager.NETWORK_TYPE_1xRTT:
case TelephonyManager.NETWORK_TYPE_IDEN:
return "2G";
//如果是3g类型
case TelephonyManager.NETWORK_TYPE_CDMA:
case TelephonyManager.NETWORK_TYPE_TD_SCDMA:
case TelephonyManager.NETWORK_TYPE_EVDO_A:
case TelephonyManager.NETWORK_TYPE_UMTS:
case TelephonyManager.NETWORK_TYPE_EVDO_0:
Expand All @@ -110,7 +112,10 @@ public static String getNetworkName(int type, int subType, String subtypeName) {
return "3G";
//如果是4g类型
case TelephonyManager.NETWORK_TYPE_LTE:
case TelephonyManager.NETWORK_TYPE_IWLAN:
return "4G";
case TelephonyManager.NETWORK_TYPE_NR:
return "5G";
default:
//中国移动 联通 电信 三种3G制式
if ("TD-SCDMA".equalsIgnoreCase(subtypeName)
Expand Down

0 comments on commit 9aeebb3

Please sign in to comment.