forked from anbox/platform_frameworks_native
/
HostBinder.h
38 lines (38 loc) · 1012 Bytes
/
HostBinder.h
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
#ifndef __HOSTBINDER_H__
#define __HOSTBINDER_H__
#include <utils/RefBase.h>
#include <binder/HostBinderShim.h>
struct binder_state
{
int fd;
void *mapped;
size_t mapsize;
};
namespace android {
class IBinder;
class HostBinder {
public:
HostBinder(int mDriverFD_);
HostBinder(binder_state* bs);
sp<IBinder> getSVMObj();
void publishSVM();
private:
int mDriverFD;
std::shared_ptr<HostBinderShim> shim;
std::shared_ptr<HostBinderShim> getShim();
};
class LocalBinder : public BBinder
{
public:
sp<IBinder> remoteBinder;
LocalBinder(std::shared_ptr<HostBinderShim> &shim_);
protected:
virtual status_t onTransact( uint32_t code,
const Parcel& data,
Parcel* reply,
uint32_t flags = 0);
private:
std::shared_ptr<HostBinderShim> shim;
};
}
#endif