OSDN Git Service

android-x86/packages-apps-Bluetooth.git
8 years agoMerge "Don't override target to 32 for Bluetooth"
Jakub Pawlowski [Fri, 4 Nov 2016 22:24:34 +0000 (22:24 +0000)]
Merge "Don't override target to 32 for Bluetooth"

8 years agoDon't override target to 32 for Bluetooth
Jakub Pawlowski [Thu, 3 Nov 2016 20:50:44 +0000 (13:50 -0700)]
Don't override target to 32 for Bluetooth

Change-Id: I1f72dec4376bb55e72d15df5af548cf4ce123c31

8 years agoMerge "BLE Check and send scan response data"
Chris Manton [Thu, 3 Nov 2016 19:57:55 +0000 (19:57 +0000)]
Merge "BLE Check and send scan response data"

8 years agoMerge changes I7f2e3ac0,Ibcd26731,I9ac5121c,Ie9135167,Ib02c74c7, ...
Sanket Agarwal [Wed, 2 Nov 2016 05:23:06 +0000 (05:23 +0000)]
Merge changes I7f2e3ac0,Ibcd26731,I9ac5121c,Ie9135167,Ib02c74c7, ...

* changes:
  Fixing A2dpSinkStreamingStateMachine thread leak.
  Now Playing List gets stuck in a loop
  MAP Client connect after PBAP Client
  MAP MCE iPhone connectivity
  MAP MCE disconnecting automatically
  MAP MCE message filtering
  Set debug flags to false

8 years agoFixing A2dpSinkStreamingStateMachine thread leak.
Ram Periathiruvadi [Fri, 14 Oct 2016 19:50:45 +0000 (12:50 -0700)]
Fixing A2dpSinkStreamingStateMachine thread leak.

A2dpSinkStreamingStateMachine was being created on every Connection
leading to a leak. Fix is to Quit the A2dpSinkStreamingStateMachine
on A2dpSinkStateMachine's Quit() and create a new Streaming
StateMachine only if it is null.
Note that both the Sink and SinkStreaming State machines quit only
on Adapter off, not on BT disconnect.

Bug: b/32097580
Tested: On Mojave and Angler with bat_mas-userdebug

Change-Id: I7f2e3ac01ce5ff965afe407e3605cac00497af36
(cherry picked from commit af41a720081dd4e9d12e1b3f082e9202ae84252d)

8 years agoNow Playing List gets stuck in a loop
Sanket Agarwal [Wed, 12 Oct 2016 09:41:30 +0000 (02:41 -0700)]
Now Playing List gets stuck in a loop

We are incorrectly setting the status of the Now Playing List folder to
uncached which makes it fetch the folder in a loop if there is possible
pagination going on

Bug: b/32051433
Change-Id: Ibcd26731c7ed4ac24d816c2f4529970e3a2f29cd
(cherry picked from commit ffded42f4a30a399738f23a4d36068e484fea8cb)

8 years agoMAP Client connect after PBAP Client
Joseph Pirozzo [Thu, 13 Oct 2016 20:47:54 +0000 (13:47 -0700)]
MAP Client connect after PBAP Client

Add code to automatically attempt to connect MAP Client (if enabled)
after PBAP Client connects.  This will typically be invoked at system or
adapter reset, but could as well happen if MAP Client isn't connected
and a new PBAP connection is established.

Bug: 32153228
Change-Id: I9ac5121ccf0d7ef3e5847df32034094e085aa434
(cherry picked from commit 46873217f3ddb8b848ce0b8fdf4a0531dfb04224)

8 years agoMAP MCE iPhone connectivity
Joseph Pirozzo [Thu, 13 Oct 2016 16:59:56 +0000 (09:59 -0700)]
MAP MCE iPhone connectivity

iPhones do not fill in the tel: field in the originators vCard upon
receipt of a text message, this was causing parsing to fail as it was
assumed that every SMS message will have an associated phone number.
Updated logic to check fields more riggorously.

Bug: 32110763
Change-Id: Ie9135167ad957a2a8054ea414d3e9ec576d3271b
(cherry picked from commit b2e57a501b1719406776c795cfed4fd271707d79)

8 years agoMAP MCE disconnecting automatically
Joseph Pirozzo [Tue, 11 Oct 2016 20:36:49 +0000 (13:36 -0700)]
MAP MCE disconnecting automatically

Disconnect commands were getting queued even if bluetooth wasn't
connected.  This would cause the disconnect command to get processed
immediately after the connection succeeded.  Updated logic to defer all
commands while "Connecting" or "Disconnecting" throw out any disconnect
commands at the head of the queue while "Disconnected" and generate
implied disconnect commands when a connect command arived while already
Connected.

Bug: 32080718
Change-Id: Ib02c74c753e88cf4876835ee8e5e0c8f2a6ebc34
(cherry picked from commit 2e8805b2ad2e8b70fb82fde37498922c92d15cb6)

8 years agoMAP MCE message filtering
Joseph Pirozzo [Fri, 7 Oct 2016 01:27:00 +0000 (18:27 -0700)]
MAP MCE message filtering

Remove message filtering from getUnreadMessages to allow all message
types supported by the MAS Server to be sent.

