更新 DeviceInfoUtils.java

This commit is contained in:
2023-12-08 20:55:32 +08:00
parent 6ae23c1e2f
commit c0548705a2

View File

@@ -20,22 +20,6 @@ public class DeviceInfoUtils {
public static int getDeviceHeight(Context context) {
return context.getResources().getDisplayMetrics().heightPixels;
}
/**
* 获取设备的唯一标识, 需要 “android.permission.READ_Phone_STATE”权限
* Android 10 无法获取此权限
*/
public static String getIMEI(Context context) {
TelephonyManager tm = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
String deviceId = tm.getDeviceId();
if (deviceId == null) {
return "UnKnown";
} else {
return deviceId;
}
}
/**
* 获取厂商名
**/