History log of /system/bt/stack/avrc/avrc_api.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
12265e39b511f28425236b0dc97c78e7d837304b 13-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Fix C/C++ compiler generated warnings

* Remove unused functions: -Wno-unused-function
* Fix logical operations that are missing parentheses:
-Wno-logical-not-parentheses, -Wno-parentheses
* Add missing braces in initializers: -Wno-missing-braces
* Remove unused variables: -Wno-unused-variable
* Fix printf()-like formatting issues: -Wno-format
* Avoid using unitialized variables:
-Wno-maybe-uninitialized, -Wno-uninitialized
* Fix a bug inside bta_gattc_get_gatt_db_impl()
when the processed GATT DB attribute type is unknown.
* Fix warnings about missing field initializers:
-Wno-missing-field-initializers
* Re-implement macro COMPILE_ASSERT(COND) to fix a compilation warning:
-Wno-non-literal-null-conversion
* Fix sign mismatch comparison warnings:
-Wno-sign-compare
* Fix warnings related to enum conversion:
-Wno-enum-conversion
* Fix warnings related to incompatible pointer types:
-Wno-incompatible-pointer-types
* Fix warnings related to enum conversion:
-Wno-enum-conversion

Bug: 26879229
Change-Id: I522931fe156aeab23ae841051a9e25ceab00b1c2
/system/bt/stack/avrc/avrc_api.c
5fe6f0cf6b223e3ed6be4912d55b3ed5b41ce0cd 06-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Removed checks for NULL returns after osi_calloc() / osi_malloc()

Removed explicit checks for NULL pointer returns after calls
to osi_calloc() and osi_malloc(), because those are not needed.
If the memory allocation fails, osi_calloc() and osi_malloc()
will trigger an assert.

Bug: 27048759
Change-Id: I2791eb2f69c08f991f8fcdef10e101a41568cd95
/system/bt/stack/avrc/avrc_api.c
abd70abb5e42c9431df94fe9d2c4a78a0d8d9af9 05-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Replaced osi_getbuf()/osi_freebuf() with osi_malloc()/osi_free()

Removed the alternative buffer allocation osi_getbuf() / osi_freebuf()
and use instead osi_malloc() / osi_free().

Correspondingly, replaced usage of osi_freebuf_and_reset()
with osi_free_and_reset().

Bug: 24914560
Change-Id: I7a9599ba7fa900321f087da684428133eb0ddd6b
/system/bt/stack/avrc/avrc_api.c
ca57b25df827286c4996e17aefc251ecd79b33fc 05-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Removed function osi_get_buf_size()

Refactored code that uses function osi_get_buf_size(), and removed
the need for that function.

Bug: 24914560
Change-Id: I0d002635024a9703acb78f47735aafc957a2b761
/system/bt/stack/avrc/avrc_api.c
20524d393e8b3bea4c573f7980cd843500b0e6a4 03-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Refactor usage of osi_free() and osi_freebuf()

* Allow to call osi_freebuf(ptr) on NULL pointers. This simplifies
the code: a notable number of "if (foo != NULL)" checks are removed.
* Add new function osi_free_and_reset(p_ptr) that frees the buffer,
and explicitly resets the pointer to NULL.
This prevents unintended usage of free memory.
* Add corresponding function osi_freebuf_and_reset(p_ptr)
* Minor cleanup around usages of osi_free() and osi_freebuf()

Also:
* Removed unused function btif_gattc_cleanup()
* Replaced usage of the following functions with osi_freebuf_and_reset()
- mca_free_buf()
- utl_freebuf()
- btif_hl_free_buf()
* Replaced usage of rc_supported_event_free() with osi_freebuf()
* Replaced usage of btif_hl_get_buf() with osi_getbuf()
* Eliminate some of the osi_get_buf_size() calls

Bug: 22948224
Change-Id: Ife860658b26274da6f228d7353cb0f1531587337
/system/bt/stack/avrc/avrc_api.c
f94e67c2d96d25f221e0503f334f4a0a277bc68c 02-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Fix the processing of AVRCP Rcvd Pass Through messages

The assignment and handling of the optional tAVRC_MSG_PASS.p_pass_data
data buffer pointer was inconsistent:
- For originating AVRCP packets, it was assigned to osi_getbuf()
allocated memory.
- For received AVRCP packets, it was a pointer in the middle of the
received data buffer.
However, in the common function avrc_pass_msg(), the p_pass_data pointer
was deallocated by osi_freebuf(). This triggered an assert when processing
AVRCP Rcvd Pass Through messages with non-zero Data Length field.

Bug: 26865159
Change-Id: I1b2eb6713636c290caca16e77226c114d99dcb8e
/system/bt/stack/avrc/avrc_api.c
6b84f291c4edce7e4102efd8d4052a63bcb4b9dc 05-May-2015 Anubhav Gupta <anubhavg@codeaurora.org> Support for A2DP Sink and Proper initialization of profiles

