History log of /system/bt/btif/src/bluetooth.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
14248c4ce8cb2a4e156006a868ef6f0ad0d41fa6 09-Dec-2016 Jack He <siyuanh@google.com> Fix A2DP metrics session duration

* Fixed A2DP duration counting. It is now counting from music play start
to music play end.
* Start logging a2dp connection as Bluetooth sessions. Currently, only
A2DP connections are logged. Thus the bluetooth session length will be
the total connection length and the length within A2DP session message
will be the audio connection length.
* Add a audio_duration_millis field in A2DPSession to record audio duration
* Add bonded memory constraint for metrics entries
* Use a builder mechanism to only build metrics upon dumping
* Refactor metrics module into BluetoothMetricsLogger class
* Created unit test for BluetoothMetricsLogger

Bug: 33694310
Test: Code compilation, Unit test, BtFunhausMetricsTest
Merged-In: Iea2a997c4ea074687a5d50860e9229f0e1b82659
Change-Id: Iea2a997c4ea074687a5d50860e9229f0e1b82659
(cherry picked from commit f3175629208a64b190dde4dcf5f92cacef70d3e9)
/system/bt/btif/src/bluetooth.c
99abd318ba26480d38500da9dfd8eece68e7aa25 30-Jul-2016 Jacky Cheung <jackyc@google.com> Add dumpsys support for LE connection parameter updates

Change-Id: Ia79483c72d3b0cfc1e339f9f4ac65295e68e8e5d
/system/bt/btif/src/bluetooth.c
c7087d2466a291185853a6b2a16f789233e3420f 18-Mar-2016 Ajay Panicker <apanicke@google.com> Add guest mode functionality (2/5)

Add a flag to enable() to start Bluetooth in restricted
mode. In restricted mode, all devices that are paired during
restricted mode are deleted upon leaving restricted mode.
Right now restricted mode is only entered while a guest
user is active.

Bug: 27410683
Change-Id: I8f23d28ef0aa3a8df13d469c73005c8e1b894d19
/system/bt/btif/src/bluetooth.c
1e7ad16b752c4965d113d2e8b825a8a1d8c8827a 07-Apr-2016 Pavlin Radoslavov <pavlin@google.com> Removed unused functions

Removed unused functions and defines that are not needed:
- l2c_bcst_msg()
- GAP_ConnBTWrite()
- gap_proc_btu_event()
- AVDT_WriteDataReq()
- L2CAP_BCST_MIN_OFFSET
- L2CAP_BCST_OVERHEAD
- AVDT_MAX_MEDIA_SIZE
- LOG_NDDEBUG in btif/src/bluetooth.c

Bug: 28068134
Change-Id: If0edda2bf86caf83027db2c897537c82a0d80667
/system/bt/btif/src/bluetooth.c
20af7c3cc040e82124184ad869d840ad6fa1eacf 28-Mar-2016 Ajay Panicker <apanicke@google.com> Revert "Add guest mode functionality (2/5)"

This reverts commit 45ee419b233480060548f19b09de6726d28a06ea.

Change-Id: I7d24acbe09305611c4e0bbfe7d40348d0fd1c365
/system/bt/btif/src/bluetooth.c
45ee419b233480060548f19b09de6726d28a06ea 18-Mar-2016 Ajay Panicker <apanicke@google.com> Add guest mode functionality (2/5)

Add a flag to enable() to start Bluetooth in restricted
mode. In restricted mode, all devices that are paired during
restricted mode are deleted upon leaving restricted mode.
Right now restricted mode is only entered while a guest
user is active.

Bug: 27410683
Change-Id: I19ff91d1d7fb8c60230fee7a05d32574b5b2aeda
/system/bt/btif/src/bluetooth.c
63ddbe8813aac242071dffc0bd413ba60e6dd7bf 21-Mar-2016 Ajay Panicker <apanicke@google.com> Add config source to dumpsys output

This logs where the config file was loaded from in the Bluetooth
Manager dumpsys output.

Bug: 27354612
Change-Id: I50d4aaa0be4f4d1d890580b03742713f4345c80f
/system/bt/btif/src/bluetooth.c
f2b7708eaf2de443100e5f22e759c125401b9c07 23-Feb-2016 Jakub Pawlowski <jpawlowski@google.com> Add missing log tag in config_clear()

Bug: 27324453
Change-Id: Icebf0273c39040ff6b1bb29dcc4d0a827e25b4a8
/system/bt/btif/src/bluetooth.c
4e6b1c82b78aa17c887376c14cf323bed02e1fd4 18-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Add support for collecting A2DP Protobuf metrics

* Add new function metrics_a2dp_session() to
connect A2DP metrics into Protobuf

