diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index 5d05f9b..b331145 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
- switch (protocol_mode) {
- case BTHH_REPORT_MODE:
- cmd.mode = HAL_HIDHOST_REPORT_PROTOCOL;
- break;
- case BTHH_BOOT_MODE:
- cmd.mode = HAL_HIDHOST_BOOT_PROTOCOL;
- break;
- default:
- return BT_STATUS_PARM_INVALID;
- }
+ /* type match IPC type */
+ cmd.mode = protocol_mode;
return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST,
HAL_OP_HIDHOST_SET_PROTOCOL,
diff --git a/android/hidhost.c b/android/hidhost.c
index 4635e53..76e65b8 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
DBG("");
+ switch (cmd->mode) {
+ case HAL_HIDHOST_REPORT_PROTOCOL:
+ case HAL_HIDHOST_BOOT_PROTOCOL:
+ break;
+ default:
+ status = HAL_STATUS_INVALID;
+ goto failed;
+ }
+
android2bdaddr(&cmd->bdaddr, &dst);
l = g_slist_find_custom(devices, &dst, device_cmp);