diff --git a/app/src/main/java/com/idormy/sms/forwarder/entity/SimInfo.kt b/app/src/main/java/com/idormy/sms/forwarder/entity/SimInfo.kt index 344ccba0a1..04f3e3bd17 100644 --- a/app/src/main/java/com/idormy/sms/forwarder/entity/SimInfo.kt +++ b/app/src/main/java/com/idormy/sms/forwarder/entity/SimInfo.kt @@ -7,19 +7,19 @@ import java.io.Serializable data class SimInfo( //运营商信息:中国移动 中国联通 中国电信 @SerializedName("carrier_name") - var mCarrierName: CharSequence? = null, + var mCarrierName: String? = null, //集成电路卡识别码即SIM卡卡号 @SerializedName("icc_id") - var mIccId: CharSequence? = null, + var mIccId: String? = null, //卡槽id:-1=没插入、 0=卡槽1 、1=卡槽2 @SerializedName("sim_slot_index") var mSimSlotIndex: Int = 0, //号码 @SerializedName("number") - var mNumber: CharSequence? = null, + var mNumber: String? = null, //国家代码 @SerializedName("country_iso") - var mCountryIso: CharSequence? = null, + var mCountryIso: String? = null, //SIM的 Subscription Id (SIM插入顺序) @SerializedName("subscription_id") var mSubscriptionId: Int = 0, diff --git a/app/src/main/java/com/idormy/sms/forwarder/utils/PhoneUtils.kt b/app/src/main/java/com/idormy/sms/forwarder/utils/PhoneUtils.kt index fe2a3c3316..3d76827d99 100644 --- a/app/src/main/java/com/idormy/sms/forwarder/utils/PhoneUtils.kt +++ b/app/src/main/java/com/idormy/sms/forwarder/utils/PhoneUtils.kt @@ -52,11 +52,11 @@ class PhoneUtils private constructor() { //1.1.1 有使用的卡,就遍历所有卡 for (subscriptionInfo in activeSubscriptionInfoList) { val simInfo = SimInfo() - simInfo.mCarrierName = subscriptionInfo.carrierName - simInfo.mIccId = subscriptionInfo.iccId + simInfo.mCarrierName = subscriptionInfo.carrierName.toString() + simInfo.mIccId = subscriptionInfo.iccId.toString() simInfo.mSimSlotIndex = subscriptionInfo.simSlotIndex - simInfo.mNumber = subscriptionInfo.number - simInfo.mCountryIso = subscriptionInfo.countryIso + simInfo.mNumber = subscriptionInfo.number.toString() + simInfo.mCountryIso = subscriptionInfo.countryIso.toString() simInfo.mSubscriptionId = subscriptionInfo.subscriptionId println(simInfo.toString()) infoList[simInfo.mSimSlotIndex] = simInfo