* Add new function btif_update_a2dp_metrics()
that is called when the metrics should be
callected

* Add few more statistics to the BTIF media stats.

Change-Id: I5862ac82e55b3546dc1fbde0c78cb4683e40d19e
/system/bt/btif/src/bluetooth.c
0e888661a5dc23e516429b3e80f1f6a1aac12015 17-Feb-2016 Andre Eisenbach <eisenbach@google.com> Instrument and fix calls to strncmp()

Bug: 27222508
Change-Id: I0075b4480aff52dcdc326b7bdb7154ca919ccee9
/system/bt/btif/src/bluetooth.c
a72c96f8dbfcb4db1e45c4954fc96d3da93a4008 06-Feb-2016 Ajay Panicker <apanicke@google.com> Additional logging for bond information

Log the bond state, the funciton that updated the bond state, as well as the
device that was updated. Also added in functionality for protobuff logging.

Example output
Bond Events:
Total Number of events: 8
Time BD_ADDR Function State
00:01:12.353 ac:9e:17:07:58:d8 btif_dm_create_bond BOND_STATE_NONE
00:01:12.354 ac:9e:17:07:58:d8 bond_state_changed BOND_STATE_BONDING
00:01:13.999 ac:9e:17:07:58:d8 bond_state_changed BOND_STATE_BONDING
00:01:14.778 ac:9e:17:07:58:d8 bond_state_changed BOND_STATE_BONDED
00:01:14.827 ac:9e:17:07:58:d8 bond_state_changed BOND_STATE_BONDED
00:01:31.534 34:36:3b:c4:bf:99 btif_dm_create_bond BOND_STATE_NONE
00:01:31.535 34:36:3b:c4:bf:99 bond_state_changed BOND_STATE_BONDING
00:01:32.771 34:36:3b:c4:bf:99 bond_state_changed BOND_STATE_BONDING

Change-Id: I01ab3a232300203704a356a17aa045e638f97463
/system/bt/btif/src/bluetooth.c
a0c02f62a49c4ae9de5789731cdbb99b686a938d 14-Jan-2016 Andre Eisenbach <eisenbach@google.com> Add ability to add interop entries dynamically (2/2)

Add ability and interface for adding dynamic entries to the interop
workaround database.

Bug: 26548845
Change-Id: Id886e4233fc1548727e79f1581cdc0c6f0738d59
/system/bt/btif/src/bluetooth.c
aa11644f763b1d33123b3f71d1a6c3977e7d69cf 16-Jan-2016 Marie Janssen <jamuraa@google.com> osi: add metrics API

Add a metrics API, which supports creating events which are eventually
passed up to the clearcut logging to track pairings and other events.

Connect this to the dumpsys call when it is called.

Change-Id: Idcf75541fd18b0413cc843d6c7e23a5f08a634a5
/system/bt/btif/src/bluetooth.c
8eea109d265c7c03d80ceb681f05b3604ec939ad 28-Jan-2016 Pavlin Radoslavov <pavlin@google.com> Add missing include statements

This fixes "implicit declaration of function ..." warnings/errors.

Change-Id: I07d0f6a60fdb34acef6a11a00f6e528adece150f
/system/bt/btif/src/bluetooth.c
ffba52aeef45451226991d9443c4442a33a7f231 14-Jan-2016 Pavlin Radoslavov <pavlin@google.com> Added metrics for A2DP transmission queue

Collect and display A2DP metrics related to the A2DP transmission queue.
The result can be displayed by "adb shell dumpsys bluetooth_manager":

A2DP State:

TxQueue:
Counts (enqueue/dequeue/readbuf) : 1767 / 1767 / 3504
Last update time ago in ms (enqueue/dequeue/readbuf) : 3 / 3 / 3
Frames per packet (total/max/ave) : 12210 / 11 / 6
Counts (flushed/dropped/dropouts) : 0 / 0 / 0
Last update time ago in ms (flushed/dropped) : 0 / 0
Counts (underflow/underrun) : 0 / 0
Bytes (underflow/underrun) : 0 / 0
Last update time ago in ms (underflow/underrun) : 0 / 0
Enqueue deviation counts (overdue/premature) : 893 / 871
Enqueue overdue scheduling time in ms (total/max/ave) : 242 / 12 / 0
Enqueue premature scheduling time in ms (total/max/ave) : 842 / 20 / 0
Dequeue deviation counts (overdue/premature) : 869 / 897
Dequeue overdue scheduling time in ms (total/max/ave) : 604 / 11 / 0
Dequeue premature scheduling time in ms (total/max/ave) : 1204 / 19 / 1

