Skip to content
Snippets Groups Projects
  1. Sep 25, 2017
    • Jakub Pawlowski's avatar
      Use one type for UUID (1/5) · 2238a88f
      Jakub Pawlowski authored
      Currently, we have few different representations for UUID in stack:
      tBT_UUID, tSDP_UUID, bt_uuid_t, bluetooth:UUID, or uint8_t*.
      
      Additionally, tBT_UUID and bt_uuid_t are used to hold UUID as 128bit
      as Little Endian or Big Endian, depending on which part of stack (GATT
      or SDP) is using it.
      
      This patch is creating one type, bluetooth::Uuid, that will replace all
      other types.
      
      Bug: 66912853
      Test: all sl4a tests for GATT and RFCOMM
      Merged-In: Ia42d3233146db0488728ed6f878f99b368fe8838
      Change-Id: Ia42d3233146db0488728ed6f878f99b368fe8838
      2238a88f
  2. Sep 22, 2017
    • Hansong Zhang's avatar
      Merge "Get rid of unused _DYNAMIC_MEMORY" · 31133150
      Hansong Zhang authored
      31133150
    • Treehugger Robot's avatar
    • Hansong Zhang's avatar
      Get rid of unused _DYNAMIC_MEMORY · 95a20365
      Hansong Zhang authored
      Removed the unused BTA_DYNAMIC_MEMORY and HID_DYNAMIC_LIBRARY
      
      Bug: 27731905
      Test: Manual
      Change-Id: I6019584b165471c4058a2ec7ef8f278531153d18
      95a20365
    • Ajay Panicker's avatar
      Change our AVRCP capabilities if the remote device only supports 1.3 · 8c35bfe6
      Ajay Panicker authored
      This prevents issues with devices that only support 1.3 but can not
      handle forward compatability like some Alpine Carkits.
      
      Bug: 37943083
      Test: Connect to Alpine carkit that only supports 1.3 and see new features
            are used.
      
      Change-Id: I6d041590dc51d7e8711b17fb1cb9c880b640052a
      (cherry picked from commit 6afd046f)
      8c35bfe6
    • Ajay Panicker's avatar
      Bluetooth: Add AVRCP 1.3 as a developer option for AVRCP version (2/2) · 8a2dd3c7
      Ajay Panicker authored
      This is requied for the 2012 Mazda 3 carkit as the carkit refuses to send
      AVRCP commands other than passthrough commands when the version is anything
      else. AVRCP 1.3 is compatible with most carkits on the market and can be
      used to get most carkits working at the cost of losing many features.
      
      Bug: 37943083
      Test: Set AVRCP 1.3 in developer options and see that SDP and the AVRCP
            capabilites have updated to reflect this.
            TestTracker: 105915/3975
      
      Change-Id: Iffc7ed1dd91eecb699153125b25451de5826f202
      (cherry picked from commit d881634d)
      8a2dd3c7
    • Ajay Panicker's avatar
      Don't reject notifications and wait until new addressed player is ready (2/2) · 604cb760
      Ajay Panicker authored
      There are some carkits like the ones found in the 2016 Honda CRZ and some
      Audi's that do not follow the spec and do not honor reject pending notification
      messages after switching players. This causes an issue whenever you switch
      players, the metadata freezes due to the fact that the carkit never re-registers
      for new track changed notifications. This patch removes the reject notification
      and reorders the current notifications.
      
      Bug: 64142363
      Test: Test with Audi S7 and 2016 Honda CRZ and see that switching players works
            TestTracker: 105391/3975
      Change-Id: Iaec70863594e13217916ab740d529f526d27c2d1
      (cherry picked from commit d8abe6d0)
      604cb760
  3. Sep 20, 2017
  4. Sep 19, 2017
    • Sunny Kapdi's avatar
      BLE Adv RPA is not updated on first timeout · c42dbc99
      Sunny Kapdi authored
      BLE Advertisement RPA is getting updated with the
      same RPA instead of the newly generated RPA on the
      first timeout. Make sure to send the newly generated
      RPA to the Controller.
      
      CRs-Fixed: 2111232
      Bug: 65857055
      Change-Id: I4d8e95c26fe8e5944fdee32089b8fcaffa238367
      c42dbc99
  5. Sep 18, 2017
    • Rob Herring's avatar
      btlinux: Fix sepolicy for split policy (Treble) builds · 759c789e
      Rob Herring authored
      
      In full Treble builds, the btlinux HAL fails to build the sepolicy:
      
      neverallow check failed at out/target/product/linaro_x86_64/obj/ETC/plat_sepolicy.cil_intermediates/plat_sepolicy.cil:4518
      from system/sepolicy/public/domain.te:673
        (neverallow base_typeattr_55 base_typeattr_56 (file (execute execute_no_trans entrypoint)))
          <root>
          allow at out/target/product/linaro_x86_64/obj/ETC/nonplat_sepolicy.cil_intermediates/nonplat_sepolicy.cil:6054
            (allow hal_bluetooth_btlinux hal_bluetooth_btlinux_exec (file (read getattr map execute entrypoint open)))
      
      Test: Build completes successfully
      Change-Id: Ibb8dbe7f2ca823c87ae4404c40cdc35656c8e0af
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      759c789e
  6. Sep 16, 2017
  7. Sep 15, 2017
    • Jack He's avatar
      Clean-up BTIF profile queue on profile shutdown · 997097ea
      Jack He authored
      * Add btif_profile_cleanup(uuid) method to remove pending connection
        requests for individual UUIDs
      * Call the above method in each profile's clean-up method
      * Add unit tests for btif_profile_queue
      
      Bug: 63790458
      Test: make, unit tests, pair and connect car kits
      Change-Id: I28288c295b7ca0259b2112c11b4e5a81d6f2e33c
      997097ea
    • Jakub Pawlowski's avatar
      SetPreferredPhy/ReadPhy callback fix · 9fd375ec
      Jakub Pawlowski authored
      Bug: 65746728
      Test: manual
      Change-Id: Ifdd8e7051c953aa1c006abecd62d1af196619d98
      9fd375ec
  8. Sep 14, 2017
  9. Sep 13, 2017
  10. Sep 12, 2017
  11. Sep 11, 2017
    • Jakub Pawlowski's avatar
      Fix alarms being posted on wrong thread · 01a63882
      Jakub Pawlowski authored
      Alarms from btu_bta_alarm_queue and btu_generic_alarm_queue should be
      processed on the main MessageLoop thread.
      Replaced obsoleted alarm_set_on_queue() alarm API with the new
      alarm_set_on_mloop() API
      
      Test: manual
      Bug: 65078753
      Change-Id: I54b472b39b44a6c541dbdcdad7414056d0dd4163
      01a63882
    • Chao Quan's avatar
      Fix crash during derigister GATT server · da483584
      Chao Quan authored
      When deregister a gatt server, GATT_deregister
      will use a loop to stop service one by one and
      call std::list::erase in GATTS_StopService to
      remove service info. But erase makes iterator lose
      efficacy. If the iterator is operated after that,
      Bluetooth will crash.
      
      Add the iterator before erase.
      
      Test: manual
      Change-Id: I10f9351a95ab4922553d8a77663a0212407607aa
      da483584
  12. Sep 08, 2017
    • Jeremy Klein's avatar
      Ensure that services are cleaned from the GattServer HandleMap. · 15f7de8b
      Jeremy Klein authored
      The incorrect service handle was being plumbed up to onServiceDeleted.
      This was causing stale entries to stick around forever in the HandleMap,
      which could later cause failures to find callback references in
      ContextMap if the connection ID changed for a given device.
      
      Bug: 65463237
      Test: unit tests modified and run
      Change-Id: I2e22858b447f4e6b5a4fbceee4c406191c84a67d
      15f7de8b
  13. Sep 07, 2017
  14. Sep 06, 2017
    • Jaekyun Seok's avatar
      Add 'vendor.' prefix to a vendor HAL service name · b926597e
      Jaekyun Seok authored
      To prevent property name collisions between properties of system and
      vendor, 'vendor.' prefix must be added to a vendor HAL service name.
      You can see the details in http://go/treble-sysprop-compatibility.
      
      Test: succeeded building gce_x86_phone-userdebug and confirmed that
      service names were renamed correctly.
      Bug: 36796459
      Change-Id: Iedcb3a01e00e80c58dc76653784a3c353f34ce0a
      b926597e
    • Michael Spang's avatar
      Fix stack-buffer-overflow in bluetooth service GATT client · b49ba108
      Michael Spang authored
      Use the tBTA_GATTC union for |notify| in bta_gattc_process_indicate() to
      avoid a stack-buffer-overflow in btif_transfer_context.
      
      ==1410==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x0077c8c0c066 at pc 0x0077e50c9ae0 bp 0x0077c8c0bcd0 sp 0x0077c8c0b460
      
      READ of size 616 at 0x0077c8c0c066 thread T38 (btu message loo)
          #0 0x77e50c9adf in __interceptor_memcpy external/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:701:5
          #1 0x77ca1e838f in memcpy(void*, void const* pass_object_size0, unsigned long) bionic/libc/include/string.h:173:12
          #2 0x77ca1e838f in btif_transfer_context(void (*)(unsigned short, char*), unsigned short, char*, int, void (*)(unsigned short, char*, char*)) system/bt/btif/src/btif_core.cc:208:0
          #3 0x77ca209853 in (anonymous namespace)::bta_gattc_cback(unsigned char, tBTA_GATTC*) system/bt/btif/src/btif_gatt_client.cc:204:7
          #4 0x77ca11455b in bta_gattc_process_indicate(unsigned short, unsigned char, tGATT_CL_COMPLETE*) system/bt/bta/gatt/bta_gattc_act.cc:1596:9
          #5 0x77ca40b4b7 in gatt_process_notification(tGATT_TCB&, unsigned char, unsigned short, unsigned char*) system/bt/stack/gatt/gatt_cl.cc:664:7
          #6 0x77ca40d78f in gatt_client_handle_server_rsp(tGATT_TCB&, unsigned char, unsigned short, unsigned char*) system/bt/stack/gatt/gatt_cl.cc:1119:9
          #7 0x77ca414447 in gatt_le_data_ind(unsigned short, unsigned char*, BT_HDR*) system/bt/stack/gatt/gatt_main.cc:576:7
          #8 0x77ca47665b in l2c_rcv_acl_data(BT_HDR*) system/bt/stack/l2cap/l2c_main.cc:211:9
          #9 0x77c9da50eb in base::Callback<void (), (base::internal::CopyMode)1>::Run() const external/libchrome/base/callback.h:389:12
          #10 0x77c9da50eb in base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask const&) external/libchrome/base/debug/task_annotator.cc:51:0
          #11 0x77c9df75e3 in base::MessageLoop::RunTask(base::PendingTask const&) external/libchrome/base/message_loop/message_loop.cc:494:19
          #12 0x77c9df80b7 in base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) external/libchrome/base/message_loop/message_loop.cc:503:5
          #13 0x77c9df8fb7 in base::MessageLoop::DoWork() external/libchrome/base/message_loop/message_loop.cc:627:13
          #14 0x77c9dfd33b in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) external/libchrome/base/message_loop/message_pump_default.cc:35:31
          #15 0x77c9e4e327 in base::RunLoop::Run() external/libchrome/base/run_loop.cc:35:10
          #16 0x77ca3e97ab in btu_message_loop_run(void*) system/bt/stack/btu/btu_task.cc:98:14
          #17 0x77ca52ad3b in work_queue_read_cb(void*) system/bt/osi/src/thread.cc:251:3
          #18 0x77ca52489b in run_reactor(reactor_t*, int) system/bt/osi/src/reactor.cc:282:11
          #19 0x77ca524413 in reactor_start(reactor_t*) system/bt/osi/src/reactor.cc:125:10
          #20 0x77ca529c6f in run_thread(void*) system/bt/osi/src/thread.cc:221:3
          #21 0x77eb40a31b in __pthread_start(void*) bionic/libc/bionic/pthread_create.cpp:214:18
          #22 0x77eb3c1dff in __start_thread bionic/libc/bionic/clone.cpp:47:16
      
      002(bluetooth) btu message loo identical 2 lines
      
      Address 0x0077c8c0c066 is located in stack of thread T38 (btu message loo)
       at offset 646 in frame
      
          #0 0x77ca114293 in bta_gattc_process_indicate(unsigned short, unsigned char, tGATT_CL_COMPLETE*) system/bt/bta/gatt/bta_gattc_act.cc:1538:0
      
      002(bluetooth) btu message loo identical 1 line
      
        This frame has 4 object(s):
      
          [32, 646) 'notify' (line 1543)
          [784, 790) 'remote_bda' (line 1544) <== Memory access at offset 646 partially underflows this variable
          [816, 817) 'gatt_if' (line 1545) <== Memory access at offset 646 partially underflows this variable
          [832, 833) 'transport' (line 1546) <== Memory access at offset 646 partially underflows this variable
      
      HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      
            (longjmp and C++ exceptions *are* supported)
      
      Thread T38 (btu message loo) created by T37 (bt_workqueue) here:
      
          #0 0x77e50fd46f in __interceptor_pthread_create _asan_rtl_:3
          #1 0x77ca529727 in thread_new_sized(char const*, unsigned long) system/bt/osi/src/thread.cc:87:3
          #2 0x77ca3e9a73 in btu_task_start_up(void*) system/bt/stack/btu/btu_task.cc:127:26
          #3 0x77ca52ad3b in work_queue_read_cb(void*) system/bt/osi/src/thread.cc:251:3
          #4 0x77ca52489b in run_reactor(reactor_t*, int) system/bt/osi/src/reactor.cc:282:11
          #5 0x77ca524413 in reactor_start(reactor_t*) system/bt/osi/src/reactor.cc:125:10
          #6 0x77ca529c6f in run_thread(void*) system/bt/osi/src/thread.cc:221:3
          #7 0x77eb40a31b in __pthread_start(void*) bionic/libc/bionic/pthread_create.cpp:214:18
          #8 0x77eb3c1dff in __start_thread bionic/libc/bionic/clone.cpp:47:16
      
      002(bluetooth) btu message loo identical 1 line
      
      Thread T37 (bt_workqueue) created by T20 (stack_manager) here:
      
          #0 0x77e50fd46f in __interceptor_pthread_create _asan_rtl_:3
          #1 0x77ca529727 in thread_new_sized(char const*, unsigned long) system/bt/osi/src/thread.cc:87:3
          #2 0x77ca3e936f in BTU_StartUp() system/bt/stack/btu/btu_init.cc:129:25
          #3 0x77ca2a513b in event_start_up_stack(void*) system/bt/btif/src/stack_manager.cc:146:3
          #4 0x77ca52ad3b in work_queue_read_cb(void*) system/bt/osi/src/thread.cc:251:3
          #5 0x77ca52489b in run_reactor(reactor_t*, int) system/bt/osi/src/reactor.cc:282:11
          #6 0x77ca524413 in reactor_start(reactor_t*) system/bt/osi/src/reactor.cc:125:10
          #7 0x77ca529c6f in run_thread(void*) system/bt/osi/src/thread.cc:221:3
          #8 0x77eb40a31b in __pthread_start(void*) bionic/libc/bionic/pthread_create.cpp:214:18
          #9 0x77eb3c1dff in __start_thread bionic/libc/bionic/clone.cpp:47:16
      
      002(bluetooth) btu message loo identical 1 line
      
      Thread T20 (stack_manager) created by T0 (droid.bluetooth) here:
      
          #0 0x77e50fd46f in __interceptor_pthread_create _asan_rtl_:3
          #1 0x77ca529727 in thread_new_sized(char const*, unsigned long) system/bt/osi/src/thread.cc:87:3
          #2 0x77ca2a4e7f in ensure_manager_initialized() system/bt/btif/src/stack_manager.cc:238:23
          #3 0x77ca2a4e7f in stack_manager_get_interface() system/bt/btif/src/stack_manager.cc:251:0
          #4 0x77ca1b7927 in init(bt_callbacks_t*) system/bt/btif/src/bluetooth.cc:144:3
          #5 0x77ca9899fb in android::initNative(_JNIEnv*, _jobject*) packages/apps/Bluetooth/jni/com_android_bluetooth_btservice_AdapterService.cpp:663:13
          #6 0x77e1c87703 in art_quick_generic_jni_trampoline /proc/self/cwd/art/runtime/arch/arm64/quick_entrypoints_arm64.S:2329:0
      
          #6 0x37ab0579318381f  (<unknown module>)
      
      002(bluetooth) btu message loo identical 1 line
      
      SUMMARY: AddressSanitizer: stack-buffer-overflow (/system/lib64/libclang_rt.asan-aarch64-android.so+0x31adf)
      
      Shadow bytes around the buggy address:
        0x001ef91817b0: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
        0x001ef91817c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x001ef91817d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x001ef91817e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x001ef91817f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      =>0x001ef9181800: 00 00 00 00 00 00 00 00 00 00 00 00[06]f2 f2 f2
        0x001ef9181810: f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 06 f2
        0x001ef9181820: f2 f2 01 f2 01 f3 f3 f3 00 00 00 00 00 00 00 00
        0x001ef9181830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x001ef9181840: f1 f1 f1 f1 00 00 00 00 00 00 00 00 00 00 00 00
        0x001ef9181850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      Shadow byte legend (one shadow byte represents 8 application bytes):
        Addressable:           00
        Partially addressable: 01 02 03 04 05 06 07
        Heap left redzone:       fa
        Freed heap region:       fd
        Stack left redzone:      f1
        Stack mid redzone:       f2
        Stack right redzone:     f3
        Stack after return:      f5
        Stack use after scope:   f8
        Global redzone:          f9
        Global init order:       f6
        Poisoned by user:        f7
        Container overflow:      fc
        Array cookie:            ac
        Intra object redzone:    bb
        ASan internal:           fe
        Left alloca redzone:     ca
        Right alloca redzone:    cb
      
      ==1410==ABORTING
      
      Bug: 65381426
      
      Change-Id: Ie632f131b622cc323ce68ec7be152caef23c95ec
      b49ba108
    • Treehugger Robot's avatar
    • Jakub Pawlowski's avatar
      Fix GATT log spam · 45c3106e
      Jakub Pawlowski authored
      Bug: 65255942
      Test: manual
      Change-Id: I212bc93149dc514517f409edc36f74e1c2895d96
      45c3106e
    • Pavlin Radoslavov's avatar
      Store a name string in property without violating string boundaries · 3b3c6d1a
      Pavlin Radoslavov authored
      Don't copy data beyond end of string when storing it as BT_PROPERTY_BDNAME
      in property.
      Also, update an unit test to create a string by considering the property
      name length.
      
      Test: Running unit tests with ASAN enabled
      Change-Id: Iaa586b4a0942f99ba469d1ed963729e7ad721503
      3b3c6d1a
    • Sagayajayasheelan Thomas's avatar
      Extended Scan HCI definations as per BT 5.0 SIG · 483e7b33
      Sagayajayasheelan Thomas authored
      
      Added Ext Scan HCI defination for periodic scan.
      
      Change-Id: Ic7dce5fb5207a22e4b193d84033d84126d780be5
      Signed-off-by: default avatarSagayajayasheelan Thomas <sagayajayasheelan.thomas@intel.com>
      483e7b33
    • Srinu Jella's avatar
      Clear IB_CFG_DONE on receiving peer config request when channel open · bb77f6a0
      Srinu Jella authored
      Root Cause: Configure request fails in CST_OPEN state
      after a configure request IB_CFG_DONE and OB_CFG_DONE both are
      cleared. Some IOT devices try to configure again in the CST_OPEN
      state which fails if OB_CFG_DONE is cleared.
      
      Fix: Clear IB_CFG_DONE and keep OB_CFG_DONE unchanged on receiving
      Peer config request when channel open.
      
      Test: Tested with Geely Carkit.
      Bug: 35082459
      
      Change-Id: I8deca0c8ff73faafc3da94dcd9ea55e06bd8a31d
      bb77f6a0
  15. Sep 05, 2017
Loading