History log of /system/bt/btif/src/bluetooth.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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
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
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
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