Change-Id: I75c8f24a26cf9ce7a4164a142d4ac286ff17f322
/system/bt/btif/src/bluetooth.c
adca1518b51935a446d968d4c893a4fd46a00621 28-Jan-2016 Pavlin Radoslavov <pavlin@google.com> Fix the calling pattern of the debug dump functions

Group together the calls to the internal foo_dump() functions,
so the output file descriptor is not closed prematurely.

Bug: 26847370
Change-Id: I3afc9502169424081efcc5deae055fbbd91ed5f1
/system/bt/btif/src/bluetooth.c
9ca88af1d964c546af1c3dc2c16c4c98071fd5b1 26-Jan-2016 Sharvil Nanavati <sharvil@google.com> Fix return value for HAL function config_clear.

Change-Id: I75712f721f7031705d0accb4ffe89467d52d7aa3
/system/bt/btif/src/bluetooth.c
da35bbce704acff55b9748264106162d33a7ff2a 12-Jan-2016 Marie Janssen <jamuraa@google.com> service: Update HAL call for arguments

The HAL now takes an additional argument for dumpsys arguments.

Change-Id: I286149e4d86ea50c4830a9f6d32e1d57025d01a7
/system/bt/btif/src/bluetooth.c
78bcff79e1b1f0efce436b33bdd6da88745bfc8a 05-Dec-2015 Pavlin Radoslavov <pavlin@google.com> Refactor the Bluetooth timers

* Updated the alarm API:
- Existing API alarm_new() is modified to take an alarm name
as an argument.
- New API alarm_new_periodic() is used to create a periodic
alarm.
- Added new API alarm_is_scheduled() to test whether an alarm is
scheduled.
- Existing API alarm_set_periodic() is removed: a periodic
alarm is created by alarm_new_periodic().
- Added new API alarm_set_on_queue() to set an alarm whose
callback is executed on a specific queue.
- Added new API alarm_register_processing_queue() and
alarm_unregister_processing_queue() to register/unregister
a queue and the corresponding thread for alarm processing.
- Added corresponding unit tests.

* Updated the alarm internals:
- Added alarm_info_t for collecting alarm-related information
and statistics.
- Collect and store alarm-related statistics into alarm_info_t
per alarm.
- Include the alarm-related statistics and info into the native
dumpsys output for Bluetooth.
- Once an alarm expires, the alarm execution is scheduled for
processing on another internal alarm-specific thread, not
on the thread that is maintaining the alarms.
- Implemented callback execution ordering guarantee among
timers on the same thread with exactly same timeout values.

* Refactor some of the usage of alarm_set() and simplify the
code by using alarm_set_on_queue() instead.

* Removed the non_repeating timers wrapper, and use directly
the alarm mechanism / API.

* Refactored all timer_entry_t timers and replaced them with alarm_t
timers:
- Replaced the btu_start_timer() / btu_stop_timer() /
btu_start_quick_timer() / btu_stop_quick_timer() /
btu_oneshot_alarm() mechanism with alarm_set_on_queue() and
alarm_cancel()
- Removed the whole mechanism around the BTU_TTYPE_* timers.

* Fixed a bug when processing the GATT indication confirmation timer
expiration (timer tGATT_TCB.conf_timer: b/26610829).

* Renamed and/or split misc. timeout functions, fields, and timers

* Renamed time-related constants and changed the values from seconds
to milliseconds

* Replaced timer tAVDT_CCB.timer_entry with three mutually exclusive timers:
idle_ccb_timer, ret_ccb_timer, rsp_ccb_timer
The reason we are using three timers, is because in the original code
function avdt_ccb_chk_timer() used the timer type in its logic: it
would stop the timer only if the type is "idle".

* Removed btm_ble_timeout() and replaced it with multiple timeout
callback functions (per timer)

* Fix the actual value of the global constant BT_1SEC_TIMEOUT and
rename it to BT_1SEC_TIMEOUT_MS

* Removed btu_cb and associated timers and events, because they are
never used.

* Removed unused timers, functions, struct and declarations that are
not used / needed.

Bug: 26611369
Bug: 26610829

Change-Id: I812c8c31710a5daefc58b01fcf35c353768f390f
/system/bt/btif/src/bluetooth.c
d2e250824fca5c42b87b3b6f5fa19646ffa2d321 25-Aug-2015 Pavlin Radoslavov <pavlin@google.com> Add support for native kernel and callout wakelocks

* Moved wakelock-related code to osi/src/wakelock.c
The API is in osi/include/wakelock.h

* Use wakelock_set_os_callouts() to specify native kernel
or callout-based wakelock.
On Android, wakelock_set_os_callouts() is called to
set the bt_os_callouts_t callbacks into the Java layer.

* Renamed alarm_set_wake_lock_paths() to wakelock_set_paths()

