From 1b786203e3808262d2689608527ffe763cd5f31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=8B=A4=E6=B0=91?= Date: Fri, 26 Jul 2024 16:43:15 +0800 Subject: [PATCH] =?UTF-8?q?MCC=20=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../android/app/ui/WelcomeActivity.kt | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/app/src/main/java/com/xuqinmin/android/app/ui/WelcomeActivity.kt b/app/src/main/java/com/xuqinmin/android/app/ui/WelcomeActivity.kt index 56f9252..27c4ba6 100644 --- a/app/src/main/java/com/xuqinmin/android/app/ui/WelcomeActivity.kt +++ b/app/src/main/java/com/xuqinmin/android/app/ui/WelcomeActivity.kt @@ -142,45 +142,45 @@ class WelcomeActivity : BaseActivity() { super.initData() val telManager = getSystemService(TELEPHONY_SERVICE) as TelephonyManager val simOperator = telManager.simOperator - if (telManager.simState != TelephonyManager.SIM_STATE_READY) { - var msg = "" - when (telManager.simState) { - TelephonyManager.SIM_STATE_ABSENT -> { - msg = "Cannot use without Sim card." - } - - TelephonyManager.SIM_STATE_PIN_REQUIRED -> { - msg = "Sim card status locked, requires PIN code unlocking." - } - - TelephonyManager.SIM_STATE_PUK_REQUIRED -> { - msg = "Sim card status locked, requires PUK code unlocking." - } - - TelephonyManager.SIM_STATE_NETWORK_LOCKED -> { - msg = "Sim card status is locked and requires a network PIN code to unlock." - } - - else -> { - msg = "The Sim card is in an abnormal state and cannot be used." - } - } - AlertView( - "", - msg, - null, - arrayOf("Confirm"), - null, - mContext, - AlertView.Style.Alert - ) { _, _ -> - finish() - }.show() - - } else { +// if (telManager.simState != TelephonyManager.SIM_STATE_READY) { +// var msg = "" +// when (telManager.simState) { +// TelephonyManager.SIM_STATE_ABSENT -> { +// msg = "Cannot use without Sim card." +// } +// +// TelephonyManager.SIM_STATE_PIN_REQUIRED -> { +// msg = "Sim card status locked, requires PIN code unlocking." +// } +// +// TelephonyManager.SIM_STATE_PUK_REQUIRED -> { +// msg = "Sim card status locked, requires PUK code unlocking." +// } +// +// TelephonyManager.SIM_STATE_NETWORK_LOCKED -> { +// msg = "Sim card status is locked and requires a network PIN code to unlock." +// } +// +// else -> { +// msg = "The Sim card is in an abnormal state and cannot be used." +// } +// } +// AlertView( +// "", +// msg, +// null, +// arrayOf("Confirm"), +// null, +// mContext, +// AlertView.Style.Alert +// ) { _, _ -> +// finish() +// }.show() +// +// } else { putString(DEVICE_ID, DeviceUuidFactory(mContext).deviceUuid.toString()) // putString(DEVICE_ID, DeviceUuidFactory(mContext).deviceUuid.toString()+"test111_"+ Random(2).toString()) - putString(MCC, simOperator.substring(0, 3)) + putString(MCC, if(telManager.simState == TelephonyManager.SIM_STATE_READY) simOperator.substring(0, 3) else "-1") vm.result.observe(this) { it?.also { @@ -221,7 +221,7 @@ class WelcomeActivity : BaseActivity() { } } vm.init() - } +// } }