Skip to content

Commit

Permalink
移除is att判断,避免兼容性问题
Browse files Browse the repository at this point in the history
  • Loading branch information
qwe7002 committed Apr 8, 2020
1 parent b6e4433 commit 77aa2d5
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions app/src/main/java/com/qwe7002/telegram_sms_compat/public_func.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.qwe7002.telegram_sms_compat;

import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
Expand Down Expand Up @@ -126,7 +125,6 @@ static boolean is_phone_number(String str) {
return true;
}

@SuppressLint("HardwareIds")
static String get_network_type(Context context) {
String net_type = "Unknown";
ConnectivityManager connect_manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
Expand All @@ -140,25 +138,14 @@ static String get_network_type(Context context) {
net_type = "WIFI";
break;
case ConnectivityManager.TYPE_MOBILE:
boolean is_att = false;
TelephonyManager telephonyManager = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
assert telephonyManager != null;
if (telephonyManager.getSubscriberId().startsWith("3104101")) {
is_att = true;
}
switch (network_info.getSubtype()) {
case TelephonyManager.NETWORK_TYPE_LTE:
net_type = "LTE";
if (is_att) {
net_type = "5G E";
}
break;
case TelephonyManager.NETWORK_TYPE_HSPAP:
if (is_att) {
net_type = "4G";
break;
}
case TelephonyManager.NETWORK_TYPE_EVDO_0:
case TelephonyManager.NETWORK_TYPE_EVDO_A:
case TelephonyManager.NETWORK_TYPE_EVDO_B:
Expand Down

0 comments on commit 77aa2d5

Please sign in to comment.