Also, added Bluetooth Wakelock Statistics to the bugreport.
Sample output:

$ adb shell dumpsys bluetooth_manager
...
Bluetooth Wakelock Statistics:
Wakelock is acquired : false
Wakelock acquired/released count : 5 / 5
Wakelock acquired/released errors : 0 / 0
Wakelock last acquired time (ms) : 1524
Wakelock acquired time min/max/avg (ms) : 1511 / 8104 / 3167
Wakelock total acquired time (ms) : 15836
Bluetooth total run time (ms) : 44123

Bug: 26645431
Change-Id: I42bfb7db5b016719faea39e47ebc77c3ad02467b
/system/bt/btif/src/bluetooth.c
1a5bb5f30385af44d11ffba10e0f5af79f0ae422 01-Dec-2015 Jakub Pawlowski <jpawlowski@google.com> Implement OOB pairing for LE devices using TK.

This patch implements OOB pairing for LE devices using TK. Patches
for other pairing methods, and other transports will follow.

Bug: 22932952
Change-Id: Iad3c0c035de3b5a62ef24d3e3b655773fa03d5c1
/system/bt/btif/src/bluetooth.c
c28849aa58c10a4e57d6cb7e5f6d876cba4f8d99 02-Dec-2015 Ajay Panicker <apanicke@google.com> Synchronize Bluetooth stack init and cleanup

Bug: 25972918
Change-Id: Ia4fb4d74f8340862233dc5073596f3082863c941
/system/bt/btif/src/bluetooth.c
b7a077b6aa2af20e9505a7baf0b1d6dfa2ad24e6 29-Oct-2015 Andre Eisenbach <eisenbach@google.com> Rename net_test_bluedroid to net_test_bluetooth

Also remove other bluedroid references.

Change-Id: I349e48e50b0a0a45ca1267a765145299837601d3
/system/bt/btif/src/bluetooth.c
08393054f0867d0f86a7f9c2eb156e67a86382c7 07-Aug-2015 Marie Janssen <jamuraa@google.com> resolved conflicts for merge of 49a86709 to mnc-dev-plus-aosp

Change-Id: Icd7ec2fd78ac4383da430708a88abaeba9009437
49a86709488e5cfd5e23759da18bf9613e15b04d 08-Jul-2015 Marie Janssen <jamuraa@google.com> build: LOG_TAG consistency, include order, build fixes

Fix the order of includes across a bunch of files, and declare LOG_TAG
at the top of every file in which it is used.

Consistently use bt_ as a LOG_TAG prefix.
Fix issues with LOG macro usage.
Remove unused includes and double-includes (when in related .h)

Add includes as necessary to compile cleanly (problems surfaced by
reordering includes)

Change-Id: Ic55520c8302b06bbc1942c10c448b20844669da6
/system/bt/btif/src/bluetooth.c
6fc5461ea7f0f39bf658684564e25cd3551ca284 05-Aug-2015 Ajay Panicker <apanicke@google.com> am aa3be1a6: Implement Bluetooth settings factory reset (3/5)

* commit 'aa3be1a696b9ae1142fe9f358ad5f97e99da7892':
Implement Bluetooth settings factory reset (3/5)
aa3be1a696b9ae1142fe9f358ad5f97e99da7892 29-Jul-2015 Ajay Panicker <apanicke@google.com> Implement Bluetooth settings factory reset (3/5)

Implemented the factory reset function to be used to reset all bluetooth
settings on device to factory default

Bug: 16161518
/system/bt/btif/src/bluetooth.c
d33e39f14834ddfcfad27b9bef5ffb87919a8644 07-Jul-2015 Marie Janssen <jamuraa@google.com> am db554581: build: Update osi log functions, use consistently

* commit 'db554581079863974af8e1289646f5deea6fc044':
build: Update osi log functions, use consistently
db554581079863974af8e1289646f5deea6fc044 26-Jun-2015 Marie Janssen <jamuraa@google.com> build: Update osi log functions, use consistently

Update the LOG_* functions to take a tag argument which makes them more
consistent with the Android Log.*(TAG, s) common syntax and removes
some #define-dependency with osi/include/log.h.

Also update to never use Android log functions directly.

Also contains minor cleanup of some header includes.

Bug: 21569831
Change-Id: If07385cafbea062232ecdbc7c673f908d5ef8921
/system/bt/btif/src/bluetooth.c
9df517bb2e81f29e51a4da8b8dd436c7649b6211 12-Jun-2015 Pavlin Radoslavov <pavlin@google.com> am 74626115: Re-enable the OSI memory allocation tracker.