Bug: 32004537
Change-Id: Id88401bd290c3a33deb99da3d1673becebe40c7f
(cherry picked from commit 625bb6b6ad191d128b1404f457225cb94b7e70f4)

8 years agoSet debug flags to false
Sanket Agarwal [Thu, 6 Oct 2016 19:53:59 +0000 (12:53 -0700)]
Set debug flags to false

- Reduces the log spam
- Eliminates any PII information in the logs

Bug: b/31811551
Change-Id: I5c421ad50706043765ef3e82cb37a44d520ecb6e
(cherry picked from commit 8964818100fb71fa1f962aeb55fc1dd54e7a9fbd)

8 years agoMerge "PBAP Logging"
Treehugger Robot [Wed, 2 Nov 2016 04:11:07 +0000 (04:11 +0000)]
Merge "PBAP Logging"

8 years agoPBAP Logging
Joseph Pirozzo [Thu, 6 Oct 2016 19:06:40 +0000 (12:06 -0700)]
PBAP Logging

Move information about how many entries were synced to VDBG (and
disable) to protect any possible PII in logs.

Bug: 31855210
Change-Id: I67b0566d063411997ffda926cecd2e889f309b13
(cherry picked from commit ec955102ce72d61635f9eca1d904d803698949ac)

8 years agoMerge "Protect against adding a null config for the BT health profile"
Treehugger Robot [Wed, 2 Nov 2016 01:18:18 +0000 (01:18 +0000)]
Merge "Protect against adding a null config for the BT health profile"

8 years agoMerge "MAP MCE"
Sanket Agarwal [Wed, 2 Nov 2016 00:54:57 +0000 (00:54 +0000)]
Merge "MAP MCE"

8 years agoMAP MCE
Joseph Pirozzo [Fri, 19 Aug 2016 20:23:41 +0000 (13:23 -0700)]
MAP MCE

Message Access Profile Client code. Supports Message Notification
Service server and Message Access Service Client for sending messages
and receiving new messages and retrieving unread messages.

Bug: 30467210
Change-Id: Ia4f27f11acbbcb5975d85344f0c19be3d1975b66
(cherry picked from commit 7765761c05e1cb2231198e7b9dccba5254c0cf75)

8 years agoProtect against adding a null config for the BT health profile
Ajay Panicker [Tue, 1 Nov 2016 18:25:10 +0000 (11:25 -0700)]
Protect against adding a null config for the BT health profile

Bug: 25340134
Test: Manual and UnitTest
Change-Id: I595a61050c88787d79db2527aa4387966680e166

8 years agoMerge "Implement new API for retrieving supported Bluetooth profiles."
Treehugger Robot [Tue, 1 Nov 2016 23:12:21 +0000 (23:12 +0000)]
Merge "Implement new API for retrieving supported Bluetooth profiles."

8 years agoMerge "Move start advertise method to advertising interface (1/3)"
Jakub Pawlowski [Tue, 1 Nov 2016 22:30:42 +0000 (22:30 +0000)]
Merge "Move start advertise method to advertising interface (1/3)"

8 years agoBLE Check and send scan response data
Chris Manton [Tue, 1 Nov 2016 03:48:42 +0000 (20:48 -0700)]
BLE Check and send scan response data

If there is scan response data, load it up during
when start advertising.  The current stack does
not provide callback for these calls.

Bug: 32539880

Test: Verified scan response occurs with CL

Change-Id: I33effbf3aa3a60c3353d4ca7708ea06df8a05a7d

8 years agoImplement new API for retrieving supported Bluetooth profiles.
Bryce Lee [Sun, 9 Oct 2016 19:58:54 +0000 (12:58 -0700)]
Implement new API for retrieving supported Bluetooth profiles.

Bug: 26451648
Change-Id: I552882034e0289b643377d14bac4fb01c9018046
(cherry picked from commit b7e2f972a0633b4d8c8843d025819d61e71053e7)

8 years agoMerge "Fix connection state broadcasts"
Sanket Agarwal [Tue, 1 Nov 2016 21:44:27 +0000 (21:44 +0000)]
Merge "Fix connection state broadcasts"

8 years agoFix connection state broadcasts
Sanket Agarwal [Tue, 4 Oct 2016 20:39:00 +0000 (13:39 -0700)]
Fix connection state broadcasts

- HFP was flipping states in case of timeout
- A2DP was not sending a disconnect when the native changed its mind
  about which device was actually connected

Change-Id: Ic89292fe0d6730b8bbbc4746f8e5afabcd59a943
(cherry picked from commit d7e1c13d177fac7d6ef1dd36663f362470372070)

8 years agoMerge "Return bool in AVRCP Controller API"
Sanket Agarwal [Tue, 1 Nov 2016 21:43:50 +0000 (21:43 +0000)]
Merge "Return bool in AVRCP Controller API"

8 years agoMove start advertise method to advertising interface (1/3)
Jakub Pawlowski [Mon, 31 Oct 2016 18:03:12 +0000 (11:03 -0700)]
Move start advertise method to advertising interface (1/3)

Advertising related code should be exposed through
BleAdvertiserInterface. Move client.listen function into this interface.
Remove reduntant clientif parameter.

