History log of /system/bt/bta/dm/bta_dm_pm.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cbd669b9c3bb3375cb794d385c7f7984eaa3deda 01-Feb-2016 Matadeen Mishra <matade@codeaurora.org> Correcting sniff behaviour in multi-connection scenario

Use case: When multiple profiles are connected on same link and if any one of the
profiles deregisters with powermanager, powermanager will initiate a sniff when it
removes the timer for one profile, even if a timeout did not trigger for other profiles.

Steps:
1. Turn on BT
2. Pair with Mi band (Wearable device)
3. Pair with carkit
4. Turn off BT
5. Turn on BT
HF and A2DP connection should successful after BT on to carkit.

Failure: HF connection fails.

Root Cause: powermanager initiates a sniff when it removes the timer for one profile
Even if a timeout did not trigger for other profiles.

Fix: When multiple profiles connect on the same link and if any one profile
deregisters with powermanager, pm should stop the timer for that profile
and restart the other profiles timers.

Bug: 27852645
Change-Id: I8e215a9d868291976c70ff32b61145b4360a7f8f
/system/bt/bta/dm/bta_dm_pm.c
af3e647479dcf27e17516b6cd2b853c453a1a01c 02-Feb-2016 Satish Kodishala <skodisha@codeaurora.org> Do not reset Sniff Subrating parameters on SCO link

Usecase:
1. Pair and connect to BT headset
2. Pair and connect to a watch
3. Pair and connect a LE device
4. Make a call and reset BT on phone
5. Verify devices connect back and SCO is established

Failure:
After BT reset, devices connect and SCO is up. After some time,
SCO and ACL link disconnects due to connection timeout.

Rootcause:
When Headset is connected during active call, HFP is connected
first. Due to active call, SCO is also established. When SCO is
established, we disable sniff subrating(SSR). When A2DP is
connected after SCO connection, it enables SSR. This enabling
of SSR is causing ACL disconnect.

Fix:
When there is new profile connection for the same device which
has SCO, we should not enable SSR. It should be enabled only
when there is no SCO.

Bug: 27852645
Change-Id: I7815dba90851366ecc0523447c2394631c10ede1
/system/bt/bta/dm/bta_dm_pm.c
5fe6f0cf6b223e3ed6be4912d55b3ed5b41ce0cd 06-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Removed checks for NULL returns after osi_calloc() / osi_malloc()

Removed explicit checks for NULL pointer returns after calls
to osi_calloc() and osi_malloc(), because those are not needed.
If the memory allocation fails, osi_calloc() and osi_malloc()
will trigger an assert.

Bug: 27048759
Change-Id: I2791eb2f69c08f991f8fcdef10e101a41568cd95
/system/bt/bta/dm/bta_dm_pm.c
abd70abb5e42c9431df94fe9d2c4a78a0d8d9af9 05-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Replaced osi_getbuf()/osi_freebuf() with osi_malloc()/osi_free()

Removed the alternative buffer allocation osi_getbuf() / osi_freebuf()
and use instead osi_malloc() / osi_free().

Correspondingly, replaced usage of osi_freebuf_and_reset()
with osi_free_and_reset().

Bug: 24914560
Change-Id: I7a9599ba7fa900321f087da684428133eb0ddd6b
/system/bt/bta/dm/bta_dm_pm.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/bta/dm/bta_dm_pm.c
258c2538e3b62a8cdb403f2730c45d721e5292b4 28-Sep-2015 Pavlin Radoslavov <pavlin@google.com> GKI cleanup - moved GKI buffer allocation wrappers to OSI

* Moved the following GKI buffer allocation functions to OSI:
- GKI_getbuf() -> osi_getbuf()
- GKI_freebuf() -> osi_freebuf()
- GKI_get_buf_size() -> osi_get_buf_size()

For now we need the osi_getbuf() / osi_freebuf() allocation wrapper,
because we need to be able to call osi_get_buf_size() on the allocated
buffer.
In the future those should be replaced with osi_malloc() / osi_free().
Currently, the osi_malloc() buffer size internal allocation tracker
does not always track the size, hence we need the osi_getbuf() wrapper.

* Replaced GKI_MAX_BUF_SIZE with BT_DEFAULT_BUFFER_SIZE

