binder

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package binder provides Go bindings for Android Binder IPC.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AIBinder_isHandlingTransaction

func AIBinder_isHandlingTransaction() bool

AIBinder_isHandlingTransaction calls the underlying C function.

func AStatus_deleteDescription

func AStatus_deleteDescription(description string)

AStatus_deleteDescription calls the underlying C function.

Types

type AIBinder_Class_onCreate

type AIBinder_Class_onCreate = capi.AIBinder_Class_onCreate

type AIBinder_Class_onDestroy

type AIBinder_Class_onDestroy = capi.AIBinder_Class_onDestroy

type AIBinder_Class_onTransact

type AIBinder_Class_onTransact = capi.AIBinder_Class_onTransact

type AIBinder_DeathRecipient_onBinderDied

type AIBinder_DeathRecipient_onBinderDied = capi.AIBinder_DeathRecipient_onBinderDied

type AIBinder_DeathRecipient_onBinderUnlinked

type AIBinder_DeathRecipient_onBinderUnlinked = capi.AIBinder_DeathRecipient_onBinderUnlinked

type AIBinder_onDump

type AIBinder_onDump = capi.AIBinder_onDump

type AParcel_boolArrayAllocator

type AParcel_boolArrayAllocator = capi.AParcel_boolArrayAllocator

type AParcel_boolArrayGetter

type AParcel_boolArrayGetter = capi.AParcel_boolArrayGetter

type AParcel_boolArraySetter

type AParcel_boolArraySetter = capi.AParcel_boolArraySetter

type AParcel_byteArrayAllocator

type AParcel_byteArrayAllocator = capi.AParcel_byteArrayAllocator

type AParcel_charArrayAllocator

type AParcel_charArrayAllocator = capi.AParcel_charArrayAllocator

type AParcel_doubleArrayAllocator

type AParcel_doubleArrayAllocator = capi.AParcel_doubleArrayAllocator

type AParcel_floatArrayAllocator

type AParcel_floatArrayAllocator = capi.AParcel_floatArrayAllocator

type AParcel_int32ArrayAllocator

type AParcel_int32ArrayAllocator = capi.AParcel_int32ArrayAllocator

type AParcel_int64ArrayAllocator

type AParcel_int64ArrayAllocator = capi.AParcel_int64ArrayAllocator

type AParcel_parcelableArrayAllocator

type AParcel_parcelableArrayAllocator = capi.AParcel_parcelableArrayAllocator

type AParcel_readParcelableElement

type AParcel_readParcelableElement = capi.AParcel_readParcelableElement

type AParcel_stringAllocator

type AParcel_stringAllocator = capi.AParcel_stringAllocator

type AParcel_stringArrayAllocator

type AParcel_stringArrayAllocator = capi.AParcel_stringArrayAllocator

type AParcel_stringArrayElementAllocator

type AParcel_stringArrayElementAllocator = capi.AParcel_stringArrayElementAllocator

type AParcel_stringArrayElementGetter

type AParcel_stringArrayElementGetter = capi.AParcel_stringArrayElementGetter

type AParcel_uint32ArrayAllocator

type AParcel_uint32ArrayAllocator = capi.AParcel_uint32ArrayAllocator

type AParcel_uint64ArrayAllocator

type AParcel_uint64ArrayAllocator = capi.AParcel_uint64ArrayAllocator

type AParcel_writeParcelableElement

type AParcel_writeParcelableElement = capi.AParcel_writeParcelableElement

type Binder

type Binder struct {
	// contains filtered or unexported fields
}

Binder wraps the NDK AIBinder handle.

func NewBinder

func NewBinder(clazz unsafe.Pointer, args unsafe.Pointer) *Binder

NewBinder creates a new Binder.

func NewBinderFromPointer

func NewBinderFromPointer(ptr unsafe.Pointer) *Binder

NewBinderFromPointer wraps a raw AIBinder pointer.

func (*Binder) AssociateClass

func (h *Binder) AssociateClass(clazz *Class) bool

AssociateClass returns the value directly.

func (*Binder) Close

func (h *Binder) Close() error

Close releases the underlying NDK handle.

func (*Binder) DebugGetRefCount

func (h *Binder) DebugGetRefCount() error

