OSDN Git Service

Avoid more annoying crashing nougat-x86 android-x86-7.1-r5
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 14 Feb 2020 05:15:13 +0000 (13:15 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 20 May 2020 05:07:45 +0000 (13:07 +0800)
device/src/controller.c
hci/src/packet_fragmenter.c

index 5cb0d54..14a9689 100644 (file)
@@ -28,6 +28,7 @@
 #include "btcore/include/version.h"
 #include "hcimsgs.h"
 #include "osi/include/future.h"
+#include "osi/include/log.h"
 #include "stack/include/btm_ble_api.h"
 
 const bt_event_mask_t BLE_EVENT_MASK = { "\x00\x00\x00\x00\x00\x00\x06\x7f" };
@@ -252,7 +253,9 @@ static future_t *start_up(void) {
         &number_of_local_supported_codecs, local_supported_codecs);
   }
 
-  assert(HCI_READ_ENCR_KEY_SIZE_SUPPORTED(supported_commands));
+  if (!HCI_READ_ENCR_KEY_SIZE_SUPPORTED(supported_commands)) {
+    LOG_WARN(LOG_TAG, "Controller doesn't support Read Encryption Key Size command");
+  }
 
   readable = true;
   return future_new_immediate(FUTURE_SUCCESS);
index eae6905..a21d733 100644 (file)
@@ -135,8 +135,6 @@ static void reassemble_and_dispatch(UNUSED_ATTR BT_HDR *packet) {
     STREAM_TO_UINT16(acl_length, stream);
     STREAM_TO_UINT16(l2cap_length, stream);
 
-    assert(acl_length == packet->len - HCI_ACL_PREAMBLE_SIZE);
-
     uint8_t boundary_flag = GET_BOUNDARY_FLAG(handle);
     handle = handle & HANDLE_MASK;