Loading system/btif/include/btif_api.h +12 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,18 @@ bool is_niap_mode(void); ******************************************************************************/ int get_niap_config_compare_result(void); /******************************************************************************* * * Function is_atv_device * * Description Returns true if the local device is an Android TV * device, false if it is not. * * Returns bool * ******************************************************************************/ bool is_atv_device(void); /******************************************************************************* * * Function btif_get_adapter_properties Loading system/btif/src/bluetooth.cc +5 −1 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ bool restricted_mode = false; bool niap_mode = false; const int CONFIG_COMPARE_ALL_PASS = 0b11; int niap_config_compare_result = CONFIG_COMPARE_ALL_PASS; bool is_local_device_atv = false; /******************************************************************************* * Externs Loading Loading @@ -140,7 +141,7 @@ static bool is_profile(const char* p1, const char* p2) { ****************************************************************************/ static int init(bt_callbacks_t* callbacks, bool start_restricted, bool is_niap_mode, int config_compare_result) { bool is_niap_mode, int config_compare_result, bool is_atv) { LOG_INFO(LOG_TAG, "%s: start restricted = %d ; niap = %d, config compare result = %d", __func__, start_restricted, is_niap_mode, config_compare_result); Loading @@ -161,6 +162,7 @@ static int init(bt_callbacks_t* callbacks, bool start_restricted, restricted_mode = start_restricted; niap_mode = is_niap_mode; niap_config_compare_result = config_compare_result; is_local_device_atv = is_atv; stack_manager_get_interface()->init_stack(); btif_debug_init(); Loading Loading @@ -191,6 +193,8 @@ int get_niap_config_compare_result() { return niap_mode ? niap_config_compare_result : CONFIG_COMPARE_ALL_PASS; } bool is_atv_device() { return is_local_device_atv; } static int get_adapter_properties(void) { /* sanity check */ if (!interface_ready()) return BT_STATUS_NOT_READY; Loading system/include/hardware/bluetooth.h +2 −1 Original line number Diff line number Diff line Loading @@ -473,9 +473,10 @@ typedef struct { * The |is_niap_mode| flag inits the adapter in NIAP mode. * The |config_compare_result| flag show the config checksum check result if * is in NIAP mode. * The |is_atv| flag indicates whether the local device is an Android TV */ int (*init)(bt_callbacks_t* callbacks, bool guest_mode, bool is_niap_mode, int config_compare_result); int config_compare_result, bool is_atv); /** Enable Bluetooth. */ int (*enable)(); Loading system/service/hal/bluetooth_interface.cc +1 −1 Original line number Diff line number Diff line Loading @@ -254,7 +254,7 @@ class BluetoothInterfaceImpl : public BluetoothInterface { // Initialize the Bluetooth interface. Set up the adapter (Bluetooth DM) API // callbacks. status = hal_iface_->init(&bt_callbacks, false, false, 0); status = hal_iface_->init(&bt_callbacks, false, false, 0, false); if (status != BT_STATUS_SUCCESS) { LOG(ERROR) << "Failed to initialize Bluetooth stack"; return false; Loading system/stack/gatt/gatt_cl.cc +12 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,12 @@ void gatt_process_read_by_type_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, /* discover included service */ else if (p_clcb->operation == GATTC_OPTYPE_DISCOVERY && p_clcb->op_subtype == GATT_DISC_INC_SRVC) { if (value_len < 4) { android_errorWriteLog(0x534e4554, "158833854"); LOG(ERROR) << __func__ << " Illegal Response length, must be at least 4."; gatt_end_operation(p_clcb, GATT_INVALID_PDU, NULL); return; } STREAM_TO_UINT16(record_value.incl_service.s_handle, p); STREAM_TO_UINT16(record_value.incl_service.e_handle, p); Loading Loading @@ -824,6 +830,12 @@ void gatt_process_read_by_type_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, return; } else /* discover characterisitic */ { if (value_len < 3) { android_errorWriteLog(0x534e4554, "158778659"); LOG(ERROR) << __func__ << " Illegal Response length, must be at least 3."; gatt_end_operation(p_clcb, GATT_INVALID_PDU, NULL); return; } STREAM_TO_UINT8(record_value.dclr_value.char_prop, p); STREAM_TO_UINT16(record_value.dclr_value.val_handle, p); if (!GATT_HANDLE_IS_VALID(record_value.dclr_value.val_handle)) { Loading Loading
system/btif/include/btif_api.h +12 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,18 @@ bool is_niap_mode(void); ******************************************************************************/ int get_niap_config_compare_result(void); /******************************************************************************* * * Function is_atv_device * * Description Returns true if the local device is an Android TV * device, false if it is not. * * Returns bool * ******************************************************************************/ bool is_atv_device(void); /******************************************************************************* * * Function btif_get_adapter_properties Loading
system/btif/src/bluetooth.cc +5 −1 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ bool restricted_mode = false; bool niap_mode = false; const int CONFIG_COMPARE_ALL_PASS = 0b11; int niap_config_compare_result = CONFIG_COMPARE_ALL_PASS; bool is_local_device_atv = false; /******************************************************************************* * Externs Loading Loading @@ -140,7 +141,7 @@ static bool is_profile(const char* p1, const char* p2) { ****************************************************************************/ static int init(bt_callbacks_t* callbacks, bool start_restricted, bool is_niap_mode, int config_compare_result) { bool is_niap_mode, int config_compare_result, bool is_atv) { LOG_INFO(LOG_TAG, "%s: start restricted = %d ; niap = %d, config compare result = %d", __func__, start_restricted, is_niap_mode, config_compare_result); Loading @@ -161,6 +162,7 @@ static int init(bt_callbacks_t* callbacks, bool start_restricted, restricted_mode = start_restricted; niap_mode = is_niap_mode; niap_config_compare_result = config_compare_result; is_local_device_atv = is_atv; stack_manager_get_interface()->init_stack(); btif_debug_init(); Loading Loading @@ -191,6 +193,8 @@ int get_niap_config_compare_result() { return niap_mode ? niap_config_compare_result : CONFIG_COMPARE_ALL_PASS; } bool is_atv_device() { return is_local_device_atv; } static int get_adapter_properties(void) { /* sanity check */ if (!interface_ready()) return BT_STATUS_NOT_READY; Loading
system/include/hardware/bluetooth.h +2 −1 Original line number Diff line number Diff line Loading @@ -473,9 +473,10 @@ typedef struct { * The |is_niap_mode| flag inits the adapter in NIAP mode. * The |config_compare_result| flag show the config checksum check result if * is in NIAP mode. * The |is_atv| flag indicates whether the local device is an Android TV */ int (*init)(bt_callbacks_t* callbacks, bool guest_mode, bool is_niap_mode, int config_compare_result); int config_compare_result, bool is_atv); /** Enable Bluetooth. */ int (*enable)(); Loading
system/service/hal/bluetooth_interface.cc +1 −1 Original line number Diff line number Diff line Loading @@ -254,7 +254,7 @@ class BluetoothInterfaceImpl : public BluetoothInterface { // Initialize the Bluetooth interface. Set up the adapter (Bluetooth DM) API // callbacks. status = hal_iface_->init(&bt_callbacks, false, false, 0); status = hal_iface_->init(&bt_callbacks, false, false, 0, false); if (status != BT_STATUS_SUCCESS) { LOG(ERROR) << "Failed to initialize Bluetooth stack"; return false; Loading
system/stack/gatt/gatt_cl.cc +12 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,12 @@ void gatt_process_read_by_type_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, /* discover included service */ else if (p_clcb->operation == GATTC_OPTYPE_DISCOVERY && p_clcb->op_subtype == GATT_DISC_INC_SRVC) { if (value_len < 4) { android_errorWriteLog(0x534e4554, "158833854"); LOG(ERROR) << __func__ << " Illegal Response length, must be at least 4."; gatt_end_operation(p_clcb, GATT_INVALID_PDU, NULL); return; } STREAM_TO_UINT16(record_value.incl_service.s_handle, p); STREAM_TO_UINT16(record_value.incl_service.e_handle, p); Loading Loading @@ -824,6 +830,12 @@ void gatt_process_read_by_type_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, return; } else /* discover characterisitic */ { if (value_len < 3) { android_errorWriteLog(0x534e4554, "158778659"); LOG(ERROR) << __func__ << " Illegal Response length, must be at least 3."; gatt_end_operation(p_clcb, GATT_INVALID_PDU, NULL); return; } STREAM_TO_UINT8(record_value.dclr_value.char_prop, p); STREAM_TO_UINT16(record_value.dclr_value.val_handle, p); if (!GATT_HANDLE_IS_VALID(record_value.dclr_value.val_handle)) { Loading