return false;
}
- // FIXME: for uid..?
- int ret = aul_svc_run_service(b, 0, ReplyCb, nullptr);
- if (ret < AUL_R_OK) {
+ // FIXME: for uid 5001 is temporary code. request code should be set properly.
+ int ret = aul_svc_run_service_async_for_uid(b, 0, ReplyCb, nullptr, 5001);
+ if (ret < AUL_SVC_RET_OK) {
LOG(ERROR) << "launch failed : " << ret;
bundle_free(b);
return false;
" <arg type='v' name='result' direction='out'/>"
" </method>"
" <method name='SendRemoteAppControl'>"
- " <arg type='s' name='devicd_id' direction='in'/>"
- " <arg type='s' name='appcontrol' direction='in'/>"
+ " <arg type='s' name='device_id' direction='in'/>"
+ " <arg type='ay' name='appcontrol' direction='in'/>"
" <arg type='u' name='len' direction='in'/>"
" <arg type='b' name='result' direction='out'/>"
" </method>"
bool DBusService::HandleSendRemoteAppControl(GVariant* params,
GDBusMethodInvocation* invocation) {
- LOG(INFO) << "HandleGetRemoteCapabilities ";
+ LOG(INFO) << "HandleSendRemoteCapabilities ";
gchar* device_id;
GVariantIter* iter;
guchar* data;
return false;
}
- int i = 0;
- while (g_variant_iter_loop(iter, "y", &data[i]))
- i++;
+ for (unsigned int i = 0; i < len; i++) {
+ if (!g_variant_iter_loop(iter, "y", &data[i])) {
+ LOG(ERROR) << "Failed to get data from GVariant!";
+ break;
+ }
+ }
+ g_variant_iter_free(iter);
EventHandler().send_app_control_event(device_id, data, len);
return true;
RemoteDeviceManager::RegisterRemoteCapabilities(device_id, caps);
} else if (cmd == Command::SEND_APPCONTROL) {
unsigned char* data = p;
- int r = AppControlManager::LaunchApplication(data, datasize);
- if (r != 0)
- LOG(ERROR) << "Failed to launch application: " << r;
+ if (!AppControlManager::LaunchApplication(data, datasize))
+ LOG(ERROR) << "Failed to launch application";
}
}