Skip to content
Snippets Groups Projects
  1. May 25, 2017
    • Jack He's avatar
      MCAP: Add a test tool for MCAP · 4e452bac
      Jack He authored
      * Add a command line tool for MCAP related tests
      * This tool can access the Bluetooth stack via a command line program
      * Type "help" to obtain a list of available console commands in this
        Bluetooth
      * Bluetooth must be disabled when this tool is running
      
      Bug: 37867299
      Test: make, PTS MCAP test
      Change-Id: I106e6625ee8a29b7fdad88cdfeb99419054ef771
      4e452bac
  2. May 24, 2017
    • Jakub Pawlowski's avatar
      Fix GATT Server disconnecting for no reason · 9a03c88c
      Jakub Pawlowski authored
      When two devices are bonded, even if the device is supposed to act just
      as a GATT Server, service discovery is performed. Doing "read by type"
      should not trigger connection timeout, or disconnection, as the server
      should wait for the client to finish connection.
      
      Please note that it does not GATT Client behaviour, as they manage the
      connection timeout through L2CA_SendFixedChnlData called on each data
      packet.
      
      Bug: 34951749
      Test: manual
      Change-Id: If53cf63dc204238a60839497992c870b1b39aa60
      9a03c88c
  3. May 23, 2017
    • Jack He's avatar
      MCAP: Add test interface for PTS test (2/2) · 8e7dc7c0
      Jack He authored
      * PTS tests requires MCAP APIs to be called at protocol level
      * This CL creates a test interface to enable the above functionality
      
      Bug: 37867299
      Test: make, no user visible effect
      Change-Id: I15cc6cc613ce8f7c57564296e45077ab877c269b
      8e7dc7c0
    • Jack He's avatar
      MCAP: Fix bugs in MCAP stack · d026099b
      Jack He authored
      * Fix error response message for clock sync opcodes
      * Fix error response message for CREATE_MDL opcode
      * Fix logging in the MCAP stack
      
      Bug: 37867299
      Test: make, PTS MCAP test
      Change-Id: I7a37ac04806bca20d732357f00b4761577b4be19
      d026099b
  4. May 22, 2017
  5. May 18, 2017
  6. May 17, 2017
  7. May 16, 2017
  8. May 15, 2017
    • Jakub Pawlowski's avatar
      Fix crash on GATT service unregistration · cac6fc59
      Jakub Pawlowski authored
      When SDP_MAX_RECORDS were reached in SDP db, which usually happen by
      registering big number of GATT services, unregistration of a service was
      causing a crash. This was because we moved from memory after the array
      into last element.
      
      Bug: 38265174
      Test: manual
      Change-Id: I7b0235213fb07c85dcc1245f1c840b41267521d5
      cac6fc59
  9. May 12, 2017
    • Emil Lenngren's avatar
      Fix BLE white list issues · 1cd1e7d5
      Emil Lenngren authored
      Since Bluetooth 4.2 and errata ESR08 there may not be more than one
      connection between two LE device addresses. Also the stack assumes
      there is at maximum one connection to the same address. This patch
      makes sure there are no connected devices in the white list when a
      connection attempt is started. Since some (even 4.2) controllers don't
      handle this correctly, currently this method is used regardless of
      controller in this patch.
      
      When the maximum L2CAP connections were reached and a new connection
      was established to a device using auto connect, the stack hung and
      would no longer create new connections until Bluetooth was restarted,
      since the state change to BLE_CONN_IDLE was forgotten. This patch
      resets the state correctly, and also never initiates a connection
      unless there is space to avoid connect-disconnect loop.
      
      There were also bugs in the background_connections hash map; memory was
      not freed when an element was erased and an incorrect hash function
      which used the pointer to a bd addr instead of the bd addr itself which
      basically meant that elements were never removed. This patch removes
      the dynamic memory allocation and uses a correct hash function.
      
      There was a bug that might lead to that the white list was filled
      beyond its maximum, due to the counter was updated on the HCI command
      complete event, which might run too late. Now the space is instead
      calculated based on what commands have been sent to the controller.
      
      The address type of the address added to the white list must also be
      tracked, otherwise it might be updated due to a BLE scan, and later the
      wrong address is removed from the white list. This patch fixes this.
      (Preferably 49-bit bd addrs should be used as identifier through the
      whole stack but we're not there yet.)
      
      There was a queue of size 10 with pending white list operations. That
      queue got full if there was initially 10 devices in the white list,
      then the 10 devices were removed and immediately after 10 other devices
      were added. This patch removes the queue altogether by instead syncing
      against the background_connections hash map.
      
      Bug: https://code.google.com/p/android/issues/detail?id=219910
      Test: stress-testing with a bunch of BLE devices and inspecting HCI log
      Change-Id: I78de654ffbea5f4962a189caf984f7f2934e8fbe
      1cd1e7d5
    • Pavlin Radoslavov's avatar
      Don't ignore the A2DP Sink preferred SBC codec config · 37a5d291
      Pavlin Radoslavov authored
      If the A2DP Sink device sends "Set Configuration" with its preferred
      SBC configuration, try using that configuration when selecting
      the codec parameters instead of the A2DP Sink SBC capability.
      
      Test: A2DP streaming, PTS AVDTP Tests: TC_ACP_SRC_SIG_SMG_BV_18_C,
            TC_ACP_SRC_SIG_SMG_BV_20_C, TC_ACP_SRC_SIG_SMG_BV_22_C
            PTS A2DP Tests: A2DP/SRC/SET/BV-04-I, A2DP/SRC/SET/BV-06-I
      Bug: 37723311
      Bug: 35664023
      Change-Id: I48e2aa664b899c1cda5df4d1f86f9cfa3a9a67f6
      37a5d291
    • Pavlin Radoslavov's avatar
      Set the RTP Header Marker bit selectively per A2DP codec · c62b5c44
      Pavlin Radoslavov authored
      Add a mechanism to set the RTP Header Marker bit per codec.
      Currently, the Marker bit is set only for AAC.
      
      Test: A2DP streaming, PTS AVDTP tests: TC_ACP_SRC_TRA_BTR_BV_01_C,
            TC_INT_SRC_SIG_SMG_BV_17_C, TC_INT_SRC_TRA_BTR_BV_01_C
      Bug: 37723283
      Change-Id: I9b8e77d44c750746c169df9628d5539ad2406b92
      c62b5c44
    • Jakub Pawlowski's avatar
      Improve GATT Server database handling. · e8de06e3
      Jakub Pawlowski authored
      - use references instead of pointers where possible. Thanks to it we can
        remove some reduntant null checks and simplify the code.
      - use directly allocated memory instead of own buffers. Thanks to it the
        stack uses around 12kb less of memory after startup.
      - use list and vector from std library, instead of some hand-written
        implementations.
      
      This patch is a prerequisite for further server refactoring, that will
      further reduce the space used, make unit-testing possible, and enable
      proper handling of PTS GATT tests.
      
      Test: sl4a GattReadTest
      Bug: 38225928
      Change-Id: I1620be682259ccb8f0c02754806e355e3f1ad0c1
      e8de06e3
  10. May 11, 2017
    • Joseph Pirozzo's avatar
      Disable output_sample.pcm · 1cf15ec3
      Joseph Pirozzo authored
      Update include files to include bt_target.h as it has the necessary
      defines to correctly allow bdroid_buildcfg.h to enable and disable
      dumping to output_sample.pcm.
      
      Bug: 38180732
      Test: Stream Bluetooth audio to device and observe that
      output_sample.pcm does not get written or appended to.
      
      Change-Id: Ia7926f93a47489686d315e3c9abd1618cb8adda3
      1cf15ec3
    • Treehugger Robot's avatar
    • Treehugger Robot's avatar
      Merge changes from topic 'eSCO' · a8fbed7b
      Treehugger Robot authored
      * changes:
        eSCO: Format changes to original vendor patch (4/5)
        eSCO: Additional fix to get eSCO working for HFP and HSP (3/5)
        eSCO: Remove BTM_WBS_INCLUDED from the stack (2/5)
        eSCO: BT 4.1 Enhanced SCO command (1/5)
      a8fbed7b
    • Andre Eisenbach's avatar
    • Pavlin Radoslavov's avatar
      Removed A2DP_GetTrackBitsPerSample() API because it is not needed · 2062d7e6
      Pavlin Radoslavov authored
      The A2DP_GetTrackBitsPerSample() API was replaced in the past
      by A2dpCodecConfig::getAudioBitsPerSample() .
       * Removed A2DP_GetTrackBitsPerSample() and related codec-specific APIs:
         - A2DP_GetTrackBitsPerSampleSbc
         - A2DP_GetTrackBitsPerSampleAac
         - A2DP_GetTrackBitsPerSampleAptx
         - A2DP_GetTrackBitsPerSampleAptxHd
         - A2DP_GetTrackBitsPerSampleLdac
           NOTE: The removed A2DP_GetTrackBitsPerSampleLdac implementation
           had a bug: a2dp_ldac_caps.bits_per_sample -> ldac_cie.bits_per_sample
           This bug itself was uncovered when switching to clang-3960126
         - A2DP_VendorGetTrackBitsPerSample()
       * Replaced few leftover usages of A2DP_GetTrackBitsPerSample()
         A2dpCodecConfig::getAudioBitsPerSample()
       * Updated the unit tests
      
      Test: Code compilation, unit tests, A2DP streaming
      Bug: 37752547
      Change-Id: I7feeda0f32922b8ef888b157673e3e2ade98b179
      2062d7e6
    • Jack He's avatar
      eSCO: Format changes to original vendor patch (4/5) · ad319935
      Jack He authored
      * Format changes to original vendor patch
      * Re-order part of SCO creation code to improve readability
      * Make log more concise and usefull
      
      Bug: 19540029
      Test: make, HFP PTS test, testplans/86884, testplans/87103
      Change-Id: Ie0199519afb30f56568c04fef728fce44a172063
      ad319935
    • Jack He's avatar
      eSCO: Additional fix to get eSCO working for HFP and HSP (3/5) · 4c76d370
      Jack He authored
      * Removed vendor specific call after codec negotiation and before eSCO
        command is sent to Bluetooth chip
      * Removed vendor specific call after a SCO connection is requested by
        the peer
      * Removed vendor specific save audio state methods
      
      Bug: 19540029
      Test: make, HFP PTS test, testplans/86884, testplans/87103
      Change-Id: I899405a8eaa2f38ee0de04949c5288f9eefa74df
      4c76d370
    • Myles Watson's avatar
      eSCO: Remove BTM_WBS_INCLUDED from the stack (2/5) · b4b0ea1a
      Myles Watson authored
      All of our platforms support WBS.
      
      Bug: 19540029
      Test: make, HFP PTS test, testplans/86884, testplans/87103
      Change-Id: I384d49f73935ebb35b17132e71c85174797c435e
      b4b0ea1a
  11. May 10, 2017
    • Mudumba Ananth's avatar
      eSCO: BT 4.1 Enhanced SCO command (1/5) · f677ae32
      Mudumba Ananth authored
      Added support for BT 4.1 enhanced SCO feature on the stack.
      This feature allows the stack to create a SCO connection with
      remote device by using Hci_Enhanced_Setup_Synchronous_Connection
      command after checking the controller (4.1) support for
      enhanced SCO command.
      Added the command parameters to use the command in both wide band
      speech(WBS) and narrow band speech(NBS) scenarios.
      
      Number of Broadcom vendor specific commands(VSCs)that are needed
      to be sent to Broadcom controllers along with this command have
      also been updated accordingly
      
      NOTE: This change would also need a firmware patch for
      the feature to work on Broadcom contollers which will
      be delivered to Google in a separate change set.
      
      Bug: 19540029
      Test: make, HFP PTS test, testplans/86884, testplans/87103
      Change-Id: I1014d81be5cbe91078a4484dd072ac3957bfdfe4
      f677ae32
    • Marie Janssen's avatar
      btif: GetItemAttributes can return no attributes · d9890e5c
      Marie Janssen authored
      If there are no attributes available, it's possible to return zero
      attributes from a GetItemAttributes request.
      
      This is triggered by some carkits who are unhappy when they only get
      titles back (the only required item) and ask for the rest of the
      attributes (which we don't have).
      
      Test: connect to honda carkit and get snoop logs to confirm
      Bug: 36055995
      Bug: 35956792
      Change-Id: I5a31e206565d212e456111d8c6b542c7a1569e5a
      d9890e5c
    • Jakub Pawlowski's avatar
      GATT Server: check UUID · 8d6df8a3
      Jakub Pawlowski authored
      Characteristic and descriptor can't use UUID equal to GATT Attribute
      Types. Using such UUID would result in invalid GATT database, and
      crashes during service discovery.
      
      Test: manual
      Bug: 38134693
      Change-Id: Ide2c21109f885cbc79287452b1dabd3f532de385
      8d6df8a3
    • Hemant Gupta's avatar
      HID: Add support for Set Idle and Get Idle commands (2/4) · cea44f2f
      Hemant Gupta authored
      Provides an interface for application to send Set Idle
      and Get Idle commands to remote HID Device. Support for these
      two commands was missing from existing code, so existing code
      design is reused to add support for these two commands.
      
      Without this support following mandatory PTS test cases for HID 1.0
      cannot be passed, TC_HOS_HID_BV_05/06.
      
      Test: Executed PTS tests TC_HOS_HID_BV_05/06 and confirmed if they can
      pass
      
      Bug: 34344715
      Change-Id: I14bc2dc349354fd87ef8aba25357514398532e87
      cea44f2f
  12. May 09, 2017
    • Jack He's avatar
      Fix broken linux build · d025bc48
      Jack He authored
      * Generic linux does not have property_get_int32. Instead,
        osi_property_get_int32() is created to handle OS_GENERIC cases
      * Some linux header have sigevent.sigev_notify_attributes typed as
        (pthread_attr_t *) whereas others typed it as (void *), as any pointer
        can be implicitly casted to (void *), the current casting to (void *)
        is unncessary and will break build on systems using (pthread_attr_t *)
      
      Test: make, unit test, no user visible effect
      Change-Id: I24b33da453dc9d40656168a3bcd900d9c99219ce
      d025bc48
  13. May 08, 2017
  14. May 06, 2017
    • Martin Brabham's avatar
      bta_dm: Stop copying garbage · 697db845
      Martin Brabham authored
      After we reach 7 ACL connections we have 7 peer device records.
      Once we reach this then we lose a connection and shrink the list we
      copy garbage into the last peer device record.  This can cause the flag
      remove_dev_pending to be set to something > 0 thus true which causes the
      stack to remove the device and its bonding information on the next
      acl change event.
      
      ACL Connections can happen from any connection (pairing, SDP, etc...)
      
      Bug: 36598959
      Test: Manual
      Change-Id: Ifbaa4098edba442274ffde183960ef53169988e7
      697db845
  15. May 05, 2017
    • Ajay Panicker's avatar
      Move hci_thread to a message loop and prevent thread from spinning · f47abc46
      Ajay Panicker authored
      Before this patch, if there was a message on the command queue and
      there were no command credits, the thread reactor would spin trying
      to process the message on the command queue and would continue until
      a credit was received. This led to a bug where upon switching users,
      hci_thread would spin and try to use 100% of the CPU. This is fixed
      by moving over to a message loop and queue system. The message loop
      processes all the messages. If there aren't enough command credits,
      command messages are deferred to the command queue and popped off
      whenever more credits are aquired. The deferred queue has priority
      to credits over recently posted messages.
      
      Bug: 37733903
      Test: Swap users with the real time scheduling patch applied, and
            general Bluetooth usage.
            TestTracker: 86249
      Change-Id: Ib775e47f6d4810d3d7d8af5b3ba84adc4ada3da5
      (cherry picked from commit 417ffed2)
      f47abc46
    • Jakub Pawlowski's avatar
      LE advertise data parsing refactor · aeebce2f
      Jakub Pawlowski authored
      * merge BTM_CheckAdvData and BTM_CheckEirData into GetFieldByType
      * check wether AD data is properly formatted when the packet is
        received. Some controllers were returning malformed data that
        resulted in stack crashes for BT5 packets.
      * add tests to verify the helpers work as expected
      
      Test: added net_test_stack_ad_parser
      Bug: 37671082
      Change-Id: I49e43d7cf7d0a8ace1ee45d9b14b2b8440096b05
      aeebce2f
    • Jakub Pawlowski's avatar
      Check device name length · 77c6d9f7
      Jakub Pawlowski authored
      BT spec limits the length of device name to 248 bytes. With the new
      LE advertising packets, that can go up to 1650 bytes long, we must check
      the length of device name received.
      
      Bug: 37671082
      Test: manual
      Change-Id: Iad309d638003c2391014c9764605d84ed5717cb1
      77c6d9f7
Loading