-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiomxnode.go
More file actions
91 lines (73 loc) · 2.06 KB
/
iomxnode.go
File metadata and controls
91 lines (73 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package android
import (
"context"
"fmt"
"github.com/AndroidGoLab/binder/binder"
"github.com/AndroidGoLab/binder/parcel"
)
// Code generated by aidlgen. DO NOT EDIT.
const DescriptorIOMXNode = "android.IOMXNode"
type IOMXNode interface {
AsBinder() binder.IBinder
}
type OMXNodeProxy struct {
Remote binder.IBinder
}
func NewOMXNodeProxy(
remote binder.IBinder,
) *OMXNodeProxy {
return &OMXNodeProxy{Remote: remote}
}
func (p *OMXNodeProxy) AsBinder() binder.IBinder {
return p.Remote
}
var _ IOMXNode = (*OMXNodeProxy)(nil)
// OMXNodeStub dispatches incoming binder transactions
// to a typed IOMXNode implementation.
type OMXNodeStub struct {
Impl IOMXNode
Transport binder.VersionAwareTransport
}
var _ binder.TransactionReceiver = (*OMXNodeStub)(nil)
func (s *OMXNodeStub) Descriptor() string {
return DescriptorIOMXNode
}
func (s *OMXNodeStub) OnTransaction(
ctx context.Context,
code binder.TransactionCode,
_data *parcel.Parcel,
) (*parcel.Parcel, error) {
if _, _err := _data.ReadInterfaceToken(); _err != nil {
return nil, _err
}
switch code {
default:
return nil, fmt.Errorf("unknown transaction code %d", code)
}
}
// IOMXNodeServer is the server-side interface that user implementations
// provide to NewOMXNodeStub. It contains only the business methods,
// without AsBinder (which is provided by the stub itself).
type IOMXNodeServer interface {
}
type oMXNodeStubWrapper struct {
impl IOMXNodeServer
stubBinder *binder.StubBinder
}
func (w *oMXNodeStubWrapper) AsBinder() binder.IBinder {
return w.stubBinder
}
var _ IOMXNode = (*oMXNodeStubWrapper)(nil)
// NewOMXNodeStub creates a server-side IOMXNode wrapping the given
// server implementation. The returned value satisfies IOMXNode
// and can be passed to proxy methods; its AsBinder() returns a
// *binder.StubBinder that is auto-registered with the binder
// driver on first use.
func NewOMXNodeStub(
impl IOMXNodeServer,
) IOMXNode {
wrapper := &oMXNodeStubWrapper{impl: impl}
stub := &OMXNodeStub{Impl: wrapper}
wrapper.stubBinder = binder.NewStubBinder(stub)
return wrapper
}