Skip to content

Commit 83111aa

Browse files
committed
Feat: Android 16 QPR2 (API 36.1)
Signed-off-by: imknown <imknown@qq.com>
1 parent 5b926a0 commit 83111aa

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

app/src/main/java/net/imknown/android/forefrontinfo/ui/common/AndroidVersionExt.kt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,13 @@ private val sdkIntFull: Int by lazy {
6767
}
6868
}
6969

70-
/** E.g.: "36.1" */
70+
/** E.g.: "35", "36.1" */
7171
val sdkFull: String by lazy {
72-
"$sdkInt.${sdkIntFull.toMinor()}"
73-
}
74-
75-
private fun Int.toMinor(): Int = if (isAtLeastAndroid16()) {
76-
Build.getMinorSdkVersion(this)
77-
} else {
78-
this % SDK_INT_MULTIPLIER
72+
if (isAtLeastAndroid16()) {
73+
"$sdkInt.${Build.getMinorSdkVersion(sdkIntFull)}"
74+
} else {
75+
sdkInt.toString()
76+
}
7977
}
8078

8179
fun isAtLeastAndroid6() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M || sdkInt >= Build.VERSION_CODES.M

0 commit comments

Comments
 (0)