Bug: 30622771
Bug: 24099160
Test: no tests necessary
Change-Id: Ifa3ba482993264f2e737cb1ca44028941056631a

8 years agoReturn bool in AVRCP Controller API
Sanket Agarwal [Thu, 29 Sep 2016 18:37:05 +0000 (11:37 -0700)]
Return bool in AVRCP Controller API

If a feature is not supported then instead of timing out the return
value from the API can lead to a quicker UI experience.

Bug: b/31754876
Change-Id: I4f23700a5318c9b98e3c464f18f73a3ac41fbfcd
(cherry picked from commit 629c041bea58d7b48e81f222167e2ac0233d389a)

8 years agoMerge "AVRCP CT: Add getPlayStatus API"
Sanket Agarwal [Tue, 1 Nov 2016 20:00:28 +0000 (20:00 +0000)]
Merge "AVRCP CT: Add getPlayStatus API"

8 years agoAVRCP CT: Add getPlayStatus API
Sanket Agarwal [Thu, 22 Sep 2016 21:12:03 +0000 (14:12 -0700)]
AVRCP CT: Add getPlayStatus API

- Required for PTS test case TC_CT_MDI_BV_01_C

Bug: b/31684931
Change-Id: Ieef8b408657931505f02b9ea408d9658ecb4a3e3
(cherry picked from commit 6eeb548cd2d00695c3492496b32780cda9e34795)

8 years agoMerge changes I3423fcf6,If595d89f,I586b6c06
Treehugger Robot [Tue, 1 Nov 2016 19:34:49 +0000 (19:34 +0000)]
Merge changes I3423fcf6,If595d89f,I586b6c06

* changes:
  Fixes for HFP & AVRCP
  Support Rewind and FF transport controls
   AVRCP CT: Add support to send stop command

8 years agoFixes for HFP & AVRCP
Sanket Agarwal [Wed, 21 Sep 2016 22:19:39 +0000 (15:19 -0700)]
Fixes for HFP & AVRCP

1. Fix NPE for when the phone does not respond to a call
2. Add PTS hooks for changing vol up/dn.

Bug: 31661223
Change-Id: I3423fcf67a2ea0fad6b9efde7ef239dbb683b737
(cherry picked from commit ddc157dec97fc1e6c8272b27835a599f82a02e5e)

8 years agoSupport Rewind and FF transport controls
Sanket Agarwal [Wed, 21 Sep 2016 17:41:59 +0000 (10:41 -0700)]
Support Rewind and FF transport controls

- Mainly to support PTS use cases

Change-Id: If595d89f783c6bee4249fe5fc995ef2997eb2b0a
(cherry picked from commit bd2b6578e1b047aedcee6f8f3628ca793e482f3c)

8 years ago AVRCP CT: Add support to send stop command
AnubhavGupta [Fri, 9 Sep 2016 12:43:49 +0000 (18:13 +0530)]
 AVRCP CT: Add support to send stop command

Change-Id: I586b6c0657100a3d1c6fd59eaa2411cc31ca0297
(cherry picked from commit 8a0b4621c3c4c005447529970bb6f3db58bf7c3a)

8 years agoMerge "Implement set addressed player functionality."
Sanket Agarwal [Tue, 1 Nov 2016 17:22:49 +0000 (17:22 +0000)]
Merge "Implement set addressed player functionality."

8 years agoImplement set addressed player functionality.
Sanket Agarwal [Fri, 16 Sep 2016 19:07:20 +0000 (12:07 -0700)]
Implement set addressed player functionality.

Bug: b/31554234

Change-Id: Ibe1170bae58e3a3d68dc942b998ca2deee3b27f8
(cherry picked from commit f178c8072f4478a8773fcda5759d825f0b41efd2)

8 years agoMerge "Implement non-blocking pagination for a long song list."
Treehugger Robot [Tue, 1 Nov 2016 00:43:41 +0000 (00:43 +0000)]
Merge "Implement non-blocking pagination for a long song list."

8 years agoImplement non-blocking pagination for a long song list.
Sanket Agarwal [Fri, 26 Aug 2016 00:56:33 +0000 (17:56 -0700)]
Implement non-blocking pagination for a long song list.

Bug: b/31253501

Change-Id: I39f7ba180a33729301618db8191821ad2745917f

8 years agoMerge changes If009c2e0,Ib2097456,I032efd2d
Sanket Agarwal [Mon, 31 Oct 2016 23:03:21 +0000 (23:03 +0000)]
Merge changes If009c2e0,Ib2097456,I032efd2d

* changes:
  Remove hashcode() override for Connection
  Handle the case of disconnecting -> active for PTS
  Cleanup state while transitioning to disconnected.

8 years agoMerge "Make Bluetooth SQL query strict to prevent injection"
Treehugger Robot [Mon, 31 Oct 2016 19:49:14 +0000 (19:49 +0000)]
Merge "Make Bluetooth SQL query strict to prevent injection"

8 years agoRemove hashcode() override for Connection
Sanket Agarwal [Wed, 7 Sep 2016 23:45:47 +0000 (16:45 -0700)]
Remove hashcode() override for Connection

hashCode is relying on the number of call which creates a race condition
when two phone calls with same number are created. It basically confuses
the stack about the object equality.

