Defines a message containing a description and arbitrary data object that can be sent to a Handler. This object contains two extra int fields and an extra object field that allow you to not do allocations in many cases. While the constructor of Message is public, the best w
| 32 | * them from a pool of recycled objects.</p> |
| 33 | */ |
| 34 | public final class Message implements Parcelable { |
| 35 | /** |
| 36 | * User-defined message code so that the recipient can identify |
| 37 | * what this message is about. Each {@link Handler} has its own name-space |
| 38 | * for message codes, so you do not need to worry about yours conflicting |
| 39 | * with other handlers. |
| 40 | * |
| 41 | * If not specified, this value is 0. |
| 42 | * Use values other than 0 to indicate custom message codes. |
| 43 | */ |
| 44 | public int what; |
| 45 | |
| 46 | /** |
| 47 | * arg1 and arg2 are lower-cost alternatives to using |
| 48 | * {@link #setData(Bundle) setData()} if you only need to store a |
| 49 | * few integer values. |
| 50 | */ |
| 51 | public int arg1; |
| 52 | |
| 53 | /** |
| 54 | * arg1 and arg2 are lower-cost alternatives to using |
| 55 | * {@link #setData(Bundle) setData()} if you only need to store a |
| 56 | * few integer values. |
| 57 | */ |
| 58 | public int arg2; |
| 59 | |
| 60 | /** |
| 61 | * An arbitrary object to send to the recipient. When using |
| 62 | * {@link Messenger} to send the message across processes this can only |
| 63 | * be non-null if it contains a Parcelable of a framework class (not one |
| 64 | * implemented by the application). For other data transfer use |
| 65 | * {@link #setData}. |
| 66 | * |
| 67 | * <p>Note that Parcelable objects here are not supported prior to |
| 68 | * the {@link android.os.Build.VERSION_CODES#FROYO} release. |
| 69 | */ |
| 70 | public Object obj; |
| 71 | |
| 72 | /** |
| 73 | * Optional Messenger where replies to this message can be sent. The |
| 74 | * semantics of exactly how this is used are up to the sender and |
| 75 | * receiver. |
| 76 | */ |
| 77 | public Messenger replyTo; |
| 78 | |
| 79 | /** |
| 80 | * Indicates that the uid is not set; |
| 81 | * |
| 82 | * @hide Only for use within the system server. |
| 83 | */ |
| 84 | public static final int UID_NONE = -1; |
| 85 | |
| 86 | /** |
| 87 | * Optional field indicating the uid that sent the message. This is |
| 88 | * only valid for messages posted by a {@link Messenger}; otherwise, |
| 89 | * it will be -1. |
| 90 | */ |
| 91 | public int sendingUid = UID_NONE; |
nothing calls this directly
no outgoing calls
no test coverage detected