Skip to content
Snippets Groups Projects
  1. Jan 04, 2017
    • Treehugger Robot's avatar
    • Pavlin Radoslavov's avatar
      Add a mechanism for configuring the A2DP Source codecs · 655fb1b9
      Pavlin Radoslavov authored
      * Codec config internal abstraction:
       - Add new classes A2dpCodecConfig and A2dpCodecs that (will)
         encapsulate all codec-related APIs
       - Add unit tests for the above two classes
       - Add method A2dpCodecConfig.buildCodecConfig(), and use it when
         creating the codec configuration instead of A2DP_InitSource2SinkCodec().
         The new method can build the codec config by taking into account
         optional user codec-related configuration preferences.
       - Use the A2DP codec config API from the hardware/libhardware bt_av.h API
       - Replace enum tA2DP_CODEC_SEP_INDEX with btav_a2dp_codec_index_t
         from the bt_av.h API
       - Move codec-specific functions from stack/include/a2dp_api.h
         and stack/a2dp/a2dp_api.cc to stack/include/a2dp_codec_api.h
         and stack/a2dp/a2dp_codec_config.cc
       - Create a new base class A2dpCodecConfig() to hold some of the
         codec-related state, and implement the corresponding A2dpCodecConfigSbc
         and A2dpCodecConfigSbcSink derived classes.
       - Move A2DP spec-related constants from stack/include/a2dp_api.h
         to stack/include/a2dp_constants.h
       - Move A2DP-related error codes from stack/include/a2dp_api.h
         to stack/include/a2dp_error_codes.h
       - Move A2DP SBC spec-related constants from stack/include/a2dp_sbc.h to
         stack/include/a2dp_sbc_constants.h
      
      * Implement the backend mechanism for handling user (re)configuration of
        A2DP Source codecs as requested via the JNI API calls.
        Also, any codec changes are reported back via JNI API callbacks.
        The current audio parameter selection (sample rate, bits per
        sample, channel mode - mono/stereo) is as follows:
        - If the user selected parameters are acceptable (based on
          local codec capability and the remote Sink capability),
          those parameters are used.
        - Else if the Audio HAL's requested parameters are acceptable,
          those are used.
        - Else if the default settings are acceptable, those are used.
        - Else use the best match among the local and the remote device's
          capabilities.
      
      * Update the mechanism for handling OTA configuration requests from the
        remote Sink device.
        - The OTA prefered codec configuration is ignored if the current
        codec configuration contains explicit user configuration, or if the
        codec configuration for the same codec contains explicit user
        configuration.
      
      * Refactor the Audio HAL <-> Bluetooth audio parameter negotiation
        mechanism:
        The new mechanism gives some flexibility to the Media Framework to
        choose the appropriate audio format (sample rate, bits per sample,
        and channel mode - mono/stereo), and at the same time allows
        the Bluetooth stack to double-check / overwrite the choice.
       - out_get_parameters() on the Audio HAL side asks the Bluetooth stack
         for all currently supported formats (for the current codec),
         and returns them to the Media Framework: sample rate, bits per sample,
         and channel mode (mono/stereo).
       - The first time adev_open_output_stream() is called on the Audio HAL,
         it asks the Bluetooth stack about the audio format currently selected
         by the Bluetooth stack (based on codec negotiation with the Sink device,
         and User Configuration).
       - The second time adev_open_output_stream() is called on the Audio HAL,
         its "config" will eventually contain the audio format selected
         internally by the Media Framework. That audio format is sent to the
         Bluetooth stack.
         If that format is acceptable to the Bluetooth stack, the Bluetooth
         stack will reconfigure itself internally, and will respond back with
         those values. Otherwise, it will respond back with the values that
         should be used instead.
      
      * Misc other fixes and refactoring:
       - Fix the BTA handling of A2DP codec reconfiguration
       - Fix a bug in the implementation of A2DP_BitsSet(), and add the
         approriate unit test. Also, fix the code that was using this function
         incorrectly.
       - The SBC encoder is compiled as a separate library
       - Replace leftover usage of "false" with "FALSE" for macros, and
         vice-versa for variable values.
      
      Test: A2DP streaming to headsets, TestPlans/71390
      Bug: 30958229
      Change-Id: I440b6126e2250e33b0075f9789dd93154c007c2b
      655fb1b9
  2. Jan 03, 2017
    • Jakub Pawlowski's avatar
      Fix failling ClosureTest · 94a2b0c2
      Jakub Pawlowski authored
      BTA closure doesn't keep the HDR messages any more, test have keep track
      of HDR pointers for itself.
      
      Bug: 33947176
      Test: test/run_unit_tests.sh  net_test_bta
      Change-Id: I32994f248dc2e082bf8bed426a32acf677c58ed5
      94a2b0c2
    • Ivan Podogov's avatar
      Allow HID Device to connect to a specific device · e99093ba
      Ivan Podogov authored
      With this change, when the app requests a connection to a
      specific device, it is always "plugged" first.
      Unplugging the previous device is left for the app to do.
      
      Test: make
      Change-Id: I2e27c12e2ee96d0c311615a3853d8c430f3b2c31
      e99093ba
  3. Dec 30, 2016
  4. Dec 29, 2016
    • Jakub Pawlowski's avatar
      Fix race condition in do_in_bta_thread · feec673e
      Jakub Pawlowski authored
      Attach posted_task to the HDR message, instead of using a queue.
      
      Bug: 33947176
      Test: re-run sl4a FilteringTest 3 times with no flakiness
      Change-Id: If0b69e82d11eeae52ac8e591bebff634073251f1
      feec673e
    • Hemant Gupta's avatar
      HIDD: Add support for HID Device Role · 28425227
      Hemant Gupta authored
      This patch adds support for HID Device role in bluedroid stack allowing
      DUT to be used as Keyboard or Mouse.
      
      Bug: 33011576
      Change-Id: I45b581a54f6c7bbc1f25226715a7ea23e34255c0
      28425227
    • Jakub Pawlowski's avatar
      HCI interface improvements · b26c1b26
      Jakub Pawlowski authored
      This patch improves btu_hcif_send_cmd_with_cb, which will accept
      base::Callback instead of function pointer as argument. It will also
      carry information about where was packet send from, which can be
      displayed when command status is received, greatly improving logs.
      
      The improved method is also used for handling VSC advertising.
      
      Bug: 30622771
      Test: sl4a ConcurrentBleAdvertiserTest
      Change-Id: I55c3e32f9231c00bfa85f971265809d6f1fecdfb
      b26c1b26
  5. Dec 28, 2016
    • Jakub Pawlowski's avatar
      Fix AdvertisingManager not being initialized · bc9a6dbe
      Jakub Pawlowski authored
      When BLE_VND_INCLUDED is not set, advertising was not properly
      initialized, which resulted in stack crashes. This patch makes sure that
      LE advertising is always properly initialized
      
      Bug: 33168939
      Test: enable LE advertising with BLE_VND_INCLUDED set to false
      Change-Id: I5fa0b3da39da99e750e1f8b6f0452a628094bfc4
      bc9a6dbe
    • Jakub Pawlowski's avatar
      Fix pointer type in BTA_DmBleCfgFilterCondition · 4d19af5a
      Jakub Pawlowski authored
      p_cond_param->srvc_uuid is of type tBTA_DM_BLE_PF_UUID_COND
      
      Bug: 33910711
      Test: sl4a FilteringTest
      Change-Id: I6b30e1e441f8256d8c8dbf593f746a3d7810eda6
      4d19af5a
  6. Dec 27, 2016
  7. Dec 21, 2016
  8. Dec 20, 2016
  9. Dec 19, 2016
    • Jakub Pawlowski's avatar
      Expose Bluetooth 5.0 properties to JNI · 0aa69dab
      Jakub Pawlowski authored
      Bug: 30622771
      Test: sl4a ConcurrentBleAdvertisingTest
      Change-Id: I6185e6926e7363824aa573c7d65f7ab66f954e52
      0aa69dab
    • Jakub Pawlowski's avatar
      Use LE Extended Advertising Report Event when available · d4246efc
      Jakub Pawlowski authored
      Bug: 30622771
      Test: sl4a ConcurrentBleAdvertisingTest
      Change-Id: Id85504922c21f15bc36ac8bb5e4ab962ee356e3d
      d4246efc
    • Jakub Pawlowski's avatar
      Use extended set scan enable/parameters when available · 0f64422f
      Jakub Pawlowski authored
      When LE Advertising Extension is available on the controller we must use
      both extended advertising and scanning commands. Otherwise, according to
      the spec, controller will return error.
      
      This patch makes sure that proper avaliable HCI calls are made.
      
      Bug: 30622771
      Test: sl4a ConcurrentBleAdvertisingTest as scanner
      Change-Id: I6906c381f0f758bd24b592390a4ef46e7fae36ed
      0f64422f
    • Jakub Pawlowski's avatar
      Update BleAdvertiserHciInterface · a8930b9a
      Jakub Pawlowski authored
      This patch updates BleAdvertiserHciInterface to be on pair with
      Bluetooth 5.0 LE Advertising Extension feature.
      
      Bug: 30622771
      Test: net_test_stack_multi_adv native test
      Change-Id: Ie0ec8c7f8ed0d7a874e392123b3486c767121140
      a8930b9a
    • Jakub Pawlowski's avatar
      Handle Advertising Set Terminated event · a618d3a4
      Jakub Pawlowski authored
      Make BleAdvertiserHciExtendedImpl report when advertising set is
      disabled because of new connection.
      
      Bug: 30622771
      Test: sl4a ConcurrentBleAdvertisingTest
      Change-Id: Ic13a31fe4bb92f121a29d540274d13893775a450
      a618d3a4
    • Jakub Pawlowski's avatar
      Advertising Extension Implementation · 0b6cd537
      Jakub Pawlowski authored
      This patch implements current BleAdvertiserHciInterface using LE
      Advertising extension HCI commands.
      
      Bug: 30622771
      Test: sl4a ConcurrentBleAdvertisingTest
      Change-Id: Icaaf24d6d02d8a887b3bb57d5b858b929f11c413
      0b6cd537
    • Jakub Pawlowski's avatar
      BLE scan filter setup simplification (2/3) · 347bf7c2
      Jakub Pawlowski authored
      Bug: 30622771
      Test: sl4a BleScanTest
      Change-Id: I55e6c201849a057995c0c6fda1c52af826749922
      347bf7c2
    • Sanket Agarwal's avatar
      AVRCP CT: Register for UUIDS Changed · 7da9a697
      Sanket Agarwal authored
      -- Also fix a bug introduced by change of data types in AVRCP Open state
      and AVRCP Browse Open state. Due to change in data type and field
      mismatch the status value was being read incorrectly
      
      Bug: b/33750053
      Test: Manual test of browse connect
      Test: PTS test for UUIDs changed
      Change-Id: Ifecf9480a3fabeee8ad8302ebb7cd48f5322dea7
      7da9a697
  10. Dec 18, 2016
    • Jack He's avatar
      Remove btif dependency on libmedia · 6bd4ba85
      Jack He authored
      * btif uses AudioTrack from frameworks/av which is under libaudioclient
      * Current dependency on libmedia is incorrect as it is an indirect
        dependency to libaudioclient
      
      Bug: 33718447
      Test: code compilation, no user visible effect
      Change-Id: I7c44095cd282fabf8595015910670193077c1514
      6bd4ba85
  11. Dec 17, 2016
  12. Dec 16, 2016
    • Jakub Pawlowski's avatar
      Refactor LE scanning HAL (2/3) · d4eb8538
      Jakub Pawlowski authored
      This patch converts btgatt_scanner_interface_t struct into
      BleScannerInterface class. It also refactors three most important
      methods from this interface: RegisterAdvertiser, Scan, and Unregister.
      Rest of this interface will be updated in following patches.
      
      Bug: 30622771
      Test: sl4a BleScanApiTest
      Change-Id: Ie35356f6c3c4f5488514ef55a48a32c93fb21b83
      d4eb8538
    • Sanket Agarwal's avatar
      Incoming HF connection: CB interaction between BTA <-> BTIF · 7eacee8b
      Sanket Agarwal authored
      For incoming connections we are not storing the handles in BTIF which
      implies that BTIF ignores the message (and so does jni -> java). This is
      fixed by sending the handle as part of BTA message on incoming accept.
      
      Other bugs include connection from remote (incoming) and disconnecting
      from host. They also depended on not storing the handle properly in
      first place.
      
      Bug: b/33555377
      Bug: b/30984220
      
      Test: Manual testing of incoming connections
      Change-Id: I84950d42aba2d2c975ea86cc8217fd0129cc90e9
      7eacee8b
    • Jack He's avatar
      Add unit tests and refactor LE legacy pairing key distribution methods · c1e0f982
      Jack He authored
      * Add unit test for confirm (c1), p1, and p2
      * Refactor the code to reduce number of methods
      * Refactor c1's code to make it testable
      
      Bug: 32413756
      Test: Code compilation, Unit Test, PTS SM Tests
      Change-Id: I5cc876b7dd2b21a0780ac9a5236420223df6cddb
      c1e0f982
    • Myles Watson's avatar
      test_vendor: Use pipe2 to set pipe flags · 5fcb584d
      Myles Watson authored
      Simplify the code to fix a typo.  F_SETFD should have been
      F_SETFL.
      
      Test: run unit tests
      
      out/host/linux-x86/nativetest/test-vendor_test_host/test-vendor_test_host \
              --gtest_filter=AsyncManagerSocketTest.*
      
      Change-Id: I215381d6e130428acae7d73d80fefc97cbf64651
      5fcb584d
    • Treehugger Robot's avatar
    • Myles Watson's avatar
      test_vendor: Add more unit tests for async_manager · a026ec5a
      Myles Watson authored
      Test: run the unit tests
       out/host/linux-x86/nativetest/test-vendor_test_host/test-vendor_test_host \
           --gtest_filter=AsyncManagerSocketTest.*
      
      Change-Id: I8c5e05c5506a067a6148d54dc23bbb931ad612e7
      a026ec5a
    • Jack He's avatar
      Replace assert with CHECK from base/logging.h · 358dd11b
      Jack He authored
      * Replace assert with CHECK
      * Remove all NDEBUG definitions
      * Remove hacks for BT_LIBCHROME_NDEBUG
      * Removed some removed directories from Makefile such as hcis, brcm, rpc
      
      Coccinelle-assisted:
      
      @@
      @@
      
      - #include "base/logging.h"
      + #include <base/logging.h>
      
      @ assert_included @
      @@
      
      @ base_logging_included @
      @@
      
      @ depends on (assert_included && !(base_logging_included)) @
      @@
      
      - #include <assert.h>
      + #include <base/logging.h>
      
      @ depends on (assert_included && base_logging_included) @
      @@
      
      - #include <assert.h>
      
      @@
      expression E;
      @@
      
      - assert(E);
      + CHECK(E);
      
      And a bash script:
      
      for file in $(find . -name "*.cc"); do
        spatch --sp-file replace_assert_with_CHECK.cocci --in-place $file
      done
      
      The following files are maually edited:
      	btif/src/btif_config.cc
      	btif/src/btif_avrcp_audio_track.cc
      	btif/src/btif_gatt_client.cc
      	osi/src/data_dispatcher.cc
      	osi/src/reactor.cc
      	osi/src/thread.cc
      	osi/src/fixed_queue.cc
      	osi/src/list.cc
      	osi/src/allocation_tracker.cc
      	osi/src/alarm.cc
      	osi/test/wakelock_test.cc
      
      Bug: 31781465
      Test: Code compilation, Unit Tests, BtStressTest, BtFunhausMetricsTest
      Change-Id: I21dc10a45be31665e41441b75b0515ed87523988
      358dd11b
    • Jakub Pawlowski's avatar
      BTA Application registration refactor · 56f33628
      Jakub Pawlowski authored
      This patch replace BTA state machine state associated with registration
      of new application, together with BTA_GATTC_API_REG_EVT, and
      tBTA_GATTC_API_REG. Instead, it uses closure to post registration task,
      and callback for registration event.
      
      Bug: 30622771
      Test: sl4a ConcurrentBleAdvertiserTest GattConnectTest
      Change-Id: I62d68485170ef5472237d62b285353f2c9bc8250
      56f33628
  13. Dec 15, 2016
    • Jack He's avatar
      Change the parameter type of smp_debug_print_nbyte_little_endian · 692219b7
      Jack He authored
      * This function used to take (const uint8_t*) as the second parameter
        and it causes all its calls to cast a (const char*) to this type
      * This patch changes it to (const char*) so no cast needed
      
      Coccinelle-assisted:
      
      @ rule1 @
      type T;
      expression A, B, C;
      @@
      
      smp_debug_print_nbyte_little_endian(A,
      - (T)
      B, C);
      
      and
      
      for file in $(find . -name "*.cc"); do
        spatch --sp-file refactor_smp_print_func.cocci --in-place $file
      done
      
      Bug: 33663033
      Test: code compilation, no user visible effect
      Change-Id: Ibeed0b414514acc4a8e94e47e99117bdb3e454ff
      692219b7
    • Ajay Panicker's avatar
      Remove unused function definitions · e98040c4
      Ajay Panicker authored
      Test: Code still compiles
      Change-Id: I4a86cd3b515ad3da8f852f024952e3f7a85d1071
      e98040c4
  14. Dec 14, 2016
    • Jakub Pawlowski's avatar
      Remove unused btm_set_random_address · 0b3f7c5d
      Jakub Pawlowski authored
      Bug: 30622771
      Test: compilation test
      Change-Id: I0e502fb9b5b2cc3ccad0aa142a0ec9fedea7d1df
      0b3f7c5d
    • Jakub Pawlowski's avatar
      LE Extended Advertising · cf9a76d6
      Jakub Pawlowski authored
      This patch checks if LE Extended Advertising, and LE Periodic Advertising
      features are supported. Also if they are supported, it will read number of
      avaliable advertisers, and maximum advertisement data size supported by
      controller.
      
      Bug: 30622771
      Test: sl4a ConcurrentBleAdvertisingTest
      Change-Id: Iabfda3dd081519ed70c99eb4290667e10790e047
      cf9a76d6
Loading