OSDN Git Service
Jakub Pawlowski [Wed, 4 May 2016 19:32:18 +0000 (12:32 -0700)]
Rewrite btif_gattc_scan_filter_add_remove to new style
Bug:
28485365
Change-Id: I618644b08ecffbb8d22186a7dc70189fb8e50a53
Jakub Pawlowski [Tue, 3 May 2016 23:00:08 +0000 (16:00 -0700)]
Rewrite register/unregister app to new style
Bug:
28485365
Change-Id: I9e709cc54990769bb5e3cee4328ce36ee992927d
Jakub Pawlowski [Tue, 3 May 2016 22:49:53 +0000 (15:49 -0700)]
Rewrite scan start/stop to new style
Bug:
28485365
Change-Id: I1b659d063181adef85cc835a350717bbb7bfe483
Jakub Pawlowski [Tue, 3 May 2016 22:47:50 +0000 (15:47 -0700)]
Rewrite btif_gattc_open to new style
Bug:
28485365
Change-Id: Idc0e12a00f155a128806b1c2a7f3f71daf6cd23f
Jakub Pawlowski [Tue, 3 May 2016 22:44:44 +0000 (15:44 -0700)]
Rewrite btif_gattc_close to new style
Bug:
28485365
Change-Id: Ic82a28cc3659b4ac9936861310578ee07f46ee31
Jakub Pawlowski [Tue, 3 May 2016 21:34:57 +0000 (14:34 -0700)]
Rewrite btif_gattc_search_service to new style
Bug:
28485365
Change-Id: I80ad14db9cfa69cbbfeee3cf362017ca0da70c8e
Jakub Pawlowski [Tue, 3 May 2016 21:33:06 +0000 (14:33 -0700)]
Rewrite btif_gattc_execute_write to new style
Bug:
28485365
Change-Id: Id93cf6e3ee1d2c9eded20d98ba791c462ff0b5af
Jakub Pawlowski [Tue, 3 May 2016 21:23:37 +0000 (14:23 -0700)]
Rewrite btif_gattc_write_char to new style
Bug:
28485365
Change-Id: Ibe0c1386befb77ddb55d20effd7ba1fda6135d7b
Jakub Pawlowski [Tue, 3 May 2016 21:08:45 +0000 (14:08 -0700)]
Rewrite btif_gattc_reg_for_notification to new style
Bug:
28485365
Change-Id: I227634b11be381977135f7c6668c4d15b7cca31b
Jakub Pawlowski [Tue, 3 May 2016 21:00:12 +0000 (14:00 -0700)]
Rewrite btif_gattc_listen to new style
Bug:
28485365
Change-Id: I63c677262b316210ab5f59908fd2e30fb9d5eebc
Jakub Pawlowski [Tue, 3 May 2016 20:48:20 +0000 (13:48 -0700)]
Rewrite btif_gattc_set_adv_data to new style
Bug:
28485365
Change-Id: Id3868d321226bc3c251bb15f3176c6e2d4b66e82
Jakub Pawlowski [Tue, 3 May 2016 20:43:58 +0000 (13:43 -0700)]
Rewrite read RSSI and set MTU to new style
Bug:
28485365
Change-Id: Ife20d1ce569a1feff561a1b7b3e7b22560a4f108
Jakub Pawlowski [Tue, 3 May 2016 19:06:36 +0000 (12:06 -0700)]
Rewrite btif_gattc_conn_parameter_update to new style
Bug:
28485365
Change-Id: Ibc5e085d381855ec139383545cfbec2750efb33f
Jakub Pawlowski [Tue, 3 May 2016 18:59:28 +0000 (11:59 -0700)]
Rewrite btif_gattc_scan_filter_param_setup to new style
Bug:
28485365
Change-Id: I290af35e0de35f4fbb7fa18ffc40eb5349027343
Jakub Pawlowski [Tue, 3 May 2016 18:50:08 +0000 (11:50 -0700)]
Rewrite scan filter related methods to new style
Bug:
28485365
Change-Id: I68e270e4d7bceee6a9a67ef2a7c50a047cf2d574
Jakub Pawlowski [Tue, 3 May 2016 18:33:36 +0000 (11:33 -0700)]
Rewrite btif_gattc_multi_adv_enable to new style
Bug:
28485365
Change-Id: I7e055c4930fc39dd3b83ea0086f0c0e12f7d815f
Jakub Pawlowski [Tue, 3 May 2016 18:20:01 +0000 (11:20 -0700)]
Rewrite btif_gattc_multi_adv_update to new style
Bug:
28485365
Change-Id: I59a908560856eff0b46b2bf5040c2ecb990ae350
Jakub Pawlowski [Tue, 3 May 2016 18:12:49 +0000 (11:12 -0700)]
Rewrite multi adv set data to new style.
Bug:
28485365
Change-Id: I28f1fd875998b039b5df969771e7b07c08d7fd3e
Jakub Pawlowski [Tue, 3 May 2016 16:11:29 +0000 (09:11 -0700)]
Rewrite btif_gattc_multi_adv_disable to new style
Bug:
28485365
Change-Id: Ifa5e4b4812ec236cc9a41a2129eaa43c328fa28f
Jakub Pawlowski [Tue, 3 May 2016 16:03:11 +0000 (09:03 -0700)]
Rewrite btif batch scan methods to new style.
Bug:
28485365
Change-Id: I62dfa6911ca0e26d490a9702d391aa30a09829a9
Jakub Pawlowski [Tue, 3 May 2016 15:55:11 +0000 (08:55 -0700)]
Rewrite btif_get_gatt_db to new style
Bug:
28485365
Change-Id: Iec63e595bfb82a4ac33564f3095cf0e7c4c37e39
Jakub Pawlowski [Tue, 3 May 2016 01:12:11 +0000 (18:12 -0700)]
Rewrite btif_gattc_set_scan_parameters to new style
Bug:
28485365
Change-Id: I29cb2e11b3e407676e312fe83248fc8b551e60ad
Jakub Pawlowski [Tue, 3 May 2016 00:50:25 +0000 (17:50 -0700)]
Rewrite GATT read operations to use new style
Bug:
28485365
Change-Id: I3c5918abdf79da7d6b566506ad53fa38656bcb65
Jakub Pawlowski [Sat, 30 Apr 2016 21:37:40 +0000 (14:37 -0700)]
Use MessageLoop in bt_jni_workqueue thread
Up till now, to execute anyting on bt_jni_workqueue thread, we were
sending events to workqueue associated with this thread. Flow was:
btif_transfer_context -> btif_sendmsg -> thread_post.
Events were containing defined action, i.e. BTIF_GATTC_SCAN_START and
pointer to struct that contained all required data to execute it.
This was very cumbersome - figuring out what is executed when event is
send was hard. Also everything have to be packed into structure which
means that
we have to define lots of structures, or have one big super-structure
holding data for all events (like in btif_gatt_client.cc). Event sending
and receiving
logic is a huge percent of all code.
From now on, there will be a MessageLoop running inside bt_jni_workqueue
that will execute all tasks that will be posted with PostTask. The
benefit of having PostTask method, is that we can simply create Closure
that will be run in bt_jni_workqueue thread. It will take care of
transferring all associated values, and their cleanup. It will also do
compile-time check of all parameters. We no longer have to create
events, structs, and separate call logic from execution logic.
Bug:
28485365
Change-Id: I5014ef680757c0d3c6c69781aadc5139c8e1c3c4
Andre Eisenbach [Wed, 11 May 2016 19:20:23 +0000 (12:20 -0700)]
Add additional VW car kits to absolute volume blacklist
Change-Id: I8b0b73595e9183b9c1540b06e9e0378312c6a63d
Fixes:
25613423
Andre Eisenbach [Wed, 11 May 2016 03:27:20 +0000 (20:27 -0700)]
Fix double mutex unlock and if() condition
Commit "L2CAP and SDP Search API for BT profiles (2/2)" introduced two
separate issues in btsock_rfc_signaled():
1. The "slot_lock" potentially gets unlocked twice, causing
undefined behaviour.
2. The call to BTA_JvRfcommWrite() was incorrectly taken outside
of the conditional if() block that only executes the code if
data is available.
This patch reverts the relevant locking change and fixes the if()
condition.
Bug:
27204458
Change-Id: I63b1257d21ca7bdd248858ec67e28f64e37a7895
Bryce Lee [Wed, 11 May 2016 00:10:09 +0000 (17:10 -0700)]
Move extern "C" to top of headers and remove tBTA_HF_CLIENT_HDR.
Previously, extern "C" was placed in various locations within the header
files, sometimes below actual struct declarations. Doing so would lead to
alignment issues between C and C++ code.
tBTA_HF_CLIENT_HDR was removed from bta_hf_client_api since it was
extraneous and empty - leading to alignment issues.
Change-Id: Icdd338f1affe4c3a70c7bbd716249be6a16443d2
Jakub Pawlowski [Tue, 10 May 2016 23:43:41 +0000 (16:43 -0700)]
Change initial order of commands after establishing an LE connection
This patch changes order of commands send to LE device after connecting.
This will cause update connection parameters to be send after read
remote version. Having it other way around cause some problems with
broadcom chips, even though it should work both ways.
Bug:
28435172
Change-Id: I8ecf76217b036842e1d9ec7df714da94a99df7d5
Jakub Pawlowski [Tue, 10 May 2016 20:29:59 +0000 (13:29 -0700)]
Change initial order of commands after establishing an LE connection
This patch changes order of commands send to LE device after connecting.
This will cause update connection parameters to be send after read
remote features. Having it other way around cause some problems with
broadcom chips, even though it should work both ways.
Bug:
28435172
Change-Id: I280993d40b63d41729f5a8ccf246809c3abf617d
AnubhavGupta [Thu, 7 Apr 2016 17:35:53 +0000 (23:05 +0530)]
A2DP_SINK: create avrcp connection only if a2dp is successful
Scenario: Pair and connect carkit to a remote mobile
Disconnect from carkit
Initiate connection from carkit and turn BT-OFF
on remote mobile phone
Issuses: Even though A2DP connection is unsuccessful we
try to connect AVRCP connectoin
Solution:
- for a2dp sink, we should not send pending play command
- we should create avrcp connection only if a2dp connection
is successful
Change-Id: If2c6a3710b6ebdaa382a3d8bcae5c137aaef1f2c
Nitin Arora [Sat, 12 Mar 2016 00:37:51 +0000 (16:37 -0800)]
PTS: Read SMP pairing options from bt_stack.conf
Use Case:
A number of cenrtification test cases require the host
to change the pairing options including auth request,
I/O capabilities, key distribution mask, key length
and Out of band capability.
Test Case: TP/PKE/BV-02-C
Failure:
Host currently only supports fixed SMP options and only
a few test cases involving pairing, are executed due
to that limitation.
Fix:
Added changes to read the SMP options from the bt_stack.conf
file at run time.
The pairing options are entered as a comma separated list eg:
SMPOptions=0xD,0x4,0xf,0xf,0x10
where the included hex values are in the following order:
\#auth, io, ikey, rkey, ksize
If all 5 options are not present, the host falls back to the
default values
Bug:
27852645
Change-Id: I693b05966695cf4660c5da10249c5f7c0663e53a
Nitin Arora [Fri, 11 Mar 2016 02:27:24 +0000 (18:27 -0800)]
PTS: Avoid BR SDP after LE pairing
Use Case: Certification test case requiring LE secure pairing
with PTS.
Test Case: TP/SCJW/BV-01-C
Failure:
While pairing with PTS for certification test cases, LE secure
pairing followed by BR/EDR cross key derivation results in the
host initiating the SDP to gather the remote BR/EDR services.
PTS considers it as a test failure.
Fix: Added run time flag in bt_stack.conf file
"PTS_DisableSDPOnLEPair" to disable the SDP immidiately after
LE pairing followed by cross key derivation.
Bug:
27852645
Change-Id: Ib5a05c47b99c2ef8256967a608ae9ebbdfba60ee
Nitin Arora [Thu, 11 Jun 2015 00:10:57 +0000 (17:10 -0700)]
PTS: Allow disabling connection updates
Use Case: Certification test case requiring LE secure pairing
with PTS.
Failure:
LE pairing test cases follow the host behavior where
connection parameters are switched to fast parameters
for SMP and service discovery and switched back to the
default values after SMP/LE discovery is complete.
PTS disconnects to these series of connection updates.
Fix:
This change disables connection updates based on run time
flag "PTS_DisableConnUpdates" fetched from bt_stack.conf
Bug:
27852645
Change-Id: I1da213fd143ccfcb0ac82c7049a94094d2716ff1
Nitin Arora [Fri, 11 Mar 2016 20:26:51 +0000 (12:26 -0800)]
PTS: Add a Secure Only mode.
Use Case:
Certification test cases require BLE to be in secure only
mode and reject legacy pairing requests.
Test Case: TP/SEC/SEM/BV-28-C
Failure:
Currently the host doesn't have a method of putting host into
a mode where it can only perform secure pairing.
This prevents execution of certification test cases
requiring Secure Only mode.
Fix:
Made changes to read the value of a tag "PTS_SecurePairOnly"
at runtime from the file "bt_stack.conf".
Bug:
27852645
Change-Id: I32cd6412621efeed2cb31c760a031762d9f369f9
Nitin Arora [Tue, 30 Jun 2015 22:04:23 +0000 (15:04 -0700)]
Changes to allow LE key upgrade
Use Case: Certifiation test cases require the LE key upgrade
to happen when the current MITM level of the device has
been upgraded. In that case, a repairing is performed,
leading to more authenticated LTK.
Test Case: TP/SEC/AUT/BV-17-C
Steps:
1. Perform LE pairing between two devices using no MITM.
2. Change the IO capability of the devices, so that a
repair would involve authentication.
3. Reconnect the devices and expect key upgrade.
Failure:
No key upgrade is seen at reconnection and the devices
continue to use the old key.
Fix:
Added changes to re-calulate the requirement of key
upgrade when the LE channel is already encrypted.
Bug:
27852645
Change-Id: If62f334dcf298b2ce9840e95035b4398cb951c84
Ajay Panicker [Thu, 5 May 2016 21:51:34 +0000 (14:51 -0700)]
Fix undefined usage of snprintf
Using a buffer as both the format and output for snprintf could
cause undefinied behaviour on certain platforms. Instead just
use a temporary variable.
Bug:
27882028
Change-Id: If9f96fba4b3447b3248917ab9fb994bd80cbca0f
Ajay Panicker [Fri, 6 May 2016 21:01:24 +0000 (14:01 -0700)]
Remove redefine of ARRAY_SIZE
Bug:
28621069
Change-Id: Ie3db0ff733052113493d0e53bb35e2d617c31bff
Pavlin Radoslavov [Mon, 9 May 2016 02:12:53 +0000 (19:12 -0700)]
Update l2c_fcr_clone_buf() to allocate large enough buffer
Apparently, in some parts of the code we assumed the original
buffer size is large enough and we can extend it and write
few more octets at the end.
Bug:
28351270
Change-Id: Idc53d8f68e55808c9f6bf7f18568288304a9bfb9
Jakub Pawlowski [Fri, 6 May 2016 20:26:45 +0000 (13:26 -0700)]
Lower unnecesary high log level
Change-Id: Id4d255d79c844cd8dbf044e5bda073b8f5d784e7
Pavlin Radoslavov [Thu, 5 May 2016 23:20:15 +0000 (16:20 -0700)]
Call BTA_VendorCleanup() during actual cleanup of the stack
Previously, BTA_VendorCleanup() was called during the shutdown
process, and this created race condition crashing the stack.
Bug:
28450506
Change-Id: Ibee90d406036862b95d18e2ef00b08b820c70f68
Treehugger Robot [Thu, 5 May 2016 23:29:24 +0000 (23:29 +0000)]
Merge "Return handle if an RFCOMM port is already open"
Treehugger Robot [Thu, 5 May 2016 22:31:40 +0000 (22:31 +0000)]
Merge "Fix size of SDP black list array"
Andre Eisenbach [Thu, 5 May 2016 17:57:44 +0000 (10:57 -0700)]
Return handle if an RFCOMM port is already open
By returning the handle, the upper layer (BTA) will attempt to
disconnect on failure to connect. Thus the attempt to open the port will
still fail, but any subsequent attempts will be able to recover.
Bug:
27204458
Change-Id: I0f8489b98adeb7f5e217201ffbbb35132a66f210
Ajay Panicker [Thu, 5 May 2016 19:51:49 +0000 (12:51 -0700)]
Fix size of SDP black list array
Bug:
28617843
Change-Id: Iff5690e3aae42d9907ed9351f1059461985c8a20
Myles Watson [Thu, 5 May 2016 18:57:54 +0000 (11:57 -0700)]
Allow C++ code to check bt_stack_config options
Stack configuration options are parsed in C.
Bug:
28485365
Change-Id: I046ef5c676256a8da23bf8c0a7d1eeb1e9603c05
Pavlin Radoslavov [Wed, 4 May 2016 06:00:15 +0000 (23:00 -0700)]
Fixed test_periodic_unregister_processing_queue unit test
Removed a copy-and-paste check in the
test_periodic_unregister_processing_queue unit test.
The removed check adds little value - it has time-dependency,
and is not robust.
Bug:
26982349
Change-Id: I4adb948713b9946b5eb821d6fe52b7ada1400182
Pavlin Radoslavov [Wed, 4 May 2016 03:20:06 +0000 (20:20 -0700)]
Avoid NULL pointer usage of startup_future in case of HCI startup timeout
Previously, the startup_timer was created within the HCI layer start_up()
function, and after several vendor calls, we created the startup_future
that is used elsewhere. However, if any of the vendor calls blocks for
very long time, the startup_timer will timeout.
The startup_timer_expired() callback will try to use startup_future
that is still NULL, and that will trigger an assert.
The issue is avoided by creating the startup_future right before
the startup_timer is scheduled.
Bug:
28528815
Change-Id: Ib9f2c6581a86d3df0fd4d02d0b4c290663b5cfa1
Treehugger Robot [Tue, 3 May 2016 23:57:18 +0000 (23:57 +0000)]
Merge "Update alarm_unregister_processing_queue() to cancel scheduled alarms"
Pavlin Radoslavov [Mon, 2 May 2016 17:52:07 +0000 (10:52 -0700)]
Update alarm_unregister_processing_queue() to cancel scheduled alarms
Update the alarm_unregister_processing_queue() implementation
so it cancels all alarms that are scheduled on the corresponding
queue.
This fixes a race condition during Bluetooth shutdown: if an alarm
expires right after an alarm processing queue is invalidated,
the alarm processing would try to use the invalidated queue.
Added the corresponding unit tests.
Also, added a missing call to alarm_unregister_processing_queue().
Bug:
26982349
Change-Id: I09a111e8080b6dbc354dffa03a487f7a8c578ce6
Jakub Pawlowski [Tue, 3 May 2016 16:42:34 +0000 (09:42 -0700)]
Simplify btif multi adv data handling
Use static fixed size arrays to transport advertisement data instead of
dynamically allocated ones. This simplifies memory allocation and
cleanup handling.
Bug:
28485365
Change-Id: I3a2642e3b11a272eeec50fd959e10820ea3de74f
Chih-Hung Hsieh [Tue, 3 May 2016 17:23:34 +0000 (10:23 -0700)]
Fix google-explicit-constructor warnings.
Bug:
28341362
Change-Id: I7ed9eb20b9b378a25a5454ce2ebfa113428baaf4
Jakub Pawlowski [Tue, 3 May 2016 04:06:16 +0000 (21:06 -0700)]
Build fix
Change-Id: I6fd0ebe5e1d650ef307b22f96869c0004f6c956f
Pavlin Radoslavov [Mon, 2 May 2016 20:40:26 +0000 (13:40 -0700)]
Add read/write timeout to the audio sockets
Add read/write timeout of 2 seconds when reading/writing
from/to the audio-related control and data sockets.
Also, removed unnecessary poll(POLLOUT), because it is not needed anymore.
Bug:
27996931
Change-Id: Ib214a85f4837760b17cded155464957f56806bd3
Pavlin Radoslavov [Mon, 2 May 2016 22:53:22 +0000 (15:53 -0700)]
Fix test_set_zero_periodic unit test failure
Removed an "EXPECT_EQ(cb_counter, 0)" statement
right after a timer of value 0 is scheduled.
The EXPECT_EQ statement shouldn't be there,
because by the time it is reached, the callback might
have been called already.
Change-Id: I61fbec96c436787321c6b36006a2bc1c0e627667
Jakub Pawlowski [Thu, 21 Apr 2016 20:16:45 +0000 (13:16 -0700)]
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
Pavlin Radoslavov [Tue, 26 Apr 2016 19:18:36 +0000 (12:18 -0700)]
Fix issues during cleanup stage of the Bluetooth stack
* Moved free-ing of bta_av_cb timers from the init function
to the cleanup stage.
* Changed the usage of btif_jni_disassociate() so it is called
synchronously. Its previous usage was complicated -
the function was called asynchronously on a different thread,
and we had to wait on a future for its completion.
* Renamed function btif_shutdown_bluetooth() to
btif_cleanup_bluetooth() to represent better its purpose.
Similarly, bte_main_shutdown() is renamed to bte_main_cleanup()
Also:
* Removed function btif_init_fail(), because it is not used.
* Updated an error log message inside function
btif_in_execute_service_request() so the log information
is accurate and more useful.
* Updated the log messages related to the lifecycle of a module
in btcore/src/module.c
Bug:
26982349
Change-Id: Icd6f159d993bdb9c8ef09bfb5b1386b3d6ea4ff2
Hemant Gupta [Fri, 22 Apr 2016 07:11:39 +0000 (12:41 +0530)]
HID: Fix compilation error when HID_HOST_REPAGE_WIN is set to 0
Update invalid function call to hidh_process_repage_process with
valid function call hidh_try_repage as this was leading to compilation
error when HID_HOST_REPAGE_WIN is set to 0
Change-Id: Ib94233ec83ac30dcae701a16c588a2e2a63cac99
Andre Eisenbach [Tue, 26 Apr 2016 16:51:06 +0000 (09:51 -0700)]
Do not log unsolicited NOOP command complete events
Bug:
27744135
Change-Id: I683e3a9f0a116f83763ebcf4d0583ea1c89ef5b2
Pavlin Radoslavov [Mon, 25 Apr 2016 19:29:29 +0000 (12:29 -0700)]
Fix a race condition during alarm_cleanup()
Fix a race condition inside function alarm_cleanup() that
could be triggered during shutdown.
Also, fix few other issues:
* Add missing "timer_delete(akeup_timer)" statement inside
alarm_cleanup()
* Fix the argument when calling "timer_delete(timer)"
* Call "semaphore_free(alarm_expired)" inside alarm_cleanup()
after the corresponding "timer" and "wakeup_timer" have
been deleted.
* Fix the argument type when calling eventfd_read() inside
semaphore_wait()
Bug:
26982349
Change-Id: I2b00cd7ee7f56f755775f8e7b370006e31c6eb08
Glenn Kasten [Tue, 8 Mar 2016 20:12:33 +0000 (12:12 -0800)]
Use audio_session_t consistently
Bug:
27562099
Change-Id: I10780c8bfc84af568795a2c15557020fbe89a1c4
Jakub Pawlowski [Mon, 25 Apr 2016 17:43:02 +0000 (10:43 -0700)]
Add const guarantees
This patch adds const qualifiers to parameter of some methods.
It adds no value right now, but will make conversion of btif to C++
much easier.
Change-Id: I380a63484230f92aedfd4ff5e1ee72f30307d9d9
Pavlin Radoslavov [Wed, 20 Apr 2016 00:30:19 +0000 (17:30 -0700)]
Fix a Floating point exception for periodic timers
Fix a Floating point exception for periodic timers that are
scheduled with interval of 0ms, and add a corresponding unit test.
Also, fix a typo when printing "Action counts" statistics.
Bug:
28278593
Change-Id: Ic381efc573ed9954c36980c26a89318d2de40b29
Pavlin Radoslavov [Wed, 20 Apr 2016 02:20:01 +0000 (19:20 -0700)]
Improve debug-ability of the stack manager
Add or update existing log messages in the stack manager,
so it is clear when each of the init/startup/shutdown/cleanup
steps is executed and completed.
The added/updated log messages are at INFO level.
Bug:
26982349
Change-Id: Ie84aa8e96133999eb76c5b351ddd4fea56404ef0
Pavlin Radoslavov [Wed, 20 Apr 2016 02:16:26 +0000 (19:16 -0700)]
Add missing mutex lock/unlock inside alarm_cleanup()
Bug:
26982349
Change-Id: I32f4e6450491adcc1e12e71fb8bb582d6397a91a
Manu Viswanadhan [Tue, 19 Apr 2016 09:28:40 +0000 (14:58 +0530)]
Fix FD leak caused by module wrapper thread
Use Case: Repeated BT ON/OFF
Failure: FD leak is observed with ON/OFF stress test
which eventually leads to crash due to unavailability
of FDs.
Steps:
BT ON/OFF.
Root Cause: During cleanup the module wrapper thread is
stopped but the resources are not freed, leading to FD leak.
Fix: Cleanup the module wrapper thread properly so that there
are no resource leaks.
Bug:
28312228
Change-Id: I4de2fba9c98a0e4ae73315759ec6bc8bf273948e
Dan Albert [Fri, 22 Apr 2016 18:24:14 +0000 (11:24 -0700)]
Fix 64-bit build break.
Master (aosp and internal) has been broken for nearly two days now.
Was broken by https://android-review.googlesource.com/#/c/212244/
because no one checked 64-bit before merging.
No one noticed post-submit because the build servers aren't
checkbuilding any 64-bit targets (aside from mips64, which is broken
for other reasons).
I've uploaded a build change to get treehugger building a 64-bit
target (http://cr/
120564724), and also to make all the targets
checkbuilds again (http://cr/
120568746).
Change-Id: I195000284de5b52a539a47ad8b308990e72eea96
Ajay Panicker [Mon, 18 Apr 2016 18:31:48 +0000 (11:31 -0700)]
Protect config module init and add date to config file
Bug:
27354612
Change-Id: I45c3c46cf9be81b9d235cfef68343413c98b6d4a
Sharvil Nanavati [Thu, 21 Apr 2016 21:54:55 +0000 (21:54 +0000)]
Merge "Fix assertion failure in btif_sock_rfc"
Pavlin Radoslavov [Wed, 20 Apr 2016 19:06:08 +0000 (12:06 -0700)]
Add missing init/destroy of state_lock mutex
Add missing init/destroy of state_lock mutex inside file
btif_sock_l2cap.c.
Also, add a missing unlock for the same mutex.
Bug:
28296454
Change-Id: I48b8deb911d29e8dcc6b7243fd61fc3ba69046dd
Sharvil Nanavati [Wed, 20 Apr 2016 17:49:10 +0000 (10:49 -0700)]
Fix assertion failure in btif_sock_rfc
The BTIF RFCOMM code was ignoring the status code on RFCOMM writes. In
the failure case, the slot id is 0 which is invalid. But the slot id
shouldn't even be referenced since the result was failure.
Stack trace:
__assert2+20 bionic/libc/bionic/assert.cpp:40
find_rfc_slot_by_id+18 system/bt/main/../btif/src/btif_sock_rfc.c:144
on_rfc_write_done system/bt/main/../btif/src/btif_sock_rfc.c:537
rfcomm_cback+632 system/bt/main/../btif/src/btif_sock_rfc.c:585
bta_jv_rfcomm_write+74 system/bt/bta/./jv/bta_jv_act.c:2121
bta_jv_sm_execute+18 system/bt/bta/./jv/bta_jv_main.c:93
bta_sys_event+56 system/bt/bta/./sys/bta_sys_main.c:523
run_reactor+254 system/bt/osi/./src/reactor.c:278
run_thread+142 system/bt/osi/./src/thread.c:209
__pthread_start(void*)+30 bionic/libc/bionic/pthread_create.cpp:199
__start_thread+6 bionic/libc/bionic/clone.cpp:41
Bug:
27819511
Change-Id: Ifcd19fdfb214559f345567f04db8146b30037363
Bluetooth Build Test [Wed, 13 Apr 2016 14:39:53 +0000 (16:39 +0200)]
Fix sluggish HID devices
Right now, when connecting to HID devices, preferred connection
parameters are not being used. This is because of bug in GAP profile.
This make all HID devices use default connection parameters, which
mean that they behave sluggish. This patch fixes that by forcing
HID devices to re-read connection parameters on each reconnection.
This is a temporary workaround until GAP is rewritten.
Change-Id: I74b70ad8e96c29517cace808632fe4d8e0251994
Bluetooth Build Test [Wed, 20 Apr 2016 19:35:28 +0000 (12:35 -0700)]
Enable test_vendor_lib compilation on Linux
Cristian Iorga [Tue, 15 Mar 2016 14:33:08 +0000 (16:33 +0200)]
vendor_libs: create Android.mk
all-subdir-makefiles call works for only one
nested sublevels, so we need to add a default
Android.mk in order to be able to build libbt-vendor module.
BUG=
28014054
Change-Id: I7cc004d2a4dd6216a80d13c6384d9dcde328323e
Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Jakub Pawlowski [Wed, 20 Apr 2016 15:51:39 +0000 (15:51 +0000)]
Merge "vendor_libs: test_vendor_lib: fix build"
Cristian Iorga [Mon, 18 Apr 2016 13:09:31 +0000 (16:09 +0300)]
vendor_libs: test_vendor_lib: fix build
Change-Id: I1ba531c5289adea3fa5d6f9e0f68cf241a127219
Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Ajay Panicker [Fri, 18 Mar 2016 00:09:24 +0000 (17:09 -0700)]
Add guest mode functionality (2/4)
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
Jakub Pawlowski [Mon, 18 Apr 2016 17:00:26 +0000 (10:00 -0700)]
Use base from libchrome
Change-Id: I57230618ef8653a168d69f871f88714ab339408a
Cristian Iorga [Wed, 30 Mar 2016 17:14:36 +0000 (20:14 +0300)]
Fix Linux libbt-vendor build
Fix enumeration values not explicitly handled in switch;
Fix the undefined reference to functions from libosi.
Change-Id: I64ab3d57d1c4879ad47ae1a03f8996287877535d
Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Sanket Agarwal [Fri, 8 Apr 2016 18:26:04 +0000 (11:26 -0700)]
Allow A2DP SNK audio track focus gain interface.
In order to duck music we need to adjust the gain of the audio track
handled by A2DP SNK. Since SNK is implemented in native we need to add
interface to adjust the gain.
Bug: b/
28065071
Change-Id: I60634cfadb502e276596bcb3aafc62ef81d9023a
Jakub Pawlowski [Thu, 14 Apr 2016 10:06:54 +0000 (03:06 -0700)]
Fix LE central device not being able to disconnect
This fixes issue introduced in
https://android-review.googlesource.com/#/c/202278
Bug:
28211048
Change-Id: I08e62149358f1c1fc1759a4ca9eb375cb0ad8230
AnubhavGupta [Tue, 22 Mar 2016 18:03:33 +0000 (23:33 +0530)]
AVRCP: Update sdp record correctly for CT or TG.
-Issuses: SDP records are faulty
- AVRCP versions are faulty
- Nexus configuration shows browsing supported
- Both Cat-1 and Cat-2 is supported for Nexus CT
-Solution
- pass sdp version as parameter
- update sdp records for avrcp controller in case of client
profiles being enabled
- BTA_AV_FEAT_BROWSE flag was incorrecly set during AV registration
causing AVRCP TG version to upgrade to 1.4 even though browsing
feature is not supported.
- Use AVRC_CTLR_INCLUDED feature flag instead of AVRC_ADV_CTRL_INCLUDED
for guarding Avrcp controller code in build/parse apis for
command/response
- update categories supported for CT properly for mobile phone config
Bug: b/
28149547
Change-Id: I3ff4082453a2624a72d8f152d75af83a8efb4937
Cristian Iorga [Thu, 14 Apr 2016 08:00:28 +0000 (11:00 +0300)]
vendor_libs: linux: Fix build
LOG_DEBUG, LOG_VERBOSE definition changed in libosi.
This triggers:
"error: use of undeclared identifier 'true'" at
build time. Fixed by the inclusion of stdbool.h.
Change-Id: Ie2ed0d6b07bc28c26669b19a2584ea248e2782a9
Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Treehugger Robot [Thu, 14 Apr 2016 20:27:53 +0000 (20:27 +0000)]
Merge "HID: Fix regression caused by commit "
3a2c2d61""
Christopher Wiley [Thu, 14 Apr 2016 17:32:56 +0000 (10:32 -0700)]
Allow unused private field
This field is unused when we build unittests for OSX.
Bug:
28117776
Test: Compiles
Change-Id: I6add6946896a8cc2838309e6188812d4c7c497cb
Andre Eisenbach [Wed, 13 Apr 2016 16:44:00 +0000 (09:44 -0700)]
Ensure PIN code dialog is shown after remote name request
If pairing is locally initiated and results in a remote name request
being performed before the PIN code is requested, then the PIN code
dialog will not be shown correctly.
This patch removes the check for locally initated pairing to ensure the
dialog is shown in all cases.
Bug:
27347017
Change-Id: I607c1c071af502fb2990b14cce676590e577b4c2
Andre Eisenbach [Mon, 11 Apr 2016 21:50:41 +0000 (14:50 -0700)]
Move autopair blacklist to interop database
Blacklist by partial name etc. was not working and had no effect; all
BDAs in the config file start with 00:, which is implausible at best, so
deleted...
Added new mechanism to blacklist by BDA only initially and added Subaru
car kit to blacklist.
Bug:
27347017
Change-Id: Ie2941cb1ab663b5444b02c44f85032f13be4ab46
Marie Janssen [Wed, 13 Apr 2016 19:43:03 +0000 (12:43 -0700)]
btif: add count of devices loaded on startup
Report devices initially loaded from the config file.
Also removes the config mutex from btif_debug_config_dump as the config
is not modified.
Bug:
27354612
Change-Id: I25033ce28744051412f0d2bd554f0651e807ba7c
Sharvil Nanavati [Wed, 13 Apr 2016 18:53:16 +0000 (18:53 +0000)]
Merge "Fix use of uninitialized value in btm_acl_update_busy_level"
Sharvil Nanavati [Wed, 13 Apr 2016 18:53:12 +0000 (18:53 +0000)]
Merge "Fix use of uninitialized value in BTA_PanSetRole"
Sharvil Nanavati [Mon, 11 Apr 2016 00:29:11 +0000 (17:29 -0700)]
Fix use of uninitialized value in btm_acl_update_busy_level
Caught by valgrind:
Thread 7 bt_jni_workqueue:
Conditional jump or move depends on uninitialised value(s)
at 0x5682870: btif_dm_upstreams_evt (btif_dm.c:1800)
by 0x56817EF: btif_context_switched (btif_core.c:180)
by 0x56817EF: bt_jni_msg_ready (btif_core.c:290)
by 0x571D1D7: work_queue_read_cb (thread.c:233)
by 0x571C1F9: run_reactor (reactor.c:275)
by 0x571CF3D: run_thread (thread.c:206)
by 0x4A5B7B3: __pthread_start(void*) (in /system/lib/libc.so)
Uninitialised value was created by a stack allocation
at 0x56D9CC6: btm_acl_update_busy_level (btm_acl.c:503)
Bug:
28113318
Change-Id: I21ffa2f6c48d3bb96dcdc71fee6ab74634e57333
Hemant Gupta [Wed, 13 Apr 2016 11:12:18 +0000 (16:42 +0530)]
HID: Fix regression caused by commit "
3a2c2d61"
uhid_event function returned 0 in normal case and with below
commit polling thread was being exited resulting in user space
not able to read the events sent by uhid kernel driver leading
to IOT issues with HID devices using the vendor hid usb drivers.
Eg: Apple Magic Mouse scroll functionality was not working as
for normal functionality of Apple Magic mouse, output report
needs to be sent to hid device, which was not being sent with
current implemenation.
commit
3a2c2d61f4c8769ea9c1615208a6daf2fa162084
Author: Myles Watson <mylesgw@google.com>
Date: Tue Nov 10 14:35:57 2015 -0800
Retry HID Polling when EINTR is returned
While I'm here
- use __func__ consistently in btif_hh_poll_event_thread.
- remove braces around a single line
BUG:
24647083
Change-Id: I80b99ff0d3ba6336f5ab7a517269fdf63df59b37
Signed-off-by: Myles Watson <mylesgw@google.com>
Change-Id: If1f69c8d024fd7d03e2d79f19b962653fe2dd8b9
Treehugger Robot [Tue, 12 Apr 2016 21:14:33 +0000 (21:14 +0000)]
Merge "Pull in libmedia's exported headers in libbtif"
Sharvil Nanavati [Mon, 11 Apr 2016 00:15:29 +0000 (17:15 -0700)]
Fix use of uninitialized value in BTA_PanSetRole
Caught by valgrind:
Conditional jump or move depends on uninitialised value(s)
at 0x57616E8: PAN_SetRole (pan_api.c:170)
by 0x56C0193: bta_pan_set_role (bta_pan_act.c:370)
by 0x56BFD65: bta_pan_hdl_event (bta_pan_main.c:387)
by 0x56D24DD: bta_sys_event (bta_sys_main.c:495)
by 0x5777029: run_reactor (reactor.c:275)
by 0x5777D6D: run_thread (thread.c:206)
by 0x49A77B3: __pthread_start(void*) (in /system/lib/libc.so)
Uninitialised value was created by a heap allocation
at 0x495883C: malloc (in /system/lib/valgrind/vgpreload_memcheck-arm-linux.so)
by 0x5774857: osi_malloc (allocator.c:67)
by 0x56C07A9: BTA_PanSetRole (bta_pan_api.c:107)
by 0x56FBF31: btpan_enable (btif_pan.c:226)
by 0x56DB3AB: btif_enable_bluetooth_evt (btif_core.c:524)
by 0x56DE3EB: btif_dm_upstreams_evt (btif_dm.c:1742)
by 0x56DC60F: btif_context_switched (btif_core.c:180)
by 0x56DC60F: bt_jni_msg_ready (btif_core.c:290)
by 0x5778007: work_queue_read_cb (thread.c:233)
by 0x5777029: run_reactor (reactor.c:275)
by 0x5777D6D: run_thread (thread.c:206)
by 0x49A77B3: __pthread_start(void*) (in /system/lib/libc.so)
Bug:
28113318
Change-Id: Icdba2b7a557254d29f8c3a62c6d1a7aafa4fdde4
Pavlin Radoslavov [Thu, 7 Apr 2016 18:47:48 +0000 (11:47 -0700)]
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
Christopher Wiley [Mon, 11 Apr 2016 22:14:23 +0000 (15:14 -0700)]
Pull in libmedia's exported headers in libbtif
Do this by listing libmedia as a shared library linked by libbtif.
We won't actually be able to link against libmedia because static
libraries don't work like that, but surrounding logic about headers
is triggered.
Bug:
27804373
Test: libbtif compiles in the presence of a new exported header path
in libmedia.
Change-Id: Ic1e776966daaf70b7b9ae6ea99af89bc9a0b3885
Christopher Wiley [Mon, 11 Apr 2016 22:18:14 +0000 (15:18 -0700)]
Fix ambiguous base::TimeDelta reference
base::TimeDelta cannot be resolved when both libbase's
android::base namespace and libchrome's base:: namespace
are included via transitive header dependencies.
Bug:
27804373
Test: Compiles.
Change-Id: I9854c92763728fb85ad21183f37c94a4d7bd61a5
Jakub Pawlowski [Mon, 11 Apr 2016 08:54:54 +0000 (01:54 -0700)]
Trigger a compilation error when LOG_TAG is not provided
When compiling for OS_GENERIC, lack of LOG_TAG causes a compilation error.
Most developement happens on Android, which compiles this without an
error. This patch triggers a compilation failure on Android when LOG_TAG is not
provided.
Bug:
28118588
Change-Id: I316aa01952fb88d77bbabb197c77e4287a3fc39b
Bluetooth Build Test [Thu, 7 Apr 2016 12:10:40 +0000 (14:10 +0200)]
Linux build fix
* add missing LOG_TAG definition
* add missing LOG_TAG inside LOG statements
* remove unnecessary includes of cutils/*.h files
* update libchrome/BUILD.gn to be on par with latest version of
library used in Android
Bug:
28094186
Change-Id: I19a07afac20789b42a070995f6aa9da68b1bb940
Jakub Pawlowski [Tue, 12 Apr 2016 13:44:52 +0000 (06:44 -0700)]
Fix valgrind error
This patch fixes following valgrind error message:
==5000== Thread 6 bt_jni_workqueue:
==5000== Conditional jump or move depends on uninitialised value(s)
==5000== at 0x4353C7:
bluetooth::LowEnergyClient::ScanResultCallback(bluetooth::hal::BluetoothGattInterface*,
bt_bdaddr_t const&, int, unsigned char*) (low_energy_client.cpp:573)
==5000== by 0x443BBB: bluetooth::hal::(anonymous
namespace)::ScanResultCallback(bt_bdaddr_t*, int, unsigned char*)
(bluetooth_gatt_interface.cpp:91)
Bug:
28113318
Change-Id: Ide82c6a7f68f6bbe427f12ca353d62f1d999d0ae
Jakub Pawlowski [Tue, 12 Apr 2016 12:50:49 +0000 (05:50 -0700)]
Cleanup unnecessary logs
Bug:
27698756
Change-Id: I30b5e4b45d4b06e0264415e85949c7bf828f28c0