#include <assert.h>
#include <glib.h>
+#include <hal/hal-common.h>
+
#include "hal-api-device-battery-ipc.h"
#include "src/generated/hal_device_battery_proxy_1.h"
void *data;
};
-#define HAL_BACKEND_SERVICE_APPID "d::HalBackendService"
-
static int hal_device_battery_ipc_cleanup_changed_event_callback_handle(rpc_port_proxy_hal_device_battery_proxy_1_device_battery_updated_cb_h *handle);
static int add_updated_cb_info(hal_device_battery_updated_cb updated_cb, void *user_data)
int hal_device_battery_ipc_get_backend(void)
{
int ret = 0;
+ const char *stub_proc_name = NULL;
+
+ ret = hal_common_get_stub_proc_name(HAL_MODULE_DEVICE_BATTERY, &stub_proc_name);
+ if (ret != 0) {
+ _E("Failed to get stub proc name for device-battery: ret(%d)", ret);
+ return ret;
+ }
rpc_port_proxy_hal_device_battery_proxy_1_device_battery_callback_s callback = {
.connected = hal_device_battery_ipc_connected_cb,
};
if (!g_hal_device_battery_ipc_h) {
- ret = rpc_port_proxy_hal_device_battery_proxy_1_device_battery_create(HAL_BACKEND_SERVICE_APPID,
+ ret = rpc_port_proxy_hal_device_battery_proxy_1_device_battery_create(stub_proc_name,
&callback, NULL, &g_hal_device_battery_ipc_h);
if (ret != RPC_PORT_ERROR_NONE) {
_E("device-battery: Failed to create ipc handle(%d)", ret);
int hal_device_display_ipc_get_backend(void)
{
int ret = 0;
+ const char *stub_proc_name = NULL;
if (g_hal_device_display_ipc_h)
return 0;
+ ret = hal_common_get_stub_proc_name(HAL_MODULE_DEVICE_DISPLAY, &stub_proc_name);
+ if (ret != 0) {
+ _E("Failed to get stub proc name for device-display: ret(%d)", ret);
+ return ret;
+ }
+
rpc_port_proxy_hal_device_display_proxy_1_device_display_callback_s callback = {
.connected = hal_device_display_ipc_connected_cb,
.disconnected = hal_device_display_ipc_disconnected_cb,
.rejected = hal_device_display_ipc_rejected_cb
};
- ret = rpc_port_proxy_hal_device_display_proxy_1_device_display_create(HAL_BACKEND_SERVICE_APPID,
+ ret = rpc_port_proxy_hal_device_display_proxy_1_device_display_create(stub_proc_name,
&callback, NULL, &g_hal_device_display_ipc_h);
if (ret != RPC_PORT_ERROR_NONE) {
_E("Failed to create display ipc handle(%d)", ret);
extern "C" {
#endif
-#define HAL_BACKEND_SERVICE_APPID "d::HalBackendService"
-
int hal_device_display_ipc_get_backend(void);
int hal_device_display_ipc_put_backend(void);
int hal_device_display_ipc_get_max_brightness(int *brightness);
}
#endif
-#endif // __HAL_DEVICE_DISPLAY_IPC_H__
\ No newline at end of file
+#endif // __HAL_DEVICE_DISPLAY_IPC_H__
int hal_device_led_ipc_get_backend(void)
{
int ret = 0;
+ const char *stub_proc_name = NULL;
if (g_hal_device_led_ipc_funcs_h)
return 0;
+ ret = hal_common_get_stub_proc_name(HAL_MODULE_DEVICE_DISPLAY, &stub_proc_name);
+ if (ret != 0) {
+ _E("Failed to get stub proc name for device-display: ret(%d)", ret);
+ return ret;
+ }
+
rpc_port_proxy_hal_device_led_proxy_1_device_led_callback_s callback = {
.connected = hal_device_led_ipc_connected_cb,
.disconnected = hal_device_led_ipc_disconnected_cb,
.rejected = hal_device_led_ipc_rejected_cb
};
- ret = rpc_port_proxy_hal_device_led_proxy_1_device_led_create(HAL_BACKEND_SERVICE_APPID,
+ ret = rpc_port_proxy_hal_device_led_proxy_1_device_led_create(stub_proc_name,
&callback, NULL, &g_hal_device_led_ipc_funcs_h);
if (ret != RPC_PORT_ERROR_NONE) {
_E("Failed to create led ipc handle(%d)", ret);
extern "C" {
#endif
-#define HAL_BACKEND_SERVICE_APPID "d::HalBackendService"
-
int hal_device_led_ipc_get_backend(void);
int hal_device_led_ipc_put_backend(void);
int hal_device_led_ipc_set_state(hal_device_led_device_type_e type, hal_device_led_state_s *state);