Bug: b/31271037
Change-Id: If009c2e0924fad540cf91bc8b0fa9b2f13404b7b

8 years agoHandle the case of disconnecting -> active for PTS
Sanket Agarwal [Mon, 29 Aug 2016 21:14:57 +0000 (14:14 -0700)]
Handle the case of disconnecting -> active for PTS

In case that a call goes from disconnecting to active and bluetooth
does not have time to realize that the call actually got destroyed,
we can get the telecom in a transition DISCONNECTING -> ACTIVE (or
RINGING etc) which it will not honor.

Bug: b/31159015
Change-Id: Ib2097456bc435810bb82ecdf79110f0bbcb63023

8 years agoCleanup state while transitioning to disconnected.
Sanket Agarwal [Fri, 26 Aug 2016 00:54:57 +0000 (17:54 -0700)]
Cleanup state while transitioning to disconnected.

If we forgot to reset state while transitioning to disconnected in HFP
it could meant that further processing is stopped since the state is
unclean.

Bug: b/31088373
Change-Id: I032efd2dfd4f39db901c9f82bccdf452060e4d86

8 years agoMerge "Implement autoconnect for PAN."
Sanket Agarwal [Mon, 31 Oct 2016 19:08:53 +0000 (19:08 +0000)]
Merge "Implement autoconnect for PAN."

8 years agoImplement autoconnect for PAN.
Sanket Agarwal [Thu, 4 Aug 2016 23:11:46 +0000 (16:11 -0700)]
Implement autoconnect for PAN.

Bug: b/30679978
Change-Id: I52c9ac49ec72a419e5f02c656abc46f2c7e4c7cc
(cherry picked from commit 599c56d2b8f09ee126b734b9c62727d255f3e8b3)

8 years agoMake Bluetooth SQL query strict to prevent injection
Ajay Panicker [Fri, 23 Sep 2016 21:56:20 +0000 (14:56 -0700)]
Make Bluetooth SQL query strict to prevent injection

Bug: 20531462
Change-Id: I8a90c81b727415fa566547f66bf0f64872850189
(cherry picked from commit 760fe9462f8fd177a7c626742fa81486ef1ab770)

8 years agoMerge "Handle all kinds of focuses and make fault tolerant to phone calls."
Treehugger Robot [Sun, 30 Oct 2016 22:22:38 +0000 (22:22 +0000)]
Merge "Handle all kinds of focuses and make fault tolerant to phone calls."

8 years agoHandle all kinds of focuses and make fault tolerant to phone calls.
Sanket Agarwal [Thu, 7 Apr 2016 20:48:40 +0000 (13:48 -0700)]
Handle all kinds of focuses and make fault tolerant to phone calls.

Audio Focus Loss Transient: We stop music and wait for focus gain.
Audio Focus Loss Transient May Duck: We lower the volume (via Gain).

Sometimes phones do not resume even after sending play after the phone
call. This is possible if there is a race condition of when A2dp thinks
it got focus back vs phone actually releasing the call. To avoid this we
add retry logic to try playing again. This also avoids janky situations
when playing music will not initiate at first.

Bug: b/28003743
Bug: b/28065071

Change-Id: I1d31156d134d98959ff3044c98206c60515d7e5a
(cherry picked from commit f8b181e9f395010dee2926a4b7b1dbe4f3db0470)

8 years agoMerge changes I2e454747,I780186f5
Treehugger Robot [Sat, 29 Oct 2016 03:02:40 +0000 (03:02 +0000)]
Merge changes I2e454747,I780186f5

* changes:
  Set session to active for A2dpMediaBrowserService.
  handlePassthroughRsp parameter update

8 years agoMerge "Prevent bonded device from being removed from the property map"
Treehugger Robot [Sat, 29 Oct 2016 02:40:05 +0000 (02:40 +0000)]
Merge "Prevent bonded device from being removed from the property map"

8 years agoPrevent bonded device from being removed from the property map
Ajay Panicker [Fri, 21 Oct 2016 23:22:11 +0000 (16:22 -0700)]
Prevent bonded device from being removed from the property map

Bug: 31947953
Test: Manual
Change-Id: Ia2d25b305c07949a9251af83e855db4511ff887f
(cherry picked from commit c4b1ccb46884a0e23e5411f2bbb2da72fcb267ca)

8 years agoSet session to active for A2dpMediaBrowserService.
Victor Chan [Sat, 26 Mar 2016 01:09:14 +0000 (18:09 -0700)]
Set session to active for A2dpMediaBrowserService.

Bluetooth Audio playbackstate was not appearing in the overview since the session was inactive.

bug:27859156
Change-Id: I2e454747efe8724daa8c5375b193cf00638aec5d
(cherry picked from commit c1b48cf21758e627fb9738a176fb1aae36c27c65)
(cherry picked from commit 519bb218e810383f12182e3fa4b68234339a2861)

8 years agohandlePassthroughRsp parameter update
Joseph Pirozzo [Tue, 25 Oct 2016 18:37:54 +0000 (11:37 -0700)]
handlePassthroughRsp parameter update

JNI changed the parameters to include the bluetooth address to support
concurrent connections but did not update the Java side.

