IpcEnvelope

The Bundle envelope carried by the two generic AIDL callbacks, IASSParcelableCallback and IASSParcelableListCallback.

AIDL has no generic Parcelable parameter, so a callback that could return "whatever this verb answers with" used to mean one interface per return type. A Bundle is the one wire type that can hold any of them, so both callbacks take a Bundle and this file owns the keys, the packing (IpcEnvelope) and the unpacking (the Bundle? readers below).

Everything an ASS verb answers with fits: a single Parcelable, a list of them, a String, a boolean, nothing at all, an open stream, or a login outcome.

Properties

Link copied to clipboard

A stream's Content-Length, or -1 when the server advertised none.

Link copied to clipboard

A stream's Content-Type, alongside the KEY_VALUE file descriptor.

Link copied to clipboard
const val KEY_GRANTED: String

Whether a login was granted, alongside the KEY_VALUE WebID the user picked.

Link copied to clipboard
const val KEY_VALUE: String

The result value: the Parcelable, the ParcelableArrayList, the String, or the boolean.

Functions

Link copied to clipboard
fun empty(): Bundle

The answer of an operation that reports only that it succeeded.

Link copied to clipboard
fun of(value: Parcelable?): Bundle

Envelopes a single value; a null value is a legitimate answer, not an error.

Link copied to clipboard
fun ofBoolean(value: Boolean): Bundle

Envelopes a single value boolean.

Link copied to clipboard
fun ofList(values: List<Parcelable>?): Bundle

Envelopes values as a ParcelableArrayList. A null list envelopes as an absent value.

Link copied to clipboard
fun ofLogin(granted: Boolean, selectedWebId: String?): Bundle

Envelopes a login outcome: whether it was granted and the WebID the user selected.

Link copied to clipboard
fun ofStream(source: ParcelFileDescriptor, contentType: String, contentLength: Long): Bundle

Envelopes an open read stream: the descriptor the caller reads and must close, plus the content type and the length (contentLength is -1 when the server advertised none).

Link copied to clipboard
fun ofString(value: String?): Bundle

Envelopes a single value String.