Skip to content

Commit 6143543

Browse files
[chore]
1. simNumber 확인할 수 없을 때 대체 문구 수정
1 parent d85b8b8 commit 6143543

File tree

1 file changed

+5
-4
lines changed
  • app/src/main/java/ch/lock/mobile/android/deviceinfo/utils

1 file changed

+5
-4
lines changed

app/src/main/java/ch/lock/mobile/android/deviceinfo/utils/SimUtils.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ class SimUtils(
3333
*/
3434
val simNumber: String
3535
get() = try {
36-
when {
37-
Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1 ->
38-
subscriptionManager.activeSubscriptionInfoList?.firstOrNull()?.iccId ?: ""
39-
else -> telephonyManager.simSerialNumber ?: ""
36+
when (Build.VERSION.SDK_INT) {
37+
in 1.. 21 -> telephonyManager.simSerialNumber ?: ""
38+
in 22..28 -> subscriptionManager.activeSubscriptionInfoList?.firstOrNull()?.iccId
39+
?: "유심이 장착되어 있지 않아 확인 불가"
40+
else -> "안드로이드 정책에 의해 확인 불가"
4041
}
4142
} catch (e: Exception) {
4243
""

0 commit comments

Comments
 (0)