History log of /system/bt/btif/src/btif_rc.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
eff259b0cef8a76b4bd32945feeee7133da2ed56 23-Jun-2017 Marie Janssen <jamuraa@google.com> btif: Pass UIDs changed up to the Java layer

Previously we were simply responding with an INTERIM response and
leaving it at that.

Test: connect to BMW kit and check that interim is sent from Java
Bug: 62775732
Change-Id: Idb7de4417438f0c9697ee5c838b511cdd2223e80
(cherry picked from commit 3d7c99dc6db3f2a0392a0b273140eb03e0050ee5)
(cherry picked from commit 39f664e629bf0727792d4670229d5dcb595c6c0a)
/system/bt/btif/src/btif_rc.cc
a43e1304c2cbca16d583e08b63cb4c95a37b7b87 08-May-2017 Jack He <siyuanh@google.com> eSCO: Format changes to original vendor patch (4/5)

* Format changes to original vendor patch
* Re-order part of SCO creation code to improve readability
* Make log more concise and usefull

Bug: 19540029
Test: make, HFP PTS test, testplans/86884, testplans/87103
Change-Id: Ie0199519afb30f56568c04fef728fce44a172063
(cherry picked from commit fe695a557a92053d4c44428ba08c0b8e945d4711)
/system/bt/btif/src/btif_rc.cc
b3a848a2cb653ff37aadf84c788d6851b8a5cdc6 14-Apr-2017 Marie Janssen <jamuraa@google.com> btif: GetItemAttributes can return no attributes

If there are no attributes available, it's possible to return zero
attributes from a GetItemAttributes request.

This is triggered by some carkits who are unhappy when they only get
titles back (the only required item) and ask for the rest of the
attributes (which we don't have).

Test: connect to honda carkit and get snoop logs to confirm
Bug: 36055995
Bug: 35956792
Change-Id: I5a31e206565d212e456111d8c6b542c7a1569e5a
(cherry picked from commit 840f4f3de98c7d6c83abae89f0b41990bc56fef4)
/system/bt/btif/src/btif_rc.cc
ae0148c1f94858856e557293785993dc3ea4a285 07-Mar-2017 Tsuyoshi Kamata <tsuyoshi.x.kamata@sonymobile.com> AVRC: Configure absolute volume to false if remove device not support it

Some AVRCP(ver>1.4) devices don't support absolute volume, when connected
to such device, volume control doesn't work properly on phone.

This patch fix the problem as bellow:
- check category of remote device
when add absolute volume feature flag.
- remove absolute volume feature flag
if remote device responses REJECT or NOT_IMPLEMENT.

Bug: 33441894
Test: manual
Change-Id: Icfd6f61699490efd937fa6d2383f333eb0f0144a
(cherry picked from commit a4fcd238aedee87384fa164e9465302aa4b69035)
/system/bt/btif/src/btif_rc.cc
e4b63ad37645ada5a4b3f028db83f95038c14b82 13-Apr-2017 Hemant Gupta <hemantg@codeaurora.org> AVRCP TG: Get Item Attribute command not working

Usecase:
1) Connect from carkit supporting AVRCP 1.4/1.5 CT to DUT
2) Issue get item attribute command with valid attribute list.

Expected behaviour:
Get item attribute command succeeds and returns the requested
attributes of particular item

Observed result:
Get Item attribute command fails with BAD Param Error

Root Cause:
Wrong structure from tAVRC_COMMAND was being passed to fill_attribute_id_array
which was leading to error being returned.

Fix:
Use get_attrs of type tAVRC_GET_ATTRS_CMD instead of get_elem_attrs of type
tAVRC_GET_ELEM_ATTRS_CMD when remote device requests for get item attributes.

Test: Checked that now bad param error is not returned in response for
get item attribute command from remote device.