- Register SDP and SEP (Stream End Point) for the profile
whose init is called. We achieve this by making registration
api aware of profile id being called.
- Register A2DP Src + Avrcp Target + Avrcp Controller. We need
to support Absolute Volume as well, so Avrcp Controller is
required here.
- Register A2DP Sink + Avrcp Controller. In this case we do not
support absolute volume. Support would be added in AVRCP
controller change
- Adapter property is updated with profile ID for which init is
called.This is required to make changes in btService for Profile
initialization
- Start listening for incoming AVRCP connection if we have
only AVRCP Controller
- Update default peer_features based on feature mask. In case
of incoming AVRCP connection, SDP will be done later.
In such a scenario default peer features sent to btif should
be based on features-set selected during initialization.
- Drop Control, Meta and Browse commands when TG is not up.
- Not to call AVRCP app callbacks when mentioned service is down.
- Close audio socket on suspend

A2DP Sink: Support for AudioTrack

- implemetation for audiotrack to take care of audio rendering
- support for audio focus state in bluedroid

Bluetooth: Support for Avrcp 1.3 Controller

- support for SDP registration
- support for sending vendor dependant commands
- support for abs vol
- support for receiving vendor dependant response
- serialization of connection and rc_features callback

Avrcp_Ctrl: handling of commands and events for AVRCP Controller

- support of parsing cmd and event pdus
- timeout handling

Change-Id: I1e8d49b087eff6301373e1e90e8d868f15847c34
/system/bt/stack/avrc/avrc_api.c
258c2538e3b62a8cdb403f2730c45d721e5292b4 28-Sep-2015 Pavlin Radoslavov <pavlin@google.com> GKI cleanup - moved GKI buffer allocation wrappers to OSI

* Moved the following GKI buffer allocation functions to OSI:
- GKI_getbuf() -> osi_getbuf()
- GKI_freebuf() -> osi_freebuf()
- GKI_get_buf_size() -> osi_get_buf_size()

For now we need the osi_getbuf() / osi_freebuf() allocation wrapper,
because we need to be able to call osi_get_buf_size() on the allocated
buffer.
In the future those should be replaced with osi_malloc() / osi_free().
Currently, the osi_malloc() buffer size internal allocation tracker
does not always track the size, hence we need the osi_getbuf() wrapper.

* Replaced GKI_MAX_BUF_SIZE with BT_DEFAULT_BUFFER_SIZE

