OSDN Git Service

android-x86/system-bt.git
8 years agoMerge "HID: Fix regression caused by commit "3a2c2d61""
Treehugger Robot [Thu, 14 Apr 2016 20:27:53 +0000 (20:27 +0000)]
Merge "HID: Fix regression caused by commit "3a2c2d61""

8 years agoAllow unused private field
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

8 years agoEnsure PIN code dialog is shown after remote name request
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

8 years agoMove autopair blacklist to interop database
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

8 years agobtif: add count of devices loaded on startup
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

8 years agoMerge "Fix use of uninitialized value in btm_acl_update_busy_level"
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"

8 years agoMerge "Fix use of uninitialized value in BTA_PanSetRole"
Sharvil Nanavati [Wed, 13 Apr 2016 18:53:12 +0000 (18:53 +0000)]
Merge "Fix use of uninitialized value in BTA_PanSetRole"

8 years agoFix use of uninitialized value in btm_acl_update_busy_level
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

8 years agoHID: Fix regression caused by commit "3a2c2d61"
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

8 years agoMerge "Pull in libmedia's exported headers in libbtif"
Treehugger Robot [Tue, 12 Apr 2016 21:14:33 +0000 (21:14 +0000)]
Merge "Pull in libmedia's exported headers in libbtif"

8 years agoFix use of uninitialized value in BTA_PanSetRole
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

8 years agoRemoved unused functions
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

8 years agoPull in libmedia's exported headers in libbtif
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

8 years agoFix ambiguous base::TimeDelta reference
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

8 years agoTrigger a compilation error when LOG_TAG is not provided
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

8 years agoLinux build fix
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

8 years agoFix valgrind error
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

8 years agoCleanup unnecessary logs
Jakub Pawlowski [Tue, 12 Apr 2016 12:50:49 +0000 (05:50 -0700)]
Cleanup unnecessary logs

Bug: 27698756
Change-Id: I30b5e4b45d4b06e0264415e85949c7bf828f28c0

8 years agoDo not update sco_state when no matching peer_addr is found
Lianchao Song [Wed, 23 Mar 2016 03:03:19 +0000 (11:03 +0800)]
Do not update sco_state when no matching peer_addr is found

In the bta_hf_client_sco_conn_cback function, sco_state should not be set to
BTA_HF_CLIENT_SCO_SHUTDOWN_ST when no matched peer_addr found, so that it
can handle BTA_HF_CLIENT_SCO_OPEN_E event later.

Bug: 26416310
Change-Id: I4540230c792490f79e4cca24cb4b34a1c383422f
Signed-off-by: m00230717 <m00230717@notesmail.huawei.com>
8 years agoDisable the Java subsystem when RFCOMM sockets are cleaned up
Sharvil Nanavati [Wed, 6 Apr 2016 23:08:38 +0000 (16:08 -0700)]
Disable the Java subsystem when RFCOMM sockets are cleaned up

Change-Id: I33dfd2aa01d6f496bee151d5994872e04d25e469

8 years agoDelete unused JV code
Sharvil Nanavati [Wed, 6 Apr 2016 21:46:49 +0000 (14:46 -0700)]
Delete unused JV code

Change-Id: I16d017ef90269a435b8f66a58ed06d2fc89d407f

8 years agoFix for issue introduced due to rebase of LE L2CAP COC
Navin Kochar [Fri, 18 Mar 2016 06:34:30 +0000 (12:04 +0530)]
Fix for issue introduced due to rebase of LE L2CAP COC

During 6721232 patch, some code got missed while doing manual rebase.
This patch is adding that missing code.

Change-Id: I2525908c29e3288e0ace1ee26c5f2aa6cfd59d68
Signed-off-by: Navin Kochar <navin.kochar@intel.com>
8 years agoUpdated the A2DP statistics
Pavlin Radoslavov [Tue, 5 Apr 2016 18:45:30 +0000 (11:45 -0700)]
Updated the A2DP statistics

 * Added "Frame expected" and "Frames limited" statistics in the
   bugreport about expected and limited number of frames per tick.
   Also, added corresponding "Counts (expected/limited)":

A2DP State:
  TxQueue:
  Counts (enqueue/dequeue/readbuf)                        : 386 / 386 / 768
  Last update time ago in ms (enqueue/dequeue/readbuf)    : 12644 / 12643 / 12600
  Frames expected (total/max/ave)                         : 2632 / 8 / 6
  Frames limited (total/max/ave)                          : 0 / 0 / 0
  Counts (expected/limited)                               : 382 / 0
  Frames per packet (total/max/ave)                       : 2618 / 7 / 6
  ...

 * Renamed "tx_queue_max_frames" to "tx_queue_max_frames_per_packet"

 * Fixed the computation of actual transmitted frames:
   tx_queue_total_frames, tx_queue_max_frames_per_packet

 * Computed / added buffer_overruns_max_count and
   buffer_underruns_average to the Protobuf stats.

Bug: 27500656
Change-Id: Id58cfb0b5de2296742c84aa0b743e0eed398f41f

8 years agoFix memory leak when saving paired devices
Marie Janssen [Tue, 5 Apr 2016 18:36:15 +0000 (11:36 -0700)]
Fix memory leak when saving paired devices

Followup from r.android.com/210955

Minor style fixes for osi/config also included.

Bug: 26071376
Change-Id: I26563b75a59a6f0ae074676754889cb988a69358