Bug: 37302234
Bug: 36055995
Change-Id: I9245f726f37ffd666d143d2232dac868a2cc3268
(cherry picked from commit 6510a471696f24a051b79ca9fd7a210bf7e293bc)
/system/bt/btif/src/btif_rc.cc
627e8282267dfe4ff7ae4f9c4dd96d92bac55d17 31-Mar-2017 Bailey Forrest <bcf@google.com> AVRCP CT: Only call handle_rc_features if target registered

If target is not registered, handle_rc_features would clear feature
flags before handle_rc_ctrl_features can use them.

Bug: b/35807779
Test: AVRCP controller track info works on iOS.
Change-Id: Iee781f2fc926a053ba9cf30089d3a49e56b94539
(cherry picked from commit 7745e29576703a84f4a6b47f13b3cec068033e28)
/system/bt/btif/src/btif_rc.cc
c338fe868cc78fca87d3827b568b0a997f575642 01-Feb-2017 Marie Janssen <jamuraa@google.com> btif: remove logspam at higher debug levels

Some CHECK macros had logs that printed the function name, which
duplicated the logs in the functions outside the checks, producing too
many logs.

Remove some unused macros.

Changes:
02-01 09:34:11.757 1259 1755 D bt_btif : get_folder_items_list_rsp
02-01 09:34:11.757 1259 1755 D bt_btif : get_folder_items_list_rsp: item_cnt: 0 len: 0
to
02-01 09:34:11.757 1259 1755 D bt_btif : get_folder_items_list_rsp: item_cnt: 0 len: 0

and similar.

Test: run logcat, check that we have less duplicated logs
Change-Id: Id6e57f38b34d176ed8be0c3baedfbcf55e61a9a4
/system/bt/btif/src/btif_rc.cc
d008a8a6188d6797273f53c8f16ee775833a7d37 19-Dec-2016 Sanket Agarwal <sanketa@google.com> AVRCP CT: Register for UUIDS Changed

-- 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
/system/bt/btif/src/btif_rc.cc
911d1ae03efec2d54c3b1b605589d790d1745488 29-Nov-2016 Myles Watson <mylesgw@google.com> Apply clang-format to the rest of the tree

find * | grep "\.[ch]" | xargs clang-format --style=file -i

Test: mma -j32
Change-Id: I6fcc9862bb7bc07c2a367ca58fef2b3cd27a6f05
/system/bt/btif/src/btif_rc.cc
ee96a3c60fca590d38025925c072d264e06493c4 23-Nov-2016 Myles Watson <mylesgw@google.com> Fix asterisks in block quotes

Remove double asterisks from block quotes.

git grep -lP '^[*][*]' | xargs sed 's/^[*][*]/ \*/' -i

Fix asterisk line lengths

git grep -l '^[ /][*]\{79,\}[*/]' | \
xargs sed -i s,"^\([ /]\)[*]\([*]\{78\}\)[*]*\([*/]\)","\1\2\3",

Test: mma -j32
Change-Id: Ie3fd375ac2f804cb0f53bf1314a005e85973b3d7
/system/bt/btif/src/btif_rc.cc
702ae1cf3faf6a5900e09500cbe6bb5f773877f7 20-Nov-2016 Jack He <siyuanh@google.com> AVRCP: Fix get metadata attribute responses

* Add checks for remaining buffer capacity to handle long metadata
* Change the attribute number max to AVRC_MAX_NUM_MEDIA_ATTR_ID
* Consolidate attribute value filling code between GetElementAttributes
and GetItemAttributes
* Check requested media attribute IDs before building response

Bug: 32407250, 33001066
Test: manual - connect to carkit and play music, see metadata and hear audio
Change-Id: I8f0c47148be35100202398c754861abb1fb9def1
/system/bt/btif/src/btif_rc.cc
368cdbab8acddb5079ccc6fac5e160478ecbfc8b 23-Nov-2016 liuchao <liuchao741@huawei.com> Fix an inappropriate NULL-pointer check in handle_rc_passthrough_cmd

This fixes a potential NULL-pointer access in case p_remote_cmd is NULL

