Parse recipients from RESPOND_VIA_MESSAGE correctly
UriUtil#parseRecipientsFromSmsMmsUri() will returns a comma-separated recipients for common use so that InsertNewMessageAction#createMessage() can create or get a conversation correctly for RESPOND_VIA_MESSAGE. In addition, mms/mmsto schemes are added. And it includes small cleanup intent-filters for LaunchConversationActivity. Test: adb shell am startservice -a android.intent.action.RESPOND_VIA_MESSAGE -d "sms:12345678,87654321" -e android.intent.extra.TEXT "Text" Change-Id: I291dc765a46846982d059016d44f90873c687867 Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
This commit is contained in:
@@ -1111,37 +1111,6 @@ public class MmsUtils {
|
||||
return subject;
|
||||
}
|
||||
|
||||
// return a semicolon separated list of phone numbers from a smsto: uri.
|
||||
public static String getSmsRecipients(final Uri uri) {
|
||||
String recipients = uri.getSchemeSpecificPart();
|
||||
final int pos = recipients.indexOf('?');
|
||||
if (pos != -1) {
|
||||
recipients = recipients.substring(0, pos);
|
||||
}
|
||||
recipients = replaceUnicodeDigits(recipients).replace(',', ';');
|
||||
return recipients;
|
||||
}
|
||||
|
||||
// This function was lifted from Telephony.PhoneNumberUtils because it was @hide
|
||||
/**
|
||||
* Replace arabic/unicode digits with decimal digits.
|
||||
* @param number
|
||||
* the number to be normalized.
|
||||
* @return the replaced number.
|
||||
*/
|
||||
private static String replaceUnicodeDigits(final String number) {
|
||||
final StringBuilder normalizedDigits = new StringBuilder(number.length());
|
||||
for (final char c : number.toCharArray()) {
|
||||
final int digit = Character.digit(c, 10);
|
||||
if (digit != -1) {
|
||||
normalizedDigits.append(digit);
|
||||
} else {
|
||||
normalizedDigits.append(c);
|
||||
}
|
||||
}
|
||||
return normalizedDigits.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Whether the data roaming is enabled
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user