mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 01:17:41 +08:00
parent
cdf0cae0cf
commit
d6b39b09c2
@ -32,7 +32,7 @@ import com.xuexiang.xutil.resource.ResUtils
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
@Suppress("PropertyName", "DEPRECATION")
|
||||
@Suppress("DEPRECATION")
|
||||
class PhoneUtils private constructor() {
|
||||
|
||||
companion object {
|
||||
@ -50,7 +50,7 @@ class PhoneUtils private constructor() {
|
||||
XUtil.getContext(), permission.READ_PHONE_STATE
|
||||
)
|
||||
val activeSubscriptionInfoList: List<SubscriptionInfo>? = mSubscriptionManager.activeSubscriptionInfoList
|
||||
if (activeSubscriptionInfoList != null && activeSubscriptionInfoList.isNotEmpty()) {
|
||||
if (!activeSubscriptionInfoList.isNullOrEmpty()) {
|
||||
//1.1.1 有使用的卡,就遍历所有卡
|
||||
for (subscriptionInfo in activeSubscriptionInfoList) {
|
||||
val simInfo = SimInfo()
|
||||
@ -97,7 +97,7 @@ class PhoneUtils private constructor() {
|
||||
//为空,两个卡都没有获取到信息
|
||||
if (infoList.isEmpty()) {
|
||||
//卡1备注信息不为空
|
||||
var etExtraSim1 = SettingUtils.extraSim1
|
||||
val etExtraSim1 = SettingUtils.extraSim1
|
||||
if (!TextUtils.isEmpty(etExtraSim1)) {
|
||||
val simInfo1 = SimInfo()
|
||||
//卡1
|
||||
@ -108,7 +108,7 @@ class PhoneUtils private constructor() {
|
||||
infoList[simInfo1.mSimSlotIndex] = simInfo1
|
||||
}
|
||||
//卡2备注信息不为空
|
||||
var etExtraSim2 = SettingUtils.extraSim2
|
||||
val etExtraSim2 = SettingUtils.extraSim2
|
||||
if (!TextUtils.isEmpty(etExtraSim2)) {
|
||||
val simInfo2 = SimInfo()
|
||||
simInfo2.mSimSlotIndex = 1
|
||||
@ -120,7 +120,7 @@ class PhoneUtils private constructor() {
|
||||
|
||||
//有一张卡,判断是卡几
|
||||
} else {
|
||||
var infoListIndex = -1;
|
||||
var infoListIndex = -1
|
||||
for (obj in infoList) {
|
||||
infoListIndex = obj.key
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user