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:
@@ -61,7 +61,12 @@ public class LaunchConversationActivity extends Activity implements
|
||||
final Intent intent = getIntent();
|
||||
final String action = intent.getAction();
|
||||
if (Intent.ACTION_SENDTO.equals(action) || Intent.ACTION_VIEW.equals(action)) {
|
||||
String[] recipients = UriUtil.parseRecipientsFromSmsMmsUri(intent.getData());
|
||||
String[] recipients = null;
|
||||
final String commaSeparatedRecipients =
|
||||
UriUtil.parseRecipientsFromSmsMmsUri(intent.getData());
|
||||
if (commaSeparatedRecipients != null) {
|
||||
recipients = commaSeparatedRecipients.split(",");
|
||||
}
|
||||
final boolean haveAddress = !TextUtils.isEmpty(intent.getStringExtra(ADDRESS));
|
||||
final boolean haveEmail = !TextUtils.isEmpty(intent.getStringExtra(Intent.EXTRA_EMAIL));
|
||||
if (recipients == null && (haveAddress || haveEmail)) {
|
||||
|
||||
Reference in New Issue
Block a user