Bug: 32404445
Test: Start bluetooth adapter with avrcpcontroller enabled observe that
bluetooth stays on.

Change-Id: I780186f5ea7e6e4b1a4f1c110df7e94e775f6019
(cherry picked from commit cbea1c575b95e219fcbbd5c4bcab8efd19b19976)

8 years agoMerge "Let audio HAL know when BT is turned off"
Sanket Agarwal [Fri, 28 Oct 2016 20:52:09 +0000 (20:52 +0000)]
Merge "Let audio HAL know when BT is turned off"

8 years agoLet audio HAL know when BT is turned off
Satish Kodishala [Wed, 21 Oct 2015 13:11:26 +0000 (18:41 +0530)]
Let audio HAL know when BT is turned off

Audio HAL needs setParams("hfp_enable=false") when BT is turned off since if it does not, then
the next enable setParams("hfp_enable=true") does not succeed due to
audio HAL being in a weird stage.

Bug: b/29937812

Change-Id: I111e38cbe578fe3eca66b07da8ad9204d064a02c
(cherry picked from commit fcc828915490c65f7c9ae2073a57ee9f0efadb15)

8 years agoMerge changes from topic 'merge_remaining_car_dev'
Sanket Agarwal [Fri, 28 Oct 2016 20:51:27 +0000 (20:51 +0000)]
Merge changes from topic 'merge_remaining_car_dev'

* changes:
  PBAP over L2CAP
  Unset the priorities for car profiles on unpair.
  HFP should timeout in Java services if Native never replied
  HF should wait for AG to change conference
  Conference calling via HFP
  Improve connection handling logic in ConnService

8 years agoMerge "Separate LE scanner and GATT client BTIF interfaces (1/3)"
Treehugger Robot [Fri, 28 Oct 2016 20:45:08 +0000 (20:45 +0000)]
Merge "Separate LE scanner and GATT client BTIF interfaces (1/3)"

8 years agoMerge "Limit number of stored device properties"
Treehugger Robot [Fri, 28 Oct 2016 20:42:48 +0000 (20:42 +0000)]
Merge "Limit number of stored device properties"

8 years agoPBAP over L2CAP
Joseph Pirozzo [Fri, 26 Aug 2016 20:13:18 +0000 (13:13 -0700)]
PBAP over L2CAP

Update PBAP to be compliant with socket connections over L2CAP in
addition to RFCOMM.  Additionally now requires SDP to complete before
connection.

Bug: 31062208
Change-Id: Idc991d871e9a67c7d6b631cafbfb98ff45d63c38
(cherry picked from commit ea2543a5009459fee3581d2fd8b2271511d31a4c)

8 years agoUnset the priorities for car profiles on unpair.
Sanket Agarwal [Mon, 22 Aug 2016 21:21:26 +0000 (14:21 -0700)]
Unset the priorities for car profiles on unpair.

When the device is unpaired the priorities should not be retained since
on the next pairing we will persist priorities if they are anything
other than UNDEFINED.

Bug: b/31021525

Change-Id: Ifd7dbf93aff3abcd0f6207395fbac90480624415
(cherry picked from commit cd29fbf80159c5a7d4573f1eb9d3eee751084f48)

8 years agoHFP should timeout in Java services if Native never replied
Sanket Agarwal [Mon, 15 Aug 2016 21:25:59 +0000 (14:25 -0700)]
HFP should timeout in Java services if Native never replied

Usually Java services should be failsafe to avoid any states
where it could be stuck listening to lower levels.

Change-Id: I0bdf511878ba773a94b00004951b1f8a94d978f5
(cherry picked from commit 7e7b555fc9539f5d9def892208b416c095543303)

8 years agoHF should wait for AG to change conference
Sanket Agarwal [Wed, 6 Jul 2016 21:56:13 +0000 (14:56 -0700)]
HF should wait for AG to change conference

We should always wait for AG to make changes to the call before we show
it to the user so that the UI does not get confusing (inconsistent).
Currently we are not waiting for the conf. call to be
disconnected/established by AG before we show this on our end.

Bug: b/29898872
Change-Id: Ia9198958122e9e539fb6f2a6f08942d3174ae2fc
(cherry picked from commit de8d996c5eb073949210f53b739ef12c2c3054ee)

8 years agoConference calling via HFP
Sanket Agarwal [Thu, 30 Jun 2016 21:52:54 +0000 (14:52 -0700)]
Conference calling via HFP

Following scenarios are supported:
1. Accepting incoming call when there is an active call (Call Waiting)
-- We always put the active call on hold.
2. Rejecting incming call when there is an active call (Call Waiting)
3. Merging calls after (1) and going into a conference
4. Ending the conference

Bug: b/29898872
Change-Id: I630bf6d7149fc12eea67f4a49b24fe500f3913d3
(cherry picked from commit 2b32bc5c037a04239b24e3bdb7d193d0091eac02)

8 years agoImprove connection handling logic in ConnService
Sanket Agarwal [Wed, 29 Jun 2016 20:33:57 +0000 (13:33 -0700)]
Improve connection handling logic in ConnService

Connection for HFP HF role in Bluetooth is currently trying to
handle all cases of connected vs disconnect HFP. This can be offloaded
to ConnServ where the connection lifecycle should be maintained (and not
in the connection itself).

