Documentation
¶
Index ¶
- Constants
- type IWeaver
- type IWeaverServer
- type WeaverConfig
- type WeaverProxy
- func (p *WeaverProxy) AsBinder() binder.IBinder
- func (p *WeaverProxy) GetConfig(ctx context.Context) (WeaverConfig, error)
- func (p *WeaverProxy) Read(ctx context.Context, slotId int32, key []byte) (WeaverReadResponse, error)
- func (p *WeaverProxy) Write(ctx context.Context, slotId int32, key []byte, value []byte) error
- type WeaverReadResponse
- type WeaverReadStatus
- type WeaverStub
Constants ¶
View Source
const ( TransactionIWeaverGetConfig = binder.FirstCallTransaction + 0 TransactionIWeaverRead = binder.FirstCallTransaction + 1 TransactionIWeaverWrite = binder.FirstCallTransaction + 2 )
View Source
const ( MethodIWeaverGetConfig = "getConfig" MethodIWeaverRead = "read" MethodIWeaverWrite = "write" )
View Source
const ( IWeaverStatusFailed int32 = 1 IWeaverStatusIncorrectKey int32 = 2 IWeaverStatusThrottle int32 = 3 )
View Source
const DescriptorIWeaver = "android.hardware.weaver.IWeaver"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IWeaver ¶
type IWeaver interface {
AsBinder() binder.IBinder
GetConfig(ctx context.Context) (WeaverConfig, error)
Read(ctx context.Context, slotId int32, key []byte) (WeaverReadResponse, error)
Write(ctx context.Context, slotId int32, key []byte, value []byte) error
}
func NewWeaverStub ¶
func NewWeaverStub( impl IWeaverServer, ) IWeaver
NewWeaverStub creates a server-side IWeaver wrapping the given server implementation. The returned value satisfies IWeaver and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.
type IWeaverServer ¶
type IWeaverServer interface {
GetConfig(ctx context.Context) (WeaverConfig, error)
Read(ctx context.Context, slotId int32, key []byte) (WeaverReadResponse, error)
Write(ctx context.Context, slotId int32, key []byte, value []byte) error
}
IWeaverServer is the server-side interface that user implementations provide to NewWeaverStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).
type WeaverConfig ¶
func (*WeaverConfig) MarshalParcel ¶
func (s *WeaverConfig) MarshalParcel( p *parcel.Parcel, ) error
func (*WeaverConfig) UnmarshalParcel ¶
func (s *WeaverConfig) UnmarshalParcel( p *parcel.Parcel, ) error
type WeaverProxy ¶
func NewWeaverProxy ¶
func NewWeaverProxy( remote binder.IBinder, ) *WeaverProxy
func (*WeaverProxy) AsBinder ¶
func (p *WeaverProxy) AsBinder() binder.IBinder
func (*WeaverProxy) GetConfig ¶
func (p *WeaverProxy) GetConfig( ctx context.Context, ) (WeaverConfig, error)
func (*WeaverProxy) Read ¶
func (p *WeaverProxy) Read( ctx context.Context, slotId int32, key []byte, ) (WeaverReadResponse, error)
type WeaverReadResponse ¶
type WeaverReadResponse struct {
Timeout int64
Value []byte
Status WeaverReadStatus
}
func (*WeaverReadResponse) MarshalParcel ¶
func (s *WeaverReadResponse) MarshalParcel( p *parcel.Parcel, ) error
func (*WeaverReadResponse) UnmarshalParcel ¶
func (s *WeaverReadResponse) UnmarshalParcel( p *parcel.Parcel, ) error
type WeaverReadStatus ¶
type WeaverReadStatus int32
const ( WeaverReadStatusOK WeaverReadStatus = 0 WeaverReadStatusFAILED WeaverReadStatus = 1 WeaverReadStatusIncorrectKey WeaverReadStatus = 2 WeaverReadStatusTHROTTLE WeaverReadStatus = 3 )
type WeaverStub ¶
type WeaverStub struct {
Impl IWeaver
Transport binder.VersionAwareTransport
}
WeaverStub dispatches incoming binder transactions to a typed IWeaver implementation.
func (*WeaverStub) Descriptor ¶
func (s *WeaverStub) Descriptor() string
func (*WeaverStub) OnTransaction ¶
func (s *WeaverStub) OnTransaction( ctx context.Context, code binder.TransactionCode, _data *parcel.Parcel, ) (*parcel.Parcel, error)
Click to show internal directories.
Click to hide internal directories.