OSDN Git Service

android-x86/system-bt.git
8 years agoOnly send first 16 characters of operator name in +COPS. am: 61b8ebf698
Sharvil Nanavati [Fri, 22 Apr 2016 00:37:30 +0000 (00:37 +0000)]
Only send first 16 characters of operator name in +COPS. am: 61b8ebf698
am: 9837f7e339

* commit '9837f7e339e6e80aaf234b80b8ff07cf09faddc0':
  Only send first 16 characters of operator name in +COPS.

Change-Id: I976b7618610287db0ce2c337a2fde44f3b5d31a9

8 years agoFix crashes with lots of discovered LE devices
Marie Janssen [Fri, 22 Apr 2016 00:37:19 +0000 (00:37 +0000)]
Fix crashes with lots of discovered LE devices
am: a8ace3826b  -s ours

* commit 'a8ace3826b05d1ade5beb5ef2ba4dfd8d9cf98b6':
  Fix crashes with lots of discovered LE devices

Change-Id: Ie1c67a4f78c3039b58702d7a80a5ad33ff3870ff

8 years agoDO NOT MERGE Blacklist devices for absolute volume control
Andre Eisenbach [Fri, 22 Apr 2016 00:23:43 +0000 (00:23 +0000)]
DO NOT MERGE Blacklist devices for absolute volume control
am: bef34921ee  -s ours

* commit 'bef34921ee313f8378059d3205ebb485498b3404':
  DO NOT MERGE Blacklist devices for absolute volume control

Change-Id: Id0ecff030d77833525fbecfea6c8fc9d029579ef

8 years agoRevert "Blacklist devices for absolute volume control"
Ian Pedowitz [Fri, 22 Apr 2016 00:23:31 +0000 (00:23 +0000)]
Revert "Blacklist devices for absolute volume control"
am: 22c5f47b7f  -s ours

* commit '22c5f47b7f7bc4739fb1ddf85eb81d8b20f7b222':
  Revert "Blacklist devices for absolute volume control"

Change-Id: Iab1a73d729f578e5e82688fb4c3e5aa1455db729

8 years agoBlacklist devices for absolute volume control
Andre Eisenbach [Thu, 21 Apr 2016 23:42:20 +0000 (23:42 +0000)]
Blacklist devices for absolute volume control
am: 2c8897ca35  -s ours

* commit '2c8897ca35a93148619d662df03bd9da1b73679a':
  Blacklist devices for absolute volume control

Change-Id: I5f0cbd1030b0e039ffcc04ae7a109f127a6acefa

8 years agoMerge "Fix absolute volume reporting if AVRC_ADV_CTRL_INCLUDED is false" into cw...
Sharvil Nanavati [Thu, 21 Apr 2016 22:35:58 +0000 (22:35 +0000)]
Merge "Fix absolute volume reporting if AVRC_ADV_CTRL_INCLUDED is false" into cw-e-dev am: 3c8de06896
am: b35d5c358e

* commit 'b35d5c358e546657bfa2195a260a9ef4301318bc':
  Fix absolute volume reporting if AVRC_ADV_CTRL_INCLUDED is false

Change-Id: Ic4827eab53322da5cc88affe2c5d9014ac6b2e56

8 years agoDO NOT MERGE ANYWHERE net_test_bluetooth: replace with gtest variant am: 786a7e5941...
Scott James Remnant [Thu, 21 Apr 2016 22:35:56 +0000 (22:35 +0000)]
DO NOT MERGE ANYWHERE net_test_bluetooth: replace with gtest variant am: 786a7e5941  -s ours
am: 919642a4cd  -s ours

* commit '919642a4cdcc2d6a112a5a6dfebc6f8e60f706ed':
  DO NOT MERGE ANYWHERE net_test_bluetooth: replace with gtest variant

Change-Id: I3ae03e08d4d15670e0f6c4e622c0a105da932868

8 years agoMerge "DO NOT MERGE ANYWHERE Rename gtest_net_test_bluedroid to gtest_net_test_blueto...
Joshua Schwarz [Thu, 21 Apr 2016 22:35:55 +0000 (22:35 +0000)]
Merge "DO NOT MERGE ANYWHERE Rename gtest_net_test_bluedroid to gtest_net_test_bluetooth." into cw-e-dev am: 78ec0dc441  -s ours
am: c20ef5387b  -s ours

