1. 25 Aug, 2015 1 commit
    • Nitin Arora's avatar
      Fix memory corruption of BLE whitelist hashmap · b7460434
      Nitin Arora authored
      When adding devices to the whitelist for LE background connections, a
      local variable is used as the hashmap key, preventing any successful
      lookups going forward. Thus the device will repeatedly add the same
      device to the whitelist and preventing successful connections going
      forward.
      
      Bug: 23423602
      Change-Id: I3d2590c0a1dd66c6e1864ea53f875a713660b645
      b7460434
  2. 24 Aug, 2015 1 commit
    • Pavlin Radoslavov's avatar
      Check the return value when reading HCI type byte · aa41fec0
      Pavlin Radoslavov authored
      Add missing return value check when reading the HCI type byte.
      This check is needed as a safeguard. For example, function
      event_uart_has_bytes() could be called (indirectly)
      within the run_reactor() loop not only when there are bytes to read,
      but also if there is an error (e.g., EPOLLHUP | EPOLLRDHUP | EPOLLERR).
      
      Bug: 23105107
      Change-Id: Ic3b6e4d656406949e384c8106b0c607f7c221759
      aa41fec0
  3. 18 Aug, 2015 1 commit
    • Pavlin Radoslavov's avatar
      Disable remote TCP connections · d2199cbb
      Pavlin Radoslavov authored
      For security reasons, TCP sockets now listen on the loopback
      IPv4 address 127.0.0.1 for incoming TCP connections.
      
      Bug: 23272146
      Change-Id: I88523f643f305f2281740575d7011b6077bf0843
      d2199cbb
  4. 14 Aug, 2015 1 commit
  5. 07 Aug, 2015 2 commits
    • Satya Calloji's avatar
      Allocate large enough buffers when copying AVRC packets · 8d88b1b7
      Satya Calloji authored
      AVRC response is created by copying the original received packet.
      When allocating a buffer for the response, the buffer length
      should be large enough to contain the response.
      
      Bug: 22437809
      Change-Id: I862d633e76d3c5221582459f19935a45e53577c7
      8d88b1b7
    • Jacob Lee's avatar
      [DS] BTM_VSC_CHIP_CAPABILITY_M_VERSION doesn't match · 5aad24f5
      Jacob Lee authored
      
      In the document, the supported version is 96.
      But, the defined supported version is 95 in the code.
      The callback function btm_ble_vendor_capability_vsc_cmpl_cback
      can not read number of track entries when it compare with 95
      and supported version from firmware.
      
      Bug: 22906552
      
      Change-Id: I64e6f14f34ef3ed0ddc3fee2fad05eb03e5938f1
      Signed-off-by: default avatarJacob Lee <jacob.lee@mediatek.com>
      5aad24f5
  6. 05 Aug, 2015 1 commit
  7. 04 Aug, 2015 3 commits
    • Nitin Arora's avatar
      Add Dialog mouse & KB to blacklist for LE secure connections · d63f7c0b
      Nitin Arora authored
      This change allows the host to mask the Cross key bit in
      the key distribution fields of the pairing request and
      response while pairing with the Dialog keyboard and mouse
      to prevent the remote from rejecting the DUT's pairing request.
      
      Bug: 22799966
      Change-Id: I89420e77875957c78e915c508de311d779fd03df
      d63f7c0b
    • Pavlin Radoslavov's avatar
      Add an explicit check for AVRCP vendor data · 84d13eda
      Pavlin Radoslavov authored
      Add an explicit check for AVRCP vendor data when parsing received vendor
      commands or responses.
      
      Bug: 21768387
      Change-Id: I715de6fc7348d063c448971a8dae6dd1b00c7062
      84d13eda
    • Pavlin Radoslavov's avatar
      Fix a crash for a race condition during Bluetooth shutdown · caaa00f5
      Pavlin Radoslavov authored
      This is same race condition observed in btif_media_task_aa_tx_flush_req()
      because btif_media_task_aa_tx_flush_req() and btif_media_task_stop_aa_req()
      are called back-to-bach.
      
      This race condition is triggered when A2DP audio is streaming on shutdown:
      "btif_a2dp_on_stopped() -> btif_media_task_stop_aa_req()" is called
      to stop the particular audio stream, and this happens right after
      the "cleanup() -> btif_a2dp_stop_media_task()" processing during
      the shutdown of the Bluetooth stack.
      
      Bug: 22700411
      Change-Id: Ia0c98d44a108cf0f57731ac8129e4d76c9934542
      caaa00f5
  8. 31 Jul, 2015 1 commit
    • Sharvil Nanavati's avatar
      Fix CTS Verifier test for insecure RFCOMM connection. · 9de273d9
      Sharvil Nanavati authored
      Closing an RFCOMM server socket does not remove the corresponding
      service record from the security database. However, the RFCOMM
      channel becomes free for reuse. The next RFCOMM server socket will
      therefore "inherit" the service record for the closed one if it
      happens to reuse the same channel.
      
      Bug: 22880207
      Change-Id: Ida3fee49e5f40667d9992dc4c4442f9289adae9e
      9de273d9
  9. 30 Jul, 2015 1 commit
    • Pavlin Radoslavov's avatar
      Fix a NULL-pointer crash · efa5991f
      Pavlin Radoslavov authored
      It seems that the current implementation of btm_sec_encrypt_change()
      does not handle the case when it is called with an invalid handle,
      such as inside file btu_hcif.c :
      
        case HCI_SET_CONN_ENCRYPTION:
          /* Device refused to start encryption. ... */
          btm_sec_encrypt_change(BTM_INVALID_HCI_HANDLE, ...)
      
      Bug: 22791224
      
      Change-Id: Ide9404d0c82819399cf258ae3f90c25b352f1e20
      efa5991f
  10. 29 Jul, 2015 4 commits
    • Andre Eisenbach's avatar
      Assign pseudo address for host-based RPA resolution matches · 48a4b9cd
      Andre Eisenbach authored
      Bug: 21963935
      Change-Id: Id72001ce17996ea04c3eba32cebcac4dbbe317bc
      48a4b9cd
    • Andre Eisenbach's avatar
      Fix memory leak in A2DP event handler · b61d25c5
      Andre Eisenbach authored
      btif_av_event_free_data() was not called in all states (idle state only)
      leading to potential memory leaks.
      
      Bug: 22822688
      Change-Id: I40520c605c9a806e6cd5ee6e36c101d0aa8d4355
      b61d25c5
    • Nitin Arora's avatar
      Reset LE encryption key size at LE disconnection only · 82c8b927
      Nitin Arora authored
      This change checks the transport type on receiving the disconnection
      and resets the encryption key size only if the LE disconnection
      has taken place.
      This fixes the issue where read request to characteristics that
      require encryption,  fails after cross key derivation due to
      disconnection of BR/EDR transport.
      
      Bug: 22515016
      Change-Id: If6aad91a628eabbb5a4b7f5c22812fe94d4c5db2
      82c8b927
    • Anubhav Gupta's avatar
      Promote AVCTP version to 1.4 · dab356e3
      Anubhav Gupta authored
      Promoting AVCTP version to 1.4 from 1.2 as Bluedroid stack
      already has got support for the same.
      Below changes are incorporated as part of this:
       - AVCTP version in SDP entry is upgraded to 1.4 for both AVRCP
         Target and controller role.
       - Service class #1 is added in extra for AVRCP Controller SDP
         entry to be in sync with AVCTP version change.
       - Browsing support is not enabled as that needs corresponding
         profile level implementation, which is currently unavailable.
      
      Change-Id: I72f7f67eb0a789fd321e9468f2a51bb5e9385a89
      dab356e3
  11. 28 Jul, 2015 1 commit
  12. 27 Jul, 2015 3 commits
    • Amirhossein Simjour's avatar
      Fix for uhid_event size check · 1500b8d9
      Amirhossein Simjour authored
      The uhid_event function used to expect that the return value of each
      read function call to match with the size of the struct uhid_event.
      Since the header file doesn't match the kernel driver, these two size
      don't always match. The exact size check is replaced with expecting
      the minimum required size.
      
      Bug: 20108348
      Change-Id: Ib61537092b109296f8290d802b68fc2efe78888c
      1500b8d9
    • Casper Bonde's avatar
      Unpair HID device cleanup · 760aa99b
      Casper Bonde authored
      
      When unparing HID devices, the attr_mask was not cleared.
      By not clearing this data, some HID device will never be able
      to connect again. (E.g. the Apple Magic Mouse)
      
      Bug: 15566403
      Change-Id: Ic80909dcecdf48d967c1a936b31554653761fa42
      Signed-off-by: default avatarCasper Bonde <c.bonde@samsung.com>
      760aa99b
    • Pavlin Radoslavov's avatar
      Fix the logic for stopping the Power Management timers. · c6137426
      Pavlin Radoslavov authored
      Previously, the logic for stopping the timers didn't take
      into account whether each timer was already running.
      
      Bug: 22666419
      Change-Id: Ia99bf8be917e9ea69f478a954085336fc899040a
      c6137426
  13. 24 Jul, 2015 1 commit
    • Andre Eisenbach's avatar
      Fix TX queue overflow detection · 196413f5
      Andre Eisenbach authored
      - Prevent possible endless loop if |nb_frame| is too high
      - Remove off-by-one calculation before sending frames
      - Remove log spam and add better debug info
      
      Bug: 22658329
      Change-Id: I374ee980aec48763beb49b4f6f8b076124cadf40
      196413f5
  14. 23 Jul, 2015 1 commit
    • Pavlin Radoslavov's avatar
      Customize Bluetooth sniff interval · 1076b7b0
      Pavlin Radoslavov authored
      Fix an earlier commit that prevents from customizing some of
      the Bluetooth sniff parameters - those cannot be overwritten
      anymore in the bdroid_buildcfg.h file.
      
      Also, fixed the indexing in tables bta_dm_pm_cfg[]
      and bta_dm_pm_spec[]
      
      Bug: 22676670
      Change-Id: I3a7074b9a9c91d312dc5d4314b7c304baf4ae20d
      1076b7b0
  15. 22 Jul, 2015 2 commits
    • Pavlin Radoslavov's avatar
      Fix a crash for a race condition during Bluetooth shutdown · 197ee685
      Pavlin Radoslavov authored
      This race condition is triggered when A2DP audio is streaming on shutdown:
      "btif_a2dp_on_stopped() -> btif_media_task_aa_tx_flush_req()" is called
      to stop the particular audio stream, and this happens right after
      the "cleanup() -> btif_a2dp_stop_media_task()" processing during
      the shutdown of the Bluetooth stack.
      
      Bug: 22602117
      Change-Id: I5de6a8f15b6a2771dde2e299a5b60554063696a2
      197ee685
    • Nitin Arora's avatar
      Update device type correctly in the NVRAM at inquiry result · ac72840a
      Nitin Arora authored
      This patch checks for the NVRAM data when inquiry result
      is received from the remote device. In case the device is
      marked as LE only or BR/EDR only, and inquiry result is
      received from the alternate transport, the device type is
      marked as Dual mode in the NVRAM
      
      Bug: 22604450
      Change-Id: Id925e8bad152a33c2bd3c371ca42a6f9c694e3b0
      ac72840a
  16. 21 Jul, 2015 6 commits
    • Nitin Arora's avatar
      Use pseudo address while re-pairing peripheral · 1da48a36
      Nitin Arora authored
      In case of pairing to an already paired device (in an instance
      where the central remote has removed the keys), the change
      makes sure that the correct address is used when LTK key
      request occurs at the peripheral.
      
      Bug: 22605510
      Change-Id: I959003f39f70281ff1e6af8d4c4549138bc1682c
      1da48a36
    • Nitin Arora's avatar
      Adding transport type while initiating remote discovery · b4365c55
      Nitin Arora authored
      This change ensures that the completion of SMP pairing for LE
      devices specifically requests remote device discovery based on
      transport type set to LE to prevent initiation of BR/EDR
      connection due to incorrect transport type info
      
      Bug: 22515456
      Change-Id: Id1e5603d3cc53ca3dff427b93059a00f8d9150a7
      b4365c55
    • Andre Eisenbach's avatar
      Fix potential crash when transcoding legacy config files · 280368c7
      Andre Eisenbach authored
      Bug: 22634292
      Change-Id: I64745671f3b69fc7e6913213aeec55267e9bc49b
      280368c7
    • Nitin Arora's avatar
      Enable enhanced connection complete event · ccd37fa0
      Nitin Arora authored
      This change enables the enhanced connection complete event in order
      to receive the local rpa address while connection is completed
      with a paired peripheral. This is required if central tries to
      repair or key upgrade an already paired device so that the confirm
      or the DHKey Check values match during the pairing process
      
      Bug: 22515703
      Change-Id: If27f3b22bc568df6f081f8ad13dfc6783a83ae47
      ccd37fa0
    • Pavlin Radoslavov's avatar
      Fix the logic for removing bonded devices · 65f9c04a
      Pavlin Radoslavov authored
      * Removed btif_storage_is_device_bonded(), because it is not needed,
        and it was giving the wrong answer in use cases like Smart Setup
        with BR/EDR connections.
      
      * Added a call to btif_storage_remove_ble_bonding_keys()
        within btif_storage_remove_bonded_device() so the bonded device
        state is properly removed.
      
      * Don't save the BLE bonding keys if it is temporary bonding
      
      Bug: 22233299
      Change-Id: I33d9f76a124acc60173f0acaa517bc29ee6603e8
      65f9c04a
    • tturney's avatar
      Exclude Polar HR Monitor from secure conn · fb229d8b
      tturney authored
      Bug: 22473630
      Change-Id: I1168444a6969532377e1bbcb2b1058d768099c20
      fb229d8b
  17. 20 Jul, 2015 1 commit
    • Arman Uguray's avatar
      Fix multi-advertising when LE Privacy is not available · 6670e315
      Arman Uguray authored
      This patch fixes a bug that caused all multi-advertising instances to be
      initialized with Instance ID 0 (which is not allowed by the stack), if LE
      privacy is not available. The problem was that the internal data structures that
      represent advertising instances were not getting their |inst_id| field
      initialized where it's supposed to.
      
      Although far from clean, this code worked before. The culprit for the regression
      is "f9fdf890 Random address does not get written properly", which moved the
      initialization of instance IDs from the loop in BTM_BleEnableAdvInstance to
      btm_ble_multi_adv_enb_privacy. The latter never gets called if privacy is not
      available, which leads to partially initialized structures.
      
      Obviously both of these places were wrong to begin with. I saw the word
      "init" in a function called btm_ble_multi_adv_init. I figured this might have
      something to do with initializing, so I moved the logic there.
      
      Bug: 21267281
      
      Change-Id: I38b9a2a71cd3f45feb267a13bf29f93564ee6075
      6670e315
  18. 17 Jul, 2015 1 commit
    • Nitin Arora's avatar
      Add Moto Key Link to blacklist for LE secure connections · f0e9c466
      Nitin Arora authored
      This change allows the host to mask the Cross key bit in
      the key distribution fields of the pairing request and
      response while pairing with the Moto key link. This is
      needed since this specific remote device performs
      calculations of the pairing confirm after masking the
      cross key bit in the key distribtuin field which results
      in a mismatch of the pairing confirm calcualted by the host
      DUT and the remote.
      
      Bug: 22539807
      Change-Id: I7d758b05023cf346c97939883edda9d3adb08e1a
      f0e9c466
  19. 16 Jul, 2015 1 commit
    • Arman Uguray's avatar
      Properly disconnect GATT connection during noisy scans · 50333a25
      Arman Uguray authored
      This patch fixes an issue that is reproducible in highly noisy environments
      (massive deployment of BLE beacons), through repeated connect/disconnect
      attempts on a remote peripheral while scanning for beacons in the background.
      The state machine in bta/gatt has a special control flow for handling disconnect
      requests during discovery, which in this case failed to resolve the original
      request by issuing an HCI_Disconnect command. This is now fixed by always
      explicitly triggering the connection close sequence once the discovery state has
      been cleaned up.
      
      This patch also includes a fix for a crash that occurred as a side-effect of the
      scenario described above.
      
      Bug: 22350508
      Change-Id: Ie9cbd3c8f54239b142bfb8dde80d9581ae70ed43
      50333a25
  20. 15 Jul, 2015 4 commits
    • Andre Eisenbach's avatar
      Cleanup alarm_get_remaining_ms · 165332bc
      Andre Eisenbach authored
      This function is used for PM sniff mode timers - at least until we can
      re-factor those not to rely on this function.
      
      Bug: 22040710
      Change-Id: Ibe6f49440228732b2bd8242db4a44e481b00b62e
      165332bc
    • Nitin Arora's avatar
      Use correct own address type for batch scan · ac1399a7
      Nitin Arora authored
      This patch ignores the input parameter and used the own
      address type from address management block while setting
      the batch scan parameters.
      
      Bug: 22227689
      Change-Id: I23fc80b68cfbd91d718c1094ef2483eaccda3ae1
      ac1399a7
    • VenkatRaghavan VijayaRaghavan's avatar
      Bug fix PM changes and LE connectivity mode fixes · 76356aee
      VenkatRaghavan VijayaRaghavan authored
      Allow PM to support multiple delay timer for different profiles and
      power mode requests. And set correct connectivity mode.
      
      Bug: 22040710
      Change-Id: Idabd9ea944f0c5a89ce542d85db9f103fa7d1816
      76356aee
    • Srinu Jella's avatar
      Store the link key derived from cross tranport link key · 21331c62
      Srinu Jella authored
      Use case: PTS test case for cross transport link key
      derivation
      
      Steps to reproduce:
      1. Start Test case GAP TP/LEP/DM/BV-15 in PTSv6.0
      
      Failure: PTS test case TP/LEP/DM/BV-15 fails as the link
      key is not stored when the key is derived from other
      transport key. So it will again go for pairing even though
      it has link key but not stored.
      
      Root cause: Link key is stored only when bond type is
      presistent, but it sets the bond type to persistent only
      when it receives SSP request but not link key is derived.
      
      Fix: So making the solution generic to store always when the
      link key type is authenticated combination key with P-256.
      
      Bug: 22486860
      Change-Id: I3eb201262f72c86a9438351cad14a6698065fa90
      21331c62
  21. 14 Jul, 2015 1 commit
  22. 13 Jul, 2015 2 commits