android.os.Build#UNKNOWN源码实例Demo

下面列出了android.os.Build#UNKNOWN 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: OpenWeatherPlus-Android   文件: DeviceUtil.java
/**
 * 获取IMEI
 */
@SuppressLint("HardwareIds")
private static String getDeviceId(Context context) {
    try {
        TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
            return Build.UNKNOWN;
        } else if (telephonyManager != null) {
            String imei = telephonyManager.getDeviceId();
            if (TextUtils.isEmpty(imei)) {
                return Build.UNKNOWN;
            }
            return "B" + imei;
        } else {
            return Build.UNKNOWN;
        }
    } catch (Exception e) {
        return Build.UNKNOWN;
    }
}
 
源代码2 项目: webrtc_android   文件: RomUtil.java
public static boolean check(String rom) {
    if (sName != null) {
        return sName.equals(rom);
    }

    if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_MIUI))) {
        sName = ROM_MIUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_EMUI))) {
        sName = ROM_EMUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_OPPO))) {
        sName = ROM_OPPO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_VIVO))) {
        sName = ROM_VIVO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_SMARTISAN))) {
        sName = ROM_SMARTISAN;
    } else {
        sVersion = Build.DISPLAY;
        if (sVersion.toUpperCase().contains(ROM_FLYME)) {
            sName = ROM_FLYME;
        } else {
            sVersion = Build.UNKNOWN;
            sName = Build.MANUFACTURER.toUpperCase();
        }
    }
    return sName.equals(rom);
}
 
源代码3 项目: imsdk-android   文件: Rom.java
public static boolean check(String rom) {
    if (sName != null) {
        return sName.equals(rom);
    }

    if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_MIUI))) {
        sName = ROM_MIUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_EMUI))) {
        sName = ROM_EMUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_OPPO))) {
        sName = ROM_OPPO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_VIVO))) {
        sName = ROM_VIVO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_SMARTISAN))) {
        sName = ROM_SMARTISAN;
    } else {
        sVersion = Build.DISPLAY;
        if (sVersion.toUpperCase().contains(ROM_FLYME)) {
            sName = ROM_FLYME;
        } else {
            sVersion = Build.UNKNOWN;
            sName = Build.MANUFACTURER.toUpperCase();
        }
    }
    return sName.equals(rom);
}
 
源代码4 项目: SimpleProject   文件: RomUtil.java
public static boolean check(String rom) {
	if (sName != null) {
		return sName.equals(rom);
	}

	if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_MIUI))) {
		sName = ROM_MIUI;
	} else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_EMUI))) {
		sName = ROM_EMUI;
	} else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_OPPO))) {
		sName = ROM_OPPO;
	} else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_VIVO))) {
		sName = ROM_VIVO;
	} else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_SMARTISAN))) {
		sName = ROM_SMARTISAN;
	} else {
		sVersion = Build.DISPLAY;
		if (sVersion.toUpperCase().contains(ROM_FLYME)) {
			sName = ROM_FLYME;
		} else {
			sVersion = Build.UNKNOWN;
			sName = Build.MANUFACTURER.toUpperCase();
		}
	}
	return sName.equals(rom);
}
 
源代码5 项目: AndroidPush   文件: RomUtil.java
public static boolean check(String rom) {
    if (sName != null) {
        return sName.equals(rom);
    }

    if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_MIUI))) {
        sName = ROM_MIUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_EMUI))) {
        sName = ROM_EMUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_OPPO))) {
        sName = ROM_OPPO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_VIVO))) {
        sName = ROM_VIVO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_SMARTISAN))) {
        sName = ROM_SMARTISAN;
    } else {
        sVersion = Build.DISPLAY;
        if (sVersion.toUpperCase().contains(ROM_FLYME)) {
            sName = ROM_FLYME;
        } else {
            sVersion = Build.UNKNOWN;
            sName = Build.MANUFACTURER.toUpperCase();
        }
    }
    return sName.equals(rom);
}
 
源代码6 项目: settingscompat   文件: RomUtil.java
public static boolean check(String rom) {
    if (sName != null) {
        return sName.equals(rom);
    }

    if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_MIUI))) {
        sName = ROM_MIUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_EMUI))){
        sName = ROM_EMUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_OPPO))){
        sName = ROM_OPPO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_VIVO))){
        sName = ROM_VIVO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_SMARTISAN))){
        sName = ROM_SMARTISAN;
    } else {
        sVersion = Build.DISPLAY;
        if (sVersion.toUpperCase().contains(ROM_FLYME)) {
            sName = ROM_FLYME;
        } else {
            sVersion = Build.UNKNOWN;
            sName = Build.MANUFACTURER.toUpperCase();
        }
    }
    return sName.equals(rom);
}
 
源代码7 项目: FriendCircle   文件: OSUtils.java
public static boolean check(String rom) {
    if (sName != null) {
        return sName.equals(rom);
    }

    if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_MIUI))) {
        sName = ROM_MIUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_EMUI))) {
        sName = ROM_EMUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_OPPO))) {
        sName = ROM_OPPO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_VIVO))) {
        sName = ROM_VIVO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_SMARTISAN))) {
        sName = ROM_SMARTISAN;
    } else {
        sVersion = Build.DISPLAY;
        if (sVersion.toUpperCase().contains(ROM_FLYME)) {
            sName = ROM_FLYME;
        } else {
            sVersion = Build.UNKNOWN;
            sName = Build.MANUFACTURER.toUpperCase();
        }
    }
    return sName.equals(rom);
}
 
源代码8 项目: OpenWeatherPlus-Android   文件: DeviceUtil.java
/**
 * 获取Android_ID
 */
public static String getAndroid_Id(Context context) {
    try {
        String androidId = Settings.System.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
        return object2String(androidId, Build.UNKNOWN);
    } catch (Exception e) {
        return Build.UNKNOWN;
    }
}
 
源代码9 项目: CrashReporter   文件: AppUtils.java
public static String getDeviceDetails(Context context) {

        return "Device Information\n"
                + "\nDEVICE.ID : " + getDeviceId(context)
                + "\nUSER.ID : " + getUserIdentity(context)
                + "\nAPP.VERSION : " + getAppVersion(context)
                + "\nLAUNCHER.APP : " + getCurrentLauncherApp(context)
                + "\nTIMEZONE : " + timeZone()
                + "\nVERSION.RELEASE : " + Build.VERSION.RELEASE
                + "\nVERSION.INCREMENTAL : " + Build.VERSION.INCREMENTAL
                + "\nVERSION.SDK.NUMBER : " + Build.VERSION.SDK_INT
                + "\nBOARD : " + Build.BOARD
                + "\nBOOTLOADER : " + Build.BOOTLOADER
                + "\nBRAND : " + Build.BRAND
                + "\nCPU_ABI : " + Build.CPU_ABI
                + "\nCPU_ABI2 : " + Build.CPU_ABI2
                + "\nDISPLAY : " + Build.DISPLAY
                + "\nFINGERPRINT : " + Build.FINGERPRINT
                + "\nHARDWARE : " + Build.HARDWARE
                + "\nHOST : " + Build.HOST
                + "\nID : " + Build.ID
                + "\nMANUFACTURER : " + Build.MANUFACTURER
                + "\nMODEL : " + Build.MODEL
                + "\nPRODUCT : " + Build.PRODUCT
                + "\nSERIAL : " + Build.SERIAL
                + "\nTAGS : " + Build.TAGS
                + "\nTIME : " + Build.TIME
                + "\nTYPE : " + Build.TYPE
                + "\nUNKNOWN : " + Build.UNKNOWN
                + "\nUSER : " + Build.USER;
    }