class BpLcdService : public BpInterfacesp<ILcdService> LcdService(){ public: BpLcdService(const sp & impl): BpInterface (impl) {} virtual void LcdOn() { Parcel data, reply; remote()->transact(LCD_ON, data, &reply); } virtual void LcdOff() { Parcel data, reply; remote()->transact(LCD_OFF, data, &reply); } }; IMPLEMENT_META_INTERFACE(LcdService, "android.app.lcdcontrol")
{
sp<IBinder> binder = defaultServiceManager()->getService(String16("LcdService"));
return interface_cast<ILcdService>(binder);
}
This client does not have main() as I intended to make this as shared library file (.so) so I can call LcdOn/Off methods from Java application with Java Native Interface.
댓글 없음:
댓글 쓰기