summaryrefslogtreecommitdiff
path: root/android/health.c
Commit message (Collapse)AuthorAgeFilesLines
* android: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-211-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds SPDX License Identifier and removes the license text. ------------------------------------- License COUNT ------------------------------------- Apache-2.0 : 80 LGPL-2.1-or-later : 42 GPL-2.0-or-later : 9 License: Apache-2.0 android/bluetoothd-wrapper.c android/tester-hidhost.c android/tester-map-client.c android/hal-audio-aptx.c android/hal-audio.c android/hal-handsfree-client.c android/tester-gatt.c android/hal-pan.c android/hal-socket.c android/tester-hdp.c android/tester-pan.c android/tester-avrcp.c android/hal-a2dp-sink.c android/hal-gatt.c android/hal-avrcp.c android/tester-a2dp.c android/hal-audio.h android/hal-bluetooth.c android/tester-socket.c android/hal-health.c android/hal-a2dp.c android/hal-ipc.c android/hal-avrcp-ctrl.c android/hal-sco.c android/hal-ipc.h android/tester-main.c android/hal-audio-sbc.c android/hal-utils.c android/hal-map-client.c android/hal-handsfree.c android/hal-log.h android/hal.h android/hal-utils.h android/tester-bluetooth.c android/hal-hidhost.c android/audio_utils/resampler.h android/audio_utils/resampler.c android/system/audio.h android/hardware/bt_sock.h android/hardware/bt_gatt_client.h android/hardware/bt_hh.h android/hardware/bluetooth.h android/hardware/hardware.h android/hardware/bt_hf_client.h android/hardware/bt_rc.h android/hardware/bt_hf.h android/hardware/bt_pan.h android/hardware/bt_gatt_types.h android/hardware/hardware.c android/hardware/audio_effect.h android/hardware/audio.h android/hardware/bt_gatt_server.h android/hardware/bt_gatt.h android/hardware/bt_hl.h android/hardware/bt_mce.h android/hardware/bt_av.h android/client/if-hh.c android/client/if-sco.c android/client/pollhandler.h android/client/haltest.c android/client/tabcompletion.c android/client/if-hf-client.c android/client/history.h android/client/if-audio.c android/client/terminal.h android/client/if-av.c android/client/if-main.h android/client/if-av-sink.c android/client/terminal.c android/client/if-mce.c android/client/if-hf.c android/client/pollhandler.c android/client/if-sock.c android/client/if-rc-ctrl.c android/client/if-rc.c android/client/history.c android/client/if-pan.c android/client/if-gatt.c android/client/if-bt.c android/client/if-hl.c License: LGPL-2.1-or-later android/sco.h android/socket.c android/tester-main.h android/hidhost.h android/map-client.h android/utils.h android/hal-msg.h android/health.h android/avrcp-lib.c android/bluetoothd-snoop.c android/a2dp.c android/bluetooth.h android/a2dp-sink.c android/handsfree-client.c android/audio-msg.h android/main.c android/pan.c android/ipc-tester.c android/health.c android/socket.h android/handsfree.h android/avrcp-lib.h android/a2dp-sink.h android/system-emulator.c android/gatt.c android/avrcp.h android/pan.h android/test-ipc.c android/hidhost.c android/a2dp.h android/avrcp.c android/sco-msg.h android/bluetooth.c android/map-client.c android/handsfree-client.h android/ipc.c android/handsfree.c android/gatt.h android/ipc.h android/ipc-common.h android/compat/wordexp.h android/cutils/properties.h License: GPL-2.0-or-later android/avdtp.h android/avctp.c android/avdtptest.c android/sco.c android/log.c android/avdtp.c android/avctp.h android/compat/readline/history.h android/compat/readline/readline.h
* build: Move declaration of _GNU_SOURCE back into individual source filesMarcel Holtmann2018-12-061-0/+1
|
* android: Remove dead codeSzymon Janc2015-10-301-58/+9
| | | | | This removes dead code due to memory allocation with new0 not being able to fail.
* android/health: improve search efficiencyMichael Janssen2014-12-161-89/+64
| | | | Iterate through the entries manually to return early for efficiency.
* mcap: Rename mcap-lib to mcapRavi kumar Veeramally2014-10-021-1/+1
|
* mcap: Unify libmcap usage for Android and non-Android versionsRavi kumar Veeramally2014-10-021-1/+1
| | | | | Now profiles/health/ , android/health and mcaptest will use profiles/health/mcap-lib.
* android/health: Fix incorrect checkAndrei Emeltchenko2014-08-291-1/+1
| | | | "!create_mdl(channel) < 0" is always false since it returns bool
* android/health: Avoid multiple times of sdp searchRavi kumar Veeramally2014-08-281-35/+40
| | | | | | | First it searches for control and data PSMs and then search again for remote mdep id. It would be better to search remote mdep id and cache in first time itself. Patch avoids load of sdp search request for second time.
* android/health: Shutdown MDL socket when freeing channelSzymon Janc2014-08-251-0/+5
| | | | | | | PTS expects to close all data channels before sending delete confirmation to peer. FD is passed over IPC to Android Bluetooth application so it needs to be shutdown while freeing channel to avoid races.
* android/health: Call MDL shutdown after mdl_deleted_cb callbackRavi kumar Veeramally2014-08-251-21/+4
| | | | | | | Shutdown_mdl shutdown io channels and unrefs it. After that related callbacks will shutdown or close and free its data. Due to timing issue process_md_delete_mdl_req send delete confirmation response to peer before properly shutting down all opened data channels.
* android/health: Remove mcl instance on mcl_disconnected call backRavi kumar Veeramally2014-08-251-14/+3
| | | | | | | | | MCAP library is maintaining two sets of mcl list. On mcl_disconnected call mcl instance is removed from regular mcl list and cached in mcl_cache list. health.c doesn't maintain any cached mcls list. So mcl_conn variable doesn't make any sense of not being connected on mcl_disconnected call back. So unref mcl on mcl_disconnected and don't do anything in mcl_unached callback.
* android/health: Fix NULL dereferenceAndrei Emeltchenko2014-08-201-3/+5
| | | | | | | | | | | | In a case get_app(), get_device(), get_channel() fail prevent dereference of NULL pointer. Fixes clang warnings: ... android/health.c:1980:15: warning: Access to field 'dev' results in a dereference of a null pointer (loaded from variable 'channel') queue_remove(channel->dev->channels, channel); ^~~~~~~~~~~~ 1 warning generated. ...
* android/health: Simplify search_cb failure caseRavi kumar Veeramally2014-08-191-4/+1
|
* android/health: Add some information messagesRavi kumar Veeramally2014-08-191-2/+7
|
* android/health: Fix connect channel failure caseRavi kumar Veeramally2014-08-191-0/+1
| | | | | There is a possibilty of created channel is being added to queue, but on failure case it does channel free but not removed from queue.
* android/health: Fix reconnect scenarioLukasz Rymanowski2014-08-131-1/+1
| | | | | | | | | | | | | | | When trying to reconnect to HDP device, BfA tries to connect MDL even MCL is not connected. D/BlueZ ( 2218): external/bluetooth/bluez/android/hal-health.c:connect_channel() I/bluetoothd( 2220): bluetoothd[2221]: external/bluetooth/bluez/android/health.c:bt_health_connect_channel() I/bluetoothd( 2220): bluetoothd[2221]: external/bluetooth/bluez/android/health.c:create_channel() mdep 1 D/BlueZ ( 2218): external/bluetooth/bluez/android/hal-bluetooth.c:handle_acl_state_changed() state 0 I/bluetoothd( 2220): bluetoothd[2221]: external/bluetooth/bluez/android/mcap-lib.c:mcap_create_mdl() I/bluetoothd( 2220): bluetoothd[2221]: health: error creating mdl MCL is not connected This patch makes sure that MCL is connected before trying to connect MDL.
* android/health: Handle incoming streaming data channel requestRavi kumar Veeramally2014-07-021-4/+9
| | | | | First data channel should be reliable data channel when remote device in sink role request data channel with option any.
* android/health: Implement MDL reconnection from remote deviceRavi kumar Veeramally2014-06-301-4/+57
|
* android/health: Fix do not set mdl callbacks on mcl_reconneced call backRavi kumar Veeramally2014-06-301-6/+7
| | | | | MDL related callbacks should be already set when creating mcl. Only update connection status.
* android/health: Implement mcl_uncached callbackRavi kumar Veeramally2014-06-301-1/+6
|
* android/health: Implement mcl_disconnected cbRavi kumar Veeramally2014-06-301-1/+45
| | | | | Provide a utility to find device by mcl and update the mcl status.
* android/health: Fix adding missing breakAndrei Emeltchenko2014-06-301-0/+1
|
* android/health: Add channel_notify for incoming connectionsAndrei Emeltchenko2014-06-301-5/+16
| | | | For other then ECHO mdep send send_channel_state_notify with fd.
* android/health: Set L2CAP mode for MCAP channelsAndrei Emeltchenko2014-06-301-15/+60
| | | | Check configuration and set L2CAP mode. Enables several PTS test cases.
* android/health: Add handling incoming connectionAndrei Emeltchenko2014-06-301-11/+45
| | | | | Add support for normal data channel creation. Also add search helper for searching apps for suitable mdepid.
* android/health: Improve debugAndrei Emeltchenko2014-06-291-3/+8
|
* android/health: Add handling for ECHO serviceAndrei Emeltchenko2014-06-291-1/+63
| | | | Reply received buffer back for ECHO service.
* android/health: Create mdep for ECHO channelAndrei Emeltchenko2014-06-291-5/+17
|
* android/health: Assign channel to user_dataAndrei Emeltchenko2014-06-291-0/+3
| | | | Assign channel for incoming connections when it is created.
* android/health: Add channel connectAndrei Emeltchenko2014-06-291-81/+113
| | | | Connect channel on incoming connection callback
* android/health: Refactor channel creationAndrei Emeltchenko2014-06-291-21/+22
| | | | | | Avoid using app_id when we shall use app structure itself. Otherwise we end up with unnecessary searches for app and problems for incoming connections.
* android/health: Add handling MDL connection requestAndrei Emeltchenko2014-06-291-1/+35
| | | | Handles MDL connection request for ECHO service
* android/health: Add HDP definitionsAndrei Emeltchenko2014-06-291-0/+4
|
* android/health: Add error check when creating appAndrei Emeltchenko2014-06-291-0/+2
|
* android/health: Fix NULL dereferenceAndrei Emeltchenko2014-06-271-1/+1
|
* android/health: Fix wrong callback return typeAndrei Emeltchenko2014-06-271-2/+6
|
* android/health: Implement destroy_channel callRavi kumar Veeramally2014-06-271-2/+23
| | | | Delete MDL channel with MDL_DELETE_REQ.
* android/health: Implement mdl reconnectRavi kumar Veeramally2014-06-271-0/+60
| | | | | MDL reconnection can be called only when it is already created, connected and closed not deleted.
* android/health: Fix deleting channels queueRavi kumar Veeramally2014-06-271-2/+2
| | | | | Channels queue is created only on device creation. So do not destroy queue on all mdls deleted in mdl_deleted_cb, just remove all entries.
* android/health: Implement mdl_closed_cb callbackRavi kumar Veeramally2014-06-271-1/+8
| | | | | Callback will be called when data channel is disconnected/closed. It does not mean that it is deleted. So only change connected status.
* android/health: Fix wrong user data passing in set_mcl_cbRavi kumar Veeramally2014-06-271-1/+1
| | | | | | It used to be channel, when set_mcl_cb refactored it got changed to channed->dev. commit 32180fa3a649ec26f9f3891a0ff5e4fe16592b91 introduced it.
* android/health: Provide a helper funtion to search channel by idRavi kumar Veeramally2014-06-261-1/+68
|
* android/health: Rename matching functionsRavi kumar Veeramally2014-06-261-16/+17
|
* android/health: Fix setting wrong PSM for SDP recordAndrei Emeltchenko2014-06-261-1/+1
|
* android/health: Add setting mcl callbacks for incoming connectionAndrei Emeltchenko2014-06-251-2/+23
| | | | | For incoming connection NULL is passed as argument since application is not known yet.
* android/health: Refactor create_deviceAndrei Emeltchenko2014-06-251-5/+7
| | | | | create_device() should not search for apps again since we have searched already, and we do not have always app_id.
* android/health: Add actual error message to error printAndrei Emeltchenko2014-06-251-1/+1
|
* android/health: Refactor setting mcl callbacks to functionAndrei Emeltchenko2014-06-251-8/+13
| | | | Function will be used in other places as well.
* android/health: trivial: Fix missing spaceAndrei Emeltchenko2014-06-251-0/+1
|
* android/health: Remove extra checkAndrei Emeltchenko2014-06-251-4/+1
| | | | gerr is always set on error condition.