Skip to content
Snippets Groups Projects
  1. Jan 18, 2017
    • Treehugger Robot's avatar
    • Sanket Agarwal's avatar
      HF CLIENT BTA: Reduce logging for non-allocated blocks · 2134bb66
      Sanket Agarwal authored
      Bug: b/33552136
      Test: adb shell dumpsys bluetooth_manager
      Change-Id: I3cb6c28bffe6b335cf82cac63dc78ce4957d78f4
      2134bb66
    • Hemant Gupta's avatar
      HID: Prevent crash by Cancelling SDP during cleanup · 10008bcd
      Hemant Gupta authored
      Usecase:
      1) User tried to connect to HID Device.
      2) SDP is internally performed by DUT. SDP is at stage,
         where L2CAP connection, configuration is done, and data
         fetch is ongoing.
      3) BT was turned off from UI.
      Observation:
      BT crashed while accessing memory that was freed already because BT turn off,
      caused ACL disconnection, leading to L2CAP disconnect indication in stack,
      leading to sdp disconnect indication.
      backtrace:
          #00 pc 000f98d4  /system/lib/hw/bluetooth.default.so (SDP_FindServiceUUIDInDb+51)
          #1 pc 000b5dbd  /system/lib/hw/bluetooth.default.so (hidh_search_callback+0x40)
          #02 pc 000f770b  /system/lib/hw/bluetooth.default.so (sdp_disconnect_ind+0x5e)
          #03 pc 00107a5f  /system/lib/hw/bluetooth.default.so (l2c_csm_execute+3446)
          #04 pc 001080e7  /system/lib/hw/bluetooth.default.so (l2c_link_hci_disc_comp+122)
          #05 pc 000fda81  /system/lib/hw/bluetooth.default.so (btu_hcif_process_event+588)
          #06 pc 000fec81  /system/lib/hw/bluetooth.default.so (btu_hci_msg_ready+96)
          #07 pc 00118191  /system/lib/hw/bluetooth.default.so
          #08 pc 0011917f  /system/lib/hw/bluetooth.default.so
          #09 pc 00041993  /system/lib/libc.so (_ZL15__pthread_startPv+30)
          #10 pc 000192b5  /system/lib/libc.so (__start_thread+6)
      Register Dump
      pid: 15740, tid: 15761, name: bluedroid wake/  >>> com.android.bluetooth <<<
      signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20000
          r0 815a5cac  r1 a1a2f370  r2 00000000  r3 85d4e541
          r4 00020000  r5 815a5cac  r6 a1a2f370  r7 b6d3ae40
          r8 00000000  r9 b6d3ae40  sl 00000002  fp 00000013
          ip a228c050  sp a1a2f360  lr a20eddc1  pc a21318d4  cpsr 200e0030
      Rootcause
      The above scenario could lead to crash we see as below, as bta_hh_cb.p_disc_db would be freed
      during HID Host cleanup, and would be accessed via callback received for parsing SDP results on
      SDP completion.
      Fix:
      While cleaning up HID Host, Cancel SDP search before freeing and resetting bta_hh_cb.p_disc_db.
      This will internally send L2CAP disconnect request for SDP, and would lead to sdp_disconnect_cfm
      call when L2CAP is disconnected, and would lead to call of hidh_search_callback with result code
      as SDP_CANCEL.
      
      Change-Id: I63563cb23dd69946f87a70cafa203c44edc9b753
      10008bcd
  2. Jan 17, 2017
  3. Jan 11, 2017
    • Pavlin Radoslavov's avatar
      Removed the feeding_init call from tA2DP_ENCODER_INTERFACE · 3e6ec10a
      Pavlin Radoslavov authored
      The feeding_init call is not used anymore - it has been superseded
      by the newer A2dpCodecs.setCodecAudioConfig() mechanism.
      
      Also, moved aptx_init_framing_params() and aptx_hd_init_framing_params()
      calls to the corresponding encoder_update functions.
      
      Test: A2DP streaming to Bluetooth headsets
      Change-Id: I52f42b4701d04fe2ddb8f115bb9cd57fe38e2b38
      3e6ec10a
  4. Jan 10, 2017
  5. Jan 09, 2017
  6. Jan 06, 2017
    • Pavlin Radoslavov's avatar
      Renamed the aptX and aptX-HD shared libraries · 4fd1b4b2
      Pavlin Radoslavov authored
      * The names of the expected aptX and aptX-HD shared libraries are
        updated to reflect better their purpose:
        - aptX: libaptX.so -> libaptX_encoder.so
        - aptX-HD: libaptXHD.so -> libaptXHD_encoder.so
      
      Also:
      * Add a missing upcall with the codec info the first time the codec
        is selected internally
      * Minor cleanup
      
      Bug: 30958229
      Test: A2DP streaming to aptX/aptX-HD headsets
      Change-Id: Ib2bfc83823190fb7a057353eb47cd71c5b4d5a3a
      4fd1b4b2
  7. Jan 05, 2017
    • Treehugger Robot's avatar
    • Treehugger Robot's avatar
      37098bbf
    • Pavlin Radoslavov's avatar
      Integration of the LDAC codec for A2DP source · be1851c4
      Pavlin Radoslavov authored
      The codec can be used if the encoding shared library is installed
      on the device:
       libldacBT_enc.so
      
      Also, increased the maximum number of SEPs AVDT_NUM_SEPS from 3
      to 6 to accomodate Sink devices that support more than 3 codecs.
      
      Test: A2DP streaming to LDAC headsets
      Bug: 30958229
      Change-Id: I114c3e6be2ebe1ac8aece62a3146637d37cd938e
      be1851c4
    • Treehugger Robot's avatar
      Merge "Add LeakyBondedQueue to libosi" · 57480eda
      Treehugger Robot authored
      57480eda
    • Treehugger Robot's avatar
    • Jack He's avatar
      Fix A2DP metrics session duration · 777228ae
      Jack He authored
      * Fixed A2DP duration counting. It is now counting from music play start
        to music play end.
      * Start logging a2dp connection as Bluetooth sessions. Currently, only
        A2DP connections are logged. Thus the bluetooth session length will be
        the total connection length and the length within A2DP session message
        will be the audio connection length.
      * Add a audio_duration_millis field in A2DPSession to record audio duration
      * Add bonded memory constraint for metrics entries
      * Use a builder mechanism to only build metrics upon dumping
      * Refactor metrics module into BluetoothMetricsLogger class
      * Created unit test for BluetoothMetricsLogger
      
      Bug: 33694310
      Test: Code compilation, Unit test, BtFunhausMetricsTest
      Change-Id: Iea2a997c4ea074687a5d50860e9229f0e1b82659
      777228ae
    • Jack He's avatar
      Add LeakyBondedQueue to libosi · 4ad0b2ba
      Jack He authored
      * LeakyBondedQueue is a fixed size queue that leaks oldest item when
        reaching its capacity. This is useful in creating memory bonded data
        structure where freshness is more important than full coverage.
      * The queue is protected by a simple mutex and is thread-safe, although
        improvements could be made to lock enqueue and dequeue separately, it
        is not implemented at this moment due to lack of demand
      * The queue uses unique_ptr to automatically free its content when it is
        destructed
      * Add several tests to verify its API and memory management
      * This data structure will be firstly used in the metrics module
      
      Bug: 33781460
      Test: Code compilation, unit tests
      Change-Id: I51cb73666ac58e4792d9cba0d6f16dad30a0ff39
      4ad0b2ba
    • Pavlin Radoslavov's avatar
      Integration of the aptX and aptX-HD codecs for A2DP source · 716335b2
      Pavlin Radoslavov authored
      Each of the codecs can be used if the corresponding encoding
      shared library is installed on the device:
       - aptX: libaptX.so
       - aptX-HD: libaptXHD.so
      
      Test: A2DP streaming to aptX and aptX-HD headsets
      Bug: 30958229
      Change-Id: I1ca36da653721576f5a5b6bdac186b9ea2790c85
      716335b2
  8. Jan 04, 2017
    • Ruchi Kandoi's avatar
      scripts: modify change_types.sh to skip matching "<data type>_" · 5de98b4f
      Ruchi Kandoi authored
      
      Script erroronously modifies UINT8_TO_BE_STREAM() to
      uint8_t_TO_BE_STREAM(). Modidy the script to prevent that.
      
      Test: Manual; Run the script on system/nfc
      Change-Id: I9e130b8eb79e400282233fad7da206b4bb1301af
      Signed-off-by: default avatarRuchi Kandoi <kandoiruchi@google.com>
      5de98b4f
    • liuchao's avatar
      Fix an inappropriate sscanf return value judgment · e2d64d8a
      liuchao authored
      This fixes an inappropriate sscanf return value judgment that
      res check here is not needed while res2 is the one that need to be checked
      
      Test: mm -j 8
      Change-Id: I3e332286c9434d5b9d01421f5f421039f84ad6c7
      e2d64d8a
    • Ivan Podogov's avatar
      Make HID Device service independent from HID Host. · 12ad6378
      Ivan Podogov authored
      By default, enabling the HID Device service is only possible
      during disabling the HID Host service. If, on the other hand,
      the HID Host service was never initialized, then a request to
      enable the HID Device service should just be executed
      immediately.
      
      Test: manual, on a device without the HID Host profile.
      Change-Id: I2ab4b8aec413b66d57eb322d38660f1b4c48ba32
      12ad6378
    • 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
Loading