* commit 'c20ef5387b82642a5e3320083dc0a76efe5fbfb7':
  DO NOT MERGE ANYWHERE Rename gtest_net_test_bluedroid to gtest_net_test_bluetooth.

Change-Id: Ib426458adec10205067a94a85cab2d3d7f67bbdb

8 years agoFix BT connection failures am: 198abcd704
Devin Kim [Thu, 21 Apr 2016 22:35:53 +0000 (22:35 +0000)]
Fix BT connection failures am: 198abcd704
am: e6fdbaf8a7

* commit 'e6fdbaf8a74e95c54b1333ed631061ce5a68d22f':
  Fix BT connection failures

Change-Id: I1f663b6dcde84e9517e9fc226598e74b711c479e

8 years agoDO NOT MERGE ANYWHERE: osi: Remove error_fclose goto and redundant fflush. am: e52633...
Alain Vongsouvanh [Thu, 21 Apr 2016 22:35:52 +0000 (22:35 +0000)]
DO NOT MERGE ANYWHERE: osi: Remove error_fclose goto and redundant fflush. am: e52633cecf  -s ours
am: 2be2e45a99  -s ours

* commit '2be2e45a991f8f7dfcd0b4443e2d19f4117912db':
  DO NOT MERGE ANYWHERE: osi: Remove error_fclose goto and redundant fflush.

Change-Id: Ib411b7d4676cc8456bc51e5891112d71538532a5

8 years agoDO NOT MERGE ANYWHERE: Add file write error checks to config_save am: 02f35e6a36...
Amadeusz Slawinski [Thu, 21 Apr 2016 22:35:50 +0000 (22:35 +0000)]
DO NOT MERGE ANYWHERE: Add file write error checks to config_save am: 02f35e6a36  -s ours
am: 99184508a2  -s ours

* commit '99184508a236c839db86ae92c97c585a9cd3d2aa':
  DO NOT MERGE ANYWHERE: Add file write error checks to config_save

Change-Id: If6a034f76c58180b3e3ea6c8be88032b35c5b225

8 years agoMerge "DO NOT MERGE Revert "A2DP SRC offload support"" into mnc-dr1.5-dev
Chris Elliott [Thu, 21 Apr 2016 22:35:49 +0000 (22:35 +0000)]
Merge "DO NOT MERGE Revert "A2DP SRC offload support"" into mnc-dr1.5-dev
am: e0800b66e0  -s ours

* commit 'e0800b66e011139186f89d0387a6c86fcc5b6ec7':
  DO NOT MERGE Revert "A2DP SRC offload support"

Change-Id: I0cf27fb610f6a24ccc0eaf9dc5641f5034167411

8 years agoDO NOT MERGE Revert "Make default SBC bitrate configurable by device."
Chris Elliott [Thu, 21 Apr 2016 22:35:47 +0000 (22:35 +0000)]
DO NOT MERGE Revert "Make default SBC bitrate configurable by device."
am: a09c5aad67  -s ours

* commit 'a09c5aad672222130e2a3c03c9a9317b56541dd1':
  DO NOT MERGE Revert "Make default SBC bitrate configurable by device."

Change-Id: I1e31bdc958154617f490a9e6825d82170657187e

8 years agoDO NOT MERGE Revert "Always send a SUSPEND_CFM event when suspended due to A2DP RECON...
Chris Elliott [Thu, 21 Apr 2016 22:35:46 +0000 (22:35 +0000)]
DO NOT MERGE Revert "Always send a SUSPEND_CFM event when suspended due to A2DP RECONFIGURE."
am: 775667a632  -s ours

* commit '775667a632ab5e8e14ced69828af65b27978f1b6':
  DO NOT MERGE Revert "Always send a SUSPEND_CFM event when suspended due to A2DP RECONFIGURE."

Change-Id: Ia111f7d01ab94430a6e3be64b4c442852f28bdf6

8 years agoMerge "Mark secure link as authenticated for LE" into cw-e-dev am: e6242fcf30
Zach Johnson [Thu, 21 Apr 2016 22:35:44 +0000 (22:35 +0000)]
Merge "Mark secure link as authenticated for LE" into cw-e-dev am: e6242fcf30
am: a7945b11ce

