1. 15 Jul, 2015 1 commit
    • 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
  2. 14 Jul, 2015 1 commit
  3. 13 Jul, 2015 2 commits
  4. 10 Jul, 2015 4 commits
    • Andre Eisenbach's avatar
      Do not reject valid connection parameter updates · 71334dcd
      Andre Eisenbach authored
      As a side-effect to increasing BTM_BLE_CONN_INT_MIN, valid connection
      parameter updates can be rejected if the requested minimum is < 11.25ms,
      but the requested maximum is >= 11.25ms.
      
      This patch introduces a new parameter "BTM_BLE_CONN_INT_LIMIT" and
      resets BTM_BLE_CONN_INT_MIN to the HCI spec defined minimum.
      
      Bug: 22245224
      Change-Id: I6a2e4d18488b63570f7d0070413d00f16a7fdba1
      71334dcd
    • Pavlin Radoslavov's avatar
      Fix a bug when responding to AVRCP UNIT_INFO and SUBUNIT_INFO · 08c08fc0
      Pavlin Radoslavov authored
      Assign appropriately the p_rsp_data pointer to point in the
      buffer with the response.
      
      Bug: 22307858
      Change-Id: I2f77f290ff2c62c09b3be18ff047167a48c7c9d4
      08c08fc0
    • Nitin Arora's avatar
      Fail LE secure pairing for secure only peripherals · 26c3dd41
      Nitin Arora authored
      This change allows the host peripheral which initiates the pairing
      to reject the pairing in case the remote does not support
      secure LE connections and the host DUT is in secure connections
      only mode.
      
      Bug: 22203134
      Change-Id: If58f791cb575d6b66c361f58e574b613d5686047
      26c3dd41
    • Srinu Jella's avatar
      Reset the ACL connection data on ACL disconnection · 8f766350
      Srinu Jella authored
      Use case: Reconnection of legacy mouse.
      
      Failure: Not able to reconnect with mouse if the previous
      connection rejected was with SC enabled device.
      
      Test Steps:
      1. Pair and connect remote devices.
      2. Start streaming music over headset and Disconnect HID
         mouse.
      3. Inquire and try to pair with any DUT which supports
         secure connection.
      4. Cancel pairing and Turn OFF remote headset.
      5. Now try reconnection from HID mouse.
      
      Root Cause: When the secure connection is established, it will
      have the 3 pages filled, and when the same acl entry is reused
      for next mouse reconnection, only one page is getting over
      written because legacy HID will have only one page supported
      and remaining 2 pages still holds the previous device's data.
      
      Fix: Fixed it by resetting the ACL entry when the ACL is
      disconnected so that even though one page is copied and
      remaining pages will not contain valid data.
      
      Bug: 22249108
      Change-Id: Icd96f22fe0787ef5845ee02940c2b0eacf7a2bbd
      8f766350
  5. 09 Jul, 2015 2 commits
    • Miao Chou's avatar
      Fix security vulnerabilities in string operations · 549c64d1
      Miao Chou authored
      This CL prevents functions, bta_ag_hfp_result and bta_hf_client_send_atd, from
      the potential strings overflowing.
      
      Bug: 20674686,20677309
      Change-Id: Iaef720fc784e020f237feb86e17857bddf57bbfc
      549c64d1
    • Pavlin Radoslavov's avatar
      Add missing data initialization · 680959b0
      Pavlin Radoslavov authored
      A local struct variable is not initialized (memset to 0)
      when sending GET_REPORT_EVT to an application.
      As a result, field hs_data.rsp_data.p_rpt_data might be used
      uninitialized.
      
      Bug: 22352578
      Change-Id: I72141117187c392bc0502a17bf71859e67c8da54
      680959b0
  6. 07 Jul, 2015 7 commits
    • Anubhav Gupta's avatar
      Properly handle outgoing connection requests in opening/opened state · fd0e9f19
      Anubhav Gupta authored
      This happens in race conditions when we try to connect to a remote
      A2DP device from Bluetooth Settings UI and simultaneously there is incoming
      connection request from previously connected remote. This fix addresses
      the scenario where because of first A2DP connection btif moves to opening/
      opened state and then the second connect request is received.
      This scenario is handled by gracefully rejecting the second connect request
      from btif layer if it is already connected or about to be connected by the
      first connect request.
      
      Bug: 22028876
      Change-Id: I53be400d1d7c9a84ca9d9a75b6b6f010975cf0cf
      fd0e9f19
    • Satya Calloji's avatar
      Incorrect address type in ADV end on reconnection · 905c72de
      Satya Calloji authored
      Handled the issue of incorrect address type and value
      (on Privacy 1.1 chipsets) on reconnection by setting
      the correct device type and address value on advertiser end
      
      Original author: Chaojing Sun <cjsun@broadcom.com>
      
      Bug: 22100659
      Change-Id: I009888cc9ebd0b631543027d6e34b6c7ecbd0ce8
      905c72de
    • Anubhav Gupta's avatar
      Override remote suspend flag on local play state changes · 9c5d0727
      Anubhav Gupta authored
      - Remote device may initiate AVDTP Suspend within 3s of AVRCP pause,
        which sets remote suspend flag. Later on resumption of local playback
        A2DP packets can not be processed further as Remote suspend flag
        remains set. current change overrides remote suspend flag if local
        suspend is triggered later.
      - This change covers the usecase where play is pressed from DUT UI
        before local suspend triggers in such scenarios current change takes
        care of resetitng remote suspend flag on AVRCP play state change event.
      - Moreover this change will drop A2DP packets when the setparameter
        is called with A2dpSuspended=true and resumes when the mentioned parameter
        is reset.
      
      This change along with corresponding app change helps mitigating
      issues reported due to A2Dp, HFP synchronizations and local and remote
      device initiated AVDTP suspend handling.
      
      Bug: 22028876
      Change-Id:  I3bb334373414170254744d9233cbd2e66219bfa0
      9c5d0727
    • Srinu Jella's avatar
      SDP: Validate input UUID's length · 42f37840
      Srinu Jella authored
      Use case: Crash observed during BT IOT testing
      
      1. Try to pair to the remote device.
      2. Connect  to the remote device's audio profiles.
      3. Remote device has given the wrong UUID's length.This will leads to crash.
      
      Failure: crash observed during profile connection
      
      Root cause: Remote sent invalid UUID length,which is causing crash
      in comparison logic.
      
      Fix: Validate input UUID's length before going for actual comparison.
      
      Bug: 19417758
      Change-Id: I8216d17e3f6cc22dfbeca4b31972b5b5584a73ea
      42f37840
    • Andre Eisenbach's avatar
      Remove extraneous patch from secure connections workaround · 97269982
      Andre Eisenbach authored
      Bug: 21817410
      Change-Id: I55b3753b0ae9f389f1531bb588c4868e96842aeb
      97269982
    • Srinu Jella's avatar
      Remove stored link key for temporarily paired devices · f1029c7a
      Srinu Jella authored
      Problem: Device shows up in paired list during just work pairing
      
      1. Create a connection from DUT to remote.
      2. Remove the link key in remote.
      3. Send a file from remote to DUT.
      4. Turn OFF BT. Turn ON.
      
      Failure: Device should not move to paired list after BT on/off
      as device removed from UI during just work pairing
      
      Root cause: remote device is not removed from btif but
      its removed from UI during justworks pairing
      
      Fix: remote device is removed from btif during justworks
      pairing to sync up UI and btif paired list
      
      Bug: 19417758
      Change-Id: I73de0a94c4f7ada644d258790a9e3e4bf11fc4e5
      f1029c7a
    • Tucker Sylvestro's avatar
      Save all snoop logs when BtSnoopSaveLog=true · 1192df9f
      Tucker Sylvestro authored
      Previously, only the last snoop log was saved, which was often not
      enough if the bluetooth stack was in a crash loop or an app was
      resetting it frequently.
      
      Bug: 22202788
      Change-Id: I74622ceabe9ce12d5ba03c640c37f697d5a5bb01
      1192df9f
  7. 06 Jul, 2015 5 commits
    • Andre Eisenbach's avatar
      Blacklist Nexus Remote for LE secure connections · 7927f68b
      Andre Eisenbach authored
      The Nexus remote will disconnect during encryption when paired with the
      secure connections feature enabled. This patch will blacklist the remote
      and mask out the feature during pairing.
      
      This patch introduces a new interop database with the aim of
      consolodating various blacklists and interop workarounds into a single
      database for code readability and maintainability of the list.
      
      Bug: 21817410
      Change-Id: I6f510e1c8c6050ab4e313209122d028e12e5f54f
      7927f68b
    • Nitin Arora's avatar
      Use correct transport type while encrypting link · 4f6c9b4f
      Nitin Arora authored
      This patch uses the transport type from the GATT event instead
      of using the device type stored in NVRAM, to determine the
      transport type while encrypting the link. The issue is seen
      with dual mode devices, when the connection on LE transport
      causes encryption request on the BR/EDR transport
      
      Bug: 21652097
      Change-Id: I895756f9c0048b5a559ea00f633b1100109e52b8
      4f6c9b4f
    • Andre Eisenbach's avatar
    • Nitin Arora's avatar
      Prevent LE remote name request during inquiry · ddbb20bf
      Nitin Arora authored
      This change prevents the LE RNR at the end of inquiry. This prevents
      extra LE connections created during BT scan, to fetch remote name,
      which will be performed later during connections.
      
      Bug: 22228981
      Change-Id: Ied61bc192cec611e7b2f41e474c5f032ed9f0981
      ddbb20bf
    • Priti Aghera's avatar
      Set random identity only if enhanced privacy is supported · 8e928b4a
      Priti Aghera authored
      Change Own address type to Random identity only if controller supports enhanced
      privacy. Check if controller supports enhanced privacy before changing own adress type
      and peer address type to 0x02 or 0x03 in auto connection.
      Privacy 4.1 only supports Public and Random address.
      
      Bug: 20817308
      Change-Id: I9f5531e4e41c824426cd64de517b44355ac2655d
      8e928b4a
  8. 01 Jul, 2015 1 commit
  9. 28 Jun, 2015 1 commit
  10. 27 Jun, 2015 1 commit
    • Pavlin Radoslavov's avatar
      Copy an AVRC packet before sending a response back · 3a2fa83d
      Pavlin Radoslavov authored
      Don't reuse AVRC buffers for responding back. Apparently,
      in the AVRC packets we transmit the offset with the payload must
      be at least 15 octets. If the original buffer is not large enough,
      this results in memory corruption.
      
      Also, use an explicit check for 'bt_rc_ctrl_callbacks' as a workaround
      until the upper layer does the right thing with the callbacks registration.
      
      Bug: 22006014
      
      Change-Id: I28c248d1580bdddbda76298d19faadf8985187fc
      3a2fa83d
  11. 25 Jun, 2015 3 commits
    • Tucker Sylvestro's avatar
      Always ACK indications in the event of an error · dd2021c6
      Tucker Sylvestro authored
      This works around a race condition in which the just-connected remote
      device sends the local device an indication before the appropriate
      handle/device/etc. has been added to the cache.  Previously we were
      dropping that indication, which led to the remote device timing out
      and disconnecting some time after the connection had been successfully
      established.
      
      Bug: 21026847
      
      Change-Id: Iea43e7c93e48b5e7a7e78a1c3fb591d6fe972fc3
      dd2021c6
    • Pradeep Panigrahi's avatar
      Set idle timeout to zero when removing fixed channel · d9663b2d
      Pradeep Panigrahi authored
      Use Case:
      1) pair and Connect to HOGP mouse
      2) Disconnect from setting menu.
      
      Failure:
      Disconnect is not sent immediately
      
      Root Cause:
      While disconnecting we start lcb's default timeout of 4 seconds before
      disconnecting the link. Since we are removing fixed channels associated
      to a remote, setting idle timeout to 0 for immediate disconnection.
      
      Bug: 21877809
      Change-Id: I39fedb6cac6f952149cb2722d028115fbdc20b70
      d9663b2d
    • Avish Shah's avatar
      Resolved incorrect AV startup sequence · 8bc9ca59
      Avish Shah authored
      Issue:
      -> In AV start-up sequence, State machine initialization was being
      called after enabling Btif A2dp service.
      -> In that case, State machine handle will be empty and it will
      prevent enable and register events to enter into BTIF.
      -> Because of the absence of enable/register events, AV module in
      stack will be unaware of upper layer registration and will not
      proceed for connection.
      
      Fix:
      -> Changed the sequence in AV start-up, initialized State machine
      first before dispatching any events to State machine.
      -> So, the handle will not be empty and will not block events like
      BTA_AV_ENABLE_EVT and BTA_AV_REGISTER_EVT to enter into BTIF.
      
      Bug: 21451237
      Change-Id: I5d47e20ed68ea5730a7c149c316446eb8a1d41af
      8bc9ca59
  12. 24 Jun, 2015 1 commit
  13. 23 Jun, 2015 11 commits
    • Nitin Arora's avatar
      SMP state machine fix for passkey entry · ea8292ea
      Nitin Arora authored
      The SMP slave state machine goes on to generate local nonce
      after a successful commit, and ignores any commit from the
      remote master if received during the generation process.
      This change fixes that race condition
      
      Bug: 21896912
      Change-Id: I0cc2f1d20f6754d19f8b39fd62e3176007c50f1b
      ea8292ea
    • Nitin Arora's avatar
      Configure Bluetooth Low Energy scan parameters correctly · 11e6c293
      Nitin Arora authored
      This patch ensures that Bluetooth Inquiry uses the low latency
      scan parameters, and the scan params set by the Apps for LE scan
      are retained and set at the end of a BT inquiry.
      
      Bug: 21896912
      Change-Id: Iaf9e47330393cc1e0c21c625e8e07ce933506983
      11e6c293
    • Satya Calloji's avatar
      Incorrect address type in LE connected event · 483847a3
      Satya Calloji authored
      Enable address resolution to resolve the incoming connection details
      to provide the correct address type as part of the LE connection
      event.
      
      Bug: 21751039
      Change-Id: I148b0ffbfa1a39a32d90f5607362754d1901203f
      483847a3
    • Srinu Jella's avatar
      Set the security mode to secure connections only mode · c5c74107
      Srinu Jella authored
      Use case: Test the secure connections only mode PTS test cases.
      
      Test Steps:
      1. Call the API BTM_SetSecureConnectionsOnly from BT-IF layer to
         put the DUT is under secure connections only mode to execute
         the PTS test case TP/SEC/SEM/BV-11-C.
      2. Run the required steps for PTS test case.
      
      Failure: Failed to enter into secure connections only mode.
      
      Root Cause: The function BTM_SetSecureConnectionsOnly doesn't set
      btm layer security mode variable to only mode and all further checks
      are based on that variable.
      
      Fix: Fixed it by setting the security mode variable properly
      in the API function.
      
      Bug: 21896912
      Change-Id: I21d37e7d24c443c2cbcd72d6f62f5e31fa7cf107
      c5c74107
    • Srinu Jella's avatar
      Correct the logic of UIPC thread id check · f88e742e
      Srinu Jella authored
      Use case:   Check the A2dp play , pause from headset
      
      STR:
      Connect to the headset from DUT
      Try play , pause from Headset once the song is started playing from headset.
      
      Failure: Bluetooth process crashed due to invalid fd descriptor while
      clearing fds using FD_CLR
      
      Root cause: Root cause for this issue is pthread join mechanism for
      UIPC thread is not proper ( incorrect logic ), as a result UIPC thread
      still running, and A2DP media task will try to start a new UIPC thread
      before the previous UIPC read thread is closed, finally sometimes
      this scenario leads to this issue. This issue doesn't come always,
      if the media task is in process of initiating the fds before staring
      the new UIPC thread, and previous UIPC thread is in exiting state.
      
      Fix: Correct the logic of UIPC thread id check while joining the UIPC thread.
      Thread id might hold pointer value where it's value is negative vaule with
      singed bit is set,so corrected the logic to check against zero or  non zero.
      
      Bug: 21896912
      Change-Id: I1307d848958656e718e95a972f258526470b1974
      f88e742e
    • Srinu Jella's avatar
      Reset the pairing state on pairing failure · bf3e67e7
      Srinu Jella authored
      Use case: Test the paring scenario with remote device with security mode 3.
      
      STR:
      1. Create a connection from Remove dev with Security Mode-3 to DUT.
      2. Enter pin key in remote, when pin key pop-up comes in DUT, reject the same.
      3. Try to create connection from DUT to Remote dev-2, within 30 seconds.
      
      Failure: Create connection not sent from DUT to remote, even though
      there was no pairing taking place
      
      Root cause: As the pairing state is not reset properly it disturbs
      the next pairing process.
      
      Reproducible using MecApp test application.
      
      Fix: Reset the pairing state to idle in case stored paring
      device matches with the device for which the pairing
      failure happened.
      
      Bug: 21896912
      Change-Id: I0a9e143a44bb2ae7e296d7d76c1323e517f9cc42
      bf3e67e7
    • Srinu Jella's avatar
      Handle connection request to already connected device. · ca7e0b1b
      Srinu Jella authored
      Use case: Test the connect collision scenario from DUT and Headset.
      
      STR:
      1. Create a connection from DUT to headset, disconnect and unpair the link.
      2. Turn OFF and turn ON headset, keep in pairing mode, headset keeps trying
         to connect back to DUT.
      3. Inquiry in DUT, and connect to headset.
      
      Failure: DUT gets stuck in pairing, whenever there is a clash in
      accept_connection and create_connection.
      
      Root cause: When DUT and remote try to connect to each other simultaneously,
      an ACL handle is created with first connect request and the second connect
      request is also processed.DUT doesn't check whether there is already a
      ACL handle present between the devices.
      
      Fix: Fixed the issue by reusing the existing handle and
      discarding the second connect request.
      
      Bug: 21896912
      Change-Id: I2001bc3b2fa50f827a4e3b41cde91af1ea106c54
      ca7e0b1b
    • Srinu Jella's avatar
      Allocated requested buffer size in SDP attribute request · c0532307
      Srinu Jella authored
      Use case: Allocated required GKI buf in sdp attr req
      
      1. Enter UUID - 0100 for L2CAP or 110C for AVRCP Target so DUT sends
         continuation frame for TSPX_sdp_service_search_pattern on PTS
      2. Start Test case TP/SSA/BV-06 in PTSv6.0
      
      Failure: Some PTS test cases request less attributes in first packet
      and request more attributes in continuation packets.
      As stack allocates the buf in start packet and using the same
      buf in continuation packets, it's causing buffer corruption and crash
      
      Root cause: Buffer allocated for start packet is not sufficient
      in continuation packets
      
      Fix: Fixing this issue by dynamically allocating buffer in continuation
      packets of service_search_attr_req and service_attr_req
      
      Bug: 21896912
      Change-Id: I8daeffb7d6486c7b916ad2f0505ad422d91a613c
      c0532307
    • Srinu Jella's avatar
      NULL pointer check in sdpu_build_attrib_entry · a3dbe938
      Srinu Jella authored
      Use case: NULL pointer check in sdpu_build_attrib_entry
      
      Crash observed during BT stability test
      
      Failure: Crash observed while accessing p_attr->value_ptr
      
      Root cause: There is no null check for p_attr->value_ptr while
      accessing it in sdpu_build_attrib_entry
      
      Fix: Fixing this issue by adding null check for p_attr->value_ptr
      while accessing it in sdpu_build_attrib_entry
      
      Bug: 21896912
      Change-Id: I1dd352a33ff6f86add7d1b1bfdf240d1b7992b83
      a3dbe938
    • Hemant Gupta's avatar
      HID: Allow reconnection from Host on paired HID Devices. · 0bcf0c6e
      Hemant Gupta authored
      Host can send connection request when paired HID device
      is in disconnected state. We are not checking the
      NORMALLY_CONNECTABLE flags from sdp record, and by default
      sending this request from host, for subsequent user initiated
      connection to paired remote HID Devices.
      If the remote HID is in page scan mode, it will get connected
      and if not, connection will fail after retrying until
      HID_HOST_MAX_CONN_RETRY times.
      
      Without this patch, if remote hid device sdp record shows that
      device's NORMALLY_CONNECTABLE flag is false, host will not be
      able to create outgoing connection to remote device even if the
      device is in pairing mode until device is unpaired giving bad
      user experience.
      
      Bug: 22028876
      Change-Id: I2b3c5c25dc7b08ab6ed0c3667897e5ea0f05f914
      0bcf0c6e
    • Nitin Shivpure's avatar
      PAN: Fix to avoid buffer corruption while rebuilding the Bnep header · eeb249bd
      Nitin Shivpure authored
      A case, where 3 remote device (PANU role) is connected with DUT (NAP role).
      the one remote (PANU role) send BNEP_COMPRESSED_ETHERNET_DEST_ONLY
      packet to DUT (NAP role), which is for another remote device (PANU role).
      So DUT (NAP role) forwards this packet to another remote device (PANU role).
      As same pbuf is used across the L2CAP/BNEP/PAN layer since reception from
      L2CAP to writing on L2CAP CID of another PANU. Sometimes buffer (p_buf) gets
      corrupted, when required buffer size is greater than actual buffer size,
      while rebuilding the Bnep header.
      
      Using bnep_write instead of bnep_writeBuf to solve the buffer corruption
      issue, which allocates the new buffer & append data into it.
      
      This patch also add TRC_BNEP & TRC_PAN into conf file.
      
      Bug: 22028876
      Change-Id: I125cab6d3da0f8126605bc7e9f764a27ee72fb1f
      eeb249bd