8 years agobtif: Don't persist remote devices to the config
Marie Janssen [Fri, 25 Mar 2016 20:37:13 +0000 (13:37 -0700)]
btif: Don't persist remote devices to the config

We don't need to persist the unpaired devices to NVRAM
so skip saving them.

This fixes a regression in a previous patch where the most recent
instead of the least recent devices would be removed, making some
devices unpairable in extremely busy environments.

Bug: 26071376

Change-Id: If7ee9d960f70c836bf08b78da5f3fc852ba60a85

8 years agoBring back support for legacy bt_config.xml
Alain Vongsouvanh [Wed, 30 Mar 2016 00:33:55 +0000 (17:33 -0700)]
Bring back support for legacy bt_config.xml

If a device migrates directly from L or earlier to a version using this
new implementation, all bt_config will be lost, requiring to repair to
the devices.

Change-Id: Ifdca0d8cad8efaa9f503ca40ac0725547a06f15c

8 years agoA2DP_SINK: initialize track handle to null
Sanket Agarwal [Wed, 30 Mar 2016 13:31:16 +0000 (19:01 +0530)]
A2DP_SINK: initialize track handle to null

- initialize track handle to null
- prevent invoking audiotrack API in case handle is null

Bug: 27613411

Change-Id: I1a8637fd2cbb3012b29c1930f978100e7f0c58d8

8 years agoFix line wrapping for btsnooz
Ajay Panicker [Fri, 1 Apr 2016 21:02:06 +0000 (14:02 -0700)]
Fix line wrapping for btsnooz

Change-Id: I4558c652577ffeb3f1ac4f273472ccf98d70924b

8 years agoFix btsnooz.py multi-line base64 decoding
Andre Eisenbach [Sat, 2 Apr 2016 00:47:54 +0000 (17:47 -0700)]
Fix btsnooz.py multi-line base64 decoding

Change-Id: Ie915c52d8a7eada10f68999c40a2b50b35f640e2

8 years agoMerge "Allow factory reset when bluetooth is off (2/2)"
Ajay Panicker [Fri, 1 Apr 2016 23:46:33 +0000 (23:46 +0000)]
Merge "Allow factory reset when bluetooth is off (2/2)"

8 years agoAdd a log message to capture empty queue in l2c_enqueue_peer_data()
Pavlin Radoslavov [Fri, 1 Apr 2016 03:22:29 +0000 (20:22 -0700)]
Add a log message to capture empty queue in l2c_enqueue_peer_data()

Add a log message in l2c_enqueue_peer_data() to help capture
an empty queue p_ccb->xmit_hold_q that is triggering an assert.

Also:
 * Fix a memory leak inside l2cu_initialize_fixed_ccb()
   p_ccb queues have been allocated again even though
   they have been allocated previously within l2cu_allocate_ccb()
 * Fix a typo in a comment: clodes -> closed
 * Removed repeated function declarations in file l2c_int.h

Bug: 27821847
Change-Id: I2df2843710310acf5a46c6fa5b302cf7390bc1b4

8 years agoAllow factory reset when bluetooth is off (2/2)
Ajay Panicker [Tue, 1 Mar 2016 00:18:12 +0000 (16:18 -0800)]
Allow factory reset when bluetooth is off (2/2)

Bug: 27348444
Change-Id: Idf0c0bda892c76be037fd28ed352237d4c5b8263

8 years agoBUILD FIX: BTIF_MEDIA_FOCUS_NOT_GRANTED should be complied only for SINK
Sanket Agarwal [Wed, 30 Mar 2016 19:21:30 +0000 (12:21 -0700)]
BUILD FIX: BTIF_MEDIA_FOCUS_NOT_GRANTED should be complied only for SINK

Since BTIF_MEDIA_FOCUS_NOT_GRANTED is only applicable for focus handling
in A2DP SINK scenario it is only defined and protected by
USE_AUDIO_TRACK.

BUG: 26928143
Change-Id: I414bda160270838c9bc911fef9798a95e1f34ec8

8 years agoMove focus handling entirely to component calling fluoride.
Sanket Agarwal [Wed, 10 Feb 2016 23:24:09 +0000 (15:24 -0800)]
Move focus handling entirely to component calling fluoride.

Audio focus handling for A2DP sink currently split between Fluoride and
the component sitting on top of it. Since this is not the best place to
decide policies, we move all such decisions to the upper layer.

Bug: b/26928143

Change-Id: I67a1a2a50782289e7e31447b01ee29a21bc8dac2

8 years agoRemove %s from Log message.
Sanket Agarwal [Sat, 13 Feb 2016 18:19:45 +0000 (10:19 -0800)]
Remove %s from Log message.

This crashes when A2DP SNK role is executed in print statement.

Change-Id: Iceca09ecc5977a5379d7f98f265fc2d52332c6e4

8 years agoAvoid using alarm APIs for LPM when Idle timeout is zero
Jaganath Kanakkassery [Fri, 12 Feb 2016 15:03:06 +0000 (20:33 +0530)]
Avoid using alarm APIs for LPM when Idle timeout is zero

For some vendors the idle timer value is configured to zero. But with
the current LPM timer implementation it will use the alarm APIs to
schedule wake_deassert(), which introduces context switch overhead.
The code is modified to trigger the wake_deassert immediately if the
idle timeout value is configured to zero. These changes improve OPP
throughput.

Change-Id: Ic48e7b990ccf55525a0d15b65c03daedfe03c582
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
8 years agoRemove unused p_db for A2DP service discovery
Andre Eisenbach [Fri, 25 Mar 2016 23:48:44 +0000 (16:48 -0700)]
Remove unused p_db for A2DP service discovery