DebugGetRefCount calls the underlying NDK function.

func (*Binder) GetClass

func (h *Binder) GetClass() *Class

GetClass creates a new Class from this Binder.

func (*Binder) GetUserData

func (h *Binder) GetUserData() unsafe.Pointer

GetUserData returns the value directly.

func (*Binder) IncStrong

func (h *Binder) IncStrong()

IncStrong calls the underlying NDK function.

func (*Binder) IsAlive

func (h *Binder) IsAlive() bool

IsAlive returns the value directly.

func (*Binder) IsRemote

func (h *Binder) IsRemote() bool

IsRemote returns the value directly.

func (*Binder) Lt

func (h *Binder) Lt(rhs *Binder) bool

Lt returns the value directly.

func (*Binder) Pointer

func (h *Binder) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

type Char16_t

type Char16_t = capi.Char16_t

type Class

type Class struct {
	// contains filtered or unexported fields
}

Class wraps the NDK AIBinder_Class handle.

func NewClassFromPointer

func NewClassFromPointer(ptr unsafe.Pointer) *Class

NewClassFromPointer wraps a raw AIBinder_Class pointer.

func (*Class) DisableInterfaceTokenHeader

func (h *Class) DisableInterfaceTokenHeader()

DisableInterfaceTokenHeader calls the underlying NDK function.

func (*Class) GetDescriptor

func (h *Class) GetDescriptor() string

GetDescriptor returns the value directly.

func (*Class) Pointer

func (h *Class) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

type EX

type EX int32
const (
	EX_NONE                  EX = 0
	EX_SECURITY              EX = -1
	EX_BAD_PARCELABLE        EX = -2
	EX_ILLEGAL_ARGUMENT      EX = -3
	EX_NULL_POINTER          EX = -4
	EX_ILLEGAL_STATE         EX = -5
	EX_NETWORK_MAIN_THREAD   EX = -6
	EX_UNSUPPORTED_OPERATION EX = -7
	EX_SERVICE_SPECIFIC      EX = -8
	EX_PARCELABLE            EX = -9
	EX_TRANSACTION_FAILED    EX = -129
)

type Error

type Error int32

Error represents an NDK error code.

const (
	ErrUnknownError       Error = -2147483648
	ErrNoMemory           Error = -12
	ErrInvalidOperation   Error = -38
	ErrBadValue           Error = -22
	ErrBadType            Error = -2147483647
	ErrNameNotFound       Error = -2
	ErrPermissionDenied   Error = -1
	ErrNoInit             Error = -19
	ErrAlreadyExists      Error = -17
	ErrDeadObject         Error = -32
	ErrFailedTransaction  Error = -2147483646
	ErrBadIndex           Error = -75
	ErrNotEnoughData      Error = -61
	ErrWouldBlock         Error = -11
	ErrTimedOut           Error = -110
	ErrUnknownTransaction Error = -74
	ErrFdsNotAllowed      Error = -2147483641
	ErrUnexpectedNull     Error = -2147483640
)

func (Error) Error

func (e Error) Error() string

type ExceptionCode

type ExceptionCode int32
const (
	None                 ExceptionCode = 0
	Security             ExceptionCode = -1
	BadParcelable        ExceptionCode = -2
	IllegalArgument      ExceptionCode = -3
	NullPointer          ExceptionCode = -4
	IllegalState         ExceptionCode = -5
	NetworkMainThread    ExceptionCode = -6
	UnsupportedOperation ExceptionCode = -7
	ServiceSpecific      ExceptionCode = -8
	Parcelable           ExceptionCode = -9
	TransactionFailed    ExceptionCode = -129
)

type FLAG

type FLAG int32
const (
	FLAG_ONEWAY FLAG = 1
)

type Flags

type Flags uint32
const (
	Oneway Flags = 1
)

type IBinder_DeathRecipient

type IBinder_DeathRecipient struct {
	// contains filtered or unexported fields
}

IBinder_DeathRecipient wraps the NDK AIBinder_DeathRecipient handle.

func NewIBinder_DeathRecipient

func NewIBinder_DeathRecipient(onBinderDied AIBinder_DeathRecipient_onBinderDied) *IBinder_DeathRecipient

