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);