* commit 'a7945b11ce231d53f5ced337136cd34ee8e5eea3':
  Mark secure link as authenticated for LE

Change-Id: I2340c1c65f8caf504837eab01c9e458cc2c5882b

8 years agoAlways send a SUSPEND_CFM event when suspended due to A2DP RECONFIGURE. am: 8b1c7af03a
Sridhar Vashist [Thu, 21 Apr 2016 22:35:42 +0000 (22:35 +0000)]
Always send a SUSPEND_CFM event when suspended due to A2DP RECONFIGURE. am: 8b1c7af03a
am: 9c55e7e6e0

* commit '9c55e7e6e0816caf83c263fd0ef7e4c4410fb46f':
  Always send a SUSPEND_CFM event when suspended due to A2DP RECONFIGURE.

Change-Id: I87df5fafbd77a06e5c0ff797a57868caafa9f57d

8 years agoMake default SBC bitrate configurable by device. am: 5f308397b7
Sridhar Vashist [Thu, 21 Apr 2016 22:35:40 +0000 (22:35 +0000)]
Make default SBC bitrate configurable by device. am: 5f308397b7
am: b2019873c6

* commit 'b2019873c6253f29026b473ad92e417796c7a166':
  Make default SBC bitrate configurable by device.

Change-Id: I2257bf7a4f6e24d1995f93469268021476c1f829

8 years agoMerge "A2DP SRC offload support" into cw-e-dev am: ffdfe1d26d
Chris Elliott [Thu, 21 Apr 2016 22:35:27 +0000 (22:35 +0000)]
Merge "A2DP SRC offload support" into cw-e-dev am: ffdfe1d26d
am: 51c3eb6a0c  -s ours

* commit '51c3eb6a0c3b55183d30881180982f62c48dba95':
  A2DP SRC offload support

Change-Id: I9f7967ca1b27fa8bc498c6f9b20d6049fd8e384a

8 years agoMerge "Add missing init/destroy of state_lock mutex" into nyc-dev
TreeHugger Robot [Thu, 21 Apr 2016 19:36:59 +0000 (19:36 +0000)]
Merge "Add missing init/destroy of state_lock mutex" into nyc-dev

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 agoAdd missing init/destroy of state_lock mutex
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

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 agoAdd guest mode functionality (2/5)
Ajay Panicker [Fri, 18 Mar 2016 00:09:24 +0000 (17:09 -0700)]
Add guest mode functionality (2/5)

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: I8f23d28ef0aa3a8df13d469c73005c8e1b894d19

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

Bug: 28068134

Change-Id: I16d017ef90269a435b8f66a58ed06d2fc89d407f

8 years agoMerge "AVRCP: Update sdp record correctly for CT or TG." into nyc-dev
Sanket Agarwal [Fri, 15 Apr 2016 20:50:44 +0000 (20:50 +0000)]
Merge "AVRCP: Update sdp record correctly for CT or TG." into nyc-dev

8 years agoMerge "Allow A2DP SNK audio track focus gain interface." into nyc-dev
Sanket Agarwal [Fri, 15 Apr 2016 20:23:49 +0000 (20:23 +0000)]
Merge "Allow A2DP SNK audio track focus gain interface." into nyc-dev

8 years agoFix LE central device not being able to disconnect
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

8 years agoAVRCP: Update sdp record correctly for CT or TG.
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

8 years agoAllow A2DP SNK audio track focus gain interface.
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

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 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 agoMerge changes I26563b75,If7ee9d96 into nyc-dev
Marie Janssen [Wed, 6 Apr 2016 14:17:04 +0000 (14:17 +0000)]
Merge changes I26563b75,If7ee9d96 into nyc-dev

* changes:
  Fix memory leak when saving paired devices
  btif: Don't persist remote devices to the config

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 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 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 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.

Bug: 27824878
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 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 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 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 agoRevert "Add guest mode functionality (2/5)"
Ajay Panicker [Mon, 28 Mar 2016 21:58:59 +0000 (21:58 +0000)]
Revert "Add guest mode functionality (2/5)"

This reverts commit 45ee419b233480060548f19b09de6726d28a06ea.

Change-Id: I7d24acbe09305611c4e0bbfe7d40348d0fd1c365

