-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathHelloClient.cpp
More file actions
29 lines (24 loc) · 743 Bytes
/
Copy pathHelloClient.cpp
File metadata and controls
29 lines (24 loc) · 743 Bytes
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
#define LOG_TAG "aidl_cpp"
#include <log/log.h>
#include <stdlib.h>
#include <utils/RefBase.h>
#include <utils/Log.h>
#include <binder/TextOutput.h>
#include <binder/IInterface.h>
#include <binder/IBinder.h>
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <binder/IPCThreadState.h>
#include "com/yuandaima/IHello.h"
#include "com/yuandaima/BpHello.h"
using namespace android;
int main(int argc, char const *argv[])
{
sp<IServiceManager> sm = defaultServiceManager();
sp<IBinder> binder = sm->getService(String16("MyHelloService"));
sp<com::yuandaima::IHello> hello = interface_cast<com::yuandaima::IHello>(binder);
hello->hello();
int ret = 0;
hello->sum(1, 2, &ret);
return 0;
}