Loading system/Android.mk +0 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ LOCAL_target_executables := \ $(TARGET_OUT_EXECUTABLES)/bluetooth_stack_with_facade LOCAL_target_libraries := \ $(TARGET_OUT_SHARED_LIBRARIES)/android.system.suspend.control-V1-ndk.so \ $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so \ $(TARGET_OUT_SHARED_LIBRARIES)/libbluetooth_gd.so \ $(TARGET_OUT_SHARED_LIBRARIES)/libgrpc++_unsecure.so \ Loading system/blueberry/tests/gd/cert/gd_device.py +2 −3 Original line number Diff line number Diff line Loading @@ -491,8 +491,6 @@ class GdAndroidDevice(GdDeviceBase): # Push test binaries self.push_or_die(os.path.join(get_gd_root(), "target", "bluetooth_stack_with_facade"), "system/bin") self.push_or_die( os.path.join(get_gd_root(), "target", "android.system.suspend.control-V1-ndk.so"), "system/lib64") self.push_or_die(os.path.join(get_gd_root(), "target", "libbluetooth_gd.so"), "system/lib64") self.push_or_die(os.path.join(get_gd_root(), "target", "libgrpc++_unsecure.so"), "system/lib64") self.push_or_die(os.path.join(get_gd_root(), "target", "libgrpc++.so"), "system/lib64") Loading Loading @@ -529,7 +527,8 @@ class GdAndroidDevice(GdDeviceBase): self.ensure_no_output(self.adb.shell("settings put global ble_scan_always_enabled 0")) self.adb.shell("cmd bluetooth_manager disable") device_bt_state = int(self.adb.shell("settings get global bluetooth_on")) asserts.assert_equal(device_bt_state, 0, "Failed to disable Bluetooth on device %s %s" % (self.label, self.serial_number)) asserts.assert_equal(device_bt_state, 0, "Failed to disable Bluetooth on device %s %s" % (self.label, self.serial_number)) logging.info("Bluetooth disabled on device %s %s" % (self.label, self.serial_number)) # Start logcat logging Loading system/blueberry/tests/gd_sl4a/lib/gd_sl4a_base_test.py +8 −4 Original line number Diff line number Diff line Loading @@ -61,9 +61,10 @@ class GdSl4aBaseTestClass(BaseTestClass): # Enable full btsnoop log self.dut.adb.root() self.dut.adb.shell("setprop persist.bluetooth.btsnooplogmode full") getprop_result = self.dut.adb.shell("getprop persist.bluetooth.btsnooplogmode") == "full" if not getprop_result: self.dut.log.warning("Failed to enable Bluetooth Hci Snoop Logging.") getprop_result = self.dut.adb.getprop("persist.bluetooth.btsnooplogmode") if getprop_result is None or ("full" not in getprop_result.lower()): self.dut.log.warning( "Failed to enable Bluetooth Hci Snoop Logging, getprop returned {}".format(getprop_result)) self.ble = BleLib(dut=self.dut) Loading Loading @@ -95,7 +96,10 @@ class GdSl4aBaseTestClass(BaseTestClass): # Make sure BLE is disabled and Bluetooth is disabled after test self.dut.sl4a.bluetoothDisableBLE() disable_bluetooth(self.dut.sl4a, self.dut.ed) try: self.cert.rootservice.StopStack(facade_rootservice.StopStackRequest()) except Exception: logging.error("Failed to stop CERT stack") # TODO: split cert logcat logs into individual tests current_test_dir = get_current_context().get_full_output_path() Loading system/bta/gatt/bta_gattc_act.cc +15 −14 Original line number Diff line number Diff line Loading @@ -255,8 +255,7 @@ void bta_gattc_process_api_open(const tBTA_GATTC_DATA* p_msg) { tBTA_GATTC_RCB* p_clreg = bta_gattc_cl_get_regcb(p_msg->api_conn.client_if); if (!p_clreg) { LOG(ERROR) << __func__ << ": Failed, unknown client_if=" << +p_msg->api_conn.client_if; LOG_ERROR("Failed, unknown client_if=%d", +p_msg->api_conn.client_if); return; } Loading @@ -268,10 +267,10 @@ void bta_gattc_process_api_open(const tBTA_GATTC_DATA* p_msg) { tBTA_GATTC_CLCB* p_clcb = bta_gattc_find_alloc_clcb( p_msg->api_conn.client_if, p_msg->api_conn.remote_bda, p_msg->api_conn.transport); if (p_clcb != NULL) { if (p_clcb != nullptr) { bta_gattc_sm_execute(p_clcb, event, p_msg); } else { LOG(ERROR) << "No resources to open a new connection."; LOG_ERROR("No resources to open a new connection."); bta_gattc_send_open_cback(p_clreg, GATT_NO_RESOURCES, p_msg->api_conn.remote_bda, GATT_INVALID_CONN_ID, Loading Loading @@ -367,7 +366,6 @@ void bta_gattc_open(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { p_data->api_conn.transport, p_data->api_conn.opportunistic, p_data->api_conn.initiating_phys)) { LOG(ERROR) << "Connection open failure"; bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_OPEN_FAIL_EVT, p_data); return; } Loading Loading @@ -396,8 +394,8 @@ static void bta_gattc_init_bk_conn(const tBTA_GATTC_API_OPEN* p_data, /* always call open to hold a connection */ if (!GATT_Connect(p_data->client_if, p_data->remote_bda, false, p_data->transport, false)) { LOG(ERROR) << __func__ << " unable to connect to remote bd_addr=" << p_data->remote_bda; LOG_ERROR("Unable to connect to remote bd_addr=%s", p_data->remote_bda.ToString().c_str()); bta_gattc_send_open_cback(p_clreg, GATT_ERROR, p_data->remote_bda, GATT_INVALID_CONN_ID, BT_TRANSPORT_LE, 0); return; Loading @@ -406,7 +404,7 @@ static void bta_gattc_init_bk_conn(const tBTA_GATTC_API_OPEN* p_data, uint16_t conn_id; if (!GATT_GetConnIdIfConnected(p_data->client_if, p_data->remote_bda, &conn_id, p_data->transport)) { LOG_WARN("Not a connected remote device"); LOG_INFO("Not a connected remote device yet"); return; } Loading Loading @@ -442,7 +440,9 @@ void bta_gattc_cancel_bk_conn(const tBTA_GATTC_API_CANCEL_OPEN* p_data) { if (GATT_CancelConnect(p_data->client_if, p_data->remote_bda, false)) { cb_data.status = GATT_SUCCESS; } else { LOG(ERROR) << __func__ << ": failed"; LOG_ERROR("failed for client_if=%d, remote_bda=%s, is_direct=false", static_cast<int>(p_data->client_if), p_data->remote_bda.ToString().c_str()); } } p_clreg = bta_gattc_cl_get_regcb(p_data->client_if); Loading Loading @@ -577,16 +577,17 @@ void bta_gattc_close(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { tBTA_GATTC cb_data = { .close = { .client_if = p_clcb->p_rcb->client_if, .conn_id = p_clcb->bta_conn_id, .reason = GATT_CONN_OK, .remote_bda = p_clcb->bda, .status = GATT_SUCCESS, .client_if = p_clcb->p_rcb->client_if, .remote_bda = p_clcb->bda, .reason = GATT_CONN_OK, }, }; if (p_clcb->transport == BT_TRANSPORT_BR_EDR) if (p_clcb->transport == BT_TRANSPORT_BR_EDR) { bta_sys_conn_close(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda); } bta_gattc_clcb_dealloc(p_clcb); Loading system/bta/gatt/bta_gatts_act.cc +8 −6 Original line number Diff line number Diff line Loading @@ -489,18 +489,20 @@ void bta_gatts_close(UNUSED_ATTR tBTA_GATTS_CB* p_cb, tBTA_GATTS_DATA* p_msg) { if (GATT_GetConnectionInfor(p_msg->hdr.layer_specific, &gatt_if, remote_bda, &transport)) { if (GATT_Disconnect(p_msg->hdr.layer_specific) != GATT_SUCCESS) { LOG(ERROR) << __func__ << ": fail conn_id=" << loghex(p_msg->hdr.layer_specific); } else { status = GATT_SUCCESS; LOG_DEBUG("Disconnecting gatt_if=%d, remote_bda=%s, transport=%d", +gatt_if, remote_bda.ToString().c_str(), transport); status = GATT_Disconnect(p_msg->hdr.layer_specific); if (status != GATT_SUCCESS) { LOG_ERROR("fail conn_id=%d", +p_msg->hdr.layer_specific); status = GATT_ERROR; } p_rcb = bta_gatts_find_app_rcb_by_app_if(gatt_if); if (p_rcb && p_rcb->p_cback) { if (transport == BT_TRANSPORT_BR_EDR) if (transport == BT_TRANSPORT_BR_EDR) { bta_sys_conn_close(BTA_ID_GATTS, BTA_ALL_APP_ID, remote_bda); } tBTA_GATTS bta_gatts; bta_gatts.status = status; Loading Loading
system/Android.mk +0 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ LOCAL_target_executables := \ $(TARGET_OUT_EXECUTABLES)/bluetooth_stack_with_facade LOCAL_target_libraries := \ $(TARGET_OUT_SHARED_LIBRARIES)/android.system.suspend.control-V1-ndk.so \ $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so \ $(TARGET_OUT_SHARED_LIBRARIES)/libbluetooth_gd.so \ $(TARGET_OUT_SHARED_LIBRARIES)/libgrpc++_unsecure.so \ Loading
system/blueberry/tests/gd/cert/gd_device.py +2 −3 Original line number Diff line number Diff line Loading @@ -491,8 +491,6 @@ class GdAndroidDevice(GdDeviceBase): # Push test binaries self.push_or_die(os.path.join(get_gd_root(), "target", "bluetooth_stack_with_facade"), "system/bin") self.push_or_die( os.path.join(get_gd_root(), "target", "android.system.suspend.control-V1-ndk.so"), "system/lib64") self.push_or_die(os.path.join(get_gd_root(), "target", "libbluetooth_gd.so"), "system/lib64") self.push_or_die(os.path.join(get_gd_root(), "target", "libgrpc++_unsecure.so"), "system/lib64") self.push_or_die(os.path.join(get_gd_root(), "target", "libgrpc++.so"), "system/lib64") Loading Loading @@ -529,7 +527,8 @@ class GdAndroidDevice(GdDeviceBase): self.ensure_no_output(self.adb.shell("settings put global ble_scan_always_enabled 0")) self.adb.shell("cmd bluetooth_manager disable") device_bt_state = int(self.adb.shell("settings get global bluetooth_on")) asserts.assert_equal(device_bt_state, 0, "Failed to disable Bluetooth on device %s %s" % (self.label, self.serial_number)) asserts.assert_equal(device_bt_state, 0, "Failed to disable Bluetooth on device %s %s" % (self.label, self.serial_number)) logging.info("Bluetooth disabled on device %s %s" % (self.label, self.serial_number)) # Start logcat logging Loading
system/blueberry/tests/gd_sl4a/lib/gd_sl4a_base_test.py +8 −4 Original line number Diff line number Diff line Loading @@ -61,9 +61,10 @@ class GdSl4aBaseTestClass(BaseTestClass): # Enable full btsnoop log self.dut.adb.root() self.dut.adb.shell("setprop persist.bluetooth.btsnooplogmode full") getprop_result = self.dut.adb.shell("getprop persist.bluetooth.btsnooplogmode") == "full" if not getprop_result: self.dut.log.warning("Failed to enable Bluetooth Hci Snoop Logging.") getprop_result = self.dut.adb.getprop("persist.bluetooth.btsnooplogmode") if getprop_result is None or ("full" not in getprop_result.lower()): self.dut.log.warning( "Failed to enable Bluetooth Hci Snoop Logging, getprop returned {}".format(getprop_result)) self.ble = BleLib(dut=self.dut) Loading Loading @@ -95,7 +96,10 @@ class GdSl4aBaseTestClass(BaseTestClass): # Make sure BLE is disabled and Bluetooth is disabled after test self.dut.sl4a.bluetoothDisableBLE() disable_bluetooth(self.dut.sl4a, self.dut.ed) try: self.cert.rootservice.StopStack(facade_rootservice.StopStackRequest()) except Exception: logging.error("Failed to stop CERT stack") # TODO: split cert logcat logs into individual tests current_test_dir = get_current_context().get_full_output_path() Loading
system/bta/gatt/bta_gattc_act.cc +15 −14 Original line number Diff line number Diff line Loading @@ -255,8 +255,7 @@ void bta_gattc_process_api_open(const tBTA_GATTC_DATA* p_msg) { tBTA_GATTC_RCB* p_clreg = bta_gattc_cl_get_regcb(p_msg->api_conn.client_if); if (!p_clreg) { LOG(ERROR) << __func__ << ": Failed, unknown client_if=" << +p_msg->api_conn.client_if; LOG_ERROR("Failed, unknown client_if=%d", +p_msg->api_conn.client_if); return; } Loading @@ -268,10 +267,10 @@ void bta_gattc_process_api_open(const tBTA_GATTC_DATA* p_msg) { tBTA_GATTC_CLCB* p_clcb = bta_gattc_find_alloc_clcb( p_msg->api_conn.client_if, p_msg->api_conn.remote_bda, p_msg->api_conn.transport); if (p_clcb != NULL) { if (p_clcb != nullptr) { bta_gattc_sm_execute(p_clcb, event, p_msg); } else { LOG(ERROR) << "No resources to open a new connection."; LOG_ERROR("No resources to open a new connection."); bta_gattc_send_open_cback(p_clreg, GATT_NO_RESOURCES, p_msg->api_conn.remote_bda, GATT_INVALID_CONN_ID, Loading Loading @@ -367,7 +366,6 @@ void bta_gattc_open(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { p_data->api_conn.transport, p_data->api_conn.opportunistic, p_data->api_conn.initiating_phys)) { LOG(ERROR) << "Connection open failure"; bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_OPEN_FAIL_EVT, p_data); return; } Loading Loading @@ -396,8 +394,8 @@ static void bta_gattc_init_bk_conn(const tBTA_GATTC_API_OPEN* p_data, /* always call open to hold a connection */ if (!GATT_Connect(p_data->client_if, p_data->remote_bda, false, p_data->transport, false)) { LOG(ERROR) << __func__ << " unable to connect to remote bd_addr=" << p_data->remote_bda; LOG_ERROR("Unable to connect to remote bd_addr=%s", p_data->remote_bda.ToString().c_str()); bta_gattc_send_open_cback(p_clreg, GATT_ERROR, p_data->remote_bda, GATT_INVALID_CONN_ID, BT_TRANSPORT_LE, 0); return; Loading @@ -406,7 +404,7 @@ static void bta_gattc_init_bk_conn(const tBTA_GATTC_API_OPEN* p_data, uint16_t conn_id; if (!GATT_GetConnIdIfConnected(p_data->client_if, p_data->remote_bda, &conn_id, p_data->transport)) { LOG_WARN("Not a connected remote device"); LOG_INFO("Not a connected remote device yet"); return; } Loading Loading @@ -442,7 +440,9 @@ void bta_gattc_cancel_bk_conn(const tBTA_GATTC_API_CANCEL_OPEN* p_data) { if (GATT_CancelConnect(p_data->client_if, p_data->remote_bda, false)) { cb_data.status = GATT_SUCCESS; } else { LOG(ERROR) << __func__ << ": failed"; LOG_ERROR("failed for client_if=%d, remote_bda=%s, is_direct=false", static_cast<int>(p_data->client_if), p_data->remote_bda.ToString().c_str()); } } p_clreg = bta_gattc_cl_get_regcb(p_data->client_if); Loading Loading @@ -577,16 +577,17 @@ void bta_gattc_close(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { tBTA_GATTC cb_data = { .close = { .client_if = p_clcb->p_rcb->client_if, .conn_id = p_clcb->bta_conn_id, .reason = GATT_CONN_OK, .remote_bda = p_clcb->bda, .status = GATT_SUCCESS, .client_if = p_clcb->p_rcb->client_if, .remote_bda = p_clcb->bda, .reason = GATT_CONN_OK, }, }; if (p_clcb->transport == BT_TRANSPORT_BR_EDR) if (p_clcb->transport == BT_TRANSPORT_BR_EDR) { bta_sys_conn_close(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda); } bta_gattc_clcb_dealloc(p_clcb); Loading
system/bta/gatt/bta_gatts_act.cc +8 −6 Original line number Diff line number Diff line Loading @@ -489,18 +489,20 @@ void bta_gatts_close(UNUSED_ATTR tBTA_GATTS_CB* p_cb, tBTA_GATTS_DATA* p_msg) { if (GATT_GetConnectionInfor(p_msg->hdr.layer_specific, &gatt_if, remote_bda, &transport)) { if (GATT_Disconnect(p_msg->hdr.layer_specific) != GATT_SUCCESS) { LOG(ERROR) << __func__ << ": fail conn_id=" << loghex(p_msg->hdr.layer_specific); } else { status = GATT_SUCCESS; LOG_DEBUG("Disconnecting gatt_if=%d, remote_bda=%s, transport=%d", +gatt_if, remote_bda.ToString().c_str(), transport); status = GATT_Disconnect(p_msg->hdr.layer_specific); if (status != GATT_SUCCESS) { LOG_ERROR("fail conn_id=%d", +p_msg->hdr.layer_specific); status = GATT_ERROR; } p_rcb = bta_gatts_find_app_rcb_by_app_if(gatt_if); if (p_rcb && p_rcb->p_cback) { if (transport == BT_TRANSPORT_BR_EDR) if (transport == BT_TRANSPORT_BR_EDR) { bta_sys_conn_close(BTA_ID_GATTS, BTA_ALL_APP_ID, remote_bda); } tBTA_GATTS bta_gatts; bta_gatts.status = status; Loading