MCC 默认值

这个提交包含在:
徐勤民 2024-07-26 16:43:15 +08:00
父节点 5ade899336
当前提交 1b786203e3

查看文件

@ -142,45 +142,45 @@ class WelcomeActivity : BaseActivity<ActivityWelcomeBinding>() {
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<ActivityWelcomeBinding>() {
}
}
vm.init()
}
// }
}