Added androidVersionCodeName function in FunctionFactory

This commit is contained in:
2023-02-03 05:11:45 +08:00
parent 4707685cc2
commit 629c402c44

View File

@@ -138,6 +138,28 @@ val isSupportMiuiVersion
*/
inline val isNotSupportMiuiVersion get() = !isSupportMiuiVersion
/**
* 获取 Android 版本代号
* @return [String]
*/
val androidVersionCodeName
get() = when (Build.VERSION.SDK_INT) {
33 -> "T"
32 -> "S_V2"
31 -> "S"
30 -> "R"
29 -> "Q"
28 -> "P"
27 -> "O_MR1"
26 -> "O"
25 -> "N_MR1"
24 -> "N"
23 -> "M"
22 -> "L_MR1"
21 -> "L"
else -> ""
}
/**
* 获取 MIUI 版本
* @return [String]