8 years agoAdd guest mode functionality (2/5)
Ajay Panicker [Fri, 18 Mar 2016 00:09:24 +0000 (17:09 -0700)]
Add guest mode functionality (2/5)

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

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 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.

Bug: 27852645
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.

Bug: 27852645
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.

Bug: 27852645
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.

Bug: 27852645
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.

Bug: 27852645
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.

Bug: 27852645
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.

Bug: 27852645
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.

Bug: 27852645
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

Bug: 27852645
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.

Bug: 27852645
Change-Id: I13dbe94e0ca52708fc62c6db7513f7985237c18c

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 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 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

Bug: 27852645
Change-Id: Ia6de62f9321a78b98930629f65078884157a9c0d
Signed-off-by: Navin Kochar <navin.kochar@intel.com>
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.

Bug: 27852645
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 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 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 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.

Bug: 27852645
Change-Id: I5bde6868b82e50b3c09cf94277dabb4862f0a2a8

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 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.

Bug: 27852645
Change-Id: I688e7c5e3bd8d844288d095cb97c2e55ddf652c6

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.

Bug: 27852645
Change-Id: I79fbc333d7b6dda0fb795776b2dbe1e1e101352c

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

Bug: 27852645
Change-Id: Ic9d065f095feba659c861828732647e968c20db8

8 years agoRemove btla-specific comments
Jakub Pawlowski [Fri, 4 Mar 2016 21:20:05 +0000 (13:20 -0800)]
Remove btla-specific comments

Change-Id: I91a19b2cfbc96d7567e0e0914058619ea364c1d4

8 years agoCorrecting sniff behaviour in multi-connection scenario
Matadeen Mishra [Mon, 1 Feb 2016 13:50:54 +0000 (19:20 +0530)]
Correcting sniff behaviour in multi-connection scenario

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

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

Failure: HF connection fails.

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

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

Bug: 27852645
Change-Id: I8e215a9d868291976c70ff32b61145b4360a7f8f

8 years agoCleanup L2CAP socket properly on close
Srinu Jella [Mon, 21 Sep 2015 06:30:48 +0000 (12:00 +0530)]
Cleanup L2CAP socket properly on close

Use case:
1. Sometimes pairing pop up occurs during Android beam
   transfer though it is not required.
2. No OPP Tx request over OBEX if we cancel during file transfer.

Precondition
1. WIFI ON and conneted with AP.

Steps:
1. Pair and connect from DUT to remote.
2. Go to gallery and send a file.
3. Accept same file and stop it from remote during transfer.
4. Repeat step 2-4 10 times.

Failure:
OPP Tx should not fail.

Root cause:
Close request was not properly handled from BT-IF layer.

Fix:
1. Handled the close request properly from BT-IF layer
   to close the socket variables and instruct the BTA layer
   close from there as well.
2. Clean up L2CAP socket properly on closure to free
   the entry registered with security manager to avoid
   leak in security manager records.

Bug: 27852645
Change-Id: I4f5d6ac92317bcaee5f9285ba71d13eea84c737c

8 years agoGAP Setting remove device pending status as FALSE
Balraj Selvaraj [Thu, 11 Feb 2016 08:16:02 +0000 (13:46 +0530)]
GAP Setting remove device pending status as FALSE

Use case: DUT deletes Link key and failed to initiate
  authentication request after remote headset turned Off and ON