1. Fixes NPEs generated by the BtCarHfpFuzzTest.
2. Reduces the number of calls to AT+CLCC

Change-Id: Ibccadb7721cbbd2260cbfc5685d66027277e8a59
(cherry picked from commit 1ff2e6e9306272bd113c8633c9b52fb169eddcb3)

8 years agoMerge "Redesign HFP Client call handling"
Sanket Agarwal [Fri, 28 Oct 2016 20:01:58 +0000 (20:01 +0000)]
Merge "Redesign HFP Client call handling"

8 years agoLimit number of stored device properties
Andre Eisenbach [Thu, 22 Sep 2016 21:30:32 +0000 (14:30 -0700)]
Limit number of stored device properties

Bug: 31651689
Change-Id: I6e31b4f89d6ebf9e6a0c6df5ea4e1a7be61a125a
(cherry picked from commit e8d2b5c0f591311c90e428d88b94cd89b88ed342)

8 years agoRedesign HFP Client call handling
Sanket Agarwal [Tue, 28 Jun 2016 03:08:43 +0000 (20:08 -0700)]
Redesign HFP Client call handling

1. Use UUIDs to interact between the upper layers and state machine.
2. Centralized place for managing calls.
3. Mechanism to co-relate outgoing calls with the AT+CLCC reply
4. Get rid of non-ECC hacks (we basically do not support devices not
supporting ECC)

Bug: b/29788044
Change-Id: I497c59583124825fad9be800a7c0a53920e67d4c
(cherry picked from commit 05462fe44531f887fe91ac173ec645e91b236025)

8 years agoSeparate LE scanner and GATT client BTIF interfaces (1/3)
Jakub Pawlowski [Thu, 27 Oct 2016 19:18:33 +0000 (12:18 -0700)]
Separate LE scanner and GATT client BTIF interfaces (1/3)

In order to properly separate low level structures associated with LE
scanner and GATT client, their interfaces must be separated first.

Test: sl4a BleScanApiTest
Bug: 30622771
Change-Id: Ib6b7be78ccc7fa2176b6c2422e3891493b08d3d0

8 years agoMerge "Remove calls when device gets disconnected"
Treehugger Robot [Fri, 28 Oct 2016 17:11:11 +0000 (17:11 +0000)]
Merge "Remove calls when device gets disconnected"

8 years agoRemove calls when device gets disconnected
Sanket Agarwal [Mon, 20 Jun 2016 23:20:28 +0000 (16:20 -0700)]
Remove calls when device gets disconnected

Bug: b/29170324
Change-Id: I4e9ae948801f80d8f22fb737812e1ed403077bff
(cherry picked from commit 8b2711a9c8537df86e73a0d01b9c3f737f29c643)

8 years agoMerge "Normalize the number before inserting into list of calls in connectionservice"
Sanket Agarwal [Fri, 28 Oct 2016 16:08:25 +0000 (16:08 +0000)]
Merge "Normalize the number before inserting into list of calls in connectionservice"

8 years agoNormalize the number before inserting into list of calls in
Sanket Agarwal [Mon, 20 Jun 2016 20:51:11 +0000 (13:51 -0700)]
Normalize the number before inserting into list of calls in
connectionservice

Number often get rewritten with brackets (or prepended with +). We take
a simple approach of removing non numbers so that rewriting can be
avoided.

Bug: b/28719753
Change-Id: If1525ea8564997e7ebe6ef63fccbc3c113b88e1c
(cherry picked from commit 7ec95a31b30a586d1b58a892651dee2e80abddad)

8 years agoMerge "Owner Card"
Sanket Agarwal [Fri, 28 Oct 2016 16:07:52 +0000 (16:07 +0000)]
Merge "Owner Card"

8 years agoOwner Card
Joseph Pirozzo [Fri, 3 Jun 2016 23:59:39 +0000 (16:59 -0700)]
Owner Card

Start phonebook download at card 1 to skip owner card.

bug: 29127941
Change-Id: I1d85cb4a6a372a707081aee7dd4936c83babf888
(cherry picked from commit 0ac9cfe106b82a1c58d859c1fbb0181a654af9b4)

8 years agoMerge "PBAP Handle IllegalArgumentException"
Sanket Agarwal [Fri, 28 Oct 2016 16:07:16 +0000 (16:07 +0000)]
Merge "PBAP Handle IllegalArgumentException"

8 years agoPBAP Handle IllegalArgumentException
Joseph Pirozzo [Mon, 9 May 2016 21:21:27 +0000 (14:21 -0700)]
PBAP Handle IllegalArgumentException

When purging call log at startup handle the IllegealArugmentException
incase the call log content provider does not exist.

bug: 28671866
Change-Id: Ic02b4382be94f62908c90f175b9f165f3742240c
(cherry picked from commit 0d4b767f9b815a5d6a12e30860a83f5fa3cf8bbe)

8 years agoMerge "Remove contacts at shutdown."
Sanket Agarwal [Fri, 28 Oct 2016 16:06:34 +0000 (16:06 +0000)]
Merge "Remove contacts at shutdown."