Test: mm -j 8
Change-Id: I06ae9afb9ae161296828e06b2c00d921189bee5c
/system/bt/btif/src/btif_rc.cc
1ee1d33e3abcaf0655daffba7d41a7a5e4a73a9a 16-Nov-2016 Marie Janssen <jamuraa@google.com> btif: DRY up command functions

also:
clang-format -i --style=file btif/src/btif_rc.cc

Test: sl4a AvrcpController tests
Change-Id: I95f7e6922c096e2460ecdeafad162515f5600d97
/system/bt/btif/src/btif_rc.cc
365fbfb547247b0e1c39a231dcf8247be89d78b3 16-Nov-2016 Ajay Panicker <apanicke@google.com> Limit the use of AVRC_ADV_CTRL_INCLUDED define

Use AVRC_ADV_CTRL_INCLUDED just to control features instead of
controlling features and inclusion of functions.

Change-Id: Ifff0d7006c3d8df1d57c79ace19ee60487c2f0a5
/system/bt/btif/src/btif_rc.cc
133f0b6503b6adced17795c7a31dd17e084507e1 15-Nov-2016 Marie Janssen <jamuraa@google.com> btif: Remove AVRC_CTRL_INCLUDED ifdefs

AVRCP controller side support is always included now.

Test: croot system/bt && mma -j37

Change-Id: I22260b4f123b352f70cbab54a19b5f8f5f171825
/system/bt/btif/src/btif_rc.cc
919fac80da709bf3da421c727f16a7652f343f84 15-Nov-2016 Marie Janssen <jamuraa@google.com> btif: Remove unused uinput interface code

uinput isn't used anymore; all media commands go through the HAL

Test: croot system/bt && mma -j37

Change-Id: I83ab133794683a26e250ea10927fa95b2e2cb28a
/system/bt/btif/src/btif_rc.cc
395e30e446bd49ad49a00f4a140af5eb29f5cfcf 08-Nov-2016 Sanket Agarwal <sanketa@google.com> Copying of pointer with incorrect size

We are passing the value in pointer (UINT_TO_PTR) hence no copy is
required for the context transfer (simply use the UINT value in the
event field instead)

Change-Id: I43625c3a4d68cd8cbadd51b1fccc4138583082b6
/system/bt/btif/src/btif_rc.cc
033d5a211b9cf8320a2a3e6ae1505d37807a734e 11-Nov-2016 Marie Janssen <jamuraa@google.com> AVRCP: unify Get{Element,Item}Attributes response.

GetElementAttributes response and GetItemAttributes response share the
same format and require the same checks for length.

Test: play media on carkit, see media. especially with long items.
Bug: 32407250
Bug: 30571638
Change-Id: I8623e7d662f7a39112b7527b6f5ab63c5e32379c
/system/bt/btif/src/btif_rc.cc
ffd512103919ccf5c4010a90773325e6c234562c 04-Nov-2016 Marie Janssen <jamuraa@google.com> AVRCP: Passthrough code cleanup

Simplify the code surrounding passthrough commands and responses since
we send them all up to the upper layer now.

Test: basic AVRCP control from a carkit
Change-Id: I1d1e22454471a9948df6602b34ae767d7091197c
/system/bt/btif/src/btif_rc.cc
b6ef10149cf5c9b31514dca8150872817d1df39f 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Use rc_handle for reconciliation of timer callback

Since the timer callback requires copy of the passed argument, it is not
a good idea to pass non-constant data. Instead passing handle since
lookup based on the handle is safe against possible corruption.

Bug: b/32610667
Change-Id: I02270b0f52d79310e2db8cf218f624eeb674b9c8
/system/bt/btif/src/btif_rc.cc
5211827c4c33e04363320d702dac68251d7ab7cf 22-Sep-2016 Sanket Agarwal <sanketa@google.com> AVRCP CT: Add get_play_status_cmd API

- Required for PTS test case TC_CT_MDI_BV_01_C