This fixes a crash (SIGSEGV) when re-connecting A2DP devices where the
SDP pointer was incorrectly reset to 0.

Bug: 27852645
Change-Id: Ie40b7e57fc117c6fe7a42020600745ef348b503c

8 years agoDon't destroy BTIF Device Management state during shutdown
Pavlin Radoslavov [Sat, 26 Mar 2016 01:55:30 +0000 (18:55 -0700)]
Don't destroy BTIF Device Management state during shutdown

Don't call btif_dm_cleanup() during stack shutdown stage,
because it will destroy/free internal state that might be used
later in the shutdown process.
Instead, btif_dm_cleanup() should happen during the stack
cleanup stage.

Also, added an unit test to capture the original issue.

Bug: 27856457
Change-Id: I8575537ad744cf4e6770046b779b6a53de93d66e

8 years agolinux build fix
Jakub Pawlowski [Sat, 26 Mar 2016 05:31:41 +0000 (22:31 -0700)]
linux build fix

Change-Id: Ibec71d18e664f575f73a472b7a522e87c3a1efa8

8 years agoBluetooth: Fix the issue that peer A2DP SNK device can not auto-reconnect.
Zhao Xuewen [Thu, 4 Feb 2016 03:20:14 +0000 (11:20 +0800)]
Bluetooth: Fix the issue that peer A2DP SNK device can not auto-reconnect.

If peer A2DP SNK disconnected by some reason, the device will reject reconnection request from peer.
This CL will judge the peer device is A2DP SRC, will reject the reconnection request.
So if peer device is A2DP SNK, will accept the reconnection request.

BUG:26274393

Change-Id: Idecef527a763693f08d76d90512546f013312aa1
Signed-off-by: z00184990 <z00184990@notesmail.huawei.com>
Signed-off-by: Zhao Xuewen <zhaoxuewen@huawei.com>
8 years agoStop turning on SCO audio automatically during call
Hall Liu [Sat, 20 Feb 2016 01:20:08 +0000 (17:20 -0800)]
Stop turning on SCO audio automatically during call

Remove some code that turns on SCO audio automatically when a device
connects, since Telecom should be responsible for routing audio to
bluetooth during a call.

Bug: 22507913
Change-Id: Iabf9cb8dd77d47505e87d865f8208268d9b417b7

8 years agoservice: use AIDL
Jakub Pawlowski [Tue, 16 Feb 2016 19:53:14 +0000 (11:53 -0800)]
service: use AIDL

Change-Id: Ic6261a9bafc65a5534f4e580ef9cae1fa82b4086

8 years agoservice: use Parcelable instead of helpers
Jakub Pawlowski [Tue, 16 Feb 2016 04:18:19 +0000 (20:18 -0800)]
service: use Parcelable instead of helpers

In order to user .aidl in the future, all types will have to be
parcelable. We don't add Parcelable to base types, as they might
be also used with other transports than binder in future.

Change-Id: I88e6961e69ac0e5d04bd4b6fe3cd7d79bd6f73ba

8 years agoTell the build system this is a host module.
Ying Wang [Wed, 23 Mar 2016 18:41:15 +0000 (11:41 -0700)]
Tell the build system this is a host module.

We need to tell the build system this is a host module before calling
local-generated-sources-dir.

Change-Id: Ie36ad938c0c7124865148f20fcb70d5187f158b8

8 years agoHID: Fix to show mouse pointer movements on UI
Nitin Shivpure [Fri, 15 Jan 2016 11:04:37 +0000 (16:34 +0530)]
HID: Fix to show mouse pointer movements on UI

As per the UHID implementation, UHID_OPEN & UHID_CLOSE
can be ignored, but it is useful for power-management.
Since these events are handled on hid host, ready_for_data
needs to be set to TRUE. Previously the hid reports were not
sent to kernel UHID driver leading to no mouse pointer movement
on UI of DUT.

Change-Id: I708f5be4240f07826c6eefc5404af3e42f80cfa4

8 years agoInitiate SCO after Mode change event
Mallikarjuna GB [Mon, 1 Jun 2015 07:28:38 +0000 (12:58 +0530)]
Initiate SCO after Mode change event

Use case:
1. Connect a headset to AG.
2. Make an outgoing call using headset.

Failure:
SCO connection request is rejected by headset.

Root cause:
AG initiated SCO connection when mode change is pending
on headset. Remote is coming out of sniff and rejected
SCO connection request.

Fix:
AG initiates SCO connection request once AG receives mode
change event. It resolves a corner case where remote failed
to accept SCO connection when initiated in between unsniff
LMP request. Issue is seen with WEP301 headset.

Change-Id: I4ea5d073630320b30f90e6141f4daf25943cca0b

8 years agoAvoid sending SCO disconnect when power mode is processing
Mallikarjuna GB [Sat, 30 May 2015 18:03:58 +0000 (23:33 +0530)]
Avoid sending SCO disconnect when power mode is processing

Use case:
1. Pair and connect with Mercedes car kit.
2. Answer incoming call by phone or car kit.
3. Switch audio between car kit and phone.
4. Repease 1-3 steps.

Failure:
Car kit is going into bad state and not accepting SCO disconnect.

Root cause:
Phone has sent SCO disconnect command to car kit when
power mode command(sniff/unsniff) is in the processing
on the ACL where SCO is active. Car kit didn't accept
remove SCO request command and gone into bad state.

