1. 10 Oct, 2016 3 commits
    • Jakub Pawlowski's avatar
      Remove return value of BTM_VendorSpecificCommand function · 3d5fbcaf
      Jakub Pawlowski authored
      The return value of BTM_VendorSpecificCommand is currently just an
      information wether the callback was passed to it or not, but many places
      through stack use this value as error indication. Remove it.
      
      Test: unit tests pass
      Change-Id: Idf73fc49fb25e52c3aeb64f2305b4498ecacd9a4
      3d5fbcaf
    • Jakub Pawlowski's avatar
      Remove return value from btsnd_hcic_* functions · 763abdfe
      Jakub Pawlowski authored
      btsnd_hcic_* functions are always returning true, so this return value
      is not really useful.
      
      Test: unit tests pass
      Change-Id: I06ced65392d180ceed565e45b7831de6aede283c
      763abdfe
    • Jakub Pawlowski's avatar
      Ignore return value of btsnd_hcic_* functions · b6ab9b3a
      Jakub Pawlowski authored
      btsnd_hcic_* functions return only true. This patch makes sure that no
      logic is waiting for "false" value.
      Few methods, that had their return value dependent on result of
      btsnd_hcic_* were made void.
      
      Test: unit tests pass
      Change-Id: I43cff62f461ff35f4bd84e5338f1a587b6a05c58
      b6ab9b3a
  2. 07 Oct, 2016 3 commits
    • Treehugger Robot's avatar
    • Ben YoungTae Kim's avatar
      HID: Fix to handle UHID_OUTPUT_EV command from UHID driver · 960b9c39
      Ben YoungTae Kim authored
      Incorrect size check for UHID_OUTPUT_EV for incoming data from
      UHID driver of kernel was leading to exiting of poll thread.
      This was causing IOT issues with Apple Magic Mouse that require
      output report to be sent for proper functioning of scroll functionality.
      
      Bug: 28942565
      Change-Id: I2eaba1f70b7cd51fb21933031d439543eb141fd2
      960b9c39
    • Gurpreet Ghai's avatar
      Add null check to avoid exception after L2CAP psm assigned · 78e1e09b
      Gurpreet Ghai authored
      Use case: BT will get crash in SNS testing.
      
      steps: SNS testing BT ON/OFF.
      
      Failure: Crash is observed.
      
      Root Cause: If the number of supported services increased,
      larger service record array is required. Smaller array is
      resulting in out of record error causing L2CAP deregister.
      
      Fix: Check added to avoid null pointer exception if null
      is returned while fetching sock from id. Also cleanup of
      SDP and security records done during BT turning Off.
      
      Change-Id: I2e77127262119cabf2c372f894427dcdf3350e80
      78e1e09b
  3. 06 Oct, 2016 1 commit
    • Jakub Pawlowski's avatar
      Refactor advertising data types · 9eaf7768
      Jakub Pawlowski authored
      Currently we have some unnecessary complicated code for handling
      advertising data. Get rid of it.
      
      Bug: 30622771
      Test: Tests making sure flags and tx power are filled are added
      Change-Id: I807cdf11577c357c116c54cab50bbf3261e1ee16
      9eaf7768
  4. 05 Oct, 2016 3 commits
    • Pavlin Radoslavov's avatar
      Use the correct API to check whether a codec is valid · a0db321d
      Pavlin Radoslavov authored
      Use the (new) A2D_IsPeerSinkCodecValid() API call as appropriate
      to check whether the codec information of a Sink peer is valid.
      Previously, A2D_IsSourceCodecSupported() was used, and that didn't
      match the original code (before the refactoring).
      A2D_IsSourceCodecSupported() has extra checks, including min/max bitpool
      oundaries, and those shouldn't be used for this initial check - the
      bitpool boundaries can be adjusted later.
      
      Similarly, use the new A2D_IsPeerSourceCodecValid() API call instead of
      A2D_IsSinkCodecSupported().
      
      Also:
       * Replaced A2D_IsValidCodec() with
         A2D_IsSourceCodecValid(), A2D_IsSinkCodecValid()
         A2D_IsPeerSourceCodecValid(), A2D_IsPeerSinkCodecValid()
         and added the appropriate unit tests.
      
       * Added extra debug messages to help identify similar issues in the future
      
      Bug: 31749230
      Test: manual test with a carkit, and unit tests
      Change-Id: Iafaeb82744df9758e686194c91624992a0c55bdf
      a0db321d
    • Jakub Pawlowski's avatar
      Remove unnecessary checks of BTM_MAX_LOC_BD_NAME_LEN · be43ee76
      Jakub Pawlowski authored
      Change-Id: I6e68f80d0d97081a4fc3879e6c11342923cfef7b
      be43ee76
    • Jakub Pawlowski's avatar
      Make Bluetooth LE multi-advertising testable · e47b769e
      Jakub Pawlowski authored
      This patch turns the code that manages LE multi-advertising into the
      BleAdvertisingManager class. All HCI calls made by this code were
      abstracted into BleAdvertiserHciInterface.
      
      Thanks to those changes, we can mock BleAdvertiserHciInterface and test
      the advertising manager.
      
      The BleAdvertisingManagerTest, still has some dependencies on other
      code from the "stack" module. These have to be implemented on top of the
      test file. In the future, this dependencies should be replaced by mockable
      classes.
      
      Test: Tests covering the change are added in this patch.
      Bug: 30622771
      Change-Id: I4a363678815c235ee01255f462db2a671ef89610
      e47b769e
  5. 04 Oct, 2016 3 commits
  6. 03 Oct, 2016 2 commits
  7. 30 Sep, 2016 7 commits
  8. 29 Sep, 2016 3 commits
    • Jakub Pawlowski's avatar
      Enable libbase logging for whole stack · 75b83661
      Jakub Pawlowski authored
      Currently, only C++ code in the service/ folder can use libbase logging.
      This patch makes sure that logging can be used and is properly
      configured for usage when the stack is running as part of Bluetooth.apk.
      
      Bug: 31806042
      Change-Id: I1f8be79ba9999b53ece0b5217a893b4bd20ecafc
      75b83661
    • Victor Khimenko's avatar
      d09a76a9
    • Andre Eisenbach's avatar
      Fix 100 LE device connection limitation · 426da5ad
      Andre Eisenbach authored
      Currently after 100 devices are added to the device security database,
      any subsequent LE connection to a newly discovered LE device address
      will fail as entries in the security record database are not reused.
      
      This patch removes a device record if the device itself is removed and
      also ensures that the oldest device security record is deleted if the
      limit is reached to ensure a new record can be allocated.
      
      Bug: 31625900
      Test: SL4A multi-device connection test + regression
      Change-Id: I22f6c82c64a9a9bfb2a16d79182903e5aa011355
      (cherry picked from commit 013c32bf)
      426da5ad
  9. 28 Sep, 2016 2 commits
    • Victor Khimenko's avatar
      Support TARGET_TRANSLATE_2ND_ARCH case · b2797fc4
      Victor Khimenko authored
      Build-only change to support the multilib case where the second arch
      is translated (and thus bluetooth library is needed).
      
      "True" multilib case is explicitly not supported.
      
      Test: Build system refactoring CL. Existing unit tests still pass.
      
      BUG=31422117
      
      Change-Id: I09f239d39f5dbe0848a89367327db1ea1074ca39
      b2797fc4
    • Jakub Pawlowski's avatar
      Separate the definition of BTM layer types from control blocks · dc3c1f2a
      Jakub Pawlowski authored
      Right now, data types, control blocks, and functions used in the BTM
      layer are defined in the same header files. This means that if someone
      wants to write a test that uses those data types, they must also define
      all control blocks, or compile the whole module.
      
      This patch separates the data types from other definitions. Thanks to
      it, we will be able to write unit tests, once other dependencies get
      separated.
      
      Change-Id: Ibc089e273cc37642fbb8672964b266c20f8d825d
      dc3c1f2a
  10. 27 Sep, 2016 2 commits
    • Jakub Pawlowski's avatar
      Use better callbacks in LE multi advertising · 0a009c38
      Jakub Pawlowski authored
      Right now, LE multi advertising related code uses it's own
      implementation of queue on top of static array. Use std::queue, and
      base::Callback instead.
      
      Changing function pointers to base::Callback instances is required for
      further refactoring, which will turn this code into class.
      
      Bug: 30622771
      Test: sl4a BleAdvertiseApiTest ConcurrentBleAdvertisingTest
      Change-Id: I839e036c6edb4e19a17def4d68d351296468f88c
      0a009c38
    • Jakub Pawlowski's avatar
      Update BUILD.gn files · 29796eb6
      Jakub Pawlowski authored
      29796eb6
  11. 24 Sep, 2016 1 commit
    • Nitin Arora's avatar
      Bluetooth: Prevent gatt DB copy if server cache is absent · c695f257
      Nitin Arora authored
      In case the server cache does not exist for a specific
      connection, the API used to copy the server DB into the
      DB structure needs to return immediately. This change
      makes sure of that and prevents dereferencing of a null
      block causing the runtime error.
      
      Change-Id: Iec3040a1280ef9d80b1b9c76eca8071dff499411
      c695f257
  12. 23 Sep, 2016 3 commits
  13. 22 Sep, 2016 5 commits
  14. 21 Sep, 2016 2 commits