Bug: b/31684931
Change-Id: Ice0bd36e3282d1c543c8c7bbec63f406311c0f6b
(cherry picked from commit 9a55fbe77cd9c6acb56e2e24cccfb9f34a89c729)
/system/bt/btif/src/btif_rc.cc
30c81fa85380a46613498aff26be8a82b6531859 17-Sep-2016 Sanket Agarwal <sanketa@google.com> Implement AVRCP SetAddressedPlayer Cmd

Bug: b/31554234
Change-Id: I700bc1dc65f9c8c7d1e5e57c568487a53ae9fbf7
(cherry picked from commit 53ffd333c7e6db731a8db2e742dcd29d4416270c)
/system/bt/btif/src/btif_rc.cc
8a8111935121fda68dbafd8cfe43173bef947dfd 29-Aug-2016 Sanket Agarwal <sanketa@google.com> [AVRCP1.6 CT] Add reply status to get_folder_items_callback.

It is useful to know what error code the get_folder_items_cmd gets back
with since it can help the UI decide if to keep fetching more. For ex.
if the return code is out of range then the UI does not need to keep
fetching anymore. This is useful for folders where we do not know the
size before hand (Media Player List or Now Playing List).

Bug: b/31253501

Change-Id: I0f43167d00bcf2e1e320be086fd9cacd163906a1
(cherry picked from commit e3a032a89ac2f20e96808fe2bded2c42fa3afb14)
/system/bt/btif/src/btif_rc.cc
b8d73a44c488c108d9e1b9fbf2d69a48a84f9733 05-May-2015 Anubhav Gupta <anubhavg@codeaurora.org> Enable AVRCP TG feature only when we can handle those commands

- Disable Control, Meta and Browse commands when TG is not up.

Change-Id: Ib54c104e87c735b55d6c6ec07c08d2149acc1a6d
/system/bt/btif/src/btif_rc.cc
d7ffd64accbd50a27289a388856e56244ccbb5da 27-Oct-2016 Myles Watson <mylesgw@google.com> Remove deprecated UNUSED macro (5/5)

Include osi.h for UNUSED_ATTR.

Test: mma -j32

Change-Id: I43260669dc1f54639e46cc9620093d727ee86276
/system/bt/btif/src/btif_rc.cc
40cde56d28ab9751ba76bded0b7ac5974c750a97 21-Oct-2016 Myles Watson <mylesgw@google.com> btif: Add do-while blocks to macros

Test: mma -j32
Change-Id: Ie82465b8cef6c4f527fad13892abb365e15dad7c
/system/bt/btif/src/btif_rc.cc
f45481678af0694902b5200ba69ced4cb61d73f0 19-Oct-2016 Myles Watson <mylesgw@google.com> btif: Fixup clang-format

In src/btif_sock_l2cap.cc:
Move a comment before the define and run clang-format again.

Fix formatting in comments that were more than 80-characters wide.

Test: mma -j32
Change-Id: I17465a1425d1de9a28f0675fe65c8529359a87af
/system/bt/btif/src/btif_rc.cc
6bd442f543972b072ef2cbbcf2f7c91202de1045 19-Oct-2016 Myles Watson <mylesgw@google.com> btif: Apply clang-format

clang-format doesn't understand block quotes of this form:

/* This is not handled well
** because there are two asterisks
**/

cd btif/

# Replace '**' at the beginning of the line with ' *'