steps:
- Pair the DUT and HS. (Link Keys get established.)
- Now Switch OFF BT on DUT. (DUT still has the Link key of HS)
- Reset the paired devices memory in HS and keep HS in
  pairing mode. (HS loses DUT's link key)
- Now switch ON BT on DUT. (DUT starts reconnection with HS,
  but as HS lost DUT's key, PIN or KEY missing event will
  come to host)
- DUT reconnects to HS (Using newly established link keys)
- Now power OFF and ON the HS.
- HS will try reconnection with DUT.
- While there is an incoming connection from HS to DUT,
  host is giving negative link key reply always for the
  multiple link key requests from HS.
- HS sends disconnection with "Authentication failure"

Failure: DUT should not delete Link key and DUT should
  initiate Authenticatin request.

Root cause: pending status was not FALSE from security device
  DB, which will causing Authentication Failure.

Fix: Setting the remove device pending status to FALSE from
  security device DB, when the link key notification event
  comes. Basically it will avoid deleting the device from
  security device DB, Which is solving the reconnection
  initated from remote when we remove the link key at
  remote side.

Bug: 27852645
Change-Id: Ic164d8d5b5c2e0b9cc5f04f993047fb0a8e5d9a9

8 years agoTrack TX empty event to manage sniff timer
Srinu Jella [Tue, 16 Feb 2016 14:52:16 +0000 (20:22 +0530)]
Track TX empty event to manage sniff timer

Use case:
OPP TX while inquiry is in progress.

Steps:
1. Send any file from DUT to remote using BT.
2. Accept file on remote.
3. During file transfer, start inquiry on DUT and
   observe behaviour.

Failure:
DUT sends sniff command in the middle of the transfer
though it is not required. eventually OPP Tx over
L2CAP file transfer fail.

Root Cause:
As per the current implementation, for tx it will
immediately starts idle timer without checking
for the completion status of tx.

Fix:
Handled the tx complete event from L2CAP properly
to start the idle timer to manage the sniff properly.

Bug: 27852645
Change-Id: I298075590042e82a2f33837f6df6af0b2fd8179a

8 years agoRead local supported codecs as part of boot sequence
Srinu Jella [Wed, 22 Jul 2015 12:00:32 +0000 (17:30 +0530)]
Read local supported codecs as part of boot sequence

Add support to read local supported codecs as part of
controller module initialization.

Also added an API from controller interface to get the
local supported codecs.

Bug: 27852645
Change-Id: I37a4ab9e6a20ed057ca794dbdd4f99c2a8c65a6e

8 years agoAdded fd for monitoring when the channel is not congested
Srinu Jella [Tue, 11 Aug 2015 13:46:52 +0000 (19:16 +0530)]
Added fd for monitoring when the channel is not congested

Use case:
Skips and Media Audio Loss are Observed During PAN Connection

Steps:
1. Launched Local Music and Media Audio was in Headset.
2. Paired and Connected to other Phone to DUT Over BT Tethering.
3. While  Listening to Media Audio in DUT, Started Watching
   Youtube in other phone.
4. Observed Below Observations During Some 30mins of PAN Connection.

Failure:
Skips and Media Audio Loss are Observed During PAN Connection

Root Cause:
socket monitor thread keeps polling for PAN fd, eventually
it will make the BTU thread also busy, inturn NOCP processing
gets delayed.

Fix:
Add PAN fd for monitoring only when L2CAP channel related to
PAN profile is not congested. It will break loop by checking the
congestion status to put the fd for polling.

Bug: 27852645
Change-Id: I2119c6c86d8e4798e516c512ad7aac7630b85a6a

8 years agoHID: Handle collisions during incoming and outgoing connections
Hemant Gupta [Fri, 11 Dec 2015 14:39:22 +0000 (20:09 +0530)]
HID: Handle collisions during incoming and outgoing connections

- This patch handles cases when incoming HID connection is in progress, and
  there is an outgoing connection attempt from upper layers. This was leading
  to a case when ougoing connection would fail as connection was already in
  progress, which triggered cleanup of connection states, which was not proper
  leading to issues in future connection attempts, as disconnection during
  ongoing connection was not handled properly in existing code.

- Reset the incoming flags during open failure to prevent any possible issues
  during further outgoing connections.

Bug: 27852645
Change-Id: I6fb0c6156482d2da41ca0d2d280091d73c27f292

8 years agoHID: Reset outgoing connection retry to 1
Hemant Gupta [Fri, 4 Mar 2016 17:19:55 +0000 (22:49 +0530)]
HID: Reset outgoing connection retry to 1

Reduce the retry time from host to 1 from 3 to prevent collision scenarios
when remote also tries to connect which could lead to potential authentication
issues in SoC.

Bug: 27852645
Change-Id: I3b5db4a4c4aa985cb9c0537499ce608f9e5d5522

8 years agoHID: Remove bond for device in case Virtual unplug is ongoing
Hemant Gupta [Fri, 11 Dec 2015 10:17:45 +0000 (15:47 +0530)]
HID: Remove bond for device in case Virtual unplug is ongoing

Remove bond for remote device in case virtual unplug was initiated from
local device, and ACL got disconnected while processing the VUP request.
this can happen when aaplication is sending disconnect and remove bond
in quick succession. Without this fix it was observed that device was
getting disconnected, but was not getting unpaired even when user
tried to unpair from UI.

Bug: 27852645
Change-Id: Ife1fc99ed59b13daf0bcf0dce3e0a59c7d9e87d7

8 years agoShorten local name in EIR data according to UTF encoding rules
Matadeen Mishra [Wed, 3 Feb 2016 15:20:31 +0000 (20:50 +0530)]
Shorten local name in EIR data according to UTF encoding rules

Use case:
Test short name after setting the name with maximum length

Steps to reproduce:
1) Phone A: Rename bluetooth into a 60 character Chinese name
2) Phone B: Discover phone A.
3) The short name of phone A will display in phone B and the short
name cantains unrecognizable chars.