* commit '74626115db17478a12d1d39bcefd5af500fadfda':
Re-enable the OSI memory allocation tracker.
74626115db17478a12d1d39bcefd5af500fadfda 11-Jun-2015 Pavlin Radoslavov <pavlin@google.com> Re-enable the OSI memory allocation tracker.

Previously, the OSI memory allocation tracker was disabled as
a temporary workaround for Bug 21561735.
The root cause for the original issue is now addressed by using the
appropriate linker flags when generating the bluetooth.default.so
shared library:

LOCAL_LDLIBS := -Wl,-Bsymbolic,-Bsymbolic-functions

Also, added missing #include in file "btif/src/btif_sock_sco.c"

Bug: 21561735
Change-Id: I384a6f3d1d03c74f8d1e3c96bf7e0b5961206feb
/system/bt/btif/src/bluetooth.c
5febd64b95260672d41964337377fb312ea2c07b 01-Jun-2015 Pavlin Radoslavov <pavlin@google.com> Disable the OSI allocation tracker.

Temporary disable the allocation tracker initialization
(even for BLUEDROID_DEBUG) when initializing Bluetooth.
This is a short-term workaround solution for several issues related to
the usage of the allocation tracker.

* Inconsistent usage of osi_malloc()/osi_calloc() and osi_free()
- Within some of the Bluetooth-related unit tests we have two copies
of the same libosi library: one copy statically linked against the
unit test, and another dlopen() at runtime as part of bluetooth.default.so
Each of those copy has its own static variables.
- For the dlopen() copy we do call allocation_tracker_init(), while for the
static copy within the unit test we don't call allocation_tracker_init()
- Occasionally, there is a memory allocation via osi_calloc()
within the dlopen()-ed library, and then it is osi_free()-ed
within the statically linked library.
Such (mis)usage creates issues in two ways: (1) free()-ing incorrect
pointer, and (2) the osi hash_map() in the dlopen()-ed library still considers
the osi-tracked memory as allocated.
NOTE: (1) could trigger random crashes, while (2) is the reason the unit
test triggers an assert

* Avoid potential issues that could result from the fact that calling
allocation_tracker_init() is not mandatory; i.e., the same
issue described above could be triggered if osi_malloc()/osi_callod()
was called before the call to allocation_tracker_init()

* There is still code that uses malloc(3)/calloc(3) and free(3) instead
of osi_malloc()/osi_calloc() and osi_free()

Also, add missing pthread_mutex_lock()/pthread_mutex_unlock() guards,
and fix the allocation_tracker_uninit() implementation so it works
properly even if void allocation_tracker_init() wasn't called.

Bug: 21561735
Change-Id: Ic83d6cd40af1189c4ee9c1dbfd0ad8e4666e1502
/system/bt/btif/src/bluetooth.c
1bd76059e72b7a0d54f6b325882f6eccd311f874 05-Dec-2014 Andre Eisenbach <eisenbach@google.com> Bluetooth native dumpsys logging support (2/5)

Includes support for BTSnoop logging in memory.

Bug: 18508263
Change-Id: I175da528cbcdc00d40622647d518a74210cfe6fd
/system/bt/btif/src/bluetooth.c
9a5a37174f84708130be8531bd0cd251305365b5 02-Jun-2015 Pavlin Radoslavov <pavlin@google.com> am b65ec7bd: Disable the OSI allocation tracker.

* commit 'b65ec7bdb30115ce0d39cf7ee1e355b61fc2a360':
Disable the OSI allocation tracker.
b65ec7bdb30115ce0d39cf7ee1e355b61fc2a360 01-Jun-2015 Pavlin Radoslavov <pavlin@google.com> Disable the OSI allocation tracker.

Temporary disable the allocation tracker initialization
(even for BLUEDROID_DEBUG) when initializing Bluetooth.
This is a short-term workaround solution for several issues related to
the usage of the allocation tracker.

* Inconsistent usage of osi_malloc()/osi_calloc() and osi_free()
- Within some of the Bluetooth-related unit tests we have two copies
of the same libosi library: one copy statically linked against the
unit test, and another dlopen() at runtime as part of bluetooth.default.so
Each of those copy has its own static variables.
- For the dlopen() copy we do call allocation_tracker_init(), while for the
static copy within the unit test we don't call allocation_tracker_init()
- Occasionally, there is a memory allocation via osi_calloc()
within the dlopen()-ed library, and then it is osi_free()-ed
within the statically linked library.
Such (mis)usage creates issues in two ways: (1) free()-ing incorrect
pointer, and (2) the osi hash_map() in the dlopen()-ed library still considers
the osi-tracked memory as allocated.
NOTE: (1) could trigger random crashes, while (2) is the reason the unit
test triggers an assert

