Skip to content
Snippets Groups Projects
  1. Feb 06, 2017
    • Jakub Pawlowski's avatar
      Use new event type in BLE scan · 16239bfe
      Jakub Pawlowski authored
      Right now new event_type in scan result is translated to legacy
      one and used through whole stack. This patch make use of new event_type
      through whole stack instead.
      
      Bug: 30622771
      Test: sl4a FilteringTest
      Change-Id: I7420c040b8c54fae00262c939bcabc6c6fcb16e6
      16239bfe
    • Jakub Pawlowski's avatar
      BLE Advertising Manager test improvements · 4c85e3d7
      Jakub Pawlowski authored
      This patch moves mock verification before call to callback. If for any
      reason the callback is not properly initialized, this is usually due to
      fact that the call didn't reach the mock. Right now in such cases we get
      a crash and stack trace. After this patch we will first get information
      about the mock not being called properly, then the crash, which would
      make debugging such issues much easier.
      
      Bug: 30622771
      Test: manual test
      Change-Id: Ia182f2eed384924395e8d6b6a2d3d0abd393a4ee
      4c85e3d7
  2. Feb 03, 2017
  3. Feb 02, 2017
  4. Feb 01, 2017
    • Ajay Kumar's avatar
      Handled invalid MTU Size in L2cap Process Commands · cf5c4293
      Ajay Kumar authored
      Use case: Execute the L2CAP test suite on Codenomicon tool
      
      (1)From tool Codenomicon Defensics 11 menu Utilities > Bluetooth Scan,
      paired Bluetooth between pc and phone.
      (2)From Defensics 11 Settings ,choose paired phone Bluetooth to be
      Target Bluetooth device address in Basic configuration.
      (3)Run the test case " Security - l2cap ".
      (4)When run to the number 28, 29 test case,check the phone. BT turn
      off and turn on
      
      Failure: BT crash observed due to invalid MTU packets from test tool
      
      Root cause: L2CAP is not validating packets in L2CAP Process Commands
      
      Fix: Fixed by sending reject CMD for invalid commands from tool
      
      Test: code compilation.
      
      Change-Id: I8c503ab77d8fca3728a84c3457d8115e31ee3a13
      cf5c4293
    • Pavlin Radoslavov's avatar
      Add memory allocation statistics to the Bluetooth dumpsys output · 64c30931
      Pavlin Radoslavov authored
      The following memory allocation statistics are added to
      the "dumpsys bluetooth_manager" output.
      Those are tracking the allocations that are using the OSI malloc mechanism:
      osi_strdup() / osi_strndup() / osi_malloc() / osi_calloc() / osi_free()
      
      Bluetooth Memory Allocation Statistics:
        Total allocated/free/used counts : 4063 / 3323 / 740
        Total allocated/free/used octets : 922460 / 607941 / 314519
      
      Test: Running "adb shell dumpsys bluetooth_manager"
      Change-Id: Ibe1d28ec3a2acfd87cfaa10e5902ef3b596e64a8
      64c30931
  5. Jan 31, 2017
    • Pavlin Radoslavov's avatar
      Update the A2DP Codec Config API · d26099b8
      Pavlin Radoslavov authored
      Previously, the JNI upcall would contain only the current codec config.
      In the new API, the upcall contains:
       1. The current codec config
       2. The list of codecs containing the local codecs capabilities
       3. The list of codecs containing the selectable codecs capabilities.
          This list is the intersection of the local codecs capabilities
          and the capabilities of the paired device.
      
      Also, updated the codec backend to accomodate the above changes:
       * Update all selectable codecs inside bta_av_co_audio_set_codec()
       * Changed getCodecConfigAndCapabilities() to return current codec
         config, local codecs capabilities, and selectable codecs capabilities.
       * Updated each codec to compute and store a copy of the selectable
         capabilities, and the local capabilities.
       * Updated tA2DP_SBC_CIE to include new field bits_per_sample
         (for consistency with the rest of the codecs).
       * Replaced usage of codec_priority of 0 with BTAV_A2DP_CODEC_PRIORITY_DEFAULT
       * If there is user codec (re)config call, we always send an upcall
         to inform the Java layer about the most recent codec info.
         Thus, the caller would always know whether the request succeeded or failed.
      
      Test: A2DP streaming with headsets and switching the codecs
      Change-Id: Ie7a5cd5c2ab01bb8676032be05bc2ad03baa1e3f
      d26099b8
  6. Jan 26, 2017
    • Stephen Li's avatar
      Merge commit '94dfdae0' into master. · e740bde6
      Stephen Li authored
      This is because patchset 1 of change 328081 got merged in to the branch
      and not patchset 2, despite what gerrit UI says. This is a known error
      and is being worked on.
      
      Change-Id: If4f6f3d705e93f03d120c6441e16e9b0afc3d9ca
      e740bde6
    • Treehugger Robot's avatar
      Merge "Remove HC_BUFFER_HDR_T" · e9bd2427
      Treehugger Robot authored
      e9bd2427
    • Andre Eisenbach's avatar
      Remove HC_BUFFER_HDR_T · 94dfdae0
      Andre Eisenbach authored
      Test: compiles
      Change-Id: Ia5bf3395bd5a18a27168f05a0a2239a37ddb2c2c
      94dfdae0
    • Pavlin Radoslavov's avatar
      Integration of the AAC codec for A2DP source · 262b15dd
      Pavlin Radoslavov authored
      Also:
       - Implemented data fragmentation inside bta_av_data_path()
         that is RTP compatible.
       - Do not use the codec_type when composing the RTP payload type
         per RFC 3016, Section 4.2. That value doesn't have actual meaning
         in the context of the Bluetooth supported codecs, and is ambiguous:
         all vendor codecs map to the same value 0xFF.
       - Updated support function A2DP_BitsSet() so it works for
         up to 64-bit integers.
       - Updated a log message inside l2c_data_write() to print
         packet length and peer MTU on error.
      
      Test: A2DP streaming to AAC headsets
      Bug: 30958229
      Change-Id: I1b530f1c5c495b8231fd68bed788d4567096683d
      262b15dd
  7. Jan 25, 2017
    • Treehugger Robot's avatar
      b2a08c86
    • Treehugger Robot's avatar
    • Srinu Jella's avatar
      Update UUIDs immediately on NVRAM · dd62d8e4
      Srinu Jella authored
      As the BTIF config updation have delay in writing items
      to the NVRAM, some times there is a chance of not updating
      incase of battery removal happens before the actual write onto
      NVRAM.
      
      As SDP UUIDs is important data to store, it will update
      immediately onto NVRAM.
      
      Test: manual
      
      Change-Id: I6637dc326f3a53211a5bbf988a2dca1020203128
      dd62d8e4
    • Andre Eisenbach's avatar
      Remove HC_BUFFER_HDR_T · 103d9988
      Andre Eisenbach authored
      Test: compiles
      Change-Id: Ia5bf3395bd5a18a27168f05a0a2239a37ddb2c2c
      103d9988
    • Ivan Podogov's avatar
      HID: Fix forced disconnection flow. · 1bbba112
      Ivan Podogov authored
      In some cases, we end up in a state where we can neither
      connect nor forcefully end connection, and will require disabling
      the Bluetooth adapter to fix this state.
      
      When a device is taking too long to connect (or out of range),
      the user may want to cancel the connection by calling disconnect
      method, which will be ignored in any state other than
      BTA_HD_CONN_ST. It is a lot better to immediately cease the
      connection process at this point, so:
      - BTA_HD_API_DISCONNECT_EVT is now not ignored in BTA_HD_IDLE_ST;
      - bta_hd_disconnect_act now reports a correct MAC address during
          disconnection (it used to send 00:00:00:00:00:00 before);
      - HidDevDisconnect now allows to forcefully end the connection,
          and does it in exactly the same way we handle the errors.
      
      When L2CAP connection fails, both hidd_l2cif_config_ind and
      hidd_l2cif_config_cfm set conn_state to HID_CONN_STATE_UNUSED,
      which is immediately overwritten by the hidd_conn_disconnect call
      (it will set conn_state to HID_CONN_STATE_DISCONNECTING, because
      ctrl_cid != 0 in both cases), thus making any subsequent calls to
      connect failing with "already connecting" error. More than that,
      all functions send the HID_DHOST_EVT_CLOSE event when failing,
      which is, again, ignored in the BTA_HD_IDLE_ST state. So:
      - BTA_HD_INT_CLOSE_EVT is now not ignored in BTA_HD_IDLE_ST;
      - conn_state is set to HID_CONN_STATE_UNUSED after the call to
          hidd_conn_disconnect, but before sending the close event.
      
      Test: Build, run, connect/disconnect multiple times.
      Change-Id: I85bb03f760bb9a6fd4c1b944d515232c1be12300
      1bbba112
  8. Jan 24, 2017
    • Jack He's avatar
      Corrected default value assignments in Bluetooth A2DP Metrics · 723bef8e
      Jack He authored
      * In certain cases btif_a2dp_source_stop_audio_req() could be called before
        btif_a2dp_source_start_audio_req() is called, resulting in session_start_us
        to be 0. In this case, audio_duration_ms = time_get_os_boottime_us() - 0
        will be a very large number that is not the actual audio duration. This
        CL marks audio_duration_ms as -1 in the above situation so that we can
        differentiate between valid and invalid audio durations
      * Set default timer and counter values to 0 when
        tx_queue_dequeue_stats.total_updates > 1
      * Move update_scheduling_stats for tx_queue_enqueue_stats to
        btif_a2dp_source_audio_handle_timer as we intend to capture the time
        intervals for enqueue scheduling instead of time intervals between
        frame enqueue (i.e. one scheduling event can enqueue multiple frames)
      * Use tx_queue_enqueue_stats for metrics instead of *dequeue* since only
        enqueue is triggered by timer event
      
      Bug: 33694310
      Test: Code compilation, BtFunhausMetricsTest
      Change-Id: I10984920afd4d77f07a5ac75736f8dcd69b13af8
      (cherry picked from commit aa79f0fb)
      723bef8e
  9. Jan 23, 2017
    • Jakub Pawlowski's avatar
      Add advertising handle zero quirk · f33ade65
      Jakub Pawlowski authored
      Some controllers are strict about VSC handle mapping, and don't allow
      using zero value.
      
      Test: manual test
      Change-Id: Ia2df17af16e0e4da375d6e7d5b5f882ced508ce9
      f33ade65
    • IHLHO KIM's avatar
      Fix the GATT server and HOGP disconnect · 63ec7bf6
      IHLHO KIM authored
      GATT server disconnect and HOGP disconnect are not working after the
      following commit: bd9e1ef1.
      
      ‘BTA_GATTS_CancelOpen’ makes ‘gatt_update_app_hold_link_status’
      return FALSE value. As a result, ‘BTA_GATTS_Close’ cannot disconnect
      the link. The sequence has to be changed like GATT client.
      
      And the above mentioned fix removed ‘found’ checking routine in
      ‘gatt_update_app_hold_link_status’.
      
      It makes two app hold links with same gatt_if when HOGP is connected and
      background connection is added. But HOGP disconnect removes only one held
      link. So HOGP is never disconnected.
      
      The ‘found’ checking routine has to be rolled back.
      
      Test: manual
      Change-Id: Ibea825b5cc844195f0cf4a30cbcca831880c9088
      63ec7bf6
  10. Jan 21, 2017
    • Jakub Pawlowski's avatar
      Fix advertising timeout behaviour. · db12bf15
      Jakub Pawlowski authored
      When advertising is enabled with timeout, enable callback was not
      called. Also we were not scheduling the disable operation after the
      timeout passes. This patch fixes that. It also make sure that the
      timeout callback is called on proper thread.
      
      Bug: 34440704
      Test: sl4a ConcurrentBleAdvertising:test_timeout
      Change-Id: I233c2692c690f55ef6243325640e48b37818c9d5
      db12bf15
  11. Jan 20, 2017
    • Treehugger Robot's avatar
    • Treehugger Robot's avatar
      Merge "Synchronize hl data operations" · 67302a08
      Treehugger Robot authored
      67302a08
    • Nagarjuna Kristam's avatar
      Update error check for LE read remote feature event · c1c2c3fd
      Nagarjuna Kristam authored
      When a BLE remote read remote feature complete event is received
      initial commands flow is proceeding if error code is not connection
      failed to establish (0x3E). Instead, the flow should fail on any
      error.
      
      Test: Re-connection stress tests with LE device
      Change-Id: I4ab80b6601f5f852fcf8da2911807438584fd3f4
      c1c2c3fd
    • Kamal Negi's avatar
      Set alarm's queue to NULL on alarm expired · 18e86afd
      Kamal Negi authored
      Use Case: Repeated BT ON/OFF
      
      Failure: ANR due to race condition between random advertisement
      address generation completion(adv_raddr_timer) and BT shutdown.
      
      Steps: SNS Stress testing.
      
      Root Cause: Race condition happens between random advertisement
      address generation completion(adv_raddr_timer) and BT shutdown.
      
      Fix:  For non-periodic alarms, set alarm's queue to NULL once alarm
      expired.
      
      Test: mm -j8
      
      Change-Id: Idf8e2bebdc2ca7621aef06dd5f2075ef2c5fa08c
      18e86afd
    • Srinu Jella's avatar
      Synchronize hl data operations · 4b18c526
      Srinu Jella authored
      Use Case: BT crash seen while transferring data
      using HDP APP to remote health device.
      
      Steps:
      1. Pair with HDP device
      2. Run HDP APP and transfer data to Remote HDP device.
      
      Failure: BT automatically resets and recovers.
      
      Root Cause: Synchronize BITF HL free buffer as simultaneously
      free buffer from BTIF and BTU thread lead to sigabort.
      
      Fix: Validate Tx packet before memcpy as it can be free
      from different thread.
      
      Test: mm -j8
      Change-Id: I566f62ce02c8e95c9f4b8d7155132e4434657f66
      4b18c526
    • Satish Kodishala's avatar
      Bluetooth: Handle get RSSI timeout gracefully · 72728794
      Satish Kodishala authored
      Usecase:
      1. Turn ON BT
      2. Pair and connect with Headset
      3. Play Music over A2DP
      4. Make GetRssi timeout
      5. Bt app crashes
      
      Failure:
      BT app crashes.
      
      Rootcause:
      Calling callback with NULL and in callback handling NULL check with assert.
      
      Fix:
      Call the callback with error instead of NULL.
      
      Change-Id: I20a9e504a513697945cd76d218ec12a0ef1e3330
      72728794
    • Sanket Agarwal's avatar
      BTA HF CLIENT: Unset initial SCO value · 35b01a9a
      Sanket Agarwal authored
      Initialize the block with invalid SCO state so that while allocating the
      if condition does not ignore the block. This was causing the stack to
      not initiate a SCO connection to the remote (AG role)
      
      Bug: b/33555377
      Test: Check for SCO initialied on audio call
      Change-Id: I3f5619c69288483bfa45c2a1adcf22008e353841
      35b01a9a
    • Jack He's avatar
      Fix A2DP Metrics Logging Capacity · 9bebcc06
      Jack He authored
      * Set the maximum number of wake events logged to 1000
      * Stop logging wake log name as it takes too much memory
      * Add counters for each of the repeated values in BluetoothLog so that
        the true number of events can be determined while oldest event get
        dropped
      * Log Bluetooth session disconnect reasons using enum instead of string
        in order to save memory usage
      * Apply other branch changes to bluetooth.proto on system/bt
      
      Bug: 33694310
      Test: Code compilation and unit tests
      Change-Id: I2cc6f9304725938b63b211d615eb1941eac60edf
      (cherry picked from commit 7ab4b59672013eddcb706e288962ab7309a75628)
      9bebcc06
  12. Jan 19, 2017
Loading