History log of /system/bt/btif/src/btif_pan.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
154be11f74357f43e9775da75adfe6b0b8025fa0 22-Jan-2018 Jakub Pawlowski <jpawlowski@google.com> Use do_in_bta_thread in BTA DM layer

This patch is transforming all the trivial cases, where no variable
length data is included in the event struct. Further patches will
convert the non-trivial cases.

Bug: none
Test: scan, connect, set name, remove device
Change-Id: Ia216a8a7c3bb225aedac34375ce07b109398557c
/system/bt/btif/src/btif_pan.cc
ff99791932fc1050693b21a5276eacba88964193 04-Dec-2017 Jack He <siyuanh@google.com> BTIF: Fix return types of interface getters

* They should return const pointer to interface structs
* Fixed return type for btif_rc_ctrl_get_interface, it should be
"const btrc_ctrl_interface_t*" but was "btrc_interface_t*". Later
casting masked this error, but it may hurt us in the future if not
fixed

Test: make
Change-Id: I41b2366cce68b1338761d84cef9ab986fd3334df
/system/bt/btif/src/btif_pan.cc
4449ed441237c9cfe32e373fb5e4979cea7ac7f6 12-Jun-2017 Hemant Gupta <hemantg@codeaurora.org> Replace strncpy with strlcpy in HID and PAN code

Test: HID and PAN functionality work fine

Bug: 62525262
Change-Id: Icd4f9073a2356f3c8ecc4a23c22388b3509974e9
/system/bt/btif/src/btif_pan.cc
5b790feeeb211c42bf78ca3ae9c26aa30e516765 18-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Make copyright headers consistent with Google template; remove "(C)"

Test: Comment changes only; still compiles...
Change-Id: Id699a8170112f06e4a2c9f2e0f0834d1817ace4e
/system/bt/btif/src/btif_pan.cc
b707f447cbb916de2e0dfd2b4e9bf15818376e64 04-Jul-2017 Jakub Pawlowski <jpawlowski@google.com> Make RawAddress into a class (1/3)

* Add libbluetooth-types - library containing types implementation, that
is common between stystem/bt and packages/apps/Bluetooth. It must be
included in every project using btif interface.
* Put Raw Address implementation into libbluetooth-types
* Unify all "to/from string" helper methods into ToString and FromString
* bd_addr_empty -> RawAddress::kEmpty
* bd_addr_any -> RawAddress::kAny

Also fix leaks in jni str2addr by adding ReleaseStringUTFChars

Test: types_unittest
Change-Id: Ie0694843ad5fbd2a80b310c5f532e5e5a9548043
Merged-In: Ie0694843ad5fbd2a80b310c5f532e5e5a9548043
/system/bt/btif/src/btif_pan.cc
a484a888196ddf8bcbf1ad3226d6451bc735a94b 25-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Rename bt_bdaddr_t into RawAddress (3/3)

Test: compilation test
Change-Id: I4571721a0c6165a66450ee157a53d8d15bfc45d0
/system/bt/btif/src/btif_pan.cc
a83ac12406eaa90e5f1f8a699b8b17e4440e2687 15-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> use bt_bdaddr_t instead of BD_ADDR in PAN related code

Test: compilation test
Change-Id: I1fced7529f3d91bf429c179cf4eba5157b35c8fd
/system/bt/btif/src/btif_pan.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/src/btif_pan.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_pan.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_pan.cc
f33b6f434f086b20fabe5913016bc423ac975057 23-Nov-2016 Marie Janssen <jamuraa@google.com> readability fix: No assigns in if conditionals

Coccinelle-assisted:
@@
variable i;
expression E;
statement S1, S2;
@@

+ i = E;
if (
(
- (i = E)
+ i
!= ...
|
- (i = E)
+ i
== ...
|
- (i = E)
+ i
< ...
|
- (i = E)
+ i
> ...
|
- (i = E)
+ i
<= ...
|
- (i = E)
+ i
>= ...
|
- (i = E)
+ i
)
) S1 else S2

for file in $(find . -name "*.cc"); do
spatch --sp no-if-assigns.cocci --in-place $file
done

clang-format --style=file -i bta/**/*.cc

Test: mma -j37 and basic sanity testing on angler, sailfish

Change-Id: I41a2964afac347c24e13869b6c172e321e646091
/system/bt/btif/src/btif_pan.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/src/btif_pan.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/src/btif_pan.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_pan.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_pan.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_pan.cc
9f20f3cff9ead8efbbcab19b2841362a0e3789ab 18-May-2016 Pavlin Radoslavov <pavlin@google.com> Improve poll(2) handling and log messages

* Better error handling and log messages inside
uipc_flush_ch_locked()
* Add missing error check inside UIPC_Read()
* Add missing OSI_NO_INTR() wrapper around poll()
inside function btu_exec_tap_fd_read()

Bug: 28823662
Change-Id: I5f1c720861bea594d53ed6465a5ff327ba352598
/system/bt/btif/src/btif_pan.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_pan.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_pan.cc