1
0
mirror of https://github.com/ioacademy-jikim/multimedia synced 2025-06-07 16:06:18 +00:00
2015-08-04 19:14:13 +09:00

19 lines
460 B
C++

#include <binder/IServiceManager.h>
#include <utils/StrongPointer.h>
#include <binder/MemoryHeapBase.h>
#include <binder/IPCThreadState.h>
using namespace android;
int main()
{
sp<IServiceManager> sm = defaultServiceManager();
sp<MemoryHeapBase> heap = new MemoryHeapBase(4096);
sm->addService( String16("my.ashmem1") , heap );
char *p = (char*)heap->getBase();
sprintf(p, "Hello Client!!\n" );
IPCThreadState::self()->joinThreadPool();
return 0;
}