8 years agoRemove contacts at shutdown.
Joseph Pirozzo [Thu, 5 May 2016 21:23:20 +0000 (14:23 -0700)]
Remove contacts at shutdown.

If the bluetooth adapter gets turned off clean up PBAP contacts.

bug: 28630194
Change-Id: Ibaec25d6f1f5f5aca4dc00c0437af54d3d534be4
(cherry picked from commit 16159961f4060636b4f778b39ef2d006807fc803)

8 years agoMerge "PBAP check device on disconnect"
Sanket Agarwal [Fri, 28 Oct 2016 16:03:53 +0000 (16:03 +0000)]
Merge "PBAP check device on disconnect"

8 years agoPBAP check device on disconnect
Joseph Pirozzo [Mon, 2 May 2016 14:25:43 +0000 (07:25 -0700)]
PBAP check device on disconnect

Upon receiving a disconnect message in Connecting or Connected verify
that the disconnect command is for the current device before
disconnecting.

bug: 28406739
Change-Id: I55498aa01a95c1ab9de1bda21c30db9c241dacc1
(cherry picked from commit 9541d943d7ca14b2e154199eaadce67a4bf12704)

8 years agoMerge "Bluetooth Connect Other Profiles"
Sanket Agarwal [Fri, 28 Oct 2016 16:02:39 +0000 (16:02 +0000)]
Merge "Bluetooth Connect Other Profiles"

8 years agoBluetooth Connect Other Profiles
Joseph Pirozzo [Fri, 29 Apr 2016 01:22:42 +0000 (18:22 -0700)]
Bluetooth Connect Other Profiles

Rework the logic in connectOtherProfiles to support both client and
server based profiles.  This logic is invoked 6 seconds after a
successful bluetooth connection is established to attempt to connect any
other valid profiles.

bug: 28249138
Change-Id: I6cc77f47a522da134af3122c07095e1a4f583f32
(cherry picked from commit 71669e2bfde4f3c76f3f93d9e118793b4eb79dfa)

8 years agoMerge "PbapClientStateMachine legacyCode removal."
Sanket Agarwal [Fri, 28 Oct 2016 16:00:30 +0000 (16:00 +0000)]
Merge "PbapClientStateMachine legacyCode removal."

8 years agoPbapClientStateMachine legacyCode removal.
Joseph Pirozzo [Wed, 27 Apr 2016 23:30:33 +0000 (16:30 -0700)]
PbapClientStateMachine legacyCode removal.

Eliminate dependencies and remove unused code after the state machine
redesign.

bug: 28249138
Change-Id: I95b362136609a8de033a057578c1b08bd46cced3
(cherry picked from commit 992274c189ae23ce454fa2136c1b164105006004)

8 years agoMerge "PBAP vcard parser"
Sanket Agarwal [Fri, 28 Oct 2016 15:59:13 +0000 (15:59 +0000)]
Merge "PBAP vcard parser"

8 years agoPBAP vcard parser
Joseph Pirozzo [Wed, 27 Apr 2016 03:02:26 +0000 (20:02 -0700)]
PBAP vcard parser

Use the built in Vcard parser library for parsing Vcards rather than a
locally defined one.  The Vcard parser library includes support for
photos.

bug: 28177843
Change-Id: I3f335ff12ceec12e51a2b8628c320ede06342259
(cherry picked from commit e14009c22dfce52531f4e34fc1d58a9440539140)

8 years agoMerge "Connect PbapClient Profile"
Sanket Agarwal [Fri, 28 Oct 2016 15:57:15 +0000 (15:57 +0000)]
Merge "Connect PbapClient Profile"

8 years agoConnect PbapClient Profile
Joseph Pirozzo [Mon, 25 Apr 2016 23:33:26 +0000 (16:33 -0700)]
Connect PbapClient Profile

Update code on CarKitt to appropriately connect the pbapClient
connection when another bluetooth connection is made or the adapter is
powered on.  This logic is necessary since pbapClient doesn't accept
incomming connections and the bluetooth connect command may not have
originated from CarKitt.

bug: 28249138
Change-Id: Iaf15ece5115b2f3cf6ef45af1d6ab8da17e0c303
(cherry picked from commit 8b0649c5b76fb40fe0acb7772a71fa3ca727c34e)

8 years agoMerge "PBAP Download Contacts in state machine"
Sanket Agarwal [Fri, 28 Oct 2016 15:55:28 +0000 (15:55 +0000)]
Merge "PBAP Download Contacts in state machine"

8 years agoPBAP Download Contacts in state machine
Joseph Pirozzo [Fri, 22 Apr 2016 16:20:30 +0000 (09:20 -0700)]
PBAP Download Contacts in state machine

Add refactored code to the new PBAP state machine to implement the safe
downloading of contacts.  Key improvements are no internal state
handling, no complex message passing, and an improved ability to abort
and handle error conditions.
bug: 28249138

Change-Id: I30aa6ab6730d92e3ec797392ee9a1be7f55fa46a
(cherry picked from commit 8bc55a6586b985f3f9d7a7c796a86fdc47c9b4b8)

8 years agoMerge "PBAPClient State Machine"
Sanket Agarwal [Fri, 28 Oct 2016 15:54:50 +0000 (15:54 +0000)]
Merge "PBAPClient State Machine"

