Telephony.Threads


public static final class Telephony.Threads
extends Object implements Telephony.ThreadsColumns

java.lang.Object
   ↳ android.provider.Telephony.Threads


Helper functions for the "threads" table used by MMS and SMS. Thread IDs are determined by the participants in a conversation and can be used to match both SMS and MMS messages. To avoid issues where applications might cache a thread ID, the thread ID of a deleted thread must not be reused to point at a new thread.

Summary

Constants

int BROADCAST_THREAD

Thread type: broadcast thread.

int COMMON_THREAD

Thread type: common thread.

Inherited constants

String ARCHIVED

If the thread is archived

Type: INTEGER (boolean)

String DATE

The date at which the thread was created.

String ERROR

Indicates whether there is a transmission error in the thread.

String HAS_ATTACHMENT

Indicates whether this thread contains any attachments.

String MESSAGE_COUNT

The message count of the thread.

String READ

Indicates whether all messages of the thread have been read.

String RECIPIENT_IDS

A string encoding of the recipient IDs of the recipients of the message, in numerical order and separated by spaces.

String SNIPPET

The snippet of the latest message in the thread.

String SNIPPET_CHARSET

The charset of the snippet.

String TYPE

Type of the thread, either Threads.COMMON_THREAD or Threads.BROADCAST_THREAD.

String _COUNT

The count of rows in a directory.

String _ID

The unique ID for a row.

Fields

public static final Uri CONTENT_URI

The content:// style URL for this table, by conversation.

public static final Uri OBSOLETE_THREADS_URI

The content:// style URL for this table, for obsolete threads.

Public methods

static long getOrCreateThreadId(Context context, String recipient)

This is a single-recipient version of getOrCreateThreadId.

static long getOrCreateThreadId(Context context, Set<String> recipients)

Given a set of recipients return its thread ID.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Constants

BROADCAST_THREAD

Added in API level 19
public static final int BROADCAST_THREAD

Thread type: broadcast thread.

Constant Value: 1 (0x00000001)

COMMON_THREAD

Added in API level 19
public static final int COMMON_THREAD

Thread type: common thread.

Constant Value: 0 (0x00000000)

Fields

CONTENT_URI

Added in API level 19
public static final Uri CONTENT_URI

The content:// style URL for this table, by conversation.

OBSOLETE_THREADS_URI

Added in API level 19
public static final Uri OBSOLETE_THREADS_URI

The content:// style URL for this table, for obsolete threads.

Public methods

getOrCreateThreadId

Added in API level 23
public static long getOrCreateThreadId (Context context, 
                String recipient)

This is a single-recipient version of getOrCreateThreadId. It's convenient for use with SMS messages.

Parameters
context Context: the context object to use.

recipient String: the recipient to send to.

Returns
long

getOrCreateThreadId

Added in API level 23
public static long getOrCreateThreadId (Context context, 
                Set<String> recipients)

Given a set of recipients return its thread ID.

If a thread exists containing the provided participants, return its thread ID. Otherwise, this will create a new thread containing the provided participants and return its ID.

Parameters
context Context

recipients Set

Returns
long