* Added new file include/bt_common.h that can be usee to include
few files that should be included alost everywhere (e.g. bt_target.h"
NOTE: This file might be removed in the future and we should include
everywhere the right set of header files.

* Removed some of the GKI-related references

* Removed file include/gki_target.h

Change-Id: Ie87830e73143de200746d54235aa99f228a95024
/system/bt/bta/dm/bta_dm_pm.c
9f1c9ad85759c7663e3bbc494f8e75b2f107da67 28-Sep-2015 Pavlin Radoslavov <pavlin@google.com> GKI cleanup - Moved struct TIMER_LIST_ENT to OSI

* Moved struct TIMER_LIST_ENT to file osi/include/non_repeating_timer.h
and renamed it to timer_entry_t
NOTE: This is a short-term solution. timer_entry_t should be
removed, and its usage everywhere should be replaced by
struct non_repeating_timer_t .
* Renamed TIMER_CBACK to timer_callback_t
* Renamed TIMER_PARAM_TYPE to timer_param_t

Change-Id: I9ca830718bf900195f9c0a513a97f6995322693b
/system/bt/bta/dm/bta_dm_pm.c
f99e586b32fc57b8a0bfd5fa1c46a46104e78be6 27-Jul-2015 Pavlin Radoslavov <pavlin@google.com> am c6137426: Fix the logic for stopping the Power Management timers.

* commit 'c6137426081fc55d8c94cd0e6b55cd0d0a52f12d':
Fix the logic for stopping the Power Management timers.
c6137426081fc55d8c94cd0e6b55cd0d0a52f12d 25-Jul-2015 Pavlin Radoslavov <pavlin@google.com> Fix the logic for stopping the Power Management timers.

Previously, the logic for stopping the timers didn't take
into account whether each timer was already running.

Bug: 22666419
Change-Id: Ia99bf8be917e9ea69f478a954085336fc899040a
/system/bt/bta/dm/bta_dm_pm.c
263cc8773270c298bb6491302bf466f2bc0f7132 15-Jul-2015 VenkatRaghavan VijayaRaghavan <venkatrv@broadcom.com> am 76356aee: Bug fix PM changes and LE connectivity mode fixes

* commit '76356aee883af67898ddc1aa3b628195f396d42a':
Bug fix PM changes and LE connectivity mode fixes
76356aee883af67898ddc1aa3b628195f396d42a 21-Apr-2015 VenkatRaghavan VijayaRaghavan <venkatrv@broadcom.com> Bug fix PM changes and LE connectivity mode fixes

Allow PM to support multiple delay timer for different profiles and
power mode requests. And set correct connectivity mode.

Bug: 22040710
Change-Id: Idabd9ea944f0c5a89ce542d85db9f103fa7d1816
/system/bt/bta/dm/bta_dm_pm.c
cab5fc179730ce6910989307680b275195876c4d 02-Jun-2015 Arman Uguray <armansito@google.com> gn-build: Remove all -Wno-unused-* flags from build files

This CL removes the -Wno-unused-variable, -Wno-unused-value, and
-Wno-unused-function flags from all GN build and Android.mk files
(except in test/ & tools/, which are not built using GN yet). Compile
warnings, caused by the newly enabled flags, have been fixed throughout
the code base.

Bug: 21570302

Change-Id: I1c128b62256faa17668124798341005bcd0f7315
/system/bt/bta/dm/bta_dm_pm.c
c1c26aae2708cb74d2aa3e70b5168e0172731c49 22-May-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Don't stop sniff timer before checking for service ID entry

- Avoid stopping sniff timer before checking for service
ID entry for which bta_sys_conn_close is called since if
entry is not present we return without re-starting timer
and ACL doesn't go into sniff.

Change-Id: I063da8e58e067ade5d646debf086bb443066106c
/system/bt/bta/dm/bta_dm_pm.c
b399701373c8829e5d0f85041e7f7542418d7773 21-May-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Don't initiate sniff in sniff mode

This change makes sure that AG does not retry
to intiate sniff if device is already in remote
initiated sniff mode.

Change-Id: I77a0c4c0aaf2e93e3168f49998fe22a971d46212
/system/bt/bta/dm/bta_dm_pm.c
9900b49968297aa15872a9b7ef3a258ecf48cf1b 21-May-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Reset sniff subrating while in SCO

Sniff subrating should not be used when link is
in SCO connection. Since the subrating value is
higher, the link would take more time to process
ACL data while in SCO connection causing unwanted
results like delay in SCO disconnects.

Change-Id: I7b964faa397624b65e0158209b8743efe13a6075
/system/bt/bta/dm/bta_dm_pm.c
0ba8b2303ed8d0f2c0636befe28b89cfe33169de 22-May-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Don't stop sniff timer before checking for service ID entry

- Avoid stopping sniff timer before checking for service
ID entry for which bta_sys_conn_close is called since if
entry is not present we return without re-starting timer
and ACL doesn't go into sniff.

Change-Id: I063da8e58e067ade5d646debf086bb443066106c
/system/bt/bta/dm/bta_dm_pm.c
7d29482dd040a00be373092a566b0d7c5b4827fb 21-May-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Don't initiate sniff in sniff mode

This change makes sure that AG does not retry
to intiate sniff if device is already in remote
initiated sniff mode.

Change-Id: I77a0c4c0aaf2e93e3168f49998fe22a971d46212
/system/bt/bta/dm/bta_dm_pm.c
d288b2af6bf5ebb41554f223adf2e7f536d2f1e5 21-May-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Reset sniff subrating while in SCO

Sniff subrating should not be used when link is
in SCO connection. Since the subrating value is
higher, the link would take more time to process
ACL data while in SCO connection causing unwanted
results like delay in SCO disconnects.

Change-Id: I7b964faa397624b65e0158209b8743efe13a6075
/system/bt/bta/dm/bta_dm_pm.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/bta/dm/bta_dm_pm.c
794f3b5f126fffc3dd1129a710187591348bbf23 01-Oct-2014 Chris Manton <cmanton@google.com> Removal of bd.[c|h]

Consolidate legacy types into bt_types.h
/system/bt/bta/dm/bta_dm_pm.c
cc0ca141ad1e81826b71c0bacdb2e8ab186f9155 01-Oct-2014 Zach Johnson <zachoverflow@google.com> Prune BTM_ReadLocalVersion

It was called once, but the version info read back was
never used. The status returned was used, but that was
implicitly getting whether the device was up or not so
replaced with a call to BTM_IsDeviceUp.
/system/bt/bta/dm/bta_dm_pm.c
5fc4be1aa79e3b732e4503a84908522fd754b56f 29-Sep-2014 Zach Johnson <zachoverflow@google.com> Remove <BT 2.0 workarounds
/system/bt/bta/dm/bta_dm_pm.c
3a02468a2cca323a61d4b461d0b37cfcc70fa3d5 12-Jun-2014 Hemant Gupta <hemantg@codeaurora.org> PM: Stop Power Manager Timer if in sniff mode - do not merge

Power manager timer is started when ACL link is in active mode
depending on profile connected. This timer was never stopped
when link was put in sniff mode by remote device preventing
system from going to sleep since timer is still active resulting
in extra power consumption.

Change-Id: I7569eed3ad7e0487e411377977b4f0671f24df12
/system/bt/bta/dm/bta_dm_pm.c
81b03192d4284acc7c9903f5b183927797dceca4 24-Jul-2014 Prerepa Viswanadham <dham@google.com> Fix build for non BLE supported targets(nakasi and manta)

Change-Id: I0de46e1dfce3a51367bc0e2640e91cdefc8a21c6
/system/bt/bta/dm/bta_dm_pm.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/bta/dm/bta_dm_pm.c
e8c3d75b75493911ebf0f99c83676359657178f7 04-May-2014 Sharvil Nanavati <sharvil@google.com> Logging cleanup: BTIF and APPL.

Change-Id: I5b1214642bbb4b9aecc0fd2c899a6ec2c9793286
/system/bt/bta/dm/bta_dm_pm.c
ead3cde4bac0c3e32cd31f149093f004eef8ceeb 06-Feb-2013 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Initial version of BLE support for Bluedroid

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

Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d
/system/bt/bta/dm/bta_dm_pm.c