mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 01:17:41 +08:00
优化:来电转发文本标明通话类型:1.呼入 2.呼出 3.未接
This commit is contained in:
parent
8567c39fcf
commit
d124bd2b2d
@ -110,13 +110,21 @@ public class PhoneStateReceiver extends BroadcastReceiver {
|
||||
}
|
||||
SettingUtil.setPrevNoticeHash(phoneNumber, currHash);
|
||||
|
||||
SmsVo smsVo = new SmsVo(phoneNumber, name + context.getString(R.string.calling), new Date(), simInfo);
|
||||
SmsVo smsVo = new SmsVo(phoneNumber, getTypeText(context, callInfo.getType(), name), new Date(), simInfo);
|
||||
Log.d(TAG, "send_msg" + smsVo.toString());
|
||||
SendUtil.send_msg(context, smsVo, simId, "call");
|
||||
|
||||
//SmsHubApi
|
||||
if (SettingUtil.getSwitchEnableSmsHubApi()) {
|
||||
SmsHubActionHandler.putData(new SmsHubVo(SmsHubVo.Type.phone, simId, name + context.getString(R.string.calling), phoneNumber));
|
||||
SmsHubActionHandler.putData(new SmsHubVo(SmsHubVo.Type.phone, simId, getTypeText(context, callInfo.getType(), name), phoneNumber));
|
||||
}
|
||||
}
|
||||
|
||||
//获取通话类型:1.呼入 2.呼出 3.未接
|
||||
private String getTypeText(Context context, int type, String name) {
|
||||
String str = context.getString(R.string.linkman) + name + "\n" + context.getString(R.string.mandatory_type);
|
||||
if (type == 3) return str + context.getString(R.string.received_call);
|
||||
if (type == 2) return str + context.getString(R.string.local_outgoing_call);
|
||||
return str + context.getString(R.string.missed_call);
|
||||
}
|
||||
}
|
||||
|
@ -390,4 +390,5 @@
|
||||
<string name="tips_clone_failed">One-click clone failed:</string>
|
||||
<string name="tips_versions_inconsistent">The APP versions of the sender and the receiver are inconsistent, and cannot be cloned with one click!</string>
|
||||
<string name="tips_get_info_failed">Failed to get one-click clone information from sender</string>
|
||||
<string name="linkman">Linkman:</string>
|
||||
</resources>
|
||||
|
@ -312,7 +312,7 @@
|
||||
<string name="todo">TODO</string>
|
||||
<string name="forwarding_function">转发功能</string>
|
||||
<string name="forwarding_function_tips">总开关,请根据实际需要,启用对应的转发功能</string>
|
||||
<string name="mandatory_type">通话类型:</string>
|
||||
<string name="mandatory_type">通话类型:</string>
|
||||
<string name="missed_call">未接来电</string>
|
||||
<string name="received_call">已接来电</string>
|
||||
<string name="local_outgoing_call">本机去电</string>
|
||||
@ -389,4 +389,5 @@
|
||||
<string name="tips_clone_failed">一键克隆失败:</string>
|
||||
<string name="tips_versions_inconsistent">发送端与接收端的APP版本不一致,无法一键克隆!</string>
|
||||
<string name="tips_get_info_failed">从发送端获取一键克隆信息失败</string>
|
||||
<string name="linkman">联 系 人:</string>
|
||||
</resources>
|
||||
|
Loading…
x
Reference in New Issue
Block a user