History log of /system/bt/btif/co/bta_hh_co.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f11e42b1c2a1c185bf83b1d08e033c4e5aec54c2 24-Feb-2017 Ajay Panicker <apanicke@google.com> Revert "HID: Fix scroll issue with Apple Magic Mouse"

Reverting due to the fact that this causes many HID issues with fugu.
The general problem seems to be that this patch requires kernel 3.18
while fugu is currently on 3.10. Will investigate further later but
reverting for now to fix fugu.

This reverts commit 3e2201163b609aab6dcc0778158e790c3201353b.
Fixes: 35667962
Fixes: 35712367
Change-Id: I536da368fc9796b26dc52892eda6501772683330
/system/bt/btif/co/bta_hh_co.cc
3e2201163b609aab6dcc0778158e790c3201353b 25-Oct-2016 Hemant Gupta <hemantg@codeaurora.org> HID: Fix scroll issue with Apple Magic Mouse

Usecase
1) Pair and connect with Apple Magic Mouse
2) Scroll over HID mouse and see if pointer moves up or down
on DUT.

Observation:
Scroll functionality does not work on DUT and mouse pointer
stays still.

Root Cause:
From kernel 3.18 onwards, UHID flags are updated and following new
flags are added. Support for handling same is missing in user
space hid driver (bta_hh_co.cc)
UHID_GET_REPORT
UHID_GET_REPORT_REPLY
UHID_SET_REPORT
UHID_SET_REPORT_REPLY

Fix:
Add support for set report and get report in HID user
space because of changes in uhid kernel driver with kernel changes
for kernel 3.18. Apple Magic Mouse scroll functionality does not
work without this fix, as Apple Mouse requires set report from
HID host for it to start working properly wrt Scroll functionality.

Bug: 35306202
Change-Id: I90230b76d68e9275dcacd9f46f03e312ddf2fa30
/system/bt/btif/co/bta_hh_co.cc
8843cc830b522cfe6f1e361297fc28fd331a1378 17-Apr-2014 Hemant Gupta <hemantg@codeaurora.org> HIDD: Add support for HID Device Role

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
/system/bt/btif/co/bta_hh_co.cc
f2af1c42ccb2f642b241c2261b42d0be61d45438 13-Dec-2016 Jack He <siyuanh@google.com> Replace assert with CHECK from base/logging.h

* 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
/system/bt/btif/co/bta_hh_co.cc
9008888d24407541aa383aa4bd363a40abbf954b 16-Nov-2016 Myles Watson <mylesgw@google.com> Fix formatting after removing defines

clang-format -i --style=file bta/*/* btif/*/* include/*

Test: mma -j32
Change-Id: I9ebb32f0cc5bd24a7cb2ae25699999aab5036b13
/system/bt/btif/co/bta_hh_co.cc
84baa7f16e830394408278dbb8c508dd9fa02887 14-Nov-2016 Myles Watson <mylesgw@google.com> Remove BLE_INCLUDED define

Test: Connect to a BLE Keyboard
Change-Id: I5f8f4017c90c3c404004632fd10e6c2b93bd7783
/system/bt/btif/co/bta_hh_co.cc
d35a648d39710bbc5ac59f8add85166455af5af7 27-Oct-2016 Myles Watson <mylesgw@google.com> Remove deprecated UNUSED macro (1/5)

Generated automatically with coccinelle

/* This rule matches functions with arguments
* that have an UNUSED(arg) in the body.
*/
@r1@
identifier arg;
identifier fn;
type t;
parameter list[n] P;
@@

fn(P, const t arg) { ...
UNUSED(arg);
...
}

/* This rule removes the UNUSED line, and adds
* UNUSED_ATTR to the parameter list.
*/
@depends on r1@
identifier r1.arg;
identifier r1.fn;
type r1.t;
parameter list[r1.n] r1.P;
typedef UNUSED_ATTR;
@@

fn(P,
- const t arg
+ UNUSED_ATTR GETRIDOFTHISCOMMA, const t arg
) { ...
-UNUSED(arg);
...
}

Test: mma -j32

Change-Id: Idcaadd688d669d484e557becd050e69454508f3c
/system/bt/btif/co/bta_hh_co.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/co/bta_hh_co.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/co/bta_hh_co.cc
80d7f60680f483a71e413f2453ab20013aff5c5c 02-Mar-2016 George Burgess IV <gbiv@google.com> Replace all uses of sprintf() with snprint()

- sprintf() does not limit the length of the character string when writing
to a buffer and may result in buffer overflow
- snprintf() requires the maximum write length as a parameter. When the
maximum length supported is smaller than the reserved buffer length,
the call will not result in buffer overflow

Bug: 31859081
Test: TestTracker/64195/3975
Change-Id: I519f8ef7b9b162fd79094f89148250d783c734c0
/system/bt/btif/co/bta_hh_co.cc
960b9c391d276bac903b370a9f67d8f8b550c14d 10-Aug-2016 Ben YoungTae Kim <ytkim@codeaurora.org> HID: Fix to handle UHID_OUTPUT_EV command from UHID driver

Incorrect size check for UHID_OUTPUT_EV for incoming data from
UHID driver of kernel was leading to exiting of poll thread.
This was causing IOT issues with Apple Magic Mouse that require
output report to be sent for proper functioning of scroll functionality.

Bug: 28942565
Change-Id: I2eaba1f70b7cd51fb21933031d439543eb141fd2
/system/bt/btif/co/bta_hh_co.cc
acb093ada78b6f912dcb98a23c644c98605a6b01 30-May-2016 Andre Eisenbach <eisenbach@google.com> HID: Check for EINTR in uhid_event() and fix return value evaluation

uhid_event() returns 0 in the normal case. Commit 3a2c2d61
results in the polling thread to be exited.

Bug: 28942565
Change-Id: Id0aff2958bc7c2704ba340aa0ff7848afb8dcf80
(cherry picked from commit 32d66694e9f782a0e9dfa423015284a573f8975c)
/system/bt/btif/co/bta_hh_co.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/co/bta_hh_co.cc
e34b0eb1110d47832a38180c1b1f8c08205aa0e2 17-May-2016 Pavlin Radoslavov <pavlin@google.com> Add a log message to capture NULL pointer in l2c_link_hci_disc_comp()

Added a log message inside l2c_link_hci_disc_comp() to help capture
a NULL pointer p_lcb->p_fixed_ccbs[xx] that triggers SIGSEGV crash.
Also, updated the typedef of bdstr_t and moved it to
file "btcore/include/bdaddr.h"

Bug: 28765514
Change-Id: Iacd9376cfb9e18b58e18865581da8edad9f68821
/system/bt/btif/co/bta_hh_co.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/co/bta_hh_co.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/co/bta_hh_co.cc