Documentation
¶
Index ¶
- Constants
- type ITranslationCallback
- type ITranslationCallbackServer
- type ITranslationService
- type ITranslationServiceServer
- type TranslationCallbackProxy
- type TranslationCallbackStub
- type TranslationServiceProxy
- func (p *TranslationServiceProxy) AsBinder() binder.IBinder
- func (p *TranslationServiceProxy) OnConnected(ctx context.Context, callback binder.IBinder) error
- func (p *TranslationServiceProxy) OnCreateTranslationSession(ctx context.Context, translationContext types.TranslationContext, ...) error
- func (p *TranslationServiceProxy) OnDisconnected(ctx context.Context) error
- func (p *TranslationServiceProxy) OnTranslationCapabilitiesRequest(ctx context.Context, sourceFormat int32, targetFormat int32, ...) error
- type TranslationServiceStub
Constants ¶
const ( TransactionITranslationServiceOnConnected = binder.FirstCallTransaction + 0 TransactionITranslationServiceOnDisconnected = binder.FirstCallTransaction + 1 TransactionITranslationServiceOnCreateTranslationSession = binder.FirstCallTransaction + 2 TransactionITranslationServiceOnTranslationCapabilitiesRequest = binder.FirstCallTransaction + 3 )
const ( MethodITranslationServiceOnConnected = "onConnected" MethodITranslationServiceOnDisconnected = "onDisconnected" MethodITranslationServiceOnCreateTranslationSession = "onCreateTranslationSession" MethodITranslationServiceOnTranslationCapabilitiesRequest = "onTranslationCapabilitiesRequest" )
const DescriptorITranslationCallback = "android.service.translation.ITranslationCallback"
const DescriptorITranslationService = "android.service.translation.ITranslationService"
const (
MethodITranslationCallbackOnTranslationResponse = "onTranslationResponse"
)
const (
TransactionITranslationCallbackOnTranslationResponse = binder.FirstCallTransaction + 0
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ITranslationCallback ¶
type ITranslationCallback interface {
AsBinder() binder.IBinder
OnTranslationResponse(ctx context.Context, translationResponse types.TranslationResponse) error
}
func NewTranslationCallbackStub ¶
func NewTranslationCallbackStub( impl ITranslationCallbackServer, ) ITranslationCallback
NewTranslationCallbackStub creates a server-side ITranslationCallback wrapping the given server implementation. The returned value satisfies ITranslationCallback 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 ITranslationCallbackServer ¶
type ITranslationCallbackServer interface {
OnTranslationResponse(ctx context.Context, translationResponse types.TranslationResponse) error
}
ITranslationCallbackServer is the server-side interface that user implementations provide to NewTranslationCallbackStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).
type ITranslationService ¶
type ITranslationService interface {
AsBinder() binder.IBinder
OnConnected(ctx context.Context, callback binder.IBinder) error
OnDisconnected(ctx context.Context) error
OnCreateTranslationSession(ctx context.Context, translationContext types.TranslationContext, sessionId int32, receiver os.IResultReceiver) error
OnTranslationCapabilitiesRequest(ctx context.Context, sourceFormat int32, targetFormat int32, receiver androidOs.ResultReceiver) error
}
func NewTranslationServiceStub ¶
func NewTranslationServiceStub( impl ITranslationServiceServer, ) ITranslationService
NewTranslationServiceStub creates a server-side ITranslationService wrapping the given server implementation. The returned value satisfies ITranslationService 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 ITranslationServiceServer ¶
type ITranslationServiceServer interface {
OnConnected(ctx context.Context, callback binder.IBinder) error
OnDisconnected(ctx context.Context) error
OnCreateTranslationSession(ctx context.Context, translationContext types.TranslationContext, sessionId int32, receiver os.IResultReceiver) error
OnTranslationCapabilitiesRequest(ctx context.Context, sourceFormat int32, targetFormat int32, receiver androidOs.ResultReceiver) error
}
ITranslationServiceServer is the server-side interface that user implementations provide to NewTranslationServiceStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).
type TranslationCallbackProxy ¶
func NewTranslationCallbackProxy ¶
func NewTranslationCallbackProxy( remote binder.IBinder, ) *TranslationCallbackProxy
func (*TranslationCallbackProxy) AsBinder ¶
func (p *TranslationCallbackProxy) AsBinder() binder.IBinder
func (*TranslationCallbackProxy) OnTranslationResponse ¶
func (p *TranslationCallbackProxy) OnTranslationResponse( ctx context.Context, translationResponse types.TranslationResponse, ) error
type TranslationCallbackStub ¶
type TranslationCallbackStub struct {
Impl ITranslationCallback
Transport binder.VersionAwareTransport
}
TranslationCallbackStub dispatches incoming binder transactions to a typed ITranslationCallback implementation.
func (*TranslationCallbackStub) Descriptor ¶
func (s *TranslationCallbackStub) Descriptor() string
func (*TranslationCallbackStub) OnTransaction ¶
func (s *TranslationCallbackStub) OnTransaction( ctx context.Context, code binder.TransactionCode, _data *parcel.Parcel, ) (*parcel.Parcel, error)
type TranslationServiceProxy ¶
func NewTranslationServiceProxy ¶
func NewTranslationServiceProxy( remote binder.IBinder, ) *TranslationServiceProxy
func (*TranslationServiceProxy) AsBinder ¶
func (p *TranslationServiceProxy) AsBinder() binder.IBinder
func (*TranslationServiceProxy) OnConnected ¶
func (*TranslationServiceProxy) OnCreateTranslationSession ¶
func (p *TranslationServiceProxy) OnCreateTranslationSession( ctx context.Context, translationContext types.TranslationContext, sessionId int32, receiver os.IResultReceiver, ) error
func (*TranslationServiceProxy) OnDisconnected ¶
func (p *TranslationServiceProxy) OnDisconnected( ctx context.Context, ) error
func (*TranslationServiceProxy) OnTranslationCapabilitiesRequest ¶
func (p *TranslationServiceProxy) OnTranslationCapabilitiesRequest( ctx context.Context, sourceFormat int32, targetFormat int32, receiver androidOs.ResultReceiver, ) error
type TranslationServiceStub ¶
type TranslationServiceStub struct {
Impl ITranslationService
Transport binder.VersionAwareTransport
}
TranslationServiceStub dispatches incoming binder transactions to a typed ITranslationService implementation.
func (*TranslationServiceStub) Descriptor ¶
func (s *TranslationServiceStub) Descriptor() string
func (*TranslationServiceStub) OnTransaction ¶
func (s *TranslationServiceStub) OnTransaction( ctx context.Context, code binder.TransactionCode, _data *parcel.Parcel, ) (*parcel.Parcel, error)