Root cause:
As Chinese characters are encoded in different
length in UTF, if shorten BT name in fixed length,
there will be unrecognized characters

Fix:
Shorten BT name according to UTF encoding rule and decrease
the length.

Bug: 27852645
Change-Id: I5f1e49c1b5d87d5e220538c90e297c50ccc790ff

8 years agoUse correct transport type for GATT client and server connections
Subramanian Srinivasan [Thu, 29 Oct 2015 00:05:22 +0000 (17:05 -0700)]
Use correct transport type for GATT client and server connections

Use correct transport type for GATT client and server connect
API calls. This change uses the transport used while calling
the connect frameworks API instead of relying on the NVRAM to
find the transport on which the connect call needs to be sent
to the BT stack.

Bug: 27852645
Change-Id: Idf5817b8980e848c6ebebf1e9a79dbce61d8cfc8

8 years agoUpdate OCF values per 0.96 spec
Satya Calloji [Wed, 2 Mar 2016 19:25:49 +0000 (11:25 -0800)]
Update OCF values per 0.96 spec

HCI command values are updated as per Google HCI
BLE requirements v0.96

Bug: 27069512
Change-Id: I30e0046c5d3198f0986e03baf697bad2be99c06e

8 years agoOCF for LE Extended Set Scan Parameters Cmd is not correct
Eri Kasamatsu [Tue, 9 Feb 2016 14:11:51 +0000 (15:11 +0100)]
OCF for LE Extended Set Scan Parameters Cmd is not correct

OCF for LE Extended Set Scan Paramaters Cmd is defined as 0x15A
in documentation but it is defined as 0x160 in stack.
This results in command failing due to unknown hci command error.

Bug: 27852645
Change-Id: Ia779164b7c03daa8053fb65e4fc8281235904031

8 years agoHandle unknown codecs sent by HF
Satish Kodishala [Thu, 25 Jun 2015 07:48:35 +0000 (13:18 +0530)]
Handle unknown codecs sent by HF

Use case:
1. Connect to headset supporting CVSD, mSBC and other codecs.
2. Verify if headset sending AT+BAC with supported codecs.
3. Check if SCO is established with mSBC codec.

Failure:
SCO is established with CVSD codec.

Root cause:
When parsing AT+BAC command, if unknown codec is received,
we are falling back to CVSD although mSBC is supported in HF.

Fix:
AT+BAC parsing function modified to return correct codecs
supported by HF when it encounters unknown codecs in arguments
of AT+BAC.

Bug: 27852645
Change-Id: I9ac7675c9d863e7362f85e3b7b8d9a42462bd5e9

8 years agoAvoid double-free on SDP search failure
Srinu Jella [Tue, 29 Dec 2015 08:00:19 +0000 (13:30 +0530)]
Avoid double-free on SDP search failure

Use case: BT transfer fails in Doze mode.

Pre-condition:
1. Device is in Doze mode.
2. Device is in Active state.

Steps to reproduce:
1. On test device and support device, turn on Bluetooth and keep test device in Bluetooth on screen.
2. Put device in Doze mode:
adb shell dumpsys battery unplug
adb shell dumpsys deviceidle step
3. From support device send pair request to test device.
4. Pair two devices.
5. Put test device in Doze mode again.
6. Share one picture from support device to test device by Bluetooth.
7. Accept Bluetooth file transferring request.

Failure: From DUT, BT transfer is failed.

Root cause: Free buffer is called twice for the SDP search failure case.

