From af6bb1ce9aa0f1f73666b25af404640930be8c10 Mon Sep 17 00:00:00 2001 From: Satish Roddom Date: Mon, 31 Aug 2009 05:00:23 -0500 Subject: [PATCH] SMS-to-email fix for messages from the web Certain carrier websites allow sending SMS to phones on their network. They allow filling out a "Reply to Address" which can be a phone number. The website may send that message to the device as an SMS-to-email, but the "From" address will be an SMS short code and not a valid email address. When the user replies to this message, the response is directed to the short code and not delivered correctly. In extractEmailAddressFromMessageBody(), currently it checks if the sender is a shortcode and an email address is present as the first word in the message body. If so, it replaces the email address as the sender replacing the short code. The fix to support the above case is remove the email address check and treat the first word as FROM address regardless of what the user types. Change-Id: Ifd39a39b352f204024c76fde293164dcd2b0896b --- .../java/com/android/internal/telephony/SmsMessageBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telephony/java/com/android/internal/telephony/SmsMessageBase.java b/telephony/java/com/android/internal/telephony/SmsMessageBase.java index e73039bbe21bb..3f0213b8866df 100644 --- a/telephony/java/com/android/internal/telephony/SmsMessageBase.java +++ b/telephony/java/com/android/internal/telephony/SmsMessageBase.java @@ -383,7 +383,7 @@ public abstract class SmsMessageBase { * 2. [x@y][ ]/[body] */ String[] parts = messageBody.split("( /)|( )", 2); - if (parts.length < 1 || parts[0].indexOf('@') == -1) return; + if (parts.length < 1) return; emailFrom = parts[0]; emailBody = parts[1]; isEmail = true;