use of com.android.mms.data.Conversation in project android-aosp-mms by slvn.
the class ComposeMessageActivityTests method testCreateManyThreads.
// Here's how to execute just this one test:
// runtest -m testCreateManyThreads mms -c com.android.mms.ui.ComposeMessageActivityTests
// This test intentionally uses the UI functions to create the threads rather than adding
// the threads directly to the mms provider's threads table.
@LargeTest
public void testCreateManyThreads() {
for (int i = 0; i < 10; i++) {
String phoneNum = String.format("424-123-%04d", i);
ContactList contactList = ContactList.getByNumbers(phoneNum, false, false);
Conversation conv = Conversation.get(mActivity, contactList, false);
WorkingMessage workingMsg = WorkingMessage.loadDraft(mActivity, conv, null);
workingMsg.setConversation(conv);
workingMsg.setText("This is test #" + i + " thread id: " + conv.getThreadId());
// Log.i(TAG, "[testCreateManyThreads] workingMsg: ");
// workingMsg.dump();
workingMsg.saveDraft(false);
}
}
use of com.android.mms.data.Conversation in project android-aosp-mms by slvn.
the class RecipientListActivity method onCreate.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
if (icicle != null) {
// Retrieve previously saved state of this activity.
mThreadId = icicle.getLong(ComposeMessageActivity.THREAD_ID);
} else {
mThreadId = getIntent().getLongExtra(ComposeMessageActivity.THREAD_ID, 0);
}
if (mThreadId == 0) {
Log.w(TAG, "No thread_id specified in extras or icicle. Finishing...");
finish();
return;
}
Conversation conv = Conversation.get(this, mThreadId, true);
if (conv == null) {
Log.w(TAG, "No conversation found for threadId: " + mThreadId + ". Finishing...");
finish();
return;
}
final ContactList contacts = conv.getRecipients();
getListView().setAdapter(new RecipientListAdapter(this, R.layout.recipient_list_item, contacts));
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
int cnt = contacts.size();
actionBar.setSubtitle(getResources().getQuantityString(R.plurals.recipient_count, cnt, cnt));
}
Aggregations