* Added new file include/bt_common.h that can be usee to include
few files that should be included alost everywhere (e.g. bt_target.h"
NOTE: This file might be removed in the future and we should include
everywhere the right set of header files.

* Removed some of the GKI-related references

* Removed file include/gki_target.h

Change-Id: Ie87830e73143de200746d54235aa99f228a95024
/system/bt/stack/avrc/avrc_api.c
70ae7de9451e3dc074a048ba98b672a6ba3a4551 23-Sep-2015 Pavlin Radoslavov <pavlin@google.com> GKI cleanup - Remove GKI pool related defines

* Removed pool ID related defines
* Updated / renamed / cleanup buffer size related defines
* Added new #define BT_DEFAULT_BUFFER_SIZE
* Removed unused defines

Change-Id: Ib1fbf463d1e6fda2c71631347de0c365a37ba5ce
/system/bt/stack/avrc/avrc_api.c
2e3d006b96eafb0651fe7f78d28250faf89405de 18-Sep-2015 Pavlin Radoslavov <pavlin@google.com> GKI cleanup - Eliminate usage of pool buffers

* Replace usage of function GKI_getpoolbuf() with GKI_getbuf()
* Remove usage of function GKI_poolutilization()
* Remove usage of function GKI_poolfreecount()

Change-Id: Ide938192b878bbfb4912642c903fce548f2b5368
/system/bt/stack/avrc/avrc_api.c
8d88b1b75c665772f714643a71e5974c7f6dd02c 07-Aug-2015 Satya Calloji <satyac@broadcom.com> Allocate large enough buffers when copying AVRC packets

AVRC response is created by copying the original received packet.
When allocating a buffer for the response, the buffer length
should be large enough to contain the response.

Bug: 22437809
Change-Id: I862d633e76d3c5221582459f19935a45e53577c7
/system/bt/stack/avrc/avrc_api.c
2ac9ae06be5091f6f2eef0022a3810752f127d04 24-Jul-2015 Anubhav Gupta <anubhavg@codeaurora.org> Fix a bug allocating buffers for fragmented AVRC packets

Use the correct offset_len when allocating buffers for AVRC
packets that need to be fragmented.

Bug: 22156175

Change-Id: I7db12474c84edacb4f0739d50a43e8cebdcca676
/system/bt/stack/avrc/avrc_api.c
08c08fc0015c3c5e864da080dba0712ee89a6712 10-Jul-2015 Pavlin Radoslavov <pavlin@google.com> Fix a bug when responding to AVRCP UNIT_INFO and SUBUNIT_INFO

Assign appropriately the p_rsp_data pointer to point in the
buffer with the response.

Bug: 22307858
Change-Id: I2f77f290ff2c62c09b3be18ff047167a48c7c9d4
/system/bt/stack/avrc/avrc_api.c
3a2fa83dac1b07b661a20e2412aad9bf81492106 26-Jun-2015 Pavlin Radoslavov <pavlin@google.com> Copy an AVRC packet before sending a response back

Don't reuse AVRC buffers for responding back. Apparently,
in the AVRC packets we transmit the offset with the payload must
be at least 15 octets. If the original buffer is not large enough,
this results in memory corruption.

Also, use an explicit check for 'bt_rc_ctrl_callbacks' as a workaround
until the upper layer does the right thing with the callbacks registration.

Bug: 22006014

Change-Id: I28c248d1580bdddbda76298d19faadf8985187fc
/system/bt/stack/avrc/avrc_api.c
46d706a9849dcd027d562200a0a43e6e9156aceb 07-Nov-2014 Mallikarjuna GB <gbmalli@codeaurora.org> Fix issues in A2dp, Avrcp, HF and AG reported by static analysis tool

- Fixes to validate Array Index Value and Null Pointer
Dereference reported by static analysis tool.

Change-Id: Id1492315f68378fdcfa517bd0a5cacefc8ebfddb
/system/bt/stack/avrc/avrc_api.c
56a3be0d6eaa1bc264736e399fb32d3094f0b513 02-Jun-2015 Pavlin Radoslavov <pavlin@google.com> Replace malloc/calloc/free with osi_malloc/osi_calloc/osi_free

There were several leftover places that were still using
malloc/calloc/free .
Those are replaced to use osi_malloc/osi_calloc/osi_free like
majority of the rest of the code.

Note: There are few remaining places that are still using
malloc/calloc/free:
* Some of the unit tests
* audio_a2dp_hw/audio_a2dp_hw.c
It is used as part of the audio.a2dp.default.so library,
and the bluetooth.default.so library
Its usage of malloc/calloc/free should be refactored
independently.

Change-Id: Iafbed996e5f1ae8eb1343fb2acfadf32e515e419
/system/bt/stack/avrc/avrc_api.c
181932fad8b91dc6831222e5b616574c39a21565 29-Dec-2014 Sharvil Nanavati <sharvil@google.com> Eliminate unusable wcassert code in favor of plain old C asssert.

The WC_* macros only expand to something meaningful when _DEBUG is
also defined. However, on enabling _DEBUG, bluedroid fails to build
because the wc_assert function is not defined anywhere. We can get
what I imagine is the equivalent behavior by switching over to the
standard C assert macro.
/system/bt/stack/avrc/avrc_api.c
b44cc59d286ad255e872c60df02e032bd8d9d75b 04-May-2014 Sharvil Nanavati <sharvil@google.com> Logging cleanup: AVRC, MCA, GATT, and SMP.

Change-Id: I6d1e61ff023b5fd19f144955cff16831cc18c6e6
/system/bt/stack/avrc/avrc_api.c
6dae552ef8d82b30fa66efab9c6f75644a805bbe 18-Apr-2014 Sharvil Nanavati <sharvil@google.com> Eliminate warnings, add -Wall and -Werror to all projects.

This change enables all warnings and treats warnings as errors. As
a result, nobody should be able to submit new code to bluedroid
that contains compiler warnings. Instead, they should fix the warnings
before submitting.

This change has already caught a type mismatch bug in
stack/avrc/avrc_api.c where an integer was being stored in a boolean.

Change-Id: Ic41960754b39a1a6aa37f1c1095003195f466183
/system/bt/stack/avrc/avrc_api.c
d2ccbbb73c7851d2fa28dc212d2fffc0ad4e5d50 13-Apr-2014 Sharvil Nanavati <sharvil@google.com> Remove executable bit on source files.

Change-Id: Id456478aea626f57fed3479346e8fb4dbd0fafa6
/system/bt/stack/avrc/avrc_api.c
247c68fe6eee3660cbdcf4509195fe735ae25573 01-Aug-2013 Satya Calloji <satyac@broadcom.com> Add support for AbsoluteVolume

Add support for AbsoluteVolume in BTIF
bug 9595622

Change-Id: I11b707f6ab50d31bd11e879b0ebe5ad5bac54ad9

Conflicts:
btif/src/btif_rc.c
/system/bt/stack/avrc/avrc_api.c
9adddf4965e9ddb01e339b934c343fcbd842a977 06-Mar-2013 Ravi Nagarajan <nravi@broadcom.com> Initial version of Stack for AVRCP 1.3

BTIF and stack changes for supporting AVRCP 1.3

Change-Id: Id02eb7b6a385683cedc41c62b6f829f5d7620bd4
/system/bt/stack/avrc/avrc_api.c
5738f83aeb59361a0a2eda2460113f6dc9194271 13-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot cdeccf6fdd8c2d494ea2867cb37a025bf8879baf

Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d
/system/bt/stack/avrc/avrc_api.c