-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiempty.go
More file actions
86 lines (69 loc) · 1.86 KB
/
iempty.go
File metadata and controls
86 lines (69 loc) · 1.86 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
package aidl
import (
"context"
"fmt"
"github.com/xaionaro-go/binder/binder"
"github.com/xaionaro-go/binder/parcel"
)
// Code generated by aidlgen. DO NOT EDIT.
const DescriptorIEmpty = "IEmpty"
type IEmpty interface {
AsBinder() binder.IBinder
}
type EmptyProxy struct {
Remote binder.IBinder
}
func NewEmptyProxy(
remote binder.IBinder,
) *EmptyProxy {
return &EmptyProxy{Remote: remote}
}
func (p *EmptyProxy) AsBinder() binder.IBinder {
return p.Remote
}
var _ IEmpty = (*EmptyProxy)(nil)
// EmptyStub dispatches incoming binder transactions
// to a typed IEmpty implementation.
type EmptyStub struct {
Impl IEmpty
}
var _ binder.TransactionReceiver = (*EmptyStub)(nil)
func (s *EmptyStub) Descriptor() string {
return DescriptorIEmpty
}
func (s *EmptyStub) OnTransaction(
ctx context.Context,
code binder.TransactionCode,
_data *parcel.Parcel,
) (*parcel.Parcel, error) {
switch code {
default:
return nil, fmt.Errorf("unknown transaction code %d", code)
}
}
// IEmptyServer is the server-side interface that user implementations
// provide to NewEmptyStub. It contains only the business methods,
// without AsBinder (which is provided by the stub itself).
type IEmptyServer interface {
}
type emptyStubWrapper struct {
impl IEmptyServer
stubBinder *binder.StubBinder
}
func (w *emptyStubWrapper) AsBinder() binder.IBinder {
return w.stubBinder
}
var _ IEmpty = (*emptyStubWrapper)(nil)
// NewEmptyStub creates a server-side IEmpty wrapping the given
// server implementation. The returned value satisfies IEmpty
// 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 NewEmptyStub(
impl IEmptyServer,
) IEmpty {
wrapper := &emptyStubWrapper{impl: impl}
stub := &EmptyStub{Impl: wrapper}
wrapper.stubBinder = binder.NewStubBinder(stub)
return wrapper
}