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:
Taesu Lee
2020-05-28 15:17:56 +09:00
parent ab856cb957
commit fcf6699742
5 changed files with 15 additions and 46 deletions

View File

@@ -324,14 +324,13 @@ public class UriUtil {
}
/**
* Extract recipient destinations from Uri of form
* SCHEME:destionation[,destination]?otherstuff
* Extract recipient destinations from Uri of form SCHEME:destination[,destination]?otherstuff
* where SCHEME is one of the supported sms/mms schemes.
*
* @param uri sms/mms uri
* @return recipient destinations or null
* @return a comma-separated list of recipient destinations or null.
*/
public static String[] parseRecipientsFromSmsMmsUri(final Uri uri) {
public static String parseRecipientsFromSmsMmsUri(final Uri uri) {
if (!isSmsMmsUri(uri)) {
return null;
}
@@ -341,7 +340,7 @@ public class UriUtil {
}
// replaceUnicodeDigits will replace digits typed in other languages (i.e. Egyptian) with
// the usual ascii equivalents.
return TextUtil.replaceUnicodeDigits(parts[0]).replace(';', ',').split(",");
return TextUtil.replaceUnicodeDigits(parts[0]).replace(';', ',');
}
/**