Fix parsing of SMS messages from short numbers.
extractEmailAddressFromMessageBody assumed all messages sent to it start with an email address, without doing any validation at all. This caused all messages sent from numbers of 4 digits or fewer (see SmsAddress.couldBeEmailGateway) to have its first word treated as the source address, even when there's no address at all. Older versions of this code didn't have that problem, but had other problems: any string containing an @, even in the middle of a sentence, would be considered an email address. This will still parse some messages incorrectly: if an SMS gateway doesn't include an email address, and the sender sends a message that happens to begin with an email address, the results are indistinguishable. This isn't actually reliably parsable; although TS 23.040 3.8 clearly defines this format, the format it defines is uselessly ambiguous. This will at least greatly reduce the number of broken cases. http://code.google.com/p/cyanogenmod/issues/detail?id=1419 http://code.google.com/p/android/issues/detail?id=6526
Loading
Please register or sign in to comment