* Avoid potential issues that could result from the fact that calling
allocation_tracker_init() is not mandatory; i.e., the same
issue described above could be triggered if osi_malloc()/osi_callod()
was called before the call to allocation_tracker_init()

* There is still code that uses malloc(3)/calloc(3) and free(3) instead
of osi_malloc()/osi_calloc() and osi_free()

Also, add missing pthread_mutex_lock()/pthread_mutex_unlock() guards,
and fix the allocation_tracker_uninit() implementation so it works
properly even if void allocation_tracker_init() wasn't called.

Bug: 21561735
Change-Id: Ic83d6cd40af1189c4ee9c1dbfd0ad8e4666e1502
/system/bt/btif/src/bluetooth.c
b959a4070b56c9b08132eb8756759046c24c1384 28-May-2015 Ian Coolidge <icoolidge@google.com> resolved conflicts for merge of 1f81b64b to mnc-dev-plus-aosp

Change-Id: I7997086b1d83bc5ee06068f82ca31c290389bc44
1f81b64b337832452e9ba1f530e612a685aebb82 22-Apr-2015 Ian Coolidge <icoolidge@google.com> Set default symbol visibility to 'hidden'.

Bug: 20427982
Change-Id: I003469d6dfce681a38baa71b5709236a1a4a2189
/system/bt/btif/src/bluetooth.c
89f5e411d9ef31436741288a2267e46dd744e273 05-Dec-2014 Andre Eisenbach <eisenbach@google.com> Bluetooth native dumpsys logging support (2/5)

Includes support for BTSnoop logging in memory.

Bug: 18508263
Change-Id: I175da528cbcdc00d40622647d518a74210cfe6fd
/system/bt/btif/src/bluetooth.c
8372aa5fa535ee4f09c09981b6125b54ace31fe2 25-Mar-2015 Kim Schulz <k.schulz@samsung.com> L2CAP and SDP Search API for BT profiles (2/2)

Added support for exposing L2CAP to Java such that OBEX over L2CAP
is made possible.

Added support to create SDP records as a seperate step.(as opposed to
creating a SDP record when a BluetoothSocket is created).
This allows both a RFCOMM channel and a L2CAP PSM to be included in a
SDP record. (Additionally the content of the SDP record is set by the
profile in Java, in stead of beeing hardcoded in the socket layer.)
This completes the L2CAP channel exposure to Java.

Change-Id: Iaf68a07d910145cdd33e940d73cd680f79164100
/system/bt/btif/src/bluetooth.c
933926c92e1378cc76bc9c149107e670c4872d4e 03-Apr-2015 Scott James Remnant <keybuk@google.com> Fix missing #includes needed for glibc

Some standard library functions are used while relying on bionic headers
including the headers the functions were actually declared on. Add those
missing #includes so that bluetooth.default.so will compile on glibc.

Change-Id: Ied9f89ce5a05911fca63f6bfe1b8cc8196ab3b1c
/system/bt/btif/src/bluetooth.c
f8027005333c88a2f097cfd70d15c3d54c7764ae 12-Mar-2015 Chris Manton <cmanton@google.com> Demote, cleanup and extend observed logging
/system/bt/btif/src/bluetooth.c
0f9b91e150e153229235c163861198e23600e636 12-Mar-2015 Sharvil Nanavati <sharvil@google.com> Use fully qualified path for OSI includes.
/system/bt/btif/src/bluetooth.c
44802768c447ab480d4227b3a852a97d923b816d 24-Dec-2014 Sharvil Nanavati <sharvil@google.com> Add platform-independent logging macros to OSI.

These macros should replace ALOG* and the various trace macros
used throughout bluedroid. This change eliminates all uses of the
ALOG* macros in favor of the new ones.
/system/bt/btif/src/bluetooth.c
c0745da4fb23eea23abac3c3cfd51cc7f1d38f6d 13-Nov-2014 Sharvil Nanavati <sharvil@google.com> Enable allocation tracking for eng and userdebug builds.

This change will result in a constant increase in memory utilization
per allocation but will help us catch memory errors earlier.
/system/bt/btif/src/bluetooth.c
9891f32471b5c01cf58e4d7dadb04cb3024a9a88 23-Sep-2014 Zach Johnson <zachoverflow@google.com> Refactor btsnoop and stack config into modules

Moves stack config out of the combined bte_config, and into
its own module.

Makes btsnoop more self sufficient and removes uneccessary
levels of indirection.

Refactor logging slightly into a (temporary) module to disassociate
from the direct calls from config. Eliminates some useless stuff in
the module as well.
/system/bt/btif/src/bluetooth.c
8df0d80f0227554d95ed51a443439ee9e7fe7e42 10-Sep-2014 Zach Johnson <zachoverflow@google.com> Move all stack init/start_up/shut_down/clean_up on a single known thread