sed 's/^[*][*]/ \*/' -i include/* src/* test/* co/*
clang-format --style=file -i src/* include/* test/* co/*

Test: mma -j32
Change-Id: I2477eae5480602d5b2fee5ec89c9ed7888022341
/system/bt/btif/src/btif_rc.cc
78965e88ee829213de595c81e391cb74589e8c67 18-Oct-2016 Greg Kaiser <gkaiser@google.com> btif_rc: Don't memset STL mutex objects

Switching to STL mutex/recursive_mutex objects left us with
code which memset these objects. These are opaque, and need to
be initialized/destroyed via constructors/destructors, not
through directly setting their memory.

We change our memset calls to only zero out the parts of the
structs which don't have these objects.

Test: Recompile
Change-Id: Idf666e935f4094ad4cfca7cdafa523f777a7e769
/system/bt/btif/src/btif_rc.cc
e7bd8905653ec2af14ae202f538ebc2646752ce0 11-May-2016 Sanket Agarwal <sanketa@google.com> Implement AVRCP Controller (Client) Browsing.

Following is included as part of the features:
a) Browsing for all 4 scopes (Media, VFS, Player and Now Playing)
b) Player selection and song selection from browse list.

The change constructs the following (from lower to upper protocol
layers):
1. AVCTP Browse (bta/ & stack/)
-- Connection Handling
-- Constructing browse commands
-- Parsing browse responses
2. AVRCP (btif/)
-- JNI interaction/API
-- Connection handling to Java
-- Delegating request and responses to Java

Bug: 28791287
Change-Id: Ibc97ded93cb9c469778ea1e37733390d561cd4cd
(cherry picked from commit 9ea8d07c9286a1f4d338dd64ee02266e324d28e5)
/system/bt/btif/src/btif_rc.cc
a5764686f719d8d779d8a5ff8cc64010b7893e36 10-Oct-2016 Marie Janssen <jamuraa@google.com> btif: migrate from pthread locks to std::mutex

Test: run unit tests / sanity connection to devices
Change-Id: I293c3600affd229fea67cdd6624eba7f186cbcb7
/system/bt/btif/src/btif_rc.cc
446df0360e0e51a4bd24d4357830c8cde585d30f 11-Oct-2016 Ajay Panicker <apanicke@google.com> Fix improper connection check for absolute volume

Test: Manually tested
Bug: 32060762
Change-Id: Ia6ca97c119d421aef1136f97afccb3f0c126334d
/system/bt/btif/src/btif_rc.cc
860616253d3e3b4f9006c2e9bfcf50587f42c297 22-Sep-2016 Ajay Panicker <apanicke@google.com> Fix improper null check when handling rc features

Bug: 31533166
Change-Id: Ia04e9c51280a3e379c0670b39a84eb5a53c5332b
/system/bt/btif/src/btif_rc.cc
a408eb7227b7060aaa84b2dada7ddd9b6a955761 22-Jun-2016 Avish Shah <avish.shah@broadcom.com> AVRCP 1.6: media browsing support on Target(1/3)

-> As a part of Avrcp 1.6 upgrade, added support
for following features:
[1] setAddressedPlayer
[2] setBrowsedPlayer
[3] getFolderItems scope=VFS/NowPlaying/Search
[4] changePath
[5] getItemAttributes
[6] playItem
[7] getTotalNumberOfItems
[8] search string in current browsed path.
[9] AddToNowPlaying
-> Defined functions and enhanced structures to
support above mentioned features.
-> Added Dual RC support.

Bug: 19361366
Merged-In: I45ed60e337b57c686d9693e19993fee1ce3c2504
Change-Id: I45ed60e337b57c686d9693e19993fee1ce3c2504
/system/bt/btif/src/btif_rc.cc
7aaf7c6c42a06e174ce305000ab7a223dc99cbdf 23-Aug-2016 Pavlin Radoslavov <pavlin@google.com> A2DP-related naming refactoring and cleanup

* Renamed A2DP-related function names, types, constants and fields.
Also, move some of those functions to a better location.
- tAVDT_DATA_CBACK -> tAVDT_SINK_DATA_CBACK
- tAVDT_MEDIA_CBACK -> tAVDT_SINK_MEDIA_CBACK
- p_data_cback -> p_sink_data_cback
- p_media_cback -> p_sink_media_cback
- p_app_data_cback -> p_app_sink_data_cback
- tBTA_AV_DATA_CBACK -> tBTA_AV_SINK_DATA_CBACK
- BTA_AV_MEDIA_SINK_CFG_EVT -> BTA_AV_SINK_MEDIA_CFG_EVT
- BTA_AV_MEDIA_DATA_EVT -> BTA_AV_SINK_MEDIA_DATA_EVT
- bta_av_stream_data_cback() -> bta_av_sink_data_cback()
- bte_av_media_callback() -> bte_av_sink_media_callback()
- tBTA_AV_CODEC -> tA2D_CODEC
- btif_a2dp_get_track_frequency() -> A2D_sbc_get_track_frequency()
- btif_a2dp_get_track_channel_count() -> A2D_sbc_get_track_channel_count()
- dump_codec_info() -> A2D_sbc_dump_codec_info()

* Misc. other cleanup:
- log messages cleanup
- normalize usage of "+=" in Android.mk files

Change-Id: Ida1528fb5d75cc322533f921daefb65be44562f1
/system/bt/btif/src/btif_rc.cc
6046fb3a99e85b90a03dd7cc0b141d421bc0c88e 16-Aug-2016 Ajay Panicker <apanicke@google.com> Implement the AVRCP "continue" and "abort continue" responses

Test: TestTracker/58842/5473
Bug: 30571638
Change-Id: I3bb1a0171e220b6e59b6b739259f98519a31aa27
(cherry picked from commit 3282d12818a0e660a5f3f4295bac55aa8e8d27b4)
/system/bt/btif/src/btif_rc.cc
da34e5b65e769247c324aefc2360c8aa5e8988d3 30-Jun-2016 Ajay Panicker <apanicke@google.com> Add logs for AVRCP commands that originate from a remote device

Change-Id: I02b213913685d831bfe00e1938baef953428e048
/system/bt/btif/src/btif_rc.cc
b7f64bc45dec7f7fec74ceb04874f322b9434bbf 22-Jun-2016 Marie Janssen <jamuraa@google.com> btif: standardize types, #ifs

Use standard types everywhere.
Use standard style for #if statements:
- #if (VAR_NAME == TRUE)
- #if (VAR_NAME1 == TRUE && VAR_NAME2 == TRUE)
Use __func__ instead of __FUNCTION__

Change-Id: Ic29d1d0b32c3ca9953752a4e5da6c28f45ec8895
/system/bt/btif/src/btif_rc.cc
c6d93ada03e6f99421c4a8d6372b5c875ea7c040 17-Jun-2016 Marie Janssen <jamuraa@google.com> AVRCP: rename constant AVRC_CTLR_INCLUDED

Typo fixed to AVRC_CTRL_INCLUDED

Change-Id: Ib0ac11916bf6e856ae2d3cfb842bd0b8fef56008
/system/bt/btif/src/btif_rc.cc
1c512b851d76deac860fce1232e4a1fa1a097f1c 06-Apr-2016 AnubhavGupta <anubhavg@codeaurora.org> Do not request AVRC_CAP_COMPANY_ID if A2DP Sink is not enabled

Also fixed AVRC_PDU_GET_PLAY_STATUS timeout response.

Bug: 28177785
Change-Id: Icde64a5c1806453850abe101f9707fff61566566
/system/bt/btif/src/btif_rc.cc
d6121a37c579731b89348e618a823c53b938449a 12-May-2016 Pavlin Radoslavov <pavlin@google.com> Restart failed system calls interrupted with errno of EINTR

In number of places we don't handle properly system calls failures
when the errno is EINTR (i.e., the system call was interrupted
by a signal). In all our use cases, the system calls should be
restarted. The handling of the following system calls (as used in the code)
has been updated/fixed:

poll, send, recv, sendmsg, nanosleep, epoll_wait
read - mostly (e.g., socket-like fds)
write - mostly (e.g., socket-like fds)
select, accept, connect

Bug: 28471477
Bug: 28658141
Change-Id: I03e6f0f67e33876780fb6d02c33eb84547ba8f95
/system/bt/btif/src/btif_rc.cc
713993d1784ab7c23aee1fa3cf1ab8676cc0aa69 21-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> Convert BTIF code from C to C++

Modifications required:
* added proper casting
* moved variable definitions before goto statements
* added 'extern "C"' markers where needed
* renamed 'operator' to 'operator_name'

Bug: 28485365
Change-Id: I903357967387207e678866c02e008f047f8263f6
/system/bt/btif/src/btif_rc.cc