Fix: Added null check for p_sdp_db to avoid freeing same buffer
     again on SDP search failure.

Bug: 27852645
Change-Id: Ic7776e842c52418c2b0fb6d6479233d01c709dc2

8 years agoRemove bluedroidtest
Andre Eisenbach [Fri, 4 Mar 2016 06:36:51 +0000 (22:36 -0800)]
Remove bluedroidtest

Use bluetooth-cli/bluetoothtbd instead.

Bug: 25369253
Change-Id: I485919dce4bf3229733c85e6a33c754b9cbd62fc

8 years agoDelete unused function declarations from sdp_api.h.
Sharvil Nanavati [Thu, 11 Jun 2015 06:20:24 +0000 (23:20 -0700)]
Delete unused function declarations from sdp_api.h.

Change-Id: I8db02d557fdfc138f2ec8de2b2d45049175fd999

8 years agoAvoid SMP process if another pairing is in progress
Nitin Arora [Thu, 28 Jan 2016 01:07:55 +0000 (17:07 -0800)]
Avoid SMP process if another pairing is in progress

This change prevents the incoming pairing/security request
from a remote device when pairing with another remote has
been initiated by the host and has not yet begun.
The pairing request by the second remote will be rejected

Bug: 22525598
Change-Id: I676c85af39d5418c699161ad11eee5951f9203d7

8 years agoIncrease the number of security slots for other new profiles
Srinu Jella [Tue, 25 Aug 2015 13:12:32 +0000 (18:42 +0530)]
Increase the number of security slots for other new profiles

Use case: MAP Sanity Test fail in multi-profile scenario.

Steps:
1. Connect to Instance 1   - Email Sanity Test Case
2. Connect to Instance 0&1 - Email & SMS Sanity Test Case

Failure: MAP sanity fail in multi-profile scenario.

Root Cause: some profile coonnection may fail in multi
profile scenario due to non availability of security id.

Fix: Increased the security slots to 75 to accomadate new
profiles introduced.

Bug: 27852645
Change-Id: Ic7c0268aea654cba2dee0c323ca0342e71ebc577

8 years agoCorrect the max SDU length used in BTIF layer
Srinu Jella [Fri, 22 Jan 2016 10:04:16 +0000 (15:34 +0530)]
Correct the max SDU length used in BTIF layer

Use case: OPP Tx over L2CAP are failing due to invalid PUT packet from DUT.

Steps:
1. Make the Remote device setup with OPP server which supports MTU
   of more than 8k.
2. Send file from DUT to Remote device.
3. Transfer always fails.

Failure: OPP Tx over L2CAP file transfer fail. It will always fail
if remote supports more than 8076 as the MTU.

Root Cause: Max SDU of L2CAP layer will be communicated to the upper
layers, and same length of SDU being sent from upper layer
to BTIF layer, but because of change in the max SDU of
BTIF, it will receive less bytes than expected will lead
to form incomplete PUT request.

Fix: Correct the max SDU length used from BTIF layer to be in
sync with max SDU calculation from L2CAP layer.

Bug: 27852645
Change-Id: Ie037c85e798bebf6a71c56488aae37455725028c

8 years agoReconstruct new packet to accomodate extra header length
Srinu Jella [Sun, 13 Sep 2015 12:54:52 +0000 (18:24 +0530)]
Reconstruct new packet to accomodate extra header length

Use case: Bluetooth process crash problem in the middle of RFCOMM
test cases due to buffer corruption detected while freeing it.

Root Cause: RFCOMM layer trying to reuse the same packet to send
to the lower layer but it will fail due to strick buffer
corruption checks.

Failure: Bluetooth process crash.

Fix:  created a new packet to accomadate new header
and copied the same payload to the new packet.

Bug: 27852645
Change-Id: I5d12b76229d11480f7f37bbcd3561de97c80a0c1

8 years agoEnable debug logs for bluetooth process threads, modules
Srinu Jella [Tue, 1 Mar 2016 11:29:35 +0000 (16:59 +0530)]
Enable debug logs for bluetooth process threads, modules

Use case: Debug enhancement for bluetooth threads,
          modules

- Most of the bluetooth process threads,modules uses
  APIs provided from the OSI layer.

- This patch enables the debug logs to know when the
  thread, module is created and exited.

