Documentation
¶
Index ¶
- Variables
- type Driver
- func (d *Driver) AcquireHandle(ctx context.Context, handle uint32) (_err error)
- func (d *Driver) ClearDeathNotification(ctx context.Context, handle uint32, recipient binder.DeathRecipient) (_err error)
- func (d *Driver) Close(ctx context.Context) (_err error)
- func (d *Driver) RegisterReceiver(ctx context.Context, receiver binder.TransactionReceiver) uintptr
- func (d *Driver) ReleaseHandle(ctx context.Context, handle uint32) (_err error)
- func (d *Driver) Reply(ctx context.Context, reply *parcel.Parcel) (_err error)
- func (d *Driver) RequestDeathNotification(ctx context.Context, handle uint32, recipient binder.DeathRecipient) (_err error)
- func (d *Driver) Transact(ctx context.Context, handle uint32, code binder.TransactionCode, ...) (_reply *parcel.Parcel, _err error)
- func (d *Driver) UnregisterReceiver(ctx context.Context, cookie uintptr)
Constants ¶
This section is empty.
Variables ¶
var ErrDriverClosed = errors.New("binder: driver is closed")
ErrDriverClosed is returned when an operation is attempted on a closed Driver.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver implements binder.Transport using /dev/binder.
func (*Driver) AcquireHandle ¶
AcquireHandle increments the strong reference count for a binder handle.
func (*Driver) ClearDeathNotification ¶
func (d *Driver) ClearDeathNotification( ctx context.Context, handle uint32, recipient binder.DeathRecipient, ) (_err error)
ClearDeathNotification clears a death notification for a binder handle.
func (*Driver) Close ¶
Close releases all death notifications, acquired binder handles, the mmap, and the file descriptor.
func (*Driver) RegisterReceiver ¶
func (d *Driver) RegisterReceiver( ctx context.Context, receiver binder.TransactionReceiver, ) uintptr
RegisterReceiver associates a TransactionReceiver with a unique cookie and starts the read loop if it has not been started yet. Returns the cookie that identifies this receiver in incoming BR_TRANSACTION events.
The cookie is the heap address of a receiverEntry allocated for this registration. The kernel binder driver uses the flat_binder_object.binder and .cookie fields to create/lookup binder nodes and to dispatch incoming transactions. Both fields must be non-zero process-space addresses -- synthetic counter values (1, 2, 3 ...) are rejected by the kernel. Storing the *receiverEntry in the receivers map keeps the object reachable, so its address remains valid until UnregisterReceiver is called.
func (*Driver) ReleaseHandle ¶
ReleaseHandle decrements the strong reference count for a binder handle.
func (*Driver) Reply ¶
Reply sends BC_REPLY with the given parcel data back to the transaction originator.
func (*Driver) RequestDeathNotification ¶
func (d *Driver) RequestDeathNotification( ctx context.Context, handle uint32, recipient binder.DeathRecipient, ) (_err error)
RequestDeathNotification registers a death notification for a binder handle. Returns an error if the handle already has a registered death recipient; call ClearDeathNotification first to replace it.