From 4109741628788c65cf964c092246cf3fccf90b3e Mon Sep 17 00:00:00 2001 From: liuguijing <1440265357@qq.com> Date: Thu, 13 Mar 2025 15:55:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=95=E5=8D=A1=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E7=9F=AD=E4=BF=A1=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/xypower/mpmaster/sms/SimUtil.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mpmaster/src/main/java/com/xypower/mpmaster/sms/SimUtil.java b/mpmaster/src/main/java/com/xypower/mpmaster/sms/SimUtil.java index 687c82cb..5e79fc45 100644 --- a/mpmaster/src/main/java/com/xypower/mpmaster/sms/SimUtil.java +++ b/mpmaster/src/main/java/com/xypower/mpmaster/sms/SimUtil.java @@ -1196,7 +1196,7 @@ public class SimUtil { if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) { return; } - if (localSubscriptionManager.getActiveSubscriptionInfoCount() > 1) { + if (localSubscriptionManager.getActiveSubscriptionInfoCount() > 0) { List localList = localSubscriptionManager.getActiveSubscriptionInfoList(); boolean doubleSim = isDoubleSim(mContext); SubscriptionInfo simInfoAnother = null; @@ -1208,6 +1208,10 @@ public class SimUtil { simInfoAnother = (SubscriptionInfo) localList.get(1); } } + } else { + if (localList != null && localList.size() > 0) { + simInfoAnother = (SubscriptionInfo) localList.get(0); + } } Intent itSend = new Intent(SMS_SEND_ACTION); itSend.putExtra(SMSRESTARTTYPE, restartType);