8 years agoPBAPClient State Machine
Joseph Pirozzo [Tue, 19 Apr 2016 22:00:27 +0000 (15:00 -0700)]
PBAPClient State Machine

Refactor PBAP Client code to function as a state machine.  By
consolidating threads and state tracking there is less duplication and
less opportunity for conflicting combinations of state.

bug: 28249138
Change-Id: I20de8041b83024a03bfbb60102c44b4e26579553
(cherry picked from commit 427695a7992c8fc3fb503794bbaff1f705451133)

8 years agoMerge "Tackle changing phone numbers by relying on IDs wherever possible."
Treehugger Robot [Fri, 28 Oct 2016 15:02:49 +0000 (15:02 +0000)]
Merge "Tackle changing phone numbers by relying on IDs wherever possible."

8 years agoTackle changing phone numbers by relying on IDs wherever possible.
Sanket Agarwal [Tue, 17 May 2016 21:46:38 +0000 (14:46 -0700)]
Tackle changing phone numbers by relying on IDs wherever possible.

AG can rewrite numbers (specially with international numbers) or simply
with brackets or other annotation. We currently do not handle such cases
well since phone number match is not accurate. Instead of relying on the
numbers them selves, we rely on the capability of AG to tell the ID of
the call in question.

Bug: b/28719753
Change-Id: I97842188f174072caf7f03e18b0597ac1912be17
(cherry picked from commit bb3dc297c976f4fab23f93f9cae00cd495739ea4)

8 years agoMerge "Define a label for A2DP Media Browser service"
Sanket Agarwal [Fri, 28 Oct 2016 14:03:12 +0000 (14:03 +0000)]
Merge "Define a label for A2DP Media Browser service"

8 years agoDefine a label for A2DP Media Browser service
Sanket Agarwal [Fri, 6 May 2016 02:04:05 +0000 (19:04 -0700)]
Define a label for A2DP Media Browser service

In order for applications to render A2DP SNK audio, they may require a
specific label for the streaming service in-stead of relying on the
application label.

Bug: b/28537735
Change-Id: If4e422160802ba578b0f38630b82462fcb619b33
(cherry picked from commit 00023aaf6c83190ae797cedf6878d4d076fa74a6)

8 years agoMerge "A2DP MediaSession active state management and NPE"
Treehugger Robot [Fri, 28 Oct 2016 06:46:07 +0000 (06:46 +0000)]
Merge "A2DP MediaSession active state management and NPE"

8 years agoA2DP MediaSession active state management and NPE
Sanket Agarwal [Fri, 22 Apr 2016 20:06:24 +0000 (13:06 -0700)]
A2DP MediaSession active state management and NPE

UIs (such as SystemUI) depend on MediaSession.isActive state to
determine whether to show it on the overview (or shades). Currently we
are keeping the session active ever since the first bluetooth connect (A2DP) happens.

This change makes the session to be active when the device connects and
the first play happens (i.e. the play state of remote device
irrespective of who initated it) and in-active when device disconnects.

Also, avoid a NPE that may happen due to races between delay in
broadcasts and accesing bluetooth state machine.

Bug: b/28345602
Bug: b/28330860

Change-Id: Id7686308ada0b608b959258d137772ee5f24c18f
(cherry picked from commit ffb10b682610a24d5c54e8828c11276fe5703d65)

8 years agoMerge "Race in hfp call termination when local termination faster than HFP update."
Treehugger Robot [Fri, 28 Oct 2016 05:45:42 +0000 (05:45 +0000)]
Merge "Race in hfp call termination when local termination faster than HFP update."

8 years agoRace in hfp call termination when local termination faster than HFP
Sanket Agarwal [Tue, 19 Apr 2016 22:57:22 +0000 (15:57 -0700)]
Race in hfp call termination when local termination faster than HFP
update.

If we make a call from the CarKitt and terminate it immidiately then the
CarKitt assumes no call has been created since phone hasnt replied yet
to the message from CarKitt. When it does reply, the CarKitt throws that
message away because it did not handle the intermediate state of
disconnection properly.

Bug: b/28122608

Change-Id: I98105fd36914612fc96cba4d56db97b342822ffa
(cherry picked from commit 57a102e5548a7a395bcd7feec3c1df6d61be8187)

8 years agoMerge "Replace NOT_SUPPORTED string constants with empty strings."
Treehugger Robot [Fri, 28 Oct 2016 03:11:15 +0000 (03:11 +0000)]
Merge "Replace NOT_SUPPORTED string constants with empty strings."

8 years agoReplace NOT_SUPPORTED string constants with empty strings.
Sanket Agarwal [Mon, 18 Apr 2016 21:59:37 +0000 (14:59 -0700)]
Replace NOT_SUPPORTED string constants with empty strings.

AVRCP was defining default state strings as NOT_SUPPORTED and hence the
UI would show NOT_SUPPORTED as the string for album/song info when no
player is selected on the phone. Replacing these strings with empty
helps UI make a more informed decision.

Bug: b/28120051

Change-Id: Ia8017dce784160d637a6653f70addb5258e7871e
(cherry picked from commit a525ff9f10b2ee0cee3269ab6082ddf09441199d)