Execution happens on the same thread, but the next step will be to
ensure each of the functions do not complete until start_up/shut_down/clean_up
complete. That will ensure each is mutually exclusive.
/system/bt/btif/src/bluetooth.c
29e83d4ba9b1554b4383d65fdada049a287600bf 30-Aug-2014 Sharvil Nanavati <sharvil@google.com> Fix heap memory leak by placing the BT device struct in static storage
/system/bt/btif/src/bluetooth.c
b0daa5d79d4e2950701fb9a5f76a306e1da42de0 05-Aug-2014 Andre Eisenbach <eisenbach@google.com> Add transport parameter to createBond() function (2/4)

Change-Id: I8176b932da705f8d0a230abd56bc5faa00005eb6
/system/bt/btif/src/bluetooth.c
e5ba8841cd39e17c05aeb4ab65b5b761d41577da 04-Jul-2014 Satya Calloji <satyac@broadcom.com> LE energy info feature

Stack and BT-IF changes for LE energy feature

Change-Id: I671e63aaead210c6352b45a5e20ad5e4bbbb77b7
/system/bt/btif/src/bluetooth.c
2dc999935d4c69ae31ea93d9014165965dd373d6 17-Apr-2014 Hemant Gupta <hemantg@codeaurora.org> Bluetooth: Support MAP Client role on Bluedroid.

Implementation changes from BTA and BTIF layer to support
MCE role on Bluedroid stack.

Change-Id: I8547b0f28338e83edabae969121872ca23fdcb36
/system/bt/btif/src/bluetooth.c
5c0b052090a57b3926669c23349b0f0db68853f8 18-Jun-2014 Andre Eisenbach <eisenbach@google.com> LE: Add is_connected() function (2/3)

Change-Id: I73c4ea7f13982bf9c208996f9c749d2dfbe698be
/system/bt/btif/src/bluetooth.c
4ad470e33021be4246ae539e1bcb7a346dbb4405 03-Jun-2014 Mike Lockwood <lockwood@google.com> Move AVRCP controller support to separate HAL interface

Change-Id: Ib7dcd7b90f85cf3b25148e2929d8921c6db37aa2
/system/bt/btif/src/bluetooth.c
3e8a242fcbeebea2857fa964ca48624d8433333e 23-May-2014 Mike Lockwood <lockwood@google.com> More work on A2DP Sink:

Output audio data through A2DP audio HAL rather than playing directly
to native AudioTrack API.

Add separate HAL interface for A2DP sink

Change-Id: I6c6cb6088c350e104b4a7354f328b29c7178e295
/system/bt/btif/src/bluetooth.c
41d4a266ceca77bb09ab1bf5c04c30d15f3ded3a 19-Aug-2013 Hemant Gupta <hemantg@codeaurora.org> Bluetooth: Add support for HFP Client role.

Implementation changes in BTA and BTIF layer to support
HFP Client role.

Change-Id: I9f939c18e8f989a50f298d0b313c5a0959c030a7
/system/bt/btif/src/bluetooth.c
10aecea0649e523ad9e94b5d0256e72729ec5875 29-May-2014 Sharvil Nanavati <sharvil@google.com> Implement GKI timers based on wake alarms and wake locks.

Before this change, bluedroid was unable to acquire wake locks
because the Bluetooth process didn't have permissions to write to
/sys/power/wake_*. We are now making wake locks accessible to
bluedroid through a HAL callout back into Java code.

The previous design did not use wake alarms. Bluedroid would attempt
to hold a wake lock until all pending timers expired, which is awful
if a timer is scheduled seconds or minutes from now. There is a
15min timer in bluedroid now so holding a wake lock for the entire
duration of pending alarms is unacceptable (power cost). The new
implementation uses a hybrid approach: if the next deadline is < 3s
away, we take a wake lock. If it is further than 3s away, we set a
wake alarm and release the wake lock.

As a result of this change, we have also eliminated a thread whose
sole purpose was to wake up every 10ms and update timers.

Change-Id: I46cd4edfcad2f5dce23c4003a14a617e7bf00541
/system/bt/btif/src/bluetooth.c
477057cc54dde60732f9a97232f0042c2c64f3a8 24-May-2014 Matthew Xie <mattx@google.com> Revert "add wakelock control callback"

This reverts commit cd7896c5c4bffa5a6f9a414177ea0038d6172964.
/system/bt/btif/src/bluetooth.c
8075fbd743d5eb3937a11156abf2c9a4f051434c 23-May-2014 Dmitry Grinberg <dmitrygr@google.com> am 262685fe: am cd7896c5: add wakelock control callback

