We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d85b8b8 commit 6143543Copy full SHA for 6143543
app/src/main/java/ch/lock/mobile/android/deviceinfo/utils/SimUtils.kt
@@ -33,10 +33,11 @@ class SimUtils(
33
*/
34
val simNumber: String
35
get() = try {
36
- when {
37
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1 ->
38
- subscriptionManager.activeSubscriptionInfoList?.firstOrNull()?.iccId ?: ""
39
- else -> telephonyManager.simSerialNumber ?: ""
+ when (Build.VERSION.SDK_INT) {
+ in 1.. 21 -> telephonyManager.simSerialNumber ?: ""
+ in 22..28 -> subscriptionManager.activeSubscriptionInfoList?.firstOrNull()?.iccId
+ ?: "유심이 장착되어 있지 않아 확인 불가"
40
+ else -> "안드로이드 정책에 의해 확인 불가"
41
}
42
} catch (e: Exception) {
43
""
0 commit comments