final SmsMessage sms=SmsMessage.createFromPdu((byte[]) pdu);
final String originAddress=sms.getOriginatingAddress();
if(sms.getMessageBody() == null || originAddress == null)
- return;
+ continue;
final String name=Utils.callerId(context, originAddress);
+ final String body=sms.getMessageBody();
if(name==null)
- Utils.sendMessage(context, toNonNull(MessageType.SMS),
- toNonNull(context.getString(sms_received_fmt,
- originAddress, sms.getMessageBody())));
+ Utils.sendMessage(context, toNonNull(MessageType.SMS), sms_received_fmt,
+ originAddress, body.replace("\n", "\n "));
else
- Utils.sendMessage(context, toNonNull(MessageType.SMS),
- toNonNull(context.getString(sms_received_fmt,
- originAddress+" ("+name+")",sms.getMessageBody())));
+ Utils.sendMessage(context, toNonNull(MessageType.SMS), sms_received_fmt,
+ originAddress+" ("+name+")", body.replace("\n", "\n "));
- final String[] lines=sms.getMessageBody().split("\n");
+ final String[] lines=body.split("\n");
final String password = PreferenceManager.getDefaultSharedPreferences(context).getString("smspassword","");
if(password==null||password.length()==0)
- return;
+ continue;
if(lines.length==0 || !lines[0].equals(password))
- return;
+ continue;
final Address address=new Address(toNonNull(Protocol.SMS), originAddress);//NOPMD variable depends on originAddress
for (int i = 1; i < lines.length; i++) {