* commit '262685fe26c0ccc7e196def7db1d7447c51efdbb':
add wakelock control callback
cd7896c5c4bffa5a6f9a414177ea0038d6172964 22-May-2014 Dmitry Grinberg <dmitrygr@google.com> add wakelock control callback

Change-Id: Iffa8f33767a037fceb4757cdff07f25f30acf453
/system/bt/btif/src/bluetooth.c
7fa4fba6f59f97df00aff07dbe8fb21b114b3c2c 17-Apr-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Merge BT 4.1 features

The features include:
- LE Peripheral Mode
- Link Layer topology (LE Central & Peripheral Concurrency)
- Dual Mode Topology (Ability to choose LE transport when connecting with
other Dual Mode devices)
- Fast advertising Interval
- Limited Discovery Time Changes
- GAP Authentication and Lost Bond
- Dual Mode Addressing
- Common Profile and Service Error Code
- 32 bit UUIDs

Change-Id: Ic6701da4cf6aaa390ff2c8816b43157f36b7fb42

Conflicts:
stack/btu/btu_hcif.c
/system/bt/btif/src/bluetooth.c
54db2c249efa91082c5a167a924a527ec73ff38d 13-Apr-2014 Sharvil Nanavati <sharvil@google.com> Remove executable bit on source files.

Change-Id: Id456478aea626f57fed3479346e8fb4dbd0fafa6
/system/bt/btif/src/bluetooth.c
bf9a8aa26988aedbc161d75f2688641ce59dc001 11-Feb-2014 Mike J. Chen <mjchen@google.com> Fix warnings when BLE_INCLUDED is FALSE

Change-Id: I27c8ac6d5410159ed6bbef6aca5bf3b9692b0467
Signed-off-by: Mike J. Chen <mjchen@google.com>
/system/bt/btif/src/bluetooth.c
5cd8bff2dd0337cb52bf48f312e3d2d55a8882fb 01-Feb-2014 Mike J. Chen <mjchen@google.com> Major warnings cleanup

Mostly fixing unused parameter warnings.
A few other warnings also fixed like possible use of
unitialized variables (no real issue found, just compiler couldn't
follow the path), signed vs unsigned warning.

Also fixed some typos, indent issues, removal of dead code, etc.

Change-Id: I95eb887aefc4d559d7921f71a0af5f3bfb01ac01
Signed-off-by: Mike J. Chen <mjchen@google.com>
/system/bt/btif/src/bluetooth.c
6c65c2f3a372885a976c14b3ccacd0b5a5fbb8bd 26-Nov-2013 Zhihai Xu <zhihaixu@google.com> fix a potential native crash during bluetooth sutdown

When bluetooth is initialized which call gki_buffer_init,
the buffer pool is allocated by GKI_os_malloc which is
to call libc malloc function.
When bluetooth is cleanup which call GKI_shutdown,
the buffer pool will be freed by GKI_os_free
which is to call libc free function.
So if we access the buffer, after the whole buffer pool is freed,
we will get this native crash.
if we call cleanup during bluetooth disabling:
the state is still BTIF_CORE_STATE_DISABLING,
then GKI_shutdown will call before bte_main_disable
( bt_hc_if->cleanup();), which is before userial thread exit.
Then we may trigger this native crash.

bug:11793775
Change-Id: Ic8ced12848d25f918a28f4d5ba29b803d6ac5bd7
/system/bt/btif/src/bluetooth.c
bad70b1d0071ee9b16a029ff145e8e53038571ff 05-Jun-2013 Zhihai Xu <zhihaixu@google.com> Add debug menu to enable btsnoop

bug: 8059358
Change-Id: I232f6d47e7fb7e9c4d71c119394fce3e72cd02fc
/system/bt/btif/src/bluetooth.c
fc4b2f1953dbe60464d0f5ef7daaa10001fbc62f 07-May-2013 Matthew Xie <mattx@google.com> Solve compilation problem when BLE/GATT/SMP features are false

bug 8664724
Change-Id: I582846ccf4b8995f298d8db533488fceb7993ae3
/system/bt/btif/src/bluetooth.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/btif/src/bluetooth.c
ead3cde4bac0c3e32cd31f149093f004eef8ceeb 06-Feb-2013 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Initial version of BLE support for Bluedroid

Change-Id: I9825a5cef9be2559c34c2a529b211b7d471147cf
/system/bt/btif/src/bluetooth.c
5738f83aeb59361a0a2eda2460113f6dc9194271 13-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot cdeccf6fdd8c2d494ea2867cb37a025bf8879baf

Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d
/system/bt/btif/src/bluetooth.c