summaryrefslogtreecommitdiff
path: root/android/hal-hidhost.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@gmail.com>2013-12-30 23:56:17 +0100
committerJohan Hedberg <johan.hedberg@intel.com>2013-12-31 11:34:05 +0200
commit81617ffdfc851210d2b554b99a5c502a0d2dd1b8 (patch)
treeb2503e2bbb5718cc8fe22507cb2e948d92a42e3a /android/hal-hidhost.c
parent98921e1bd50814e781de9e6c7274d2231dd1bb0f (diff)
downloadbluez-81617ffdfc851210d2b554b99a5c502a0d2dd1b8.tar.gz
android/hidhost: Move get_protocol parameter check to daemon
HAL library is to be as simple as possible and parameters values should be verified by daemon for robustness anyway. Move this check to daemon.
Diffstat (limited to 'android/hal-hidhost.c')
-rw-r--r--android/hal-hidhost.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index 6a6b68257..5d05f9b2f 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -218,16 +218,8 @@ static bt_status_t get_protocol(bt_bdaddr_t *bd_addr,
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_GET_PROTOCOL,