整理:删除多余的判断

This commit is contained in:
Naccl 2022-01-15 17:58:29 +08:00
parent 874cb7f957
commit 86f3960300
3 changed files with 3 additions and 15 deletions

View File

@ -30,11 +30,7 @@ public class SmsHubVo implements Serializable {
this.msgId = UUID.randomUUID().toString();
if (channel != null) {
String simInfo = simId == 2 ? SettingUtil.getAddExtraSim2() : SettingUtil.getAddExtraSim1(); //自定义备注优先
if (!simInfo.isEmpty()) {
simInfo = "SIM" + simId + ":" + simInfo;
} else {
simInfo = SimUtil.getSimInfo(simId);
}
simInfo = "SIM" + simId + ":" + simInfo;
this.channel = simInfo;
}
this.content = content;

View File

@ -81,11 +81,7 @@ public class PhoneStateReceiver extends BroadcastReceiver {
Log.d(TAG, "getSubscriptionId = " + callInfo.getSubscriptionId());
int simId = SimUtil.getSimIdBySubscriptionId(callInfo.getSubscriptionId());
String simInfo = simId == 2 ? SettingUtil.getAddExtraSim2() : SettingUtil.getAddExtraSim1(); //自定义备注优先
if (!simInfo.isEmpty()) {
simInfo = "SIM" + simId + "_" + simInfo;
} else {
simInfo = SimUtil.getSimInfo(simId);
}
simInfo = "SIM" + simId + "_" + simInfo;
if (TextUtils.isEmpty(name)) {
List<PhoneBookEntity> contacts = ContactHelper.getInstance().getContactByNumber(context, phoneNumber);

View File

@ -53,11 +53,7 @@ public class SmsBroadcastReceiver extends BroadcastReceiver {
//自定义备注优先
simInfo = simId == 2 ? SettingUtil.getAddExtraSim2() : SettingUtil.getAddExtraSim1();
if (!simInfo.isEmpty()) {
simInfo = "SIM" + simId + "_" + simInfo;
} else {
simInfo = SimUtil.getSimInfo(simId);
}
simInfo = "SIM" + simId + "_" + simInfo;
} catch (Exception e) {
Log.e(TAG, "获取接收手机号失败:" + e.getMessage());
}