CallbackHandlerRegistry

public class CallbackHandlerRegistry


The holder for callbacks that are tagged with RemoteCallable. Note: This should only be referenced by generated code, there is no reason to reference this otherwise.

Summary

Nested types

The interface used to trigger a callback when the pending intent is fired.

Public constructors

Public methods

void
<T extends CallbackReceiver> invokeCallback(
    Context context,
    T receiver,
    Intent intent
)

Trigger a call to a callback using arguments that were generated with getArgumentBundle.

void
<T extends CallbackReceiver> invokeCallback(
    Context context,
    T receiver,
    Bundle bundle
)

Trigger a call to a callback using arguments that were generated with getArgumentBundle.

static void
<T extends CallbackReceiver> registerCallbackHandler(
    Class<T> cls,
    String method,
    CallbackHandlerRegistry.CallbackHandler<T> handler
)

Registers a callback handler to be executed when a given PendingIntent is fired for a RemoteCallback.

static RemoteCallback
stubToRemoteCallback(
    CallbackReceiver receiver,
    Class<CallbackReceiver> cls,
    Bundle args,
    String method
)

Turns a callback receiver stub into a remote callback.

Public constructors

CallbackHandlerRegistry

Added in 1.0.0-alpha02
public CallbackHandlerRegistry()

Public methods

invokeCallback

Added in 1.0.0-alpha02
public void <T extends CallbackReceiver> invokeCallback(
    Context context,
    T receiver,
    Intent intent
)

Trigger a call to a callback using arguments that were generated with getArgumentBundle.

invokeCallback

Added in 1.0.0-alpha02
public void <T extends CallbackReceiver> invokeCallback(
    Context context,
    T receiver,
    Bundle bundle
)

Trigger a call to a callback using arguments that were generated with getArgumentBundle.

registerCallbackHandler

Added in 1.0.0-alpha02
public static void <T extends CallbackReceiver> registerCallbackHandler(
    Class<T> cls,
    String method,
    CallbackHandlerRegistry.CallbackHandler<T> handler
)

Registers a callback handler to be executed when a given PendingIntent is fired for a RemoteCallback. Note: This should only be called by generated code, there is no reason to reference this otherwise.

stubToRemoteCallback

Added in 1.0.0-alpha02
public static RemoteCallback stubToRemoteCallback(
    CallbackReceiver receiver,
    Class<CallbackReceiver> cls,
    Bundle args,
    String method
)

Turns a callback receiver stub into a remote callback. Note: This should only be called by generated code, there is no reason to reference this otherwise.