Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/os/RemoteCallbackList.Builder#nestedclasses) \| [Ctors](https://developer.android.com/reference/android/os/RemoteCallbackList.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/os/RemoteCallbackList.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/os/RemoteCallbackList.Builder#inhmethods)

# RemoteCallbackList.Builder

*** ** * ** ***


`
public
static
final

class
RemoteCallbackList.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.os.RemoteCallbackList.Builder\<E extends [android.os.IInterface](https://developer.android.com/reference/android/os/IInterface)\> |

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/android/os/RemoteCallbackList`.

## Summary

| ### Nested classes ||
|---|---|
| ` interface` | `https://developer.android.com/reference/android/os/RemoteCallbackList.Builder.InterfaceDiedCallback<E extends https://developer.android.com/reference/android/os/IInterface>` For notifying when the process hosting a callback interface has died. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/os/RemoteCallbackList.Builder#Builder(int)(int frozenCalleePolicy) ` Creates a Builder for `https://developer.android.com/reference/android/os/RemoteCallbackList`. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/os/RemoteCallbackList<E>` | ` https://developer.android.com/reference/android/os/RemoteCallbackList.Builder#build()() ` Builds and returns a `https://developer.android.com/reference/android/os/RemoteCallbackList`. |
| ` https://developer.android.com/reference/android/os/RemoteCallbackList.Builder<E>` | ` https://developer.android.com/reference/android/os/RemoteCallbackList.Builder#setExecutor(java.util.concurrent.Executor)(https://developer.android.com/reference/java/util/concurrent/Executor executor) ` Sets the executor to be used when invoking callbacks asynchronously. |
| ` https://developer.android.com/reference/android/os/RemoteCallbackList.Builder<E>` | ` https://developer.android.com/reference/android/os/RemoteCallbackList.Builder#setInterfaceDiedCallback(android.os.RemoteCallbackList.Builder.InterfaceDiedCallback<E>)(https://developer.android.com/reference/android/os/RemoteCallbackList.Builder.InterfaceDiedCallback<E> callback) ` Sets the callback to be invoked when an interface dies. |
| ` https://developer.android.com/reference/android/os/RemoteCallbackList.Builder<E>` | ` https://developer.android.com/reference/android/os/RemoteCallbackList.Builder#setMaxQueueSize(int)(int maxQueueSize) ` Sets the max queue size. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

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


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

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


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

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


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

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


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(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` `
https://developer.android.com/reference/java/lang/Object#wait(long)(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` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

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


## Public constructors

### Builder

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (int frozenCalleePolicy)
```

Creates a Builder for `https://developer.android.com/reference/android/os/RemoteCallbackList`.

**Note:** If the kernel does not support frozen notifications, the list
will silently fall back to `https://developer.android.com/reference/android/os/RemoteCallbackList#FROZEN_CALLEE_POLICY_UNSET` behavior (i.e., callbacks
are invoked immediately regardless of the frozen state of the target process). However,
`https://developer.android.com/reference/android/os/RemoteCallbackList#getFrozenCalleePolicy()` will still return the policy specified here.

<br />

<br />

| Parameters ||
|---|---|
| `frozenCalleePolicy` | `int`: When the callback recipient's process is frozen, this parameter specifies when/whether callbacks are invoked. It's important to choose a strategy that's right for the use case. Leaving the policy unset with `https://developer.android.com/reference/android/os/RemoteCallbackList#FROZEN_CALLEE_POLICY_UNSET` is not recommended as it allows callbacks to be invoked while the recipient is frozen. Value is one of the following: - `https://developer.android.com/reference/android/os/RemoteCallbackList#FROZEN_CALLEE_POLICY_UNSET` - `https://developer.android.com/reference/android/os/RemoteCallbackList#FROZEN_CALLEE_POLICY_ENQUEUE_ALL` - `https://developer.android.com/reference/android/os/RemoteCallbackList#FROZEN_CALLEE_POLICY_ENQUEUE_MOST_RECENT` - `https://developer.android.com/reference/android/os/RemoteCallbackList#FROZEN_CALLEE_POLICY_DROP` |

## Public methods

### build

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public RemoteCallbackList<E> build ()
```

Builds and returns a `https://developer.android.com/reference/android/os/RemoteCallbackList`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/RemoteCallbackList<E>` | The built `https://developer.android.com/reference/android/os/RemoteCallbackList` object. This value cannot be `null`. <br /> |

### setExecutor

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public RemoteCallbackList.Builder<E> setExecutor (Executor executor)
```

Sets the executor to be used when invoking callbacks asynchronously.

This is only used when callbacks need to be invoked asynchronously, e.g. when the process
hosting a callback becomes unfrozen. Callbacks that can be invoked immediately run on the
same thread that calls `https://developer.android.com/reference/android/os/RemoteCallbackList#broadcast(java.util.function.Consumer<E>)` synchronously.

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/RemoteCallbackList.Builder<E>` | This value cannot be `null`. <br /> |

### setInterfaceDiedCallback

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public RemoteCallbackList.Builder<E> setInterfaceDiedCallback (InterfaceDiedCallback<E> callback)
```

Sets the callback to be invoked when an interface dies.

<br />

| Parameters ||
|---|---|
| `callback` | `InterfaceDiedCallback`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/RemoteCallbackList.Builder<E>` | This value cannot be `null`. <br /> |

### setMaxQueueSize

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public RemoteCallbackList.Builder<E> setMaxQueueSize (int maxQueueSize)
```

Sets the max queue size.

<br />

| Parameters ||
|---|---|
| `maxQueueSize` | `int`: The max size limit on the queue that stores callbacks added when the recipient's process is frozen. Once the limit is reached, the oldest callback is dropped to keep the size under the limit. Should only be called for `https://developer.android.com/reference/android/os/RemoteCallbackList#FROZEN_CALLEE_POLICY_ENQUEUE_ALL`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/RemoteCallbackList.Builder<E>` | This builder. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the maxQueueSize is not positive. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | if frozenCalleePolicy is not `https://developer.android.com/reference/android/os/RemoteCallbackList#FROZEN_CALLEE_POLICY_ENQUEUE_ALL`. |