Fix:
AG should send sco disconnect once power mode change is completed
to avoid this failure.

Change-Id: I7eba162a8fd9615795009ab26005535a3e5c7e86

8 years agoProcess complete AT cmd response.
Satish Kodishala [Thu, 11 Feb 2016 17:05:40 +0000 (22:35 +0530)]
Process complete AT cmd response.

Usecase:
1. Enable hf client role and connect with AG.
2. Receive an incoming call and accept from hf client.
3. End call from hf client.
4. Repeat the steps few times.

Failure:
UI is not updated with proper call status although
call is active.

Root cause:
When OK is received as part of AT command response,
application is not updated for it. This caused response
state mismatch in application and hence queue was not
cleared properly.

Fix:
Parse complete AT command response and update application
accordingly.

Change-Id: I8cb2362369b209903700e87330ed2a3e3052b188

8 years agoAbort parsing in case of format error
Satish Kodishala [Thu, 11 Feb 2016 14:32:08 +0000 (20:02 +0530)]
Abort parsing in case of format error

Usecase:
1. Enable hf client and connect to AG.
2. Send +COPS with length more than allowed 16 characters.

Failure:
Crash might be seen while parsing +COPS response from AG.

Root cause:
sscanf used for parsing the AT commands does not update
the characters scanned when there is format error.

Fix:
Abort the processing in case of format error.

Change-Id: Id3ca80712df3d0251cf9ffb04d9c766be809ae84

8 years agoMove to idle when remote disconnects during connection.
Ayan Ghosh [Tue, 7 Jan 2014 11:17:19 +0000 (16:47 +0530)]
Move to idle when remote disconnects during connection.

Chrysler Uconnect Touch initiates disconnect for a2dp on
l2cap just after discovery on AVDTP channel, stack does not
send any message to BTIF layer for disconnection, this
causes btif getting stuck in opening state and later no stable
connection update is sent to app. Since it is intermediate
state all subsequent connection trials fails.

Send disconnect event from incoming state to closing state
and then closing state will send proper msg to btif layer. Add
closing msg handling in btif layer so that we can update app
for connection disconnect when initiated from remote and move to
proper stable state for accepting/initiating connection.

Change-Id: I011d9ffe9d721235217320c1e5281f70328c7f13

8 years agoAllocate buffer for AV SDP in Stack
Ayan Ghosh [Thu, 3 Mar 2016 10:37:38 +0000 (16:07 +0530)]
Allocate buffer for AV SDP in Stack

Remove buffer allocation in BTA while going for SDP before triggering
A2DP connection. This strategy is followed to address memory corruption
issues due to freeing of BTA buffer before SDP RSP call back is
triggered and access the freed buffer from there, leads to crash when
running Codemonicom tests.

The change allocates and frees buffer in stack.

Change-Id: If6d60d2aa60d19ce5120dd38c2f365d70943db81

8 years agoDo not initiate SDP for incoming AVDTP connection
Ayan Ghosh [Thu, 11 Dec 2014 12:26:02 +0000 (17:56 +0530)]
Do not initiate SDP for incoming AVDTP connection

There are few instances when remote initiates L2CAP
channel for AVDTP signaling but keeps quite after that,
and later on timeout DUT goes for rest of the signalling
procedure but does sdp prior to the same.Few peer
devices deletes a2dp sink sdp record when there is an
ongoing connection, as a result sdp request fails and
DUT fails to proceed with signalling procedure and
connection setup fails.

This patch makes sure that DUT does not go for redundant
sdp request for AVDTP, provided remote has already
established L2cap connection for the same. SDP is done
explicitly only incase of outgoing AV connection.

This issue is seen with Nokia Es headset.

Change-Id: Id44368687d5b3f97bf0258f8d4ff75f185db23af

8 years agoProcess AV HAL start only when previous instance is cleaned up
Ayan Ghosh [Thu, 3 Mar 2016 13:28:24 +0000 (18:58 +0530)]
Process AV HAL start only when previous instance is cleaned up

Change-Id: Iee232dacd3b79e6e94d26c73fb3e563fddced75c

8 years agoRestrict DUT supported SBC configuration in GET_CAP response
Ayan Ghosh [Thu, 17 Mar 2016 09:29:06 +0000 (14:59 +0530)]
Restrict DUT supported SBC configuration in GET_CAP response

DUT shows all possible SBC configurations as supported
as part of GET_CAP response and also allows AV SINK to
opt for any of these values from that set as part of
SET_CONFIG request, but later opts for only recommended
figures while streaming so that leads to mismatch in
configuration between the config values SINK sets during
SET_CONFIG and config values DUT chooses for streaming
and hence it causes PTS (version 6.4 onwards) certification
failure for below A2DP and AVDTP cases:

A2DP:
TC_SRC_SET_BV_04_I
TC_SRC_SET_BV_06_I

AVDTP:
TC_ACP_SRC_SIG_SMG_BV_18_C
TC_ACP_SRC_SIG_SMG_BV_20_C
TC_ACP_SRC_SIG_SMG_BV_22_C

Restricting DUT supported SBC configurations to reflect only
the configuration DUT opts for during streaming makes sure
remote also opts for those config values during SET_CONFIG
and later there is no mismatch.

Change-Id: I13dbe94e0ca52708fc62c6db7513f7985237c18c

8 years agoUse handles to identify GATT attributes (1/4)
Jakub Pawlowski [Thu, 17 Mar 2016 19:05:54 +0000 (12:05 -0700)]
Use handles to identify GATT attributes (1/4)

Bug: 27778668
Change-Id: Id7454450c1ce2164001a1f9ca0b91f18d84e3fd6

8 years agoAdd missing initialization of queue btm_cb.sec_pending_q
Pavlin Radoslavov [Mon, 21 Mar 2016 23:35:41 +0000 (16:35 -0700)]
Add missing initialization of queue btm_cb.sec_pending_q

Bug: 27763878
Change-Id: I93001a679e22b744c3feafda1997e5f7e707db4e

8 years agoLog error code on wakelock acquisition/release failure
Andre Eisenbach [Thu, 17 Mar 2016 23:51:36 +0000 (16:51 -0700)]
Log error code on wakelock acquisition/release failure

Bug: 27721443
Change-Id: I8ac9e738d916bfdcf125e33c0e09f90cc8d26d55

8 years agoCleanup after p_mcb if L2CA_ConnectReq() failed
Pavlin Radoslavov [Fri, 18 Mar 2016 08:02:45 +0000 (01:02 -0700)]
Cleanup after p_mcb if L2CA_ConnectReq() failed

If L2CA_ConnectReq() failed, make sure that
we cleanup the lcid cache state after the
affected p_mcb.

Also, extra check and a log message inside function
rfc_check_send_cmd().

Bug: 27334916
Change-Id: Ib2950d12ce456d74355f4bcc0e3c4d87603f8f91

8 years agoDon't clear the btsnoop log ringbuffer on compress.
Sharvil Nanavati [Mon, 29 Feb 2016 23:50:49 +0000 (15:50 -0800)]
Don't clear the btsnoop log ringbuffer on compress.

Change-Id: I0bf4279104e87b151553eba913491d934f3cde41

8 years agoAdd config source to dumpsys output
Ajay Panicker [Mon, 21 Mar 2016 18:23:09 +0000 (11:23 -0700)]
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

8 years agoDo not leak eventfd's for RFCOMM/AVDT/L2CAP
Andre Eisenbach [Fri, 18 Mar 2016 09:09:58 +0000 (02:09 -0700)]
Do not leak eventfd's for RFCOMM/AVDT/L2CAP

Various users of fixed_queue's do not free the lists properly after
using them. As a result two event fd's leak for each fixed_queue that
is not free'd, as fixed_queue contains two semaphores.

This can lead to run-away file descriptor allocation and an eventual
hard limit leading to various undefined behaviours.

Bug: 27731859
Change-Id: If9ce64b711083bf474d217aa537220065722ad3a

8 years agoMerge "Wait for UHID interface on boot"
wrehman [Thu, 17 Mar 2016 04:24:35 +0000 (04:24 +0000)]
Merge "Wait for UHID interface on boot"

8 years agoDon't send AT+BCC if local device doesn't support codec negotiation.
Sharvil Nanavati [Tue, 15 Mar 2016 20:13:45 +0000 (13:13 -0700)]
Don't send AT+BCC if local device doesn't support codec negotiation.

The current code only checked if the peer supported codec negotiation
before sending AT+BCC. But if codec negotation is disabled on the
local device, we should definitely not send AT+BCC.

Bug: 27213013
Change-Id: Id372a32a61a3d96d5c093bc50594ef0b8c2eff2e

8 years agoHID service discovery refactor
Jakub Pawlowski [Tue, 15 Mar 2016 22:35:38 +0000 (15:35 -0700)]
HID service discovery refactor

This patch changes how HID is initialized.
Up till now, HID discovery was intricately chained,
to make sure two operations are not scheduled at same time.
From now on, all discovery is done and all operations are
scheduled for execution right away. There is separate set
of functions making sure all operations will be executed
without collisions.

This patch also removes BTA_HH_SCPP_INST_DEF, which was
used as hardcoded service id.

Bug: 27698756
Change-Id: I30a7388e129844c5e4727b2ed2b7c05867cc73a8

8 years agoRestructure GATTC
Jakub Pawlowski [Tue, 15 Mar 2016 22:35:00 +0000 (15:35 -0700)]
Restructure GATTC

This patch changes how GATTC is structured. Up till now, it
contained tBTA_GATTC_CACHE and tBTA_GATTC_CACHE_ATTR. Those
structures were so ugly, someone hide them inside internal
header, to make sure noone would ever access them from outside
GATTC. They are now replaced with:
tBTA_GATTC_SERVICE,
tBTA_GATTC_CHARACTERISTIC,
tBTA_GATTC_DESCRIPTOR and
tBTA_GATTC_INCLUDED_SVC.

Those looks much better, and were made globally avaliable.
Thanks to way they're build, we no longer need set of access
methods, which were also very ugly:
BTA_GATTC_GetFirstChar
BTA_GATTC_GetNextChar
BTA_GATTC_GetFirstIncludedService
etc.

This patch breaks HID, DO NOT SUBMIT without HID refactor.

Bug: 27455533
Change-Id: Ic42cfff175e0cc1a0d8e1a1216e2b4b756cbf77d

8 years agoAdd LE L2CAP Connection Oriented Channel
Navin Kochar [Wed, 9 Mar 2016 17:41:53 +0000 (23:11 +0530)]
Add LE L2CAP Connection Oriented Channel

This implementation for LE L2CAP Connection Oriented Channel (a Bluetooth
Core Spec 4.1 feature) has been tested on the following formal and informal
IOP events conducted by BT SIG Sport and Fitness Working Group.

* Informal IOP – Tokyo 2014
* UPF 49 – Berlin 2014
* Formal IOP – Tokyo 2014
* Formal IOP – Santa Clara 2015

Change-Id: Ia6de62f9321a78b98930629f65078884157a9c0d
Signed-off-by: Navin Kochar <navin.kochar@intel.com>
8 years agoStart listener thread only after successful open call
Srinu Jella [Fri, 22 Jan 2016 12:19:15 +0000 (17:49 +0530)]
Start listener thread only after successful open call

Use case: Stress tests ON\OFF with different concurrent
scenarios

Failure: Crash in btsnoop_net_listen thread

Root cause: While starting and shutting down the module
we are calling same function update_logging(). While at
the start it is creating listen thread and throwing error
and exiting without closing the listen thread. While
shutdown of module it "should_log" matches with "is_logging"
and it considers cleanup is not required and returns,
leaving Behind the listen thread open. In the next BT ON,
another listen thread is created and causes the crash.

Fix: Started listener thread after prerequisite operations
are successful.

Change-Id: I92ef293d9b061d0ea65a0c41b506870152114bb0

8 years agoWait for UHID interface on boot
Warren Rehman [Thu, 10 Mar 2016 11:02:10 +0000 (20:02 +0900)]
Wait for UHID interface on boot

Poll and sleep to wait for UHID interface on boot to avoid losing
initial input event after boot.

Bug: 27442119
Change-Id: Ie2141c94624363385951c8316ad854d6ae2e82ec

8 years agoAllocate sufficient memory for FCS
Srinu Jella [Tue, 15 Mar 2016 11:06:19 +0000 (16:36 +0530)]
Allocate sufficient memory for FCS

Use Case: Hit LeakCanary detection during HDP

Failure: Crash while running LeakCanary detection.

Root cause: Did not have sufficient memory for data frame
which lead to crash.

Fix: Allocating sufficient memory for the data frame
which includes FCS in the header field.

Change-Id: I3bb862f29ecc854423796dc89820ba21c5db6050

8 years agoosi: add osi_rand()
Marie Janssen [Thu, 10 Mar 2016 19:27:53 +0000 (11:27 -0800)]
osi: add osi_rand()

Provide a replacement for rand() which has a better random source.

Change-Id: I38a8c74d86b89ec160b43b0f648f53b463be89bb

8 years agoRemoved unused function bta_sys_vs_hdl()
Pavlin Radoslavov [Mon, 14 Mar 2016 16:45:24 +0000 (09:45 -0700)]
Removed unused function bta_sys_vs_hdl()

Change-Id: Iaf199d418aafc0b518df2f7febfa1c9e29f1fa42

8 years agoRemoved duplicate (re)define of BTA_DM_SDP_DB_SIZE
Pavlin Radoslavov [Mon, 14 Mar 2016 17:06:45 +0000 (10:06 -0700)]
Removed duplicate (re)define of BTA_DM_SDP_DB_SIZE

Removed conditional duplicate re-define of BTA_DM_SDP_DB_SIZE.
BTA_DM_SDP_DB_SIZE has been already (conditionally) defined to 8000
in file include/bt_target.h

The conditional re-define of BTA_DM_SDP_DB_SIZE to a smaller
value (250) in file bta/dm/bta_dm_int.h should be removed, because
it is confusing and error-prone.

Change-Id: Id10a45562c7c57fd0a9131ef50b7b7a5c2801ec5

8 years agoFree allocation tracker hash map entries to reduce memory pressure
Srinu Jella [Fri, 6 Nov 2015 09:29:10 +0000 (14:59 +0530)]
Free allocation tracker hash map entries to reduce memory pressure

Use case:
A2DP playback becomes choppy after long hours of testing.

Steps:
1. installed 3rd party app that performs recurring LE scans.
2. Leave phone to run overnight.
3. After 24h+, connect a Bluetooth headset and music is very choppy.

Root cause:
The memory allocation tracker has support for double free check
where it stores all allocations in hash map but it never get
removed to track double free issue, A2DP memory allocation is
taking more time and leading to choppyness.

Fix:
Free the hash map entry to avoid memory leak from
allocation tracker.

Bug: 27621407
Change-Id: If57bd0b89c1d9b99c4f066c537a9e0fa49bc093f

8 years agoMerge "Add pair event device class and fix timestamp"
Ajay Panicker [Fri, 11 Mar 2016 19:33:21 +0000 (19:33 +0000)]
Merge "Add pair event device class and fix timestamp"

8 years agoAdd pair event device class and fix timestamp
Ajay Panicker [Thu, 10 Mar 2016 23:30:16 +0000 (15:30 -0800)]
Add pair event device class and fix timestamp

Added a function to get the device class to use with pair events.
Also update check_cod_hid as it was only being used with COD_HID_MAJOR.
Also fixed an issue with pair event timestamps where they were
using the wrong clock.

Bug: 27499938
Change-Id: I0805d7a3f82b28e7d7e73d80818948843f51a82b

8 years agoFix startup error when no config file provided
Jakub Pawlowski [Thu, 10 Mar 2016 17:20:45 +0000 (09:20 -0800)]
Fix startup error when no config file provided

If bluetoothtbd was started without config file
present, it would die on asserts about missing config.
From now it'll proceed with default settings.

Change-Id: I46c35fb2ed71efa49430206da13a19ca7df44a64

8 years agoMerge "Linux vendor driver linkage fixes"
Jakub Pawlowski [Thu, 10 Mar 2016 18:58:43 +0000 (18:58 +0000)]
Merge "Linux vendor driver linkage fixes"

8 years agoLinux vendor driver linkage fixes
Jakub Pawlowski [Thu, 10 Mar 2016 17:25:48 +0000 (09:25 -0800)]
Linux vendor driver linkage fixes

Linux driver depends on osi, so it must be linked with it.
It also must export bt_vendor_interface_t, and named properly,
otherwise it is not being recognized as vendor library.

Bug: 27589244
Change-Id: Ib6817b11e4226f2e289ff0d521daca059ca9aca6

8 years agoMerge "Fix build error caused by missing LOG_TAG"
Jakub Pawlowski [Wed, 9 Mar 2016 19:25:45 +0000 (19:25 +0000)]
Merge "Fix build error caused by missing LOG_TAG"

8 years agoMerge "Add missing 'cd third_party' step"
Jakub Pawlowski [Wed, 9 Mar 2016 19:25:06 +0000 (19:25 +0000)]
Merge "Add missing 'cd third_party' step"

8 years agoAdd missing log tag
Jakub Pawlowski [Wed, 9 Mar 2016 19:22:00 +0000 (11:22 -0800)]
Add missing log tag

Change-Id: Icae6cf63de8d298fb12451887594abe24b026c77

8 years agoRemove bta_gattc_id2handle
Jakub Pawlowski [Fri, 4 Mar 2016 19:46:08 +0000 (11:46 -0800)]
Remove bta_gattc_id2handle

Now that the instance id is equal to handle, we no longer need this
mapping function.

Bug: 27455533
Change-Id: I6760f8fc81460df8520d4ebf1899ed256ce5ad1e

8 years agoUse attribute handle instead of id in GATT cache
Jakub Pawlowski [Wed, 2 Mar 2016 22:47:55 +0000 (14:47 -0800)]
Use attribute handle instead of id in GATT cache

Currently we generate an id for each GATT attribute. Those ids
are used to differentiate between attributes that have the same
UUID. We need to get rid of those ids because it won't work with
partial GATT database updates due to "service change"
notifications. Instead, attribute handles, which are unique
across the whole GATT database will be used.

This is first patch in series to achieve that. It gets rid
of id generation, and just assigns handle in place of ids inside
of gatt cache. Upcoming patches will change the GATT cache API
and eventually get rid of "id" completly.

Bug: 27455533
Change-Id: I74c10872ecc223329b8ac7fef4085963bf272624

8 years agoHID multi-device refactoring
Jakub Pawlowski [Tue, 8 Mar 2016 20:36:46 +0000 (12:36 -0800)]
HID multi-device refactoring

We don't really support multiple HID services in same device.
We shouldn't use default value 0 for service id.
We shouldn't merge service id and characteristic id into one field,
as it's done not right right now.

Bug: 27455533
Change-Id: I46cc1b62bb2c7393e62f3b1a8e4650706954a066

8 years agoSDP: Restrict attribute length to SDP_MAX_ATTR_LEN
venkata Jagadeesh [Tue, 15 Dec 2015 07:30:01 +0000 (13:00 +0530)]
SDP: Restrict attribute length to SDP_MAX_ATTR_LEN

Use case:
Bluetooth crash during the SNS testing.

Root Cause:
In sdpu_build_partial_attrib_entry there is no length check, it can
exceed the maximum allowable value and lead to a crash in memcpy.

Fix:
Restrict remaining attribute length to SDP_MAX_ATTR_LEN
in sdpu_build_partial_attrib_entry.

Change-Id: I5bde6868b82e50b3c09cf94277dabb4862f0a2a8

8 years agobluetooth-cli: add support for --exec
Marie Janssen [Tue, 8 Mar 2016 19:50:27 +0000 (19:50 +0000)]
bluetooth-cli: add support for --exec
am: 5d80cb938d

* commit '5d80cb938d7fb3312870a047749cc839ba5bafca':
  bluetooth-cli: add support for --exec

8 years agobluetooth-cli: add support for --exec
Marie Janssen [Fri, 22 Jan 2016 02:45:53 +0000 (18:45 -0800)]
bluetooth-cli: add support for --exec

Adds the --exec and -e arguments, which execute commands when the
cli starts.

This also adds support for chaining commands at the command line by
separating them with ';' characters.

Change-Id: Ic2bf8a908fbb7fb4cf775810754571fa96d75e87

8 years agoGATT cache storage refactoring
Jakub Pawlowski [Tue, 8 Mar 2016 03:04:34 +0000 (03:04 +0000)]
GATT cache storage refactoring
am: c10b209f62

* commit 'c10b209f62a52d2a782d4d8c97734b6c142f2567':
  GATT cache storage refactoring

8 years agoGATT cache storage refactoring
Jakub Pawlowski [Sun, 6 Mar 2016 01:57:51 +0000 (17:57 -0800)]
GATT cache storage refactoring

Currently when storing GATT cache into file, we save it piece
after piece, max 10 elements at once. This is not necessary,
we have enough space to just save all at once.
Also the logic doesn't need to be so complicated - no need
to state machine for such simple task.

Bug: 27455533
Change-Id: I82923dbedfb317835e45e13e0ea28151eb524d37

8 years agoIgnore LCB entries that migth have been released while queued
Pavlin Radoslavov [Mon, 7 Mar 2016 21:05:23 +0000 (21:05 +0000)]
Ignore LCB entries that migth have been released while queued
am: fb2105f348

* commit 'fb2105f3488e48f2d908b13a33f47e34f6e3f78d':
  Ignore LCB entries that migth have been released while queued

8 years agoIgnore LCB entries that migth have been released while queued
Pavlin Radoslavov [Tue, 1 Mar 2016 21:32:41 +0000 (13:32 -0800)]
Ignore LCB entries that migth have been released while queued

Function btm_send_pending_direct_conn() dequeues tL2C_LCB
entries from the conn_pending_q queue and calls the processing
function.
However, there is the possilility of a race condition
and releasing the entry by l2cu_release_lcb() before it is processed.
Now tL2C_LCB that are not in_use are ignored.

Bug: 27418154
Change-Id: I4b5fda605a60c8aebbf5587bb12dd74ac5d28f68

8 years agoFix build error caused by missing LOG_TAG
Patrick Tsai [Sun, 6 Mar 2016 09:42:19 +0000 (01:42 -0800)]
Fix build error caused by missing LOG_TAG

FAILED: gcc -MMD -MF obj/hci/src/libhci.hci_packet_parser.o.d -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DHAS_NO_BDROID_BUILDCFG -DLOG_NDEBUG=1 -DEXPORT_SYMBOL=__attribute__\(\(visibility\(\"default\"\)\)\) -DKERNEL_MISSING_CLOCK_BOOTTIME_ALARM=TRUE -DOS_GENERIC -I../../hci/include -I../.. -I../../include -I../../bta/include -I../../btcore/include -I../../stack/include -I/home/patrick/src/fluoride/libhardware/include -I/home/patrick/src/fluoride/core/include -I/home/patrick/src/fluoride/media/audio/include -g -O0 -fpic -fdata-sections -ffunction-sections -fvisibility=hidden -std=c99 -c ../../hci/src/hci_packet_parser.c -o obj/hci/src/libhci.hci_packet_parser.o
In file included from ../../hci/src/hci_packet_parser.c:28:0:
../../hci/src/hci_packet_parser.c: In function ‘read_command_complete_header’:
../../hci/src/hci_packet_parser.c:239:43: error: expected ‘)’ before ‘__func__’
     LOG_ERROR("%s: return status - 0x%x", __func__, status);

Change-Id: I6ca721ba24ba3170d701f606f0676c5c4e707cf8

8 years agoAdd missing 'cd third_party' step
Patrick Tsai [Sun, 6 Mar 2016 08:35:09 +0000 (00:35 -0800)]
Add missing 'cd third_party' step

8 years agoUpdate device type in NVRAM correctly during inquiry
Subramanian Srinivasan [Fri, 4 Mar 2016 22:02:25 +0000 (22:02 +0000)]
Update device type in NVRAM correctly during inquiry
am: ab7418f58c

* commit 'ab7418f58c84216d57b7c0d553f09f5748badd82':
  Update device type in NVRAM correctly during inquiry

8 years agoUpdate device type in NVRAM correctly during inquiry
Subramanian Srinivasan [Thu, 23 Jul 2015 22:05:05 +0000 (15:05 -0700)]
Update device type in NVRAM correctly during inquiry

If the NVRAM device type for a device is not dual mode and the inquiry
result is received for BLE or BR/EDR transport, then this patch updates
the NVRAM device type to dual mode.

Change-Id: I688e7c5e3bd8d844288d095cb97c2e55ddf652c6

8 years agoDefault missing DevType and DevClass in NVRAM.
Jacky Cheung [Fri, 4 Mar 2016 21:58:32 +0000 (21:58 +0000)]
Default missing DevType and DevClass in NVRAM.
am: 3b6ef54cd2

* commit '3b6ef54cd262da6a41a16dafe361040740024717':
  Default missing DevType and DevClass in NVRAM.

8 years agoGATT: Initiate L2CAP disconnect only when the channel is open
venkata Jagadeesh [Fri, 4 Mar 2016 21:58:28 +0000 (21:58 +0000)]
GATT: Initiate L2CAP disconnect only when the channel is open
am: bf955cb7e5

* commit 'bf955cb7e50e1047452e741effa504c8aefc8a4f':
  GATT: Initiate L2CAP disconnect only when the channel is open

8 years agoDefault missing DevType and DevClass in NVRAM.
Jacky Cheung [Fri, 4 Mar 2016 21:29:02 +0000 (13:29 -0800)]
Default missing DevType and DevClass in NVRAM.

Missing DevType and DevClass in NVRAM were not properly set to a
default values previously.

8 years agoGATT: Initiate L2CAP disconnect only when the channel is open
venkata Jagadeesh [Thu, 26 Nov 2015 08:44:00 +0000 (14:14 +0530)]
GATT: Initiate L2CAP disconnect only when the channel is open

Use case:
Crash found during L2CAP disconnect from faulty BLE APP.

Steps:
Run SNS testing.

Failure:
Crash during L2CAP disc.

Root cause:
Faulty BLE application triggering GATT disconnection
which internally triggering L2CAP disconnection without checking
proper state of channel.

Fix:
- Initiate L2CAP disconnect only when the channel is open
- Validate LCB during disconnection from upper layers

Change-Id: Ic9d065f095feba659c861828732647e968c20db8

8 years agoRemove btla-specific comments
Jakub Pawlowski [Fri, 4 Mar 2016 21:50:24 +0000 (21:50 +0000)]
Remove btla-specific comments
am: 1be7ae1a08

* commit '1be7ae1a0890380b8a3daebcade0c1f55b04b167':
  Remove btla-specific comments