- This would be useful while debugging the ON/OFF,
  ANR issues.

Bug: 27852645
Change-Id: I17f4f583d2c431725a8c44c586b29980b4bdab3f

8 years agoCorrected the stream for error checking
Srinu Jella [Tue, 1 Mar 2016 14:15:41 +0000 (19:45 +0530)]
Corrected the stream for error checking

Replace event_stream with acl_stream

Bug: 27852645
Change-Id: I9ceb75ee05bad5d2ef1af819b3930216cc750507

8 years agoPeer support of Absolute Volume to be updated only if device supports A2DP
Ayan Ghosh [Tue, 3 Dec 2013 09:22:22 +0000 (14:52 +0530)]
Peer support of Absolute Volume to be updated only if device supports A2DP

Peer support of absolute Volume feature should be updated to Audio
frameworks only for device which supports A2DP Sink and AVRCP Absolute
Volume TG roles together.
Audio manager need not be updated for AVRCP only peer devices as
that would cause sudden rise in ongoing stream volume when avrcp only
device connects, if it is set to some lower value with other device
connected for A2DP.

Bug: 27852645
Change-Id: I75509d0b0fd1b06fa08390940a327dd2887d7562

8 years agoLimit Max Bitpool value to SPEC recommended one
Ayan Ghosh [Fri, 26 Dec 2014 12:48:28 +0000 (18:18 +0530)]
Limit Max Bitpool value to SPEC recommended one

Preferred bipool for 44.1 KHz sampling rate for SBC
codec is considered as 53. Hence limit Max Bitpool
value to 53 in setconfig request to have it same as
the one DUT sets in getConfig response and in encoding
pcm packets.
few BMW series of CKs does not connect unless DUT
configures max bitpool in setconfig request to 53.

Bug: 27852645
Change-Id: Ie7ca504c23f6bae8fda997cdeb3e0ff0733defb0

8 years agoAllow Carkit to trigger play immediately after call
Ayan Ghosh [Wed, 7 Aug 2013 14:35:29 +0000 (20:05 +0530)]
Allow Carkit to trigger play immediately after call

Removing check in stack where AVRCP Play and Pause commands
are being dropped if carkit initiates play or pause within
six seconds.
This addresses the scenario where JCI-Mazda CK pauses the
streaming by initiating Avrcp Pause right before making call
and can not resume the streaming by sending Avrcp Play right
after call ends.

Bug: 27852645
Change-Id: Ibb04223de746f528b356e78bd65130d3fd526a44

8 years agoInitialize sco codecs supported with CVSD
Satish Kodishala [Thu, 27 Aug 2015 05:21:45 +0000 (10:51 +0530)]
Initialize sco codecs supported with CVSD

Usecase:
1. Connect headset/carkit supporting codec negotiation
   but does not send AT+BAC with available codecs.
2. Make a call and create SCO connection.
3. Transfer audio to AG from headset/carkit.
4. Transfer audio back to carkit.

Failure:
AG will not establish SCO connection with remote.

Rootcause:
We initialize codecs supported by remote as 0 and update
it with codecs received as part of AT+BAC. When AG sends
+BCS to start codec negotiation, it received AT+BCS=1 from
remote. Since 1 is not in the list of remote supported codecs
(0), AG will not create SCO connection in step#4.

Fix:
Initialize sco codecs supported by remote with mandatory
codec, CVSD.

Bug: 27852645
Change-Id: Ibe0e1a7bd3e59e8618568d320acfbde88f3fc11e

8 years agoIgnore empty optional parameters in CLCC response
Satish Kodishala [Tue, 15 Sep 2015 14:16:41 +0000 (19:46 +0530)]
Ignore empty optional parameters in CLCC response

Usecase:
Pair and connect with AG that sends the optional parameters
in CLCC response.

Failure:
When optional parameters in CLCC response from AG is empty,
HF client is not parsing the empty optional parameters.
User may not be see the phone number on UI properly on
hf client device.

Root cause:
AGs like iPhone sends optional parameters in the CLCC response.
HF client is returning NULL when it encounters empty optional parameters.

Fix:
Ignore empty optional parameters in CLCC Response from AG.

Bug: 27852645
Change-Id: Ia90986ccc4c9c9f1a6fb3a914bc1df8b0a75ba0f