NewIBinder_DeathRecipient creates a new IBinder_DeathRecipient.

func NewIBinder_DeathRecipientFromPointer

func NewIBinder_DeathRecipientFromPointer(ptr unsafe.Pointer) *IBinder_DeathRecipient

NewIBinder_DeathRecipientFromPointer wraps a raw AIBinder_DeathRecipient pointer.

func (*IBinder_DeathRecipient) Close

func (h *IBinder_DeathRecipient) Close() error

Close releases the underlying NDK handle.

func (*IBinder_DeathRecipient) Pointer

func (h *IBinder_DeathRecipient) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

type IBinder_Weak

type IBinder_Weak struct {
	// contains filtered or unexported fields
}

IBinder_Weak wraps the NDK AIBinder_Weak handle.

func NewIBinder_Weak

func NewIBinder_Weak(binder unsafe.Pointer) *IBinder_Weak

NewIBinder_Weak creates a new IBinder_Weak.

func NewIBinder_WeakFromPointer

func NewIBinder_WeakFromPointer(ptr unsafe.Pointer) *IBinder_Weak

NewIBinder_WeakFromPointer wraps a raw AIBinder_Weak pointer.

func (*IBinder_Weak) Clone

func (h *IBinder_Weak) Clone() *IBinder_Weak

Clone creates a new IBinder_Weak from this IBinder_Weak.

func (*IBinder_Weak) Close

func (h *IBinder_Weak) Close() error

Close releases the underlying NDK handle.

func (*IBinder_Weak) Lt

func (h *IBinder_Weak) Lt(rhs *IBinder_Weak) bool

Lt returns the value directly.

func (*IBinder_Weak) Pointer

func (h *IBinder_Weak) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*IBinder_Weak) Promote

func (h *IBinder_Weak) Promote() *Binder

Promote creates a new Binder from this IBinder_Weak.

type Parcel

type Parcel struct {
	// contains filtered or unexported fields
}

Parcel wraps the NDK AParcel handle.

func NewParcel

func NewParcel() *Parcel

NewParcel creates a new Parcel.

func NewParcelFromPointer

func NewParcelFromPointer(ptr unsafe.Pointer) *Parcel

NewParcelFromPointer wraps a raw AParcel pointer.

func (*Parcel) Close

func (h *Parcel) Close() error

Close releases the underlying NDK handle.

func (*Parcel) GetDataPosition

func (h *Parcel) GetDataPosition() error

GetDataPosition calls the underlying NDK function.

func (*Parcel) GetDataSize

func (h *Parcel) GetDataSize() error

GetDataSize calls the underlying NDK function.

func (*Parcel) Pointer

func (h *Parcel) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

type Pid_t

type Pid_t = capi.Pid_t

type Status

type Status struct {
	// contains filtered or unexported fields
}

Status wraps the NDK AStatus handle.

func AStatus_fromServiceSpecificError

func AStatus_fromServiceSpecificError(serviceSpecific int32) *Status

AStatus_fromServiceSpecificError calls the underlying C function.

func AStatus_fromServiceSpecificErrorWithMessage

func AStatus_fromServiceSpecificErrorWithMessage(serviceSpecific int32, message string) *Status

AStatus_fromServiceSpecificErrorWithMessage calls the underlying C function.

func AStatus_newOk

func AStatus_newOk() *Status

AStatus_newOk calls the underlying C function.

func NewStatusFromPointer

func NewStatusFromPointer(ptr unsafe.Pointer) *Status

NewStatusFromPointer wraps a raw AStatus pointer.

func (*Status) Close

func (h *Status) Close() error

Close releases the underlying NDK handle.

func (*Status) GetDescription

func (h *Status) GetDescription() string

GetDescription returns the value directly.

func (*Status) GetMessage

func (h *Status) GetMessage() string

GetMessage returns the value directly.

func (*Status) GetServiceSpecificError

func (h *Status) GetServiceSpecificError() error

GetServiceSpecificError calls the underlying NDK function.

func (*Status) IsOk

func (h *Status) IsOk() bool

IsOk returns the value directly.

func (*Status) Pointer

func (h *Status) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

type Uid_t

type Uid_t = capi.Uid_t

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL