• Home
  • History
  • Annotate
  • only in /packages/apps/Bluetooth/src/com/android/bluetooth/
History log of /packages/apps/Bluetooth/src/com/android/bluetooth/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3e191ef459a9f81bf6cfcfee1e36dec72c2831f2 12-Jun-2018 Ajay Panicker <apanicke@google.com> Prevent crash when a Browsable player has an empty root

Bug: 110051940
Test: runtest bluetooth -c
com.android.bluetooth.avrcp.BrowserPlayerWrapperTest

Change-Id: I2d6db2814f3ea61e95e0a1cc8417274f103af5de
(cherry picked from commit acdf7d6bc28bdda01a3918772d0082fa75bc91c5)
(cherry picked from commit 5851f9b5afe30aea8625e56fc2192befb63c663b)
ewavrcp/BrowsedPlayerWrapper.java
7760d083a490110a4d0ac64a9e4689cebbd12491 05-Jun-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "A2DP: Don't suppress noisy intent while stopping A2dpService" into pi-dev
e1aa31860e1dfbedff375560e6d979497aef750f 04-Jun-2018 Ajay Panicker <apanicke@google.com> Merge "Check for null metadata on update" into pi-dev
09b958725cbdb2a19ef0ac667c6e62145141404c 31-May-2018 Ajay Panicker <apanicke@google.com> Check for null metadata on update

Bug: 80281220
Test: runtest bluetooth -c
com.android.bluetooth.avrcp.MediaPlayerWrapperTest

Change-Id: I0751b54fe383e33eeebe06c671aebaa188e6d680
ewavrcp/MediaPlayerWrapper.java
6743e015e076aa1a24f92d3be187f9af6d19b303 29-May-2018 Chienyuan <chienyuanhuang@google.com> HFP: Only reset AG indicator listeners when HF is first connected

* Only reset AG indicator listener state in HeadsetStateMachine
when entering Connected state from Connecting state

Bug: 80408316
Test: Connect a headset that does not need RSSI, make a phone call,
hangup and check AG indicator listener states
Change-Id: I6422102fab1e12c412890aae84ac471237817ff4
(cherry picked from commit 384c62b824cd98cb3dcbf578d763101f1c04b42a)
fp/HeadsetStateMachine.java
f024fcf86f8513e6cbeea980382b400f63da75f4 31-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Test: Fix flaky PhonePolicyTest and ActiveDeviceManagerTest" into pi-dev
bd161c11c4bee853ed833d150a9bb19ee410d6d0 30-May-2018 Jack He <siyuanh@google.com> Test: Fix flaky PhonePolicyTest and ActiveDeviceManagerTest

* PhonePolicyTest needs to stub A2dpService.connect() and
HeadsetService.connect() methods for it to pass stably
* Fixed a miscounted frequency for HeadsetService.setPriority()
in PhonePolicyTes.testDisconnectNoAutoConnect().
* Fixed a race condition in ActiveDeviceManagerTest where dependency
calls such as HearingAidService.setActiveDevice() happens before
internal state such as mHearingAidActiveDevice is set. The fix
requires ActiveDeviceManagerTest to wait for ActiveDeviceManager's
handler looper to finish executing scheduled tasks before checking any
internal states

Bug: 80437170
Test: run PhonePolicyTest, ActiveDeviceManagerTest 100 times
Change-Id: Iece11914c4c7f7c54abcbf78caa7ddd2ba1d740f
(cherry picked from commit 4afa9552fd6fa0056977388661ec22a28bee1c7f)
tservice/ActiveDeviceManager.java
fe1ef2fd4e1699d82f0e58d97ddbe30f3c91cd0b 30-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Inform AudioManager if absolute volume is supported after connection" into pi-dev
03cd5a71266b2ec80df962d0dc6c9da9b80f4b98 28-May-2018 Ugo Yu <ugoyu@google.com> A2DP: Don't suppress noisy intent while stopping A2dpService

- While stopping A2dpService, setActiveDevice(null) is called to
notify AudioManager the disconnection. However, if A2DP is streaming,
music won't be stopped by this notification since noisy intent has
been suppressed due to A2DP is actually still connected.
- Add a function removeActiveDevice() to handle events which needs
AudioManager to send noisy intent no matter the conection state is.
- Also, we need to store AVRCP volume level since setActiveDevice
is replaced by removeActiveDevice in A2dpService.stop.

Bug: 80376490
Test: runtest bluetooth -j48
Turn off Bluetooth while playing A2DP streaming

Change-Id: Ied9efcb608ff5235551a06b5462379ed7a754b6a
2dp/A2dpService.java
0f5b951d00b5efb447774eabb899872e6cf83ccb 18-May-2018 tedwang <tedwang@google.com> avrcp-addressed-player-changed

Send player update to native stack in PTS mode

Bug: 79375787
Bug: 79376305
Test: PTS Test AVRCPTG/MPS/BV-05-C AVRCP/TG/MPS/BV-07-C
Change-Id: I6851c0b147c2ee67b5ed3ec9c3491baa68e2e0d2
tils.java
ewavrcp/AvrcpTargetService.java
ewavrcp/MediaPlayerList.java
0a8f03739e0ddf9dac656a5aa7d23c0eaede1717 29-May-2018 Ajay Panicker <apanicke@google.com> Inform AudioManager if absolute volume is supported after connection

Previously we were setting the absolute volume flag in audio manager
before disconnecting the previous active device and connecting the next
active device. This led to absolute volume somtimes falsly being
reported as unsupported due to the fact that the Audio Service clears
the flag while disconnecting the previous A2DP device. By waiting for
the new device to inform the Audio Service that the remote device
supports absolute volume.

Bug: 79504164
Test: Switch between devices that support absolute volume
Change-Id: I56ddc55c8343ba562e964d8664d61649290e7443
ewavrcp/AvrcpVolumeManager.java
f32b53eab70ea1775ea0ec25337fe28544e5e025 24-May-2018 Ajay Panicker <apanicke@google.com> Merge "Treat the buffering state as playing" into pi-dev
d230345c80c1f218769a9ce481dd06e6f5b0781c 24-May-2018 Ajay Panicker <apanicke@google.com> Treat the buffering state as playing

If the player bounces between buffering and playing there could be an
issue where the carkit retrieves the playback state and it is sent as
stopped even if AVRCP thinks its playing internally.

Bug: 79528664
Test: See in snooplogs that when playing music from the cloud, the
buffering state is sent as playing.

Change-Id: I7afb16af75b4f7f4f301b8f802a0084db25ff00b
ewavrcp/MediaPlayerList.java
ewavrcp/helpers/PlayStatus.java
eac16138c381b6b28482dcf7ccfa840057e25262 23-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AVRCP, HIDD: Fix crash if stop() is called before start()" into pi-dev
f10c481a53dca05f4a48b2d0378011a807a3c531 23-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "SCO: Resume A2DP when call ended and SCO is not connected" into pi-dev
fe1afbbec992c542954414b242be58f9935ba094 23-May-2018 Hansong Zhang <hsz@google.com> AVRCP, HIDD: Fix crash if stop() is called before start()

Add a check for sInstance != null

Test: toggle airplane mode
Bug: 80193890
Change-Id: I92913858f387015791cfee9818112de81d2a5fb8
id/HidDeviceService.java
ewavrcp/AvrcpTargetService.java
7c0793add907e742c07a491fae9290e9585648af 23-May-2018 Ajay Panicker <apanicke@google.com> Merge "Add field to set A2DP device volume on connect (2/2)" into pi-dev
f13e3c53c138805f27820eff286448c599ca217a 23-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "PhonePolicy: Only auto connect to the last active A2DP device" into pi-dev
de590719da3ad68322ef05abf2b707034ffa10a6 23-May-2018 Ugo Yu <ugoyu@google.com> SCO: Resume A2DP when call ended and SCO is not connected

- Fix A2DP suspended, but did not resume after phone call
if SCO was disconnected during this call.
- Add a condition to resume A2DP if phone state changed
to idle and SCO is not connected.

Bug: 80118967
Test: Manual test:
1. Make a phone call while music is playing.
2. Switch audio path to speaker.
3. Hang up phone call.

Change-Id: Icde281aedfc4721910e1c57a4f6c604e4fee5e83
(cherry picked from commit 0f7d72610b341c2ba4a755c3354ea11865c4026a)
fp/HeadsetService.java
ad32af8b6a7e2ff2d6bc3bc5c830ac6f85c38ff6 23-May-2018 Vasu Nori <vnori@google.com> Merge "Merge "fix initial "hfp-enable" state of HFP client state machine." am: 3e56faafed am: c21a6101e7 am: f6c97d9a5b" into pi-dev
c465e715542766e3fa7df73bef4cae8be1be88ae 23-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "On STR_START, request audio focus for TV only" into pi-dev
0c3e89e90ff670dd4356e9e31565e15aaea3abc9 22-May-2018 Jack He <siyuanh@google.com> PhonePolicy: Only auto connect to the last active A2DP device

* Only auto connect to the last device indicated by
BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED intent
* Ignore the intent when EXTRA_DEVICE is null since we cannot tell
if setting active device to null is due to user action or due to
device disconnection. Consider revising this policy in future
revisions of phone policy

Bug: 79995170
Test: PhonePolicyTest, connect and toggle Bluetooth
Change-Id: I0a0b34e69c6db206fcb6ca67e7edd6421a61f586
(cherry picked from commit f3bff5dcae6cd8f7571d23ed06d8d59207434f1b)
tservice/PhonePolicy.java
6b41e73a3ad6593cd9b075964f3920d273a2699a 22-May-2018 vnori <vnori@google.com> Merge "fix initial "hfp-enable" state of HFP client state machine." am: 3e56faafed am: c21a6101e7
am: f6c97d9a5b

fix initial "hfp-enable" state of HFP client state machine.

initial state of "hfp-enable" is true.
when a call is placed, since the state is assumed to be
audio-routing already, no effort is made to actually route the audio to HU.

by fixing the initial state to "hfp-enable = false",
tihs problem is circumvented.

Bug: 79857325
Test: tested manually.

Change-Id: I6d7e5d03542571102c6ab3a1d73680bdde50c968
(cherry picked from commit 632cf273f75f0f534149904ffb1cacc92b403436)
fpclient/HeadsetClientStateMachine.java
70ec6e99b31e283aa14fe236a487901718e84d6f 19-May-2018 Powei Feng <powei@google.com> On STR_START, request audio focus for TV only

Bug: 79779046
Test: Manual
Change-Id: Ic44eb897ef755b25680122bdd505e38a5b072679
(cherry picked from commit 4745665d2d26c9d74752baf8ce1dc5414a07c7d0)
2dpsink/A2dpSinkStreamHandler.java
669801dcb1655e62bdd4268af84ebf795dad40ed 22-May-2018 Joseph Pirozzo <pirozzoj@google.com> Limit AVRCP Browsing fetch size

Limit the size of AVRCP Browsing transactions to improve performance and
reliability for large folders.

Bug: 79093111
Test: Browse a folder with more than 1000 songs.
Change-Id: I49919a72b39acf2bc443e630d32435a76e3115e7
(cherry picked from commit cf6fe57f1b3a6a70e81e524639a4b6934431ad28)
vrcpcontroller/AvrcpControllerStateMachine.java
a00f1b6d6b4d49634ec7a0ca483befc896e9d89b 23-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AVRCP: Don't set globally allocated lists to null" into pi-dev
0fa90812dfb69e60c0b61b3fd04aa36aa14a1e21 22-May-2018 Ajay Panicker <apanicke@google.com> AVRCP: Don't set globally allocated lists to null

Bug: 79147244
Test: runtest bluetooth
Change-Id: I46b427b684b25704092f83ca72da4394065bf895
(cherry picked from commit b995b045b8f1577efb7e56b8f361b8e45b69f135)
ewavrcp/MediaPlayerList.java
099b9449d5c11e26f5dc17bd14170f3fe0a2e412 22-May-2018 Pavlin Radoslavov <pavlin@google.com> Allow outgoing A2DP connection when pairing via NFC

If Bluetooth is disabled, pairing via NFC will start the Bluetooth
Adapter service in Quiet Mode. In such mode only the incoming A2DP
connection requests should be rejected - the outgoing A2DP connection
requests should be allowed.

Bug: 79330878
Test: Manual: (1) Disable Bluetooth; (2) Pair with a Headset via NFC;
(3) Play music. Updated existing unit tests.

Change-Id: I3dd892b963116c8f169f63bb117401a4a078ab9c
Merged-In: I3dd892b963116c8f169f63bb117401a4a078ab9c
(cherry picked from commit c713e54b82851072afdc5fb6bc6decc2f438d81b)
2dp/A2dpService.java
2dp/A2dpStateMachine.java
1dac523802ab61d20701e078e73209c062a6b9ab 21-May-2018 Eric Laurent <elaurent@google.com> Add field to set A2DP device volume on connect (2/2)

Add a field to setBluetoothA2dpDeviceConnectionStateInt() to allow
Bluetooth to set a volume for the new device when it connects.

Bug: 79529581
Test: Switch repeatedly between devices and see that the old volume isn't
used on the new device or the new volume isn't used on the old device.
Change-Id: If6dba6e08a9a449733db2b05c6523939c5fa9cea
2dp/A2dpService.java
ewavrcp/AvrcpTargetService.java
ewavrcp/AvrcpVolumeManager.java
3f58524aecc03ca63e0a244f3f1857c9b7ba2808 17-May-2018 Ugo Yu <ugoyu@google.com> Update a2dp state to not playing while quitting the state machine

- Fix a race condition for a2dp while turning off Bluetooth.
- Audio state won't be updated if A2dpService stop before stack
report audio state change.
- Update audio state to not playing if it is playing and the
state machine is quitting.

Bug: 79911521
Test: manual test, turn off Bluetooth while a2dp is playing
Change-Id: I09c4e062fd2205abf57c25ca44cba27088ebf5e5
(cherry picked from commit b440ba997894ccc2a62aa09711e55d8f597770e4)
2dp/A2dpStateMachine.java
ac09c40f4d5dba3521ffe912f6ab797e8d7dda58 21-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "HSP: Correctly hang up call when key is pressed" into pi-dev
83db1636e9cf4f874efcacec72688674c950dfbb 21-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes from topic "bt-phone-policy-fix-auto-connect-multi-dev" into pi-dev

* changes:
PhonyPolicy: Don't connect other profiles if all profiles are disconnected
PhonePolicy: Stop auto connecting to devices that failed to connect
PhonePolicy: Gate CONNECT_OTHER_PROFILE per device
f451ece4cd322f71ba3643c440e6b065e9e93f28 20-May-2018 Jack He <siyuanh@google.com> HSP: Correctly hang up call when key is pressed

* When ringing, key pressed event should answer call
* When in call and audio is not active, key pressed event should connect
audio to headset by setting it as active device
* When in call and audio is active, key pressed event should hang up
call
* When call state is idle and audio is active, key pressed event should
disconnect audio
* When idle and audio is not active, key pressed event should dial
outgoing call using the last dialed number if exists

Bug: 74234576
Test: HeadsetStateMachineTest
Change-Id: Idc0925f1b4e77128e00a50927d0f8442792e5a8e
(cherry picked from commit 405293b65f0f5c0ef739d7ebf95e4db653595ddc)
fp/AtPhonebook.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
3cc3ca76069837340db03751e64b6df230e5d8cc 18-May-2018 Jack He <siyuanh@google.com> PhonyPolicy: Don't connect other profiles if all profiles are disconnected

* When the delayed CONNECT_OTHER_PROFILES method is triggered,
PhonePolicy should not auto connect other profiles for a device if all
profiles are disconnected for THAT device
* Remove device from retry set when all its profiles are disconnected
* Clean up retry set if all profiles are disconnected for all devices

Bug: 79938868
Test: PhonePolicyTest
Change-Id: I37b6828797dd659ac0d1cf1784e903148c1749df
(cherry picked from commit d3ed2838205aeb4087e4ab9269a73cf790f312bf)
tservice/PhonePolicy.java
d8ae37693406af4fa2633092ec9500a484933a9e 18-May-2018 Jack He <siyuanh@google.com> PhonePolicy: Stop auto connecting to devices that failed to connect

* Set priority from AUTO_CONNECT to ON when device failed to connect
as indicated by transition from CONNECTING TO DISCONNECTED state
* Set priority from AUTO_CONNECT to ON for all disconnected devices
when a device is connected

Bug: 79956685
Test: runtest -j40 bluetooth -c
com.android.bluetooth.btservice.PhonePolicyTest
Change-Id: I319ee174fa5f32630418c40f8372e30d41ae8871
(cherry picked from commit d5fcc13ca66d1eabeee0e6f9a6daeabbdc6b7573)
tservice/PhonePolicy.java
d617142a6e7567c6ae46fbbbebb58e14900cb3a1 18-May-2018 Jack He <siyuanh@google.com> PhonePolicy: Gate CONNECT_OTHER_PROFILE per device

* When A2DP or HFP is connected for a device, PhonePolicy will try to
connect to other profiles such as HFP, A2DP and PAN in case the remote
device did not connect these profiles themselves.
* De-duping this effort by checking if PhonePolicy handler already has
the CONNECT_OTHER_PROFILES message works for a single device but
won't work when multiple devices are connecting at the same time
from the remote side. Only the first connected device's connection
request with be honored and other devices' connection request might be
dropped if the first device's connection request is still in progress
* Therefore, we need to create a HashSet to gate this message per
BluetoothDevice

Bug: 79938868
Test: runtest -j40 bluetooth
Change-Id: I3865404c16b0243e610c8a94e3d32459107581a8
(cherry picked from commit a5e75bcd70bba16b7701ea5f08ac3816d82d318a)
tservice/PhonePolicy.java
b22c15ad006a08e4eaaf8945dc42d877eff43d69 18-May-2018 Ajay Panicker <apanicke@google.com> Send Media Update even if Metadata sync timeout occurs

Trying to send a metadata update after a timeout occurs will allow badly
behaving players to still send updates even if data isn't synced. Note
unsynced data can lead to missing or wrong metadata on some carkits and
this is only done as a last resort.

Bug: 73593104
Test: Open Android Auto and Spotify, see in logs that Spotify now has a
playlist that is missing album info.

Change-Id: I251d7a29d869e775409e15eba45b85831450e819
(cherry picked from commit 34d2984da5845a017dac2f32dd1e20a1a8fbfac8)
ewavrcp/MediaPlayerWrapper.java
01ffbccf5bb8236fe816ce072271e78ce463c9f6 19-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Set device volume when AudioManager says device is connected" into pi-dev
69b47ca7db36f1d0e54f7d8263c222e917346fa9 18-May-2018 Ajay Panicker <apanicke@google.com> Set device volume when AudioManager says device is connected

Instead of setting the remembered volume before the active device switch
happens, set it once we get a callback from the AudioManager that the
device has changed. This prevents the posibility of the new volume being
used with the old active device.

Bug: 79529581
Test: Switch devices multiple times and see that the volume changes when
the new device is connected.

Change-Id: I6a9e10654c844a5e2727d5409e27dd9e8176dd18
2dp/A2dpService.java
ewavrcp/AvrcpNativeInterface.java
ewavrcp/AvrcpTargetService.java
ewavrcp/AvrcpVolumeManager.java
ff5993924ef627e8b723d33ccb5514cb15bb134d 20-Feb-2018 Jack He <siyuanh@google.com> HeadsetService: Manage voice recognition for multiple devices

* Handle voice recognition in HeadsetService so that we can manage
multiple connected HFP devices. Implement the following policies to
manage relations among multiple HFP devices:
- If voice recognition is initiated by HF, the HF will be set as
active device and following startVoiceRecognition(device) callback will
be routed to the initiating HFP regardless of the input argument
- If startVoiceRecognition(device) is called without a pending request
from HF, the requested device will be set as active device and audio
will be routed to that device
* Added unit tests to verify voice recognition function behavior in
Multi-HFP which can be:
- Started by HF and stopped by HF
- Started by HF and stopped by AG
- Started by AG and stopped by HF
- Started by AG and stopped by AG
* Fixed logic in HeadsetStateMachine to match the expected behavior

Bug: 35793101
Test: runtest -j40 bluetooth
Change-Id: Ibbabcf7a5eb9355a1f35fb9ff287f7345cdcd372
(cherry picked from commit 2e5b99c2e33a27bed7acfdef46c1e2c95b04f591)
fp/HeadsetService.java
fp/HeadsetStateMachine.java
fp/HeadsetSystemInterface.java
06a28b9d84f85e9bf40cd2396bcfb4ae33a507a8 17-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AVRCP: Verify SetBrowsedPlayer player ID" into pi-dev
d3ce33869dd4cc814ffc5077fab1c192d74b40a5 16-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AdapterState: Set BLE start timeout to 4 seconds" into pi-dev
999410571acd0086b44b6d4e87d0e66d76200ecf 16-May-2018 Myles Watson <mylesgw@google.com> AdapterState: Set BLE start timeout to 4 seconds

Some devices need more than two seconds to initialize the
transport, download firmware, and update.

Fixes: 79369424
Test: runtest bluetooth
Change-Id: Ib1d58a32f721b50385f0959f42e7829ef8c92454
(cherry picked from commit 3c745fe42c776e7c58cfc56901ef6dc0b32c99e8)
tservice/AdapterState.java
f499c3d8ca788862ed618f659b152b0bfe7bef47 15-May-2018 Hansong Zhang <hsz@google.com> AVRCP: Verify SetBrowsedPlayer player ID

IUT should reject the invalid SetBrowsedPlayer command sent from PTS.

Bug: 79377126
Test: PTS AVRCP/TG/MPS/BI-02-C
Change-Id: I3727247c14ccc00698802e267a80b75c8ec8f701
(cherry picked from commit 6d91f542d9ed595ecffc29bafcd1334043041427)
ewavrcp/MediaPlayerList.java
7833c9ad56da53c8967589075720cb8384dfeefc 14-May-2018 Pavlin Radoslavov <pavlin@google.com> Reset the Active device to null if a wired headset is connected

If a Bluetooth headset is connected, it will become the Active device
for A2DP/HFP, and will be used for audio output. Then, if a wired
headset is connected, audio is automatically rerouted to the wired headset
by the Audio Framework. However, from Bluetooth perspective, the Active
device hasn't changed, therefore attempts to (re)set the Active device
to the Bluetooth headset will not be successful (the processing
will be no-op).

The solution is to keep track in the ActiveDeviceManager whether
a wired headset is connected - if yes, then explicitly reset the
Active device to null.

Bug: 78212654
Test: Manual - (1) connect a wired headset and Bluetooth headsets.
(2) Switch the Active device to a Bluetooth headset.
Unit tests added
Change-Id: I1cecd9a096ff5e5bc39583e21f6c8053610d2ee0
Merged-In: I1cecd9a096ff5e5bc39583e21f6c8053610d2ee0
(cherry picked from commit 3669a243e7aaebef705ef6e0c188e7f7b7a4461a)
tservice/ActiveDeviceManager.java
d317d2c6457fbe7ea8e10aed537c7d797682ed0e 14-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Use custom metadata object for all logging" into pi-dev
80fb98cd67e2cd8273ca78042c51fd7cbefd76bd 09-May-2018 Ajay Panicker <apanicke@google.com> Use custom metadata object for all logging

The metadata object in AVRCP handles null checks and fields properly
helping prevent crashes caused by poorly behaving media apps. Also add
the duration and track number and total number of tracks fields to the
metadata string.

Bug: 78562371
Test: Compile and "adb shell dumpsys bluetooth_manager"
Change-Id: Iaa9739f429795cbbb64b24eddfbf90beb8f090ba
Merged-In: Iaa9739f429795cbbb64b24eddfbf90beb8f090ba
(cherry picked from commit a9edfd4544b3091d597d61d99ccfa2475d3816d5)
ewavrcp/GPMWrapper.java
ewavrcp/MediaPlayerWrapper.java
ewavrcp/helpers/Metadata.java
27fca676c2809f992575420cf9fe360ae909699b 05-May-2018 Jack He <siyuanh@google.com> SCO: Suspend and resume A2DP before SCO setup and after SCO tear down

* Suspend A2DP:
- before calling mNativeInterface.connectAudio(device)
- before call state becomes busy and audio should be connected, as defined by:
1. numActive + numHeld > 0
2. Call setup state is not idle, but not incoming
3. Call state is incoming and in-band ringing is enabled
* Resume A2DP:
- when mNativeInterface.connectAudio(device) returns false
- when SCO audio is disconnected and call state is idle as defined by:
1. numActive + numHeld > 0
2. Call setup state is not idle

Bug: 74988740
Test: make a hangout call while music is playing
Change-Id: I85672b4e61c91a7db2458600ad3bacfe8d529af1
(cherry picked from commit 47fa7f7ba376a2a9724504b9b597699ac20fb19b)
fp/HeadsetService.java
fp/HeadsetStateMachine.java
fp/HeadsetSystemInterface.java
9595b447a7e17c2af581ee730aa01a501f806ffb 12-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Do calculations for item x out of y in AVRCP" into pi-dev
11cfacfa45f105d1fa0215fb6cd96f7d8107be09 11-May-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Send remaining contacts instead of error on Contact deletion" into pi-dev
dc7a3644b85ed75469047858c294f75cf6aeab1c 10-May-2018 Pavlin Radoslavov <pavlin@google.com> Continue playing audio if output to local device is selected by the user

Audio will continue playing if the user explicitly selected the
local device as output.
However, if the local device was selected implicitly because the
remote device has been disconnected, then the music will stop
before selecting the local device as output.

Bug: 77192195
Test: Manual - play music to Bluetooth Headset, then either
(a) Select local device as output; (b) disconnect Headset
Change-Id: I9253b7983ac40951f17876db44919830984201d3
Merged-In: I9253b7983ac40951f17876db44919830984201d3
(cherry picked from commit f093fd4aae74dcb7bc218aa7aa4eb03e8f851ebf)
2dp/A2dpService.java
2a47bbd673c3b8503f61b889966561db2afc393c 08-May-2018 Sumit Deshmukh <sumitd@codeaurora.org> PBAP: Send remaining contacts instead of error on Contact deletion

Precondition: vCardFilter should not be null.

Usecase:
1) Establish PBAP Connection.
2) Start Pull Phonebook Operation.
3) Delete some latest created contact while pull
phonebook operation is in progress.

Issue:
OBEX_HTTP_INTERNAL_ERROR is sent during contact download.

Root Cause:
If contact is deleted or not found after pull phonebook
operation is started, StringIndexOutOfBoundException causes
sending OBEX_HTTP_INTERNAL_ERROR.

Fix:
Skip deleted contact entry and send remaining contact without
sending OBEX_HTTP_INTERNAL_ERROR.

Test: Issue not seen as per above usecase.

Bug: 79447289
Change-Id: I357cce93e5ddfff62ad928864272257b18602d55
(cherry picked from commit dd21a0b942e2b4246d596874c3d7d244ea845a41)
bap/BluetoothPbapVcardManager.java
f32d4cea65f86ca2e54ea4ae5ef30a7bdab72bf4 08-May-2018 Ajay Panicker <apanicke@google.com> Do calculations for item x out of y in AVRCP

We have to do this calculation ourself as sometimes the media player
doesn't give us the info and some carkits require it in order to display
the correct media metadata.

Bug: 78617730
Test: Use GPM and see that the track num shows up in the snoop logs
Change-Id: Iee4b20fd16163f0eeaac3f1fa0959f619ac194e6
(cherry picked from commit 725986178cbbfb11dd99cad1ebb4ea6f7aa1b1b2)
ewavrcp/MediaPlayerWrapper.java
ewavrcp/helpers/Util.java
67ae7fd3d186d619c4cbf0499b8504da13c9925c 09-May-2018 Ajay Panicker <apanicke@google.com> Merge "Disconnect MediaBrowserWrapper after every operation" into pi-dev
7293a9642b571f3f2592575f7701a26e881c316e 07-May-2018 Ajay Panicker <apanicke@google.com> Send correct key state and ignore keys from inactive device (2/2)

Also make it clearer whether the key state is pushed or released.

Bug: 79178216
Test: Run host native test net_test_avrcp
Change-Id: I92a2006412fad2fec8f0a5d57e71c63d344f87ae
(cherry picked from commit e68b1b5fcf7aaf3b656e36d13e9f1f082f4a22e1)
ewavrcp/AvrcpNativeInterface.java
ewavrcp/AvrcpTargetService.java
ewavrcp/MediaPlayerList.java
18ef65e474d1079fbbc46695c199f6265e9f4e84 04-May-2018 Ajay Panicker <apanicke@google.com> Disconnect MediaBrowserWrapper after every operation

Instead of trying to keep Browsable Players in a conected state whenever
possible, disconnect them immediatly after every opperation in order to
prevent them from keeping a high priority.

Bug: 78787396
Test: "adb shell dumpsys activity" and see that browsable players don't
have thier priorities bumped.
Change-Id: I66eede99fe256676ef64596f73aed00d7142f8f7
ewavrcp/BrowsablePlayerConnector.java
ewavrcp/BrowsedPlayerWrapper.java
a639b81f96c534c2f1066354b4a574c0dda2f713 26-Apr-2018 Jack He <siyuanh@google.com> HFP: Fix phone state change in Telecom and VoIP calls

* We used to ignore phone state change when devices are all disconnected
* Instead, phone state change should always be captured by HeadsetService's
HeadsetPhoneState regardless of device connection state.
* This prevents HeadsetService from notifying remote device wrong phone
state when just connected
* VoIP calls' phone state change should also be handled in
HeadsetService to allow multiple connected HFP devices to sync
* Add unit test for phone state change
* Synchronize HeadsetServce state cleanup and setters using
mStateMachines to avoid race condition
* Log the pid and uid of key SCO event callers
* Intents should be sent when audio is disconnected from headset

Call Policy after this change:
* VoIP call -> Telecom Call: Telecom call should cause VoIP call to stop
* Telecom call -> VoIP call: VoIP call should be rejected
* VoIP call state is no longer cleaned during SCO tear down, instead, it
should be teared down by the original caller to
startScoUsingVirtualVoiceCall() via stopScoUsingVirtualVoiceCall()

Bug: 76201254
Bug: 76114959
Test: HeadsetServiceTest, HeadsetServiceAndStateMachineTest
Connect to Bose QC35, call, turn off headset, end call, turn on
headset
Change-Id: I230f4da47fc57392208e26156f9e975ea2a1fad5
tils.java
fp/HeadsetCallState.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
fp/HeadsetSystemInterface.java
f079d79c78c38058c28222cd26b2697d9b3f2c07 02-May-2018 vnori <vnori@google.com> Merge "Grab audio focus when starting Voice actoins. tested in pi (go/ag/3974655)."
am: b835703500

Bug: 76031221

Test: tested manually. Start Local media player. From
KitchenSink->HeadSet Audio->"Start Voice Interaction".
Ask a question. Local media should stop, Should hear the anwer.
and then Local media should resume playing.

Change-Id: I97136a0eb00468c10d74037c790b75e3eb4b7835
(cherry picked from commit c28c7a20bab6cab1954c15393948fb7ed79b3366)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
463e0b09ab0da8b833545f8d3821be08f82a8c8e 02-May-2018 android-build-team Robot <android-build-team-robot@google.com> Merge "AdapterProperties: Always set the scan mode on enable/disable" into pi-dev
6abeaeb6ab0476dce35f673c6c16b435356b230f 26-Apr-2018 Myles Watson <mylesgw@google.com> AdapterProperties: Always set the scan mode on enable/disable

Fixes: 75375851
Test: runtest bluetooth
boot and manually verify dumpsys bluetooth_manager output
Change-Id: Ie7aa171dc91703bdeeb203dbe316ca8230129fbd
(cherry picked from commit b350b2c774093de6d30abf9b3db8f7891562f6ed)
tservice/AdapterProperties.java
aa7a4e8c2e84eb696eb140c60e717391960236e5 27-Apr-2018 Ajay Panicker <apanicke@google.com> Prevent NPE from onQueueChanged with a null queue

Bug: 78768610
Test: runtest bluetooth -c
com.android.bluetooth.avrcp.MediaPlayerWrapperTest
Change-Id: Ie8b8f96017bff20d54dbb06a620c235e8b8db1ae

(cherry picked from commit 6502f0f0e4cea84b2f470fffc10e84d344d9072d)
ewavrcp/MediaPlayerWrapper.java
4ca65536560edeaf26b9a3d35e88915386668e5c 01-May-2018 android-build-team Robot <android-build-team-robot@google.com> Merge "Use lowercase bdaddr and fix improper string compare in Volume Manager" into pi-dev
dd4851fc4f5b8da3a2cedfb3276bb8d4235325eb 27-Apr-2018 Ajay Panicker <apanicke@google.com> Use lowercase bdaddr and fix improper string compare in Volume Manager

Currently Bluetooth Native code uses lowercase Bluetooth addresses.
Instead have AvrcpNativeInterface.java convert these to uppercase since
this is what BluetoothDevice.java uses. This is so that the addresses
used by the volume manager will match in case. Also fix an improper
comparison in AvrcpVolumeManager.java.

Bug: 30602783
Test: See that Sony MDR-1RBT connects after being switched to the active
device and the remembered volume is correctly restored.

Change-Id: I84df84586d3d1ad846a9ff8e88bc28b772c0b87b
(cherry picked from commit 2b650ad68b16952e6b00c37704eda5b575a1d0fe)
ewavrcp/AvrcpNativeInterface.java
ewavrcp/AvrcpTargetService.java
ewavrcp/AvrcpVolumeManager.java
f55506ebe7bb30a93d5314d9fcccbeb607f98496 27-Apr-2018 Hansong Zhang <hsz@google.com> HearingAidService: Fix first connection to a device

* Always connect to the target device itself, even if no HiSyncId
* Don't disconnect before connect if no HiSyncId info
* Clear HiSyncId and capabilities map during service start and stop
* Add debug log message for OnDeviceAvailable stack event

Test: instrumentation test
Bug: 69623109
Change-Id: Idbf43561331cfbf9c512f4b37b1a83ad118c2f4f
(cherry picked from commit 910605c7e63e005a366d9d00356202872196a9cc)
earingaid/HearingAidService.java
92486313b0464776d0cb6b14d797fd9e38909c82 28-Apr-2018 android-build-team Robot <android-build-team-robot@google.com> Merge "Cleanup and improve AVRCP logging" into pi-dev
66901324bbd868e0ec1a0cda2d0f1ef79f4300ea 27-Apr-2018 android-build-team Robot <android-build-team-robot@google.com> Merge "Unit tests for Active device manager" into pi-dev
5bab1e5ebcc02011b4a587c23234f6025a545168 20-Apr-2018 Ajay Panicker <apanicke@google.com> Cleanup and improve AVRCP logging

Bug: 78304072
Test: Compile
Change-Id: I40d06a7bd0b8b22b7092cbcb5443af72f625be51
(cherry picked from commit e4ae6d86a5254cc4474af98c6abae38eaaea386b)
ewavrcp/BrowsedPlayerWrapper.java
ewavrcp/MediaPlayerList.java
ewavrcp/MediaPlayerWrapper.java
ewavrcp/helpers/Metadata.java
ewavrcp/helpers/PlayStatus.java
ewavrcp/helpers/Util.java
ad2bb221168ac2a92e85b791f7e4070633e10c5a 24-Apr-2018 Hansong Zhang <hsz@google.com> Unit tests for Active device manager

Bug: 77191556
Test: unit test
Change-Id: If3453e8db47cd630f1cb9444ee90e2f5aa5043eb
Merged-In: If4f66f3ace85244a9d6aab6e98a1bdc3c401e560
(cherry picked from commit f9007fd5ee2ea88c83fd8577797733435188550f)
tservice/ActiveDeviceManager.java
9e18c9de74a1882e629ee99a037be46b3ec18bba 27-Apr-2018 Hansong Zhang <hsz@google.com> MediaPlayerList: Prevent NPE in wrapper.cleanup()

Bug: 78516364
Test: manual
Change-Id: I78d9e6737056b0e436087333a58f522399494ab9
(cherry picked from commit 1d09dc7c97f04547d9b407f1ae99dd54e2b856e0)
ewavrcp/MediaPlayerList.java
375d5d2fbbbc96951aa7ca6a535c2026a5ad3e53 26-Apr-2018 Kai Wang <kwangsudo@google.com> Merge "Add email address in Pbap filter" into pi-dev
bc5e652497d767d9a576d6b89cbacde4ed2881be 25-Apr-2018 Jack He <siyuanh@google.com> Allow PRIORITY_UNDEFINED when remote device is BONDING or BONDED

* When priority is undefined, it is likely that SDP has not completed
and peer is initiating the connection. Allow this connection for HFP,
A2DP, and HearingAid if the device is bonded or bonding.
* Added unit tests for various okToConnect methods

Bug: 78336562
Test: A2dpServiceTest, HeadsetServiceTest, HearingAidServiceTest
let Benz NTG5 Star2 Car kit connect to DUT

Change-Id: I3e35fab38b485efa89b33c65a3980072a17b7272
(cherry picked from commit b65a4c16f5a25ace5eaf0976a5940c92bbe6708a)
2dp/A2dpService.java
earingaid/HearingAidService.java
fp/HeadsetService.java
cb172374db71d6ae118c6919d0f9ebc548a7d905 23-Apr-2018 Pavlin Radoslavov <pavlin@google.com> Newly connected A2DP/HFP device will become the Active device

* Now all the logic for selecting the A2DP/HFP Active device
is handled by the ActiveDeviceManager
* Changed the semantics of selecting the A2DP/HFP Active device:
The newly connected A2DP/HFP device will become the Active device
* Updated the description in ActiveDeviceManager to describe the
latest logic
* Removed old code for MESSAGE_SELECT_ACTICE_DEVICE_TIMEOUT that
is not needed / relevant anymore.
* Updated HeadsetService, so it doesn't choose proactively
the first connected HFP device as the Active device - now this
is done by the ActiveDeviceManager.
Also, updated the corresponding unit tests that were assuming
the first connected device automatically becomes the
Headset Active device.

Bug: 77191556
Test: Manual - connect multiple Headsets
Change-Id: I9e8c6a3493d15d710cdeb6e56c76f3dfb4abca61
Merged-In: I9e8c6a3493d15d710cdeb6e56c76f3dfb4abca61
(cherry picked from commit 26e20aeda4c397e98d37a2136d6c6d9ec982d435)
tservice/ActiveDeviceManager.java
fp/HeadsetService.java
32f47799e46afa44fa8ebd6c72e3f393fa6082f4 25-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Hearing Aid: fix logic in connect and disconnect" into pi-dev
25171dfea53dea9d9760925fd50830c4ba47335c 25-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Scan manager: Suspend scan when location is off" into pi-dev
6f242929239617419eda3a93651bf33207a6a850 24-Apr-2018 Hansong Zhang <hsz@google.com> Hearing Aid: fix logic in connect and disconnect

* Hearing Aid Service reads the HiSyncId map and connect to the given
device and also the other side device (if any) at the same time. Before
connecting, the Hearing Aid Service disconnects devices from other pair.
* Simplify the logic in connect and disconnect to handle devices with
same HiSyncId.

Bug: 69623109
Test: unit test
Change-Id: Ib6e966e2aa51c991d89c9993f685aa15c039b89b
(cherry picked from commit 8b683ddb8ff86882ba18e05246d1b5b4fdb44b29)
earingaid/HearingAidService.java
6c12f756cdc0ef1112d64c70e31c21b29dfda04e 18-Apr-2018 Petri Gynther <pgynther@google.com> A2DP offload: switch to new properties

Bug: 63932139
Bug: 76201991
Test: Manual A2DP testing (A2DP offload enabled and disabled)
Change-Id: Ic0e15ceaf7dac1336789e83a98eba7e3ebfb09ef
Merged-In: Ic0e15ceaf7dac1336789e83a98eba7e3ebfb09ef
tservice/AdapterProperties.java
cd53caa864581bfc679c065696fe3506f46d8d31 20-Apr-2018 Hansong Zhang <hsz@google.com> Fix NPE in MediaPlayerList

Bug: 78289651
Test: manual
Change-Id: Ia6fa0d45591c04210294895afa35167ad67c3e02
ewavrcp/MediaPlayerList.java
4209478a2e979761c789ef21f4f8f9300a9573c7 19-Apr-2018 Hansong Zhang <hsz@google.com> Fix NPE in BrowsedPlayerWrapper

Bug: 78286518
Test: manual
Change-Id: Id177033b01c2bd9aa15d2c2fe70eb1acf143e8ff
ewavrcp/BrowsedPlayerWrapper.java
e0f6f14c808b5274c84c165d879357518f455d6f 19-Apr-2018 Kai <kwangsudo@google.com> Add email address in Pbap filter

Add email address in Pbap filter.

Bug: 78166201
Test: Pair phone with Car kit.
Compare pcecontacts.vcf with psecontacts.vcf

Change-Id: I4bb2d19d973fe34bd7bd94957ce43bf933a9a198
bapclient/PbapClientConnectionHandler.java
c85243fa399ff16ebb9aebad70a05f4994f9e177 19-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Implement Bluetooth device volume memory" into pi-dev
9cada26da8f04a0f6b2cc76db72c96315668c705 05-Apr-2018 Hansong Zhang <hsz@google.com> Scan manager: Suspend scan when location is off

* Add a broadcast receiver to listen for location on/off event. When
location is off, send SUSPEND_SCAN message; when location is on, send
RESUME_SCAN message
* In handleStartScan(), suspend the scan if location is off, unless it
is a filtered scan or issued by a legacy app
* Both location on/off and display on/off events are handled in
HandlerThread, so there is no collision
* Add instrumentation test to bring GattService up and down

Test: instrumentation test and manual
Bug: 73485839
Change-Id: I3230ccd6406733043611406d3f19e99863ff082e
att/ScanManager.java
a05dfaf4ad5032aadc684c28b35233346e5ce92c 18-Apr-2018 Andre Eisenbach <eisenbach@google.com> Merge "Enable the AVRCP Service by default (1/2)" into pi-dev
efc4fa308a17e14addba503c425824ecf84997f8 18-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Revert "Scan manager: Suspend scan when location is off"" into pi-dev
dc99b60a4096d6ae64275a58e38ae87072ab135d 18-Apr-2018 Jakub Pawlowski <jpawlowski@google.com> Revert "Scan manager: Suspend scan when location is off"

This reverts commit efc013507b0b2b5c772f6db0389b5bd29116a0b7.

Reason for revert: b/78213091

Change-Id: I104db37bf45d50047b5ff7fb5b2311734185e500
Bug: 78213091
att/ScanManager.java
9e6762d56978ae31ea5d99a734259f5968fae68c 18-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Scan manager: Suspend scan when location is off" into pi-dev
c10cddd90f713f89d0a6ba513b0656004d5d03bf 13-Apr-2018 Ajay Panicker <apanicke@google.com> Implement Bluetooth device volume memory

Bluetooth volume memory is now handled on a per device basis. The volume
is stored in a shared preference and is loaded every time the device is
active. Volume is persisted for devices that both do and don't support
absolute volume.

Bug: 33962015
Test: Connect to multiple devices and switch between devices. See that
the volume is restored each time a device becomes active.

Change-Id: I596a4f0d701a7c5b8c52285807970f8b172cc423
(cherry picked from commit 029dc111e40ec8603d51423592e7a3b1179c31a2)
2dp/A2dpService.java
ewavrcp/AvrcpTargetService.java
ewavrcp/AvrcpVolumeManager.java
53c70fdd210ba8bded6d5a4f2df9edfd633a6bb1 17-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AVRCP ignore duplicate volume changed notifications" into pi-dev
8c374062c934cd8ff1d7340b2151608c1429a923 16-Apr-2018 Jakub Pawlowski <jpawlowski@google.com> GATT: put include declarations before characteristics in service

BT spec Version 5.0 | Vol 3, Part G 3.1:
"All include definitions shall immediately follow the service
declaration and precede any characteristic definitions."

Bug: 78107486
Change-Id: Ifb61864d30fed450a73cd71c60b4e85666ae1458
(cherry picked from commit b163ff5168330966fc1ba5dae45114a55feef2c7)
att/GattService.java
412ffb8cc9dcec0c5dcaa8f0aa1b719512578137 12-Apr-2018 Joseph Pirozzo <pirozzoj@google.com> AVRCP ignore duplicate volume changed notifications

If two volume changes come in quickly only the first one has its
absolute volume changed notification blocked. Update code to keep track
of how many requests were received recently and block all of them.

Bug: 77526454
Test: Stream music and hold volume up/down on phone.
Change-Id: Ibc96050ed1ed536da568c2d6917bfeb5a851b84e
(cherry picked from commit 3c3f7619bd7921cd46efe1f9b060ce2197a1a768)
vrcpcontroller/AvrcpControllerStateMachine.java
398cb23a4eb601f8a2313c180612aa53f1fc1094 16-Apr-2018 Joseph Pirozzo <pirozzoj@google.com> Merge "AVRCP controller browsing range limit" into pi-dev
7a50c3d529f4d4c875cd04fd08d856b9a56b0590 11-Apr-2018 Ajay Panicker <apanicke@google.com> Enable the AVRCP Service by default (1/2)

Bug: 77238060
Test: Flash a device and see that AvrcpTargetService is enabled
Change-Id: Ic08ab142bb72a96fe83372bb6409bab720739c01
ewavrcp/AvrcpTargetService.java
faabf3d4b9f33c20183751911d4a88590c8af585 12-Apr-2018 Ajay Panicker <apanicke@google.com> Prevent NPE from null metadata in GPM

Bug: 77238060
Test: Compile
Change-Id: I360e1da83dcb147013cca7ccf6d14ee0f162ec54
ewavrcp/GPMWrapper.java
eac17ef844bc39b41e042088fe9cb9cfb4e3817f 12-Apr-2018 Stanley Tng <stng@google.com> Merge "Pass new LE CoC min_ce/max_ce parameters to native stack" into pi-dev
a8488cbbbcf23740d43e7fffb845273313ca42ab 12-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Return cached data for the Now Playing Queue" into pi-dev
be1553bdb0db067dee4cee93a796769c0b76349d 12-Apr-2018 Joseph Pirozzo <pirozzoj@google.com> AVRCP controller browsing range limit

Previous code was erroneously only considering lowest byte of integer
length for start and stop range resulting in incorrect results when
getting folder contents. Updated to use full 32 bits of range, and
allow early exit from long running commands.

Bug: 72496280
Test: stream music and browse at the same time.

Change-Id: I3a1ed990a6e9612c79535348137cfaa428a11d46
(cherry picked from commit 518221917f87fef3c481ebf2e082e151489d704e)
vrcpcontroller/AvrcpControllerService.java
vrcpcontroller/AvrcpControllerStateMachine.java
a5690e3a9deafc6265f1425f93072b85a76eb7be 19-Mar-2018 Stanley Tng <stng@google.com> Pass new LE CoC min_ce/max_ce parameters to native stack

Add new test parameters, min_ce and max_ce, to the SL4A tests for LE
Connection-oriented Channel (CoC) feature.

Test: Run cmd: act.py -c $MY_SL4A_CONFIG -tc BleCoc2ConnTest
Bug: 77528723

Change-Id: I97da38372c28da5d4f610951b56706c5f6247516
(cherry picked from commit f2526072203e128a6c053118120e9ed8a18797b0)
att/GattService.java
6a64e7c986ab1a137ba65ac4994acd0cbee3744c 12-Apr-2018 Remi NGUYEN VAN <reminv@google.com> Merge "Add NOT_ROAMING to bluetooth network capabilities." into pi-dev
2980556c292eaa89c743fea37372efd6543a31ae 12-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "PBAP Delete CallLog" into pi-dev
eca6642bdf1d0ae66416c864efe8075c9694dded 06-Apr-2018 Remi NGUYEN VAN <reminv@google.com> Add NOT_ROAMING to bluetooth network capabilities.

Bug: b/69113950
Fixes: b/69113950
Test: manual: flashed, tested BT tethering working.
(Clean cherry-pick from aosp Ic5ab5bf3985bce5cd9dd679fd2f88f7f8efc4e55)
Merged-In: Ic6ae2edde1b76d00681fa35826c3f18c78655cde
Merged-In: I9768e585a6182d7bb0553b0d046a1a851f182ac6

Change-Id: I9cb633fbea188e3ef9c9426fa28a1d7c85964ad1
an/BluetoothTetheringNetworkFactory.java
ec0c4c48a68c61005e55af5c7ec9960018712f2e 12-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Metrics: Log profile connection events" into pi-dev
1222db67cc42229138108218077a28b10cc342bb 12-Apr-2018 Ajay Panicker <apanicke@google.com> Return cached data for the Now Playing Queue

Similar to the need to cache the folder items, we need to cache the now
playing list since carkits will poll for the data in chunks. If we have
to go through the framework for the data every time this can be
incredibly slow causing lots of jenk.

Bug: 77879544
Test: "runtest bluetooth -c com.android.bluetooth.avrcp.MediaPlayerWrapperTest"
Also test with BMW with a playlist of over 300 songs.

Change-Id: Ib2c8af797d3d87b79bbf386775506bcc06715a33
(cherry picked from commit 359b7b5d31933c19751fab5644966e11776c81da)
ewavrcp/MediaPlayerWrapper.java
223230cf7aa57375f3de45f32efdbc9484dd83ab 12-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Init the AVRCP Target Service before user unlock" into pi-dev
0ad53ef457f156314595a27c63660454450d3c84 02-Apr-2018 Jack He <siyuanh@google.com> Metrics: Log profile connection events

* Add MetricsLogger class that has static methods to log metrics data
across the Java statck
* Log profile connection events for each profile
* Add unit test for MetricsLogger

Bug: 77476285
Test: make, MetricsLoggerTest, BtFunhausMetricsTest,
send and receive files over OPP,
connect to HID keyboards,
adb shell dumpsys bluetooth_manager --proto-bin
Change-Id: If2f42b9c682a678f86eaa61e2acd569cab2653e8
Merged-In: If2f42b9c682a678f86eaa61e2acd569cab2653e8
(cherry picked from commit 83556defe4c4b43f31b8617adeed197e94180e44)
2dp/A2dpService.java
2dpsink/A2dpSinkStateMachine.java
vrcpcontroller/AvrcpControllerStateMachine.java
tservice/AdapterService.java
tservice/MetricsLogger.java
dp/HealthService.java
earingaid/HearingAidService.java
fp/HeadsetService.java
fpclient/HeadsetClientStateMachine.java
id/HidDeviceService.java
id/HidHostService.java
ap/BluetoothMapService.java
apclient/MceStateMachine.java
ewavrcp/AvrcpTargetService.java
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
an/PanService.java
bap/PbapStateMachine.java
bapclient/PbapClientStateMachine.java
ap/SapService.java
8e9e3053cfc96e55d6245088b3b868c57260ed85 10-Apr-2018 Ajay Panicker <apanicke@google.com> AVRCP: Only display "Not Provided" for the title of a song

The Artist, Album, and Genre fields will now be reported as an empty
string instead of showing "Not Provided".

Bug: 68812037
Test: Connect to a carkit and see that missing fields aren't showing.
Change-Id: I419b3d2f6a18dbecd3711cfd3dcb340be48ce7e4
(cherry picked from commit 458b79cd8032dbe3d178327f5e92a73a2ffc7d48)
ewavrcp/helpers/Util.java
fb1594fe803b8b0f7633d04d8a8740eb2d8d4ea7 10-Apr-2018 Ajay Panicker <apanicke@google.com> Init the AVRCP Target Service before user unlock

A2DP was trying to use the AVRCP service before it was initialized since
A2DP is started at boot. Now both profiles will be started at boot.

Bug: 77549528
Test: Add a passcode to phone and then connect to device before
unlocking phone.

Change-Id: Ie661d412a9219d5baa5ba40d01cb1c75afa19954
(cherry picked from commit 93bbf5d22ceb7612ed061ebd45cdd747d918a955)
ewavrcp/AvrcpTargetService.java
ewavrcp/MediaPlayerList.java
efc013507b0b2b5c772f6db0389b5bd29116a0b7 05-Apr-2018 Hansong Zhang <hsz@google.com> Scan manager: Suspend scan when location is off

* Add a broadcast receiver to listen for location on/off event. When
location is off, send SUSPEND_SCAN message; when location is on, send
RESUME_SCAN message
* In handleStartScan(), suspend the scan if location is off, unless it
is a filtered scan or issued by a legacy app
* Both location on/off and display on/off events are handled in
HandlerThread, so there is no collision

Test: manual
Bug: 73485839
Change-Id: Ie7adcd91afbb95e2bd231a11ed557915583f1d6c
att/ScanManager.java
3a9af9e6a7cc2391c6b558a696ac4184f9fe146f 11-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "HFP: Fix typo in various permission check messages" into pi-dev
afc350c30b22769949e079b4242fc4d5af47bc6e 10-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "HFP: Let Telephony ignore screen off when listening to signal strength" into pi-dev
103f9175e14424b0d5760c37210386aabc45d79a 03-Apr-2018 Treehugger Robot <treehugger-gerrit@google.com> HFP: Fix typo in various permission check messages

Bug: 72830122
Test: make, no functional change
Change-Id: Ie10d7f40fa6dccafc70313328e26291863c5fd64
(cherry picked from commit b6df6dd3eea0b4f3c8cda7c9db5333f319dbf0cc)
fp/HeadsetService.java
ea9205ec6cc5ae8e732f93842dc7a1bf5daaddc1 09-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "HFP: Fix AG indicator update for Multi-HFP" into pi-dev
c8081adf06569edc9558a59f555ba36084267d5f 12-Mar-2018 Erik Kline <ek@google.com> Migrate to IpClient and eschew MultinetworkPolicyTracker

Test: as follows
- built
- flashed
- treehugger
Bug: 62476366
Bug: 72663849

Merged-In: I50760bd73dbc160979c7c7c5af880a1178c6972e
Merged-In: Idec412e81d85c1c742d7f00c8d698470420aebe5
Change-Id: I1fa52f55f536cf443e69af6326b7662d0771469f
(cherry picked from commit 73c86e52446ad4da5c464b37df2a6af14d4b1c12)
an/BluetoothTetheringNetworkFactory.java
3ca279cb473ba10740ff70be158869ca2773c859 06-Apr-2018 Jack He <siyuanh@google.com> HFP: Let Telephony ignore screen off when listening to signal strength

* Set INDICATION_FILTER_SIGNAL_STRENGTH to INDICATION_UPDATE_MODE_IGNORE_SCREEN_OFF
when start listening to signal strength update
* Set it back to INDICATION_UPDATE_MODE_NORMAL when we stop listening to
these updates

Bug: 65112388
Test: make, HeadsetPhoneStateTest,
connect to carkits, shield device when screen is off

Change-Id: I7d6abe9e1d75b32629daf0a3336c289c3362ea7d
(cherry picked from commit 280b8fe412beb2fa3517cf6ef00f882015b01d01)
fp/HeadsetPhoneState.java
448309eada01c130b2fee8977f7fd74875978cbc 06-Apr-2018 Jack He <siyuanh@google.com> HFP: Fix AG indicator update for Multi-HFP

* Keep AG indicator subscription when at least one HFP device is connected
* Respect AT+BIA commands by turnning indicator subscription on and off

Bug: 77655992
Test: make, HeadsetPhoneStateTest, HeadsetStateMachineTest
Change-Id: Ifa4a1c2f730b286f4f8d35fdec92e37f05f02b67
(cherry picked from commit 53f33f4b5221ca9ca9f41588b25861bfe300f3c7)
fp/HeadsetAgIndicatorEnableState.java
fp/HeadsetNativeInterface.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStackEvent.java
fp/HeadsetStateMachine.java
fp/HeadsetSystemInterface.java
c8e48372193d3b84b4e264bbab0ddca87f9f34a3 07-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add hidden API to get current user of HID Device (3/3)" into pi-dev
7d53d3d5dd50e4732371145b2bb0de854f67140b 06-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes from topic "hearing-aid-set-active-device" into pi-dev

* changes:
Active device manager: Integrate Hearing Aid
Hearing Aid: change set/get active device(2/3)
0557fe1ec6c72daccfb6333e4a88a68ad85bafe2 26-Mar-2018 Hansong Zhang <hsz@google.com> Add hidden API to get current user of HID Device (3/3)

Bug: 69136526
Test: test with apps using HID Device profile
Change-Id: I76b7cc1c2c5eb9e993cda81f3dde6760cc3b75fc
(cherry picked from commit 9c3580cb72509b71d2ad68319c526ddeef921986)
id/HidDeviceService.java
4bc7daecf842b2cfbd0741668df798d531f7dcda 13-Mar-2018 Hansong Zhang <hsz@google.com> Active device manager: Integrate Hearing Aid

* When A2DP/HFP is set to be active, Hearing Aid will be inactive
* When Hearing Aid is set to be active, HFP/A2DP will be inactive
* When Hearing Aid is active, incoming A2DP/HFP connected device
will not be active
* Change the HearingAidService.setActiveDevice() to return boolean

Test: manual
Bug: 69623109
Change-Id: I8d29078aa4ff2b770cb032aa9b1584520a527067
Merged-In: I8d29078aa4ff2b770cb032aa9b1584520a527067
(cherry picked from commit ce3625bd5e29d01d56d8aca04f55e3b8185534b4)
tservice/ActiveDeviceManager.java
16af9f60379b6cf371c126175ca7a7fb06ae9ea0 28-Mar-2018 Hansong Zhang <hsz@google.com> Hearing Aid: change set/get active device(2/3)

* setActiveDevice() returns false in error case, e.g. when the device is
not connected
* add getActiveDevices() instead of isActiveDevice(), which returns a list
that must have two elements: left and right, and each can be null

Test: manual
Bug: 69623109
Change-Id: I1e8541ca5b2030a231bbbea86c71183768a6570f
Merged-In: I1e8541ca5b2030a231bbbea86c71183768a6570f
(cherry picked from commit d9f44b8fc6b1fcf61d7abfac5b69b7cb2fadfc9f)
earingaid/HearingAidService.java
dbc5d564733f231461be42dd67dedbb08397f8fd 27-Mar-2018 Hemant Gupta <hemantg@codeaurora.org> OPP: Ignore back press in Incoming alert screen

Use case:
1. Receive incoming file from remote
2. Tap on incoming notification to view incoming alert screen.
3. Press back button
4. perform above use case multiple times
5. Drag status bar and click on accept notification

Error:
Incoming notification not getting clear after click
on Accept.

Fix:
Avoid updating incoming status as hidden, and ignore
back press event in Incoming alert window.

Test: Able to receive file successfully after above usecase

Fixes: 77182502
Change-Id: I87e2077a5357744d8aa99b9d9c8103ba6acbedca
Merged-In: I87e2077a5357744d8aa99b9d9c8103ba6acbedca
(cherry picked from commit 38a111dc71e8f6d3db2520f971b733b41a2ef7bd)
pp/BluetoothOppIncomingFileConfirmActivity.java
1ac795e87366fc40fcd18cd2aa8bf0e75d904aee 28-Mar-2018 Kai <kwangsudo@google.com> PBAP Delete CallLog

Add account's hashcode into calllog table. Check ContentResolver
before delete CallLog.

Bug: 76153766
Test: Pair two phones with car kit.
Disconnect one of them and check call history.
Reboot carkit.
Check log if there is any PBAP fatal exception.
Change-Id: I427e39922029200915ad4a95566e132c6d514301
bapclient/CallLogPullRequest.java
bapclient/PbapClientConnectionHandler.java
910f83acb593c0a136ca98cf5760d6b43f7a8c32 01-Apr-2018 Sumit Deshmukh <sumitd@codeaurora.org> MAP: Remove extra line feed in Message Listing object

Usecase:
1) Establish MAP session.
2) Do Message Listing for any folder with messages.

Issue:
Extra line feed is present and seen in messageListing xml object
as &#10; for carkit other than BENZ which causes parsing issues
in some carkits.

Root Cause:
FastXmlSerializer.startDocument() and xmlMsgElement.text("\n")
both add line feed.

Fix:
Line feed is already added method FastXmlSerializer.startDocument()
So need to remove extra line feed added.

Test: No extra junk characters are seen in Mesage Listing Response

Fixes: 77447850
Change-Id: I86a7bff088982fe4906399f645a28f03b8073d83
Merged-In: I86a7bff088982fe4906399f645a28f03b8073d83
(cherry picked from commit 50e0bd95ef314d5a2026dbb5f529f4d7191e24b2)
ap/BluetoothMapMessageListing.java
730c6dc97ba79a0aae31f1858d23a25adaed8907 31-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Reload contacts on user switch" into pi-dev
c1c6ce55cb1f9c8ddb5bd16fe2b474611dc92d45 31-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AVRCP Browsing concurrency" into pi-dev
510a4d29eaaa660a792bfdad85c4705093842b24 31-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "OPP: Interrup Obex Client thread while sending ABORT" into pi-dev
b7d21fccfb066e0f2dcbc4a73cf45a07c17614aa 30-Jan-2018 Joseph Pirozzo <pirozzoj@google.com> AVRCP Browsing concurrency

When performing browsing commands allow other commands that can be
processed simultaneously to execute. Update states that extend
CmdStgate to pass those messages up to the parent connected state for
processing.

Bug: 72495854
Test: runtest bluetooth
Change-Id: I2e1073a7d3befaf3a263b2d10f8b571f78d66cf6
(cherry picked from commit 7388595061f1ea7fa5cc33911d7e0137f3e8fd3b)
vrcpcontroller/AvrcpControllerStateMachine.java
f6561b64c609e7dec1fb2d2ddf29539f35e9af82 21-Mar-2018 Hemant Gupta <hemantg@codeaurora.org> OPP: Handle abnormal behaviour while sharing file from Snapchat

Use case:
1. Take a pic in Snapchat
2. share this picture via BT

Expected Result:
Photo can be shared successfully via BT to remote device

Root Cause:
Android Content Resolver not able to find name column from
received URI of external app.

Fix:
Add extra check while fetching name value from provider,
to prevent cursor exception and make file transfer successful.

Test: No crash observed while sharing file from Snapchat

Fixes: 77167222
Change-Id: I26c6543a4276fd18496ec5479a99eda52dd403b5
(cherry picked from commit 43ea91bac76336fad1a0a3f280229ef4667f859d)
pp/BluetoothOppSendFileInfo.java
0094cb8f143e0be2db67d145114cf8ec198397dc 30-Mar-2018 Hemant Gupta <hemantg@codeaurora.org> OPP: Interrup Obex Client thread while sending ABORT

Precondition: PTS 7.2.1

Use case:
1. Execute test case TC_OPP_CL_OPH_BV_27_I for OPP
2. Try to cancel the transfer as requested by PTS, by cancelling the transfer.

Expectation:
Test case should pass

Observation:
Test case fails

Root cause:
While aborting put operation IO exception is seen
because of timeout and dut closes Obex session.

Fix:
First interrupt Obex client thread, during abort
request while file transfer is active.

Test: TC_OPP_CL_OPH_BV_27_I can be passed after the patch.

Fixes: 77306447
Change-Id: I06f4a4c63999df1beb0c8913251f576636518ff8
(cherry picked from commit 19f86e20fdc841154d7c1301f3065d2b92fa5a09)
pp/BluetoothOppTransfer.java
c5328cf44d025286c0d44008748c4d8493268920 25-Jan-2018 Myles Watson <mylesgw@google.com> PBAP: Reload contacts on user switch

When the active user changes, update contacts.

The car kit will still have the old contacts, but when it
asks for new contacts it will get contacts for the new user.

Bug: 72435402
Test: Connect and disconnect to a car kit, switch users, repeat
Change-Id: Ia015aa5b3d6dece4515d76bb1804e2c1ba05e349
(cherry picked from commit 1d2fecb0d36f19056f2e1014da1a10af37fc6d59)
bap/BluetoothPbapService.java
a077cac30750544c05455866e08773c04de42243 28-Mar-2018 Jakub Pawlowski <jpawlowski@google.com> Improve BondStateMachine logging

Use strings instead of hard to guess numbers when displaying bond state
changes.

Bug: 67907612
Test: observe logs in console during bonding
Change-Id: I4223ba9267387f497be280d44f2f4b562a16218c
tservice/BondStateMachine.java
5efc502c33f23730e6be59c138725705febfa78c 29-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "HIDD: Add caller permission check" into pi-dev
b4073364fe6aed5434738647eefa6899af6a9957 28-Mar-2018 Adam Bookatz <bookatz@google.com> Merge "Bluetooth talks to statsd" into pi-dev
4a6fdddc84107ab900afb6d8b09b68129ed4133e 28-Mar-2018 Hansong Zhang <hsz@google.com> HIDD: Add caller permission check

Test: SL4A
Bug: 63384609
Change-Id: Ib9efd1c8d3f3568c1bb4881fe9495323067527e1
(cherry picked from commit 43c3db261ee6e2eccee86b46336a3a08e9326b35)
id/HidDeviceService.java
3eb37afdf7fd1960ee73bc4cf23ff8fe5fd94320 27-Mar-2018 Bookatz <bookatz@google.com> Bluetooth talks to statsd

Fix statsd ble scan logging by logging directly from bluetooth.

Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testBleUnoptimizedScan
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testBleScan
Bug: 71607284
Bug: 69478888
Change-Id: Ie2df364ebd98d275947bba09952a515ed19c8634
tservice/AdapterService.java
att/AppScanStats.java
2a46f5c26de153fd597737771eccb61cd233afc2 28-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes I52e2f8da,I8fe66b02 into pi-dev

* changes:
Disable the Now Playing List for players with no active item
Return only fresh data from the MediaController
9f5567754dd79e3eaa65a349f985ce53b29842e8 28-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AdapterService: Handle snoop settings changes" into pi-dev
67471fe9a400db3f5048c6cb44d07b531f649d9f 23-Mar-2018 Pavlin Radoslavov <pavlin@google.com> Add a missing null pointer check inside AvrcpTargetService.dump()

This fixes NPE when "dumpsys bluetooth_manager"

Bug: 76219543
Test: Manual: adb shell dumpsys bluetooth_manager
Change-Id: Ie39844fb44c424631595444e42bbaccb019b7d3a
(cherry picked from commit 13c98d2c26c9d7a92227b37144e9b2028005f793)
Merged-In: Ie39844fb44c424631595444e42bbaccb019b7d3a
ewavrcp/AvrcpTargetService.java
8b9a5a1d92ac99bc5f602957656c23329f84f964 22-Mar-2018 Ajay Panicker <apanicke@google.com> Disable the Now Playing List for players with no active item

If there is some reason we cant determine the current active item in the
now playing list of the player, disable their now playing list. We do
this by only returning a one item now playing list consisting of the
current item.

Bug: 76128322
Test: View the now playing list on a carkit using a player that doesn't
have an active item (Used VLC for this test)

Change-Id: I52e2f8daead3baf1028b47e1907871b5506de399
(cherry picked from commit b58c0e2b7039f9ca50b76071c695ad386a75aa03)
Merged-In: I52e2f8daead3baf1028b47e1907871b5506de399
ewavrcp/MediaPlayerList.java
eb0db9f704a6446e3dcc17b1e824cb3a6930a4a7 22-Mar-2018 Ajay Panicker <apanicke@google.com> Return only fresh data from the MediaController

By returning previously cached data there was a chance of it becomming
stale. By now always polling the MediaContoller for its most recent and
up to date data, we ensure that the information sent to the carkit is
farm fresh.

Bug: 76128322
Test: runtest bluetooth -j38
Change-Id: I8fe66b02b47d3a4481f321d8ac4f6b412e3a1361
(cherry picked from commit f808b40a691a050900fcc5641ee4eba6619b0636)
Merged-In: I8fe66b02b47d3a4481f321d8ac4f6b412e3a1361
ewavrcp/MediaPlayerList.java
ewavrcp/MediaPlayerWrapper.java
02d05f122b048a14f6ee6ecd4b3a36b4e3b9ae78 26-Mar-2018 Myles Watson <mylesgw@google.com> AdapterService: Handle snoop settings changes

Allow a user to toggle Bluetooth to start or stop snoop logging after
changing the developer setting.

Bug: 67634644
Test: runtest bluetooth \
-c com.android.bluetooth.btservice.AdapterServiceTest \
-m testSnoopLoggingChange
Change-Id: Ie42b9485538b6bb679831ba1f8e5eddd50060e13
Merged-In: Ie42b9485538b6bb679831ba1f8e5eddd50060e13
(cherry picked from commit b6b7f6446f7c283df5595722f04b30282b55fe91)
tservice/AdapterService.java
084a14dd10e0b7e6826225486c759de246511ce2 17-Mar-2018 Ajay Panicker <apanicke@google.com> Add a property to enable the New AVRCP Profile (2/2)

You can now use the new AVRCP Profile by setting
persist.bluetooth.enablenewavrcp to true. Also add a binder interface
that will be used later in the future.

Bug: 68854188
Test: Check to see that the profile is used when property is true and is
not used when property is false.
Change-Id: Ia68696cfcb1c8077ab80cfe90f345bd0a09e185f
(cherry picked from commit f37b51f4b4d6d7259898fe71598dd1994be71f31)
Merged-In: Ia68696cfcb1c8077ab80cfe90f345bd0a09e185f
2dp/A2dpService.java
ewavrcp/AvrcpTargetService.java
ewavrcp/MediaPlayerList.java
6dc6c7943c16784e8f760412163af700907c94e7 16-Mar-2018 Ajay Panicker <apanicke@google.com> Add the AVRCP Target Service (1/2)

The AVRCP Target Service is started by Bluetooth Adapter like a normal
service instead of being started by A2DP like the old service. All it
does is initializes the player list and helps communicate data between
the Media Framework and the Native Interface.

Bug: 68854188
Test: Compiles and local test with service enabled
Change-Id: Ifb26f0fa3fac37686924bd6835e1d346ebf68bf1
(cherry picked from commit 4864ab08b2ca00623692fb7743ab10b68f1c6d86)
Merged-In: Ifb26f0fa3fac37686924bd6835e1d346ebf68bf1
tservice/Config.java
ewavrcp/AvrcpNativeInterface.java
ewavrcp/AvrcpTargetService.java
ewavrcp/helpers/PlayStatus.java
3cf7e318416748f0e57be387bd94820a34ef1185 15-Mar-2018 Ajay Panicker <apanicke@google.com> Implement the JNI layer for the AVRCP Service (1/3)

Add the JNI interface for the AVRCP Target Service and the Java class
that controls it.

Bug: 68854188
Test: Compile
Change-Id: Id368ea817439763eb2d0edd581a84ce32515b1f2
(cherry picked from commit d8806e81c6aedce36125db5d682a06adcfab24f9)
Merged-In: Id368ea817439763eb2d0edd581a84ce32515b1f2
ewavrcp/AvrcpNativeInterface.java
ewavrcp/helpers/PlayStatus.java
99a82a9d6d6b7d86a2bd0aabeef7b193cfe623db 15-Mar-2018 Ajay Panicker <apanicke@google.com> Add the MediaPlayerList and fix some checks

The MediaPlayerList class handles keeping track of all the Browsers and
Media Controllers. It will also keep track of which is the active
controller and be able to return the most current metadata.

Fix the metadata equals check as it was comparing more than we wanted.
Depending on where you retrieve the information certain fields may be
filled out differenty even though the song represented was the same.

Also add a queue ID check for the MediaPlayerWrapper in addition to a
null queue.

Bug: 68854188
Test: Compile and Manual testing on full build
Change-Id: I1a25f5a44eb2b5b1775c04baefbfc66c018251e9
(cherry picked from commit 97229a2406d884b4692d77b5e12c0de0063e70f7)
Merged-In: I1a25f5a44eb2b5b1775c04baefbfc66c018251e9
ewavrcp/BrowsablePlayerConnector.java
ewavrcp/BrowsedPlayerWrapper.java
ewavrcp/GPMWrapper.java
ewavrcp/MediaPlayerList.java
ewavrcp/MediaPlayerWrapper.java
ewavrcp/helpers/AvrcpPassthrough.java
ewavrcp/helpers/Metadata.java
ewavrcp/helpers/PlayerInfo.java
ewavrcp/helpers/Util.java
10b84632069f38494bcfe1ff0a7cc2f54ac15319 26-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add BrowsablePlayerConnecter to handle creating the browsable player list" into pi-dev
48b6af1e6b0c29e0c2ab07225acb33e1b2b77cdb 26-Mar-2018 Tej Singh <singhtejinder@google.com> Merge "Log: Bluetooth Connections" into pi-dev
3caeda9025ef4c97dffb52fba8550bef1a57e084 15-Mar-2018 Ajay Panicker <apanicke@google.com> Add BrowsablePlayerConnecter to handle creating the browsable player list

BrowsablePlayerConnector connects to all provided browsable players and
checks if connection succeeds as well as the root folder has more than
zero items. The results are returned in a callback.

Bug: 68854188
Test: Compile
Change-Id: I32023836c3bfba496cd216ade246c7e217a99999
(cherry picked from commit 14fcb562b193b65c163f3c4fd15e91c6e09300df)
Merged-In: I53d1bdc9ae930f5ca39ae683ceda19e9abd58f25
ewavrcp/BrowsablePlayerConnector.java
de778443fdb539d38db92069661fdc18626a4c9c 09-Mar-2018 Ajay Panicker <apanicke@google.com> Add the BrowsedPlayerWrapper

The BrowserPlayerWrapper provides a convienent interface for AVRCP to
use that handles all connections, and requests with a convienent API.
Also this patch adds a mockable MediaBrowser as well as adding the
MediaControllerFactory and MediaBrowserFactory classes in order to make
injecting test objects much easier.

Bug: 68854188
Test: runtest -c com.android.bluetooth.avrcp.BrowserPlayerWrapperTest
Change-Id: I34b5326eaf35d8db43f6a8d709f60ade4c642e88
(cherry picked from commit 390145f1fd2f83bbfb2576823a9c9d7831efa152)
Merged-In: I4f80c17e4290d36c9948eb46cce6745b810173a0
vrcp/Avrcp.java
vrcp/BrowsedMediaPlayer.java
vrcp/mockable/MediaBrowser.java
vrcp/mockable/MediaBrowserFactory.java
vrcp/mockable/MediaController.java
vrcp/mockable/MediaControllerFactory.java
ewavrcp/BrowsedPlayerWrapper.java
ewavrcp/GPMWrapper.java
ewavrcp/helpers/Util.java
f4a6530f8771f88baec6f6e1f7ee3ce9cc64e2f0 09-Mar-2018 Ajay Panicker <apanicke@google.com> Add utility objects to unify all media metadata types.

Right now there are four types of metadata in the media framework.
MediaMetadata, MediaDescripion, MediaSession.QueueItem, and
MediaBrowser.MediaItem. This patch provides utility functions to merge
all of these into the Metadata class to be used throughout AVRCP.

Bug: 68854188
Test: runtest bluetooth -c com.android.bluetooth.avrcp.MediaPlayerWrapperTest
Change-Id: I0213473b7a6e54e8a1ca7a3d651bf12ad6139f8e
(cherry picked from commit dbed4ea9ddc73fb248feb2e2f513752696ce4536)
Merged-In: I24b3816db2410dd7428f443036cbf869da1fb89e
ewavrcp/GPMWrapper.java
ewavrcp/MediaPlayerWrapper.java
ewavrcp/helpers/Folder.java
ewavrcp/helpers/ListItem.java
ewavrcp/helpers/MediaData.java
ewavrcp/helpers/Metadata.java
ewavrcp/helpers/Util.java
4543564aa27508671ea970ba87af8da4ae147ce1 23-Mar-2018 Myles Watson <mylesgw@google.com> AdapterProperties: Add dumpsys support

AdapterProperties
Name: PhoneName
Address: 0A:DD:7E:55:00:01
BluetoothClass: null
ScanMode: SCAN_MODE_CONNECTABLE
ConnectionState: STATE_CONNECTED
State: ON
MaxConnectedAudioDevices: 3
A2dpOffloadEnabled: false
Discovering: false
DiscoveryEndMs: 0
Bonded devices:
40:40:00:40:60:10 [BR/EDR] Pixel 2
AC:50:80:30:00:1F [BR/EDR] BB-BTHP

Bug: 75375851
Test: adb shell dumpsys bluetooth_manager
Change-Id: I4a84bd5224e4d047359b58f2a9812be0c59893a5
(cherry picked from commit 9578c95ea86bab135fa1159dab8a0363f97861c5)
Merged-In: I4a84bd5224e4d047359b58f2a9812be0c59893a5
tservice/AdapterProperties.java
tservice/AdapterService.java
5c3b8bf93e3e12b1d59e7427d85b0f74ee79d7e3 23-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "HIDD: Address API Review concerns" into pi-dev
3adb724c3217c695033115365fe7bceb6e7d7c3b 23-Mar-2018 Hansong Zhang <hsz@google.com> HIDD: Fix the logic in unregisterApp()

unregisterApp() does nothing when no app is registered

Test: SL4A
Bug: 72168126
Change-Id: I6a541fee6cbd8fdabfddd0b1c56f90c8dfdecafd
id/HidDeviceService.java
56a2c2ebfedee651fc7e17f6ea60a7b5632ded4f 23-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Bluetooth A2DP Sink only connect from Disconnected state" into pi-dev
7933e26fa67d79bf755a1f94dcb9e1d5d94f1bea 23-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Remove browsing requirement from MediaPlayerWrapper for queue support" into pi-dev
22dc412f7fb88631376c9f2f407304945e389efa 08-Mar-2018 Ajay Panicker <apanicke@google.com> Remove browsing requirement from MediaPlayerWrapper for queue support

An incorrect asumption was made that browsing was required in order to
have a now playing list. For AVRCP this is true, but in the Media
Framework a player can support browsing but have no queue and vice
versa.

Bug: 68854188
Test: runtest bluetooth -c com.android.bluetooth.avrcp.MediaPlayerWrapperTest
Change-Id: Ic4fa856e2576712f196316efe1b66f85fa1570bf
(cherry picked from commit 567a31d99c8da7bfcbf2eaad3d4f3276064932f4)
Merged-In: I11b1f4c2629476308939cdc424904b2aa2814b37
ewavrcp/GPMWrapper.java
ewavrcp/MediaPlayerWrapper.java
ewavrcp/helpers/MediaData.java
7bad0fdd894d89c42d9c6b698bdc7e3f21a787db 23-Mar-2018 Hansong Zhang <hsz@google.com> HIDD: Add null pointer check in JNI and check invalid unregister

* Check null pointer before invoking JNI methods
* unregisterApp() returns false when no app is registered

Test: SL4A
Bug: 72168126
Change-Id: I17d99696f0e7a385d8cb155328731b0f45fc518b
id/HidDeviceService.java
471a177fa690b8e2d14e033fe6869c501046931a 28-Feb-2018 Ivan Podogov <ginkage@google.com> HIDD: Address API Review concerns

Bug: 72168436
Test: make
Change-Id: I5119a299e38c294fe7c74898594b756ee4c19a46
(cherry picked from commit 2d73c646a4f83eb8dbf6337e941c4b874e3b9272)
id/HidDeviceService.java
9269023f99ae1f1dba1d977ce152c709291114f9 22-Mar-2018 Tej Singh <singhtejinder@google.com> Log: Bluetooth Connections

Logs bluetooth connections.
Note: This change is cherry picked from aosp: go/aog/647339.

Bug: b/72320489
Bug: b/74457175
Test: verified logs appear in adb logcat -b stats
Merged-In: Ibd082c6bb1e39e2453d59b5a0d8c6ba04047daaa
Change-Id: Ibd082c6bb1e39e2453d59b5a0d8c6ba04047daaa
tservice/AdapterProperties.java
c82e112b911494b5ca5abb2395454e4982c1ecf8 21-Mar-2018 Hansong Zhang <hsz@google.com> HID Device: Unregister inactive app

When an app is registered and another app is trying to register, the
first app will automatically be unregistered if it is not visible

Bug: 72168126
Test: manual - register an app, and go to home screen
Change-Id: If4c279f95a10576537dcc4fb5c681c85b2518f1d
(cherry picked from commit cefef42c77577e6fe807db2725ef8b88e7183f02)
id/HidDeviceService.java
2341c35ba2a229d69b2720ceb8e616c48d484ace 21-Mar-2018 Joseph Pirozzo <pirozzoj@google.com> Bluetooth A2DP Sink only connect from Disconnected state

While in the pending or Connected state ignore CONNECT calls since
the A2DP sink is already in the process of connecting or
disconnecting to a target device.

Bug: 76096462
Test: While connected to a device attempt to change connection to
another device.

Change-Id: I533bf526ccb1d65b3eebf3b04ea95882ce0cdb74
(cherry picked from commit bd6e060fd2812408d47b151673cf0ffca98e0676)
2dpsink/A2dpSinkStateMachine.java
113d9bdf745358421d36b546590d2a2857265670 19-Mar-2018 Hansong Zhang <hsz@google.com> Hearing Aid Service: set and get activeDevice

* Implement setActiveDevice() and isActiveDevice()
* Add a helper method to notify Settings and Audio about active device
change

Bug: 69623109
Test: instrumentation test and manual test
Change-Id: I3af85a08f648d01974185478ae02def60d467bcb
(cherry picked from commit e80cb5dc3a8bd3478ccddebd14abbb35c7235229)
earingaid/HearingAidService.java
b26e3bb830b729bccf159c73abcd57d46277cc7e 14-Mar-2018 Anthony Stange <stange@google.com> DO NOT MERGE Retrieve the background scan mode from Settings.Global.

The default value stays the same. Reading from Settings.Global will
enable us to experiment with the value in the future.

Bug: 71765044
Test: Built successfully.
Change-Id: Ie52938f022ed6cd4402e22a28620d5f19e550917
att/ScanManager.java
09e97f4cfcca3564c8daa864ede0eee172e9d5aa 03-Mar-2018 Hansong Zhang <hsz@google.com> Hearing Aid Service with native interface

Bug: 64038649
Test: compilation and instrumentation test
Change-Id: Ic18a5dc4e28b5ecfc96c5ce7300c89b028e5887d
(cherry picked from commit bb773ae52ae2fd387a66ce03b14b63911345cd7f)
tservice/PhonePolicy.java
tservice/ServiceFactory.java
earingaid/HearingAidNativeInterface.java
earingaid/HearingAidService.java
earingaid/HearingAidStackEvent.java
earingaid/HearingAidStateMachine.java
fc72b6542b8170ae77f89dcae60be2640ce0e990 09-Nov-2017 Hansong Zhang <hsz@google.com> Hearing Aid State Machine without native interface

This is the state machine in Java layer. The native interface is not
hooked up yet.
It cannot handle native connect/disconnect event.

Bug: 64038649
Test: compilation and instrumentation test
Change-Id: I494af5b7cdfecde536fb034f2ebe5f889f888b32
(cherry picked from commit b1c893b36f1db91f93f5712d9ca6a1e1b37df73f)
earingaid/HearingAidService.java
earingaid/HearingAidStateMachine.java
4c8580f64600d9d207a1ecdbb5a034980fdbf291 02-Mar-2018 Hansong Zhang <hsz@google.com> Hearing Aid Service Stub

This is the Hearing Aid service in Java layer.

Bug: 64038649
Test: compilation; toggling the Bluetooth on/off.
Change-Id: Ib32f140d09dd33a9f49ecb91adb8e3cfd5eb3e86
(cherry picked from commit 817f2d076775debd1923c8b4e35c5e47638180a3)
tservice/Config.java
earingaid/HearingAidService.java
d07fb3812b70d06564e7c1dca3233a2c2c7533f2 15-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Remove broadcastMetadata trigger." into pi-dev
68c709bd188bf59276945648a4d478f93539b26d 15-Mar-2018 Vasu Nori <vnori@google.com> Merge "Fix bugs in tests which fail when Bluettoth is turned off. on internal gerritt, this is ag/3738365" into pi-dev
315b552a72a3fcddaf6fe8d843595c9b4a3bf4e8 15-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Playback resume after call" into pi-dev
3bac74bc78b15a00ace9a339803ed1df72e06f1c 15-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "RemoteDevices: Use String(val) to set a remote device alias" into pi-dev
a613a638fa2a2fe0cd4a46984e3cc68b96e0546d 14-Mar-2018 Joseph Pirozzo <pirozzoj@google.com> Remove broadcastMetadata trigger.

On some devices the play/pause status would go through an extra
transition due to the value provided by the Media Browse Service not
being in line with the actual state. By eliminating that state we
eliminate the race condition.

Bug: 74605206
Test: runtest bluetooth -p com.android.bluetooth.a2dpsink

(cherry picked from commit 3a3d34faa2053b0481e8ac76da956d42b3fc0596)

Change-Id: I53e4a11636dc798e69e8229bf48db0617cf4dbce
vrcpcontroller/AvrcpControllerStateMachine.java
5915f0c7b1f4f7fcf9c36c5250091d4a61c08acc 15-Mar-2018 Vasu Nori <vnori@google.com> Fix bugs in tests which fail when Bluettoth is turned off.
on internal gerritt, this is ag/3738365

Bug: 74609188
Test: tested manually: runtest bluetooth
Change-Id: I01af14906f44b21838a46a5a30a19b1cda5fcc03
(cherry picked from commit cc27a3dcc0f4d1bf09641c992d230b2eeeed0f21)
apclient/MceStateMachine.java
52bb423cb93e7b9434e077081aacd9944d61f1f2 14-Mar-2018 Joseph Pirozzo <pirozzoj@google.com> Playback resume after call

Under normal circumstances music is paused automatically when placing a
call, when there are multiple phones involved it is sometimes necessary
to pause the music on phones not making a call. When audio is resumed
there needs to be sufficient time for all devices to register that the
call has ended before music can resume.

Bug: 73133707
Test: runtest bluetooth -p com.android.bluetooth.hfpclient and manual
testing

(cherry picked from commit 13405d11e19b9d636ea7613121b041d33638c6c0)

Change-Id: I93c5eb9786664b1251dc7c4d2d846d33eb58e72c
2dpsink/A2dpSinkStreamHandler.java
b1d9087bb858cfaf34895c42cedea0184ea3ea39 16-Jun-2016 Eric Caruso <ejcaruso@google.com> RemoteDevices: Use String(val) to set a remote device alias

DeviceProperties::mAlias is of type String. Always construct a new
String from the byte array and use that.

Bug: 29363875
Test: Manual test with android LE scanning app.
Confirmed that FRIENDLY_NAME update would not throw exceptions.

Change-Id: I6648e4ca8f0907ea338cd2932bda72b630692427
tservice/RemoteDevices.java
199070ba88541999e99a0261dfaa15ccc3a467c0 12-Mar-2018 Hansong Zhang <hsz@google.com> Profile Service: Make onCreate() and onDestroy() symmetric

* Move profile service unregistration from onDestroy() to doStop()
* Make the field mAdapterService in ProfileService private

Bug: 67460963
Bug: 74511352
Test: instrumentation test
Change-Id: Ic583b895b81700dcea054bc58be8ed7e786d3778
(cherry picked from commit 2f37ccbd61df9ed864cfa0607b84b6f2ae4b3560)
tservice/ProfileService.java
att/GattService.java
pp/BluetoothOppService.java
30f396b583b5eed9d4b014a1c666804a3b545758 14-Mar-2018 Pavlin Radoslavov <pavlin@google.com> Add a missing null pointer check in the codec config comparison logic

Also, rearange the "if" logic into "else if" so it is more natural.

Bug: 74622467
Test: Manual with A2DP Offload enabled and LDAC Headset
Change-Id: I363c7b1aedf5c33f5cdeb56862385969ea8bde1c
(cherry picked from commit d4a798f85529dfe21b7500a4e67e46c633719c0c)
2dp/A2dpStateMachine.java
06457b672e7182b66230e9da553f261494b9bc03 13-Mar-2018 Jakub Pawlowski <jpawlowski@google.com> Disable log spam in AVRCP

Bug: 74572514
Change-Id: If9f5cc8b4f6cb57bf9590e6aca7d80c86fbd4388
(cherry picked from commit 8abeaf18fbdd24c9a44956fc305ed9c213ad0520)
vrcp/Avrcp.java
ae6a3b51a2059f0316b3981dd8b936b55009492a 13-Mar-2018 Petri Gynther <pgynther@google.com> Merge "A2DP Offload support" into pi-dev
381e2cc28b001e9c11e3472bd5faaeec005a0948 12-Mar-2018 Hansong Zhang <hsz@google.com> Revert "Hearing Aid Service Stub"

This reverts commit 06801a47fb65c132f9a923522f6b68c86c491d70.

Reason for revert: Service shutdown not working
Bug: 74511352
Bug: 69623109
Test: Manual
Change-Id: I54fccb1378a96656e7b4df2df3d9d96594499a9d

(cherry picked from commit 1799556b5cdee32119001e37dded728685c8b0cb)
tservice/Config.java
earingaid/HearingAidService.java
7ed1048ed4ebc0ae6e29da9dee608c2a701dd82e 12-Mar-2018 Hansong Zhang <hsz@google.com> Revert "Hearing Aid State Machine without native interface"

This reverts commit 3e1b61a6f8397046cb2a65e20ba251bfdf343444.

Reason for revert: Service shutdown not working
Bug: 74511352
Bug: 69623109
Test: Manual
Change-Id: I0a1a4d98104b7d7c0dac85464236b61cbb5a44a8

(cherry picked from commit 59d340a991edea214c63a3e657255e6cad572583)
earingaid/HearingAidService.java
earingaid/HearingAidStateMachine.java
a781f9faf8e4bd4b207089faba0153ee925421fa 20-Jan-2018 Satish kumar sugasi <ssugas@codeaurora.org> A2DP Offload support

Bug: 63932139
Bug: 72242910
Test: Manual; TestTracker/148125
Change-Id: Iecce1d86d457db7c25c77e43557d255f2898a2d3
(cherry picked from commit 87173c40be4288affe06882d864d23cb1008bd99)
2dp/A2dpService.java
2dp/A2dpStateMachine.java
tservice/AdapterProperties.java
tservice/AdapterService.java
dbd53d223fddcad41820c3ded5d36058c5910e7f 09-Mar-2018 Jack He <siyuanh@google.com> HFP: Only allows active device to change SCO volume

Bug: 71557297
Test: make phone call over Bluetooth headset
Change-Id: If7a9d99c386678c55fe4554bcf7eb88261024908
(cherry picked from commit 2fc44eb65fdd3d4b73df91038d0e81426b44c93e)
fp/HeadsetStateMachine.java
b39346d4e204a138b48dba0918ed2951a456f253 09-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes I1f97539c,I3ef01e4b into pi-dev

* changes:
Hearing Aid State Machine without native interface
Hearing Aid Service Stub
7d71c59f4c3ba2feb5033e7385f5eda4cec6944b 09-Mar-2018 Myles Watson <mylesgw@google.com> AdapterService: Call onBluetoothReady at BREDR_STARTED

Fixes: 74433475
Test: Pair a headset, power off the headset, power on
Change-Id: I2760e3ea5122aa7a25c997185594f277429b8fcf
tservice/AdapterService.java
b53a6caa19af34171392147bc182b28a398f7dc1 09-Nov-2017 Hansong Zhang <hsz@google.com> Hearing Aid State Machine without native interface

This is the state machine in Java layer. The native interface is not
hooked up yet.
It cannot handle native connect/disconnect event.

Bug: 69623109
Test: compilation and instrumentation test
Change-Id: I1f97539c6a8899fe6c2984d3b1fcd7466e88b00c
Merged-In: I1611c4c63757876a8956e1997d5a29104adbfa06
(cherry picked from commit 3e1b61a6f8397046cb2a65e20ba251bfdf343444)
earingaid/HearingAidService.java
earingaid/HearingAidStateMachine.java
27e53fc9f4e55aa3efe352c6950ff80a93ead487 02-Mar-2018 Hansong Zhang <hsz@google.com> Hearing Aid Service Stub

This is the Hearing Aid service in Java layer.

Bug: 69623109
Test: compilation; toggling the Bluetooth on/off.
Change-Id: I3ef01e4b1826e92b2310d0222b21f2813898cac3
Merged-In: I37c9d6847bf0f62f2eadafc05193839ab61ae9dc
(cherry picked from commit 06801a47fb65c132f9a923522f6b68c86c491d70)
tservice/Config.java
earingaid/HearingAidService.java
42aaaac5a186df929a8d0e1523650ae943400a5c 23-Feb-2018 Myles Watson <mylesgw@google.com> AdapterService: Support GATT as the only profile

Bug: 72435402
Bug: 73505205
Bug: 26060309
Test: runtest bluetooth -m testEnableDisableOnlyGatt
Change-Id: I3cfda91dba8a914a5419c56cb37ebc4e6a6bf8f8
Merged-In: I3cfda91dba8a914a5419c56cb37ebc4e6a6bf8f8
(cherry picked from commit 8ad5517ef7b05bc81699a404d17e5aeb987aea8b)
tservice/AdapterService.java
23e019a1baec61013773df5f8107c58279cfdf39 21-Feb-2018 Myles Watson <mylesgw@google.com> AdapterState: Simplify state transitions

- Split PendingCommandState into
- TurningOnState
- TurningOffState
- TurningBleOnState
- TurningBleOffState
- Move timeouts to enter() and exit()
- Move the native callback to AdapterService
- Remove scan setting disable

Bug: 72435402
Fixes: 66452171
Fixes: 66711270
Test: runtest bluetooth
Toggle bluetooth from settings rapidly
act.py -tc BtStressTest:test_toggle_bluetooth
Change-Id: Ic9728a9717dac7b337978deeb58104b38fea641e
Merged-In: Ic9728a9717dac7b337978deeb58104b38fea641e
(cherry picked from commit 292bc3c6845366a092f1b55443c208403aecb4f1)
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/JniCallbacks.java
b972c44e4b15e7c8341da1a05a88208132335273 06-Mar-2018 Andreas Gampe <agampe@google.com> Bluetooth: Fix incorrect map access

Found by Errorprone.

(cherry picked from commit 8e7eeed907b0d147565f7460a2497209a7a423e4)

Bug: 73288226
Test: m javac-check-Bluetooth RUN_ERROR_PRONE=true
Merged-In: Icd0015746c4c0fc5e318dcf18afdaefbfe886ec4
Change-Id: Icd0015746c4c0fc5e318dcf18afdaefbfe886ec4
apclient/MapClientService.java
78a6d872522ed230d07fa95dac1a56b127075cac 03-Mar-2018 Jack He <siyuanh@google.com> Metrics: Move bluetooth.proto to system/bt/proto

* Move bluetooth.proto to system/bt/proto/ and compile it for both
Java LITE runtime and C++ LITE runtime so that it can be shared
between Java and native code
* Modify Bluetooth code to use builder for protobuf messages
* Modify LE scan logging to log number of scan results at the end of a
scan session
* Modify AdapterService to merge native metrics before Java metrics so
that Java metrics can overwrite native metrics if needed

Bug: 33693818
Test: make, toggle Bluetooth, clearcut server-client E2E test
adb shell dumpsys bluetooth_manager --proto-bin
ACTS tests: BtMetricsTest, BtFunhausMetricsTest
Change-Id: I028df93d64faa58e7be6603a5a436517b9ebe297
(cherry picked from commit 1a7e3dc80de278cf675c266324c69b0fa866e0d6)
tservice/AdapterService.java
tservice/ProfileService.java
tservice/bluetooth.proto
att/AppScanStats.java
att/GattService.java
5ea921e2977806cafb3734c28cda39b57d0efed6 03-Mar-2018 Hansong Zhang <hsz@google.com> Merge "PBAP: Disable verbose log" am: 0b8050d02b am: 5c319ce60a
am: 722d793b19

Change-Id: Id05a71eaa6c4e665967a5cdd2cbcf459d03e3dc8
dd1d9b7a7e4aa1aa09a23f0fef2328b8d0b3a216 03-Mar-2018 Joseph Pirozzo <pirozzoj@google.com> Merge "MAP client handle failure to connect." am: 46dc71dc75 am: 423a7cb097
am: 483839d425

Change-Id: I96bda8b246263142ec13f104279364a0f64370ab
0b8050d02b64498cdd97057b29e20a2b84120d86 03-Mar-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Disable verbose log"
674f9d67a4c6bb62bc14d7b9c654a208bc88c453 03-Mar-2018 Hansong Zhang <hsz@google.com> PBAP: Disable verbose log

Test: manual
Change-Id: I8d53da434b7f61a8c1da828f2b217f70fce2c1ce
bap/BluetoothPbapService.java
63c93afe47c10156cbdd6d3d0275d41803560d1b 02-Mar-2018 Joseph Pirozzo <pirozzoj@google.com> MAP client handle failure to connect.

Update MAP client to correctly handle the MSG_MAS_DISCONNECTED while in
the Connecting state.

Bug: 74111588
Test: Connect MAP client to a phone that rejects it.
Change-Id: I38f88613d55c95210c2e27dc3cb3052047411d13
apclient/MceStateMachine.java
11a69708f512f94e686af47c831ff17454118247 01-Mar-2018 Ajay Panicker <apanicke@google.com> Merge "Remove adjustAvrcpAbsoluteVolume" am: 7434c51235 am: 535fec5d12
am: 228803ee9d

Change-Id: I2d9d1108a5f815b618c27a12ea5db40b632fa79b
7434c512352679c44a744b0d5316bfa3496d1a58 01-Mar-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Remove adjustAvrcpAbsoluteVolume"
ff77fb7108403626cfd2a8b0c90601e431a5dc09 28-Feb-2018 Ajay Panicker <apanicke@google.com> Remove adjustAvrcpAbsoluteVolume

The AudioManager now handles all calculations for volume stepping now
and no longer uses adjustAvrcpAbsoluteVolume.

Bug: 68812037
Test: Compile and Test Absolute Volume on a device that supports it
Change-Id: I548ee4370e1143863f83d5e55fa2531ac0c60f24
2dp/A2dpService.java
vrcp/Avrcp.java
8978dc007a21580367e5e79dcbe92131c6a661b3 28-Feb-2018 Myles Watson <mylesgw@google.com> Merge "HeadsetClient: Return from stop() if not started" am: 7fb7e20e70 am: 0f0eedc126
am: f9b4d4b0ff

Change-Id: I43ac6e2ed5fadf16f197782aa46219a56e9eac94
c32e968fab6a13e5067d7ba6dcb12e42a733656a 28-Feb-2018 Myles Watson <mylesgw@google.com> HeadsetClient: Return from stop() if not started

Bug: 73827720
Test: runtest bluetooth \
-c com.android.bluetooth.btservice.ProfileServiceTest

Change-Id: I1956ba55f48a7dda99a04e556c37cbb4833ba1fd
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
37a1ae715abb2cfc5694ee629c52ec489b0cf684 28-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Merge "Don't remove auto-connect priority for A2DP connected devices" am: 7b7567ceea am: 64ae5312df
am: 6e7c89f14a

Change-Id: I52746123fbaeee442fa75d3530fe0ee3e930f92b
2bb921516fddb3947f8a3dc199d142a9690b063a 28-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Don't remove auto-connect priority for A2DP connected devices

The original adjustOtherSinkPriorities() implementation has a bug
that could incorrectly reset the PRIORITY_AUTO_CONNECT for A2DP
connected device to PRIORITY_ON.
Note: the bug is specific to A2DP and does not apply to HFP.

Also, added a corresponding unit test: testSetPriorityMultipleDevices

Bug: 73902689
Test: Manual: re-connect multiple A2DP/HFP devices
Unit test:
runtest bluetooth \
--test-class com.android.bluetooth.btservice.PhonePolicyTest \
--test-method testSetPriorityMultipleDevices
Change-Id: Ieb28afef95fb83259cbff74632ea7ea7d38445dd
tservice/PhonePolicy.java
9f0238a3d2efaab81a56e18b63f3a8224f1af179 27-Feb-2018 Jack He <siyuanh@google.com> Merge "Adapter: Use config value for default max connected audio devices" am: e2e75ad45d am: 0d1103db27
am: b3878aa407

Change-Id: I0041d72c414c5d3410930f7eb8d4b11e6417e1b5
e2e75ad45daa7e8b0fb222146e22df9267c4db9f 27-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Adapter: Use config value for default max connected audio devices"
bede74dbb4c1d57fa8801ca6e870ce20c7bce473 27-Feb-2018 Jack He <siyuanh@google.com> Adapter: Use config value for default max connected audio devices

* Use config_bluetooth_max_connected_audio_devices config value for
default max connected audio devices
* Override above value using system property if the property is set by
development settings
* Check and normalize resultant value to permitted range
[MAX_CONNECTED_AUDIO_DEVICES_LOWER_BOND,
MAX_CONNECTED_AUDIO_DEVICES_UPPER_BOUND]
* Dump this value to dumpsys

Bug: 64767509
Test: Enable and disable multi-device mode in development settings
Change-Id: Id038d742e9aadfc964b52e406467f4e86a73b73f
tservice/AdapterProperties.java
tservice/AdapterService.java
c8abcfe58433fb03fc1dd59244c9092ef20e1edb 27-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Merge "Initialize max number of connected A2DP devices in the native stack via JNI" am: cd2b63998c am: d88a8d57e5
am: a7ce59f5e6

Change-Id: I64cbf2c0d9492efef0229192bb5a315f26833631
53b47e34f28614875677b769df01222c6a8a8e71 27-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Initialize max number of connected A2DP devices in the native stack via JNI

Pass the maximum number of connected A2DP devices from Java to the
native stack as a parameter to the init() call.

Bug: 72351654
Test: Manual: Connect to multiple A2DP devices, check the log messages
Change-Id: Ida39267038e225e7a83a563dee2b7f862c02a851
2dp/A2dpNativeInterface.java
2dp/A2dpService.java
5704376ea86dff814137f314f2488040d2faea2b 27-Feb-2018 Jack He <siyuanh@google.com> Merge changes from topic "bt-a2dp-fix-state-machine-timeout" am: d669257379 am: e10548cfe7
am: ce1cd3e52a

Change-Id: Ibc85713ca53c7bada06e1786434442d5524522ee
079a76e32cd030eb864635d2a2bd493283806d8d 27-Feb-2018 Jack He <siyuanh@google.com> A2DP: Make sure CONNECT_TIMEOUT is scheduled in intermediate states

* Always schedule CONNECT_TIMEOUT message when entering Connecting and
Disconnecting state
* Always remove CONNECT_TIMEOUT message when exting Connecting and
Disconnecting state
* Add testIncomingTimeout in A2dpStateMachineTest to verify that an
incoming connecting request could timeout as well

Bug: 73899051
Test: connect and disconnect to A2dp devices
runtest -j32 bluetooth -c com.android.bluetooth.a2dp.A2dpStateMachineTest

Change-Id: I4412c77c8395a1ede12d7c1bd071822e55f5dd9c
2dp/A2dpStateMachine.java
602fe258758a28d579e6357eca68b634fa6e6897 27-Feb-2018 Jack He <siyuanh@google.com> A2DP: Simplify debug log mechanism

* Override log() method in StateMachine to log messages gated by DBG
flag
* Replace all usages of "if (DBG) Log.d(TAG, msg)" with log(msg)
* Call StateMachine.setDbg(DBG) in the constructor to enable more
logging for StateMachine
* Add null check to getCurrentMessages() in logging to avoid unintended
NPE

Bug: 73899051
Test: connect to and disconnect from A2DP devices
Change-Id: Id89f3ba99c97c62dca74fa3901dc3c6f2c352fc1
2dp/A2dpStateMachine.java
ef0791fc9c05a6e45e0dbeeb7629f19dbd345572 26-Feb-2018 Jack He <siyuanh@google.com> Merge "PBAP: Send intents during connection state transitions" am: af580a5537 am: 587e506eae
am: da3145e531

Change-Id: I00133701bb9d575da933a83f1e6779006eddcdac
376a4f727d288fe174a5d215c551d05436302b5a 24-Feb-2018 Jack He <siyuanh@google.com> PBAP: Send intents during connection state transitions

* PBAP connection state changed intent was accidentally removed in
I77ebb7f64370326b717db64cb94c8696f74b0c5c and should be added back
during each state transition
* There should be a break after handling REQUEST_PERMISSION message in
WaitingForAuth state

Bug: 73385732
Test: make, connect to headset with PBAP support
Change-Id: Ief7d88094d4a909188986fea49c5ce6b64a14833
bap/BluetoothPbapService.java
bap/PbapStateMachine.java
42c90a884071ecd586967e8e21c44da7672878c7 24-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Merge "Clear A2DP active device during start/stop in the native stack" am: 181c5854c4 am: 4273ffcee1
am: 3898ca536d

Change-Id: I5dbab07aa54f939aa5197e09d088b39f051aebb6
181c5854c46d2a7c08c780df1603b13f76fb610a 24-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Clear A2DP active device during start/stop in the native stack"
8fe1ad67eb6094fc648518bdab650aef04608bb8 24-Feb-2018 Martin Brabham <optedoblivion@google.com> Merge "Fix bug for CLCC polling; remove message if not using" am: 43cecf9570 am: 457bbb15f0
am: d071f7c4bd

Change-Id: I8e69b8c677991aba376469a52730d61af77164a3
43cecf9570373cffbaa278e4ceaaf783c27f21e8 24-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Fix bug for CLCC polling; remove message if not using"
eca33ae00074603889d9496601a6a2907e04147a 21-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Clear A2DP active device during start/stop in the native stack

Use setActiveDevice(null) during A2dpService.start() and stop()
to clear the A2DP active device both in A2dpService and the native
Bluetooth stack.
Otherwise, if A2dpService is restarted without the Bluetooth process
itself being restarted, the native Bluetooth stack might contain
stale state about the active device.

Bug: 73832547
Test: Manual - A2DP streaming, enable Location -> Bluetooth scanning,
restart Bluetooth in Quick Settings
Change-Id: I8e001215ef052e588ddf6c53e2caf1382a70ae9b
2dp/A2dpService.java
e5c2d3bd9d62bbb85f990cc0b6a32d86f6864fbf 24-Feb-2018 Joseph Pirozzo <pirozzoj@google.com> Merge "Disable unnecessary logging" am: f3c1f86662 am: 6d028e088f
am: 263023b4b0

Change-Id: I258c2d7b3d619ca9e5c504732295d5446002b854
f3c1f86662628a28e5ed6c0f7245de84c4b37358 23-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Disable unnecessary logging"
df187d4ce767f34d455841641da4261fcdc9f2ca 20-Jan-2018 Martin Brabham <optedoblivion@google.com> Fix bug for CLCC polling; remove message if not using

Bug: 70660604
Change-Id: Icfcbb6b2487cdfbe0e7f4c0bb056e4a2b6bd9380
(cherry picked from commit 1a14ebc6d3aa422aabc5c6eb7b0bb4d4c3e3169d)
fpclient/HeadsetClientStateMachine.java
ed422ab8c82f51c6ada5159ab9704991957465b0 23-Feb-2018 vnori <vnori@google.com> Merge "When a duplicate connect request is received, return success to caller. Returning fail is causing the caller to tear down the connection in progress." am: f2437b90c1 am: 08556f6726
am: b8828e8707

Change-Id: Ia50058e9f8e9b715979f79d77260f0af9d6db1bc
f15f967ca5733529dc6a2c149016721b204cef8a 23-Feb-2018 Joseph Pirozzo <pirozzoj@google.com> Merge "Broadcast Disconnecting" am: 74743602f1 am: 235dd2259c
am: bc6d3aa8eb

Change-Id: I835e409c359eeb98d80b15fa4f0fef57edda1d94
f2437b90c1cdb3d955909c635e6e7c31c058783c 23-Feb-2018 vnori <vnori@google.com> Merge "When a duplicate connect request is received, return success to caller. Returning fail is causing the caller to tear down the connection in progress."
a016a2a7ece99211165717d01401a5c1a4c4ac3b 23-Feb-2018 Joseph Pirozzo <pirozzoj@google.com> Disable unnecessary logging

Protect some Log.d statements by DBG or VDBG and disable the flag.

Bug: 73799270
Test: Observe logcat for less logging.
Change-Id: I59ba5d9c3a2be7d6de3ef9d41906ebbc38be2875
2dpsink/mbs/A2dpMediaBrowserService.java
vrcpcontroller/AvrcpControllerService.java
vrcpcontroller/AvrcpControllerStateMachine.java
vrcpcontroller/BrowseTree.java
vrcpcontroller/TrackInfo.java
90c9df1fdae91c2b06856cd49fa526d321c62e36 23-Feb-2018 Vasu Nori <vnori@google.com> When a duplicate connect request is received, return success to caller.
Returning fail is causing the caller to tear down the connection
in progress.

Test: tested manually

Change-Id: I368cfe96b683d9b20d56c645d1d780a3ab90f4b4
apclient/MapClientService.java
16939d04b14acdd40cadc9035a2130fbdf11577b 23-Feb-2018 Joseph Pirozzo <pirozzoj@google.com> Broadcast Disconnecting

HeadsetClientStateMachine doesn't have a Disconnecting state, so remove
the broadcast that indicates we are going into that state.

Bug: 72117635
Test: Pair phone to car kit while in a call.
Change-Id: I89f2f0d0ba31dd35eb331ed94bd5211f3da97e7b
fpclient/HeadsetClientStateMachine.java
5e32d5a070424fe34e014986518a339f79ceab1b 22-Feb-2018 Myles Watson <mylesgw@google.com> Merge "AdapterService: Keep lists for profile states" am: 2399dccfd2 am: 2f3ec01328
am: d39681d051

Change-Id: Ia907457177620bdc613d17069cda6f0f20d10b1c
35bbcaba2cfd2285e3897b501c34469043108a08 29-Jan-2018 Myles Watson <mylesgw@google.com> AdapterService: Keep lists for profile states

Track ProfileService objects instead of strings
Document Profile functions
Reset Config.Init after AdapterServiceTest
Call initNative and cleanupNative in ProfileServiceTest

AdapterServiceTest: Verify state transitions

Bug: 72435402
Fixes: 73649718
Test: runtest bluetooth
Change-Id: I47c18ce150ceb6dabdb79cac77541a15c9cc8d6e
tservice/AdapterService.java
tservice/ProfileService.java
b0cb2660dcab93589b231aaca2262ae9f223839a 21-Feb-2018 Myles Watson <mylesgw@google.com> Merge "PBAP: Handle null contacts in the updateList" am: 78e831dd52 am: 0b47db5008
am: 00c714979b

Change-Id: If284b3f7983d3cb6dad3a9fc0b2a0989d386f545
65a6b0e556d87a4f749105b4e0bc9e16c23b74fd 20-Feb-2018 Myles Watson <mylesgw@google.com> PBAP: Handle null contacts in the updateList

Bug: 72435402
Test: runtest bluetooth
Change-Id: I0f25bc4ce53a977c49f814692cb39bc2b1aa50ec
bap/BluetoothPbapUtils.java
eb76740eb0aac41cf1b2e43b8302e72ba925e434 21-Feb-2018 Andre Eisenbach <eisenbach@google.com> Merge "Revert "AdapterService: Keep lists for profile states"" am: 52218122c6 am: 79f35dd7b7
am: 7838f7c12e

Change-Id: Ia32384863e3782b53e8fc49c55ba01584d4f2bb2
479d8b4ae16b0b52afa2a7d184849428e096e7e3 21-Feb-2018 Andre Eisenbach <eisenbach@google.com> Revert "AdapterService: Keep lists for profile states"

This reverts commit 75b64427d7ba22d0f1ca3049eb6dd4686f5f57c5.

Reason for revert:
This patch introduces unwanted Bluetooth adapter state transitions that cause the quick settings Bluetooth icon to indicate the wrong state.

Bug: 72435402
Change-Id: I2aeb5104d5828b3a8740bbc15836fdc82a907b59
Fixes: 73649718
tservice/AdapterService.java
tservice/ProfileService.java
59a4addfb914f583b85807a6cb191c6ceb899226 17-Feb-2018 Myles Watson <mylesgw@google.com> Merge "PBAP: Use a message to signal CONTACTS_LOADED" am: 02605908d5 am: 8999834c98
am: a8e608b514

Change-Id: Id4c0e844ec1634bd6c3ac341edce9114525646d2
da159f3751a057b4314c3dd4dd5cbfeb03907e5d 17-Feb-2018 Myles Watson <mylesgw@google.com> Merge "PBAP: Move notify to Authenticator.java" am: 1be0c2d3ce am: 68a36f678f
am: 025e4ca9b5

Change-Id: Ib9dc2e924e0aa6f4b549f4011bcc9d8d60faa030
02605908d5338eeaa001b75c37ed36f5ba4e221f 17-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Use a message to signal CONTACTS_LOADED"
1be0c2d3cef3a3aefcfd3fc862ce561b4c8aeb39 17-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Move notify to Authenticator.java"
d31732bff8e04552bbd633e6db9c5a8f0bc77013 17-Feb-2018 Myles Watson <mylesgw@google.com> Merge "AdapterService: Keep lists for profile states" am: 27dfb7ca6c am: 3c592d5bcc
am: b0f315731c

Change-Id: Ieda1be554b2f2efe0d79c8d3cb37a3afa825d7da
b2ae19a6e3a764efa36fdd136e6a1bca1e71922e 17-Feb-2018 Myles Watson <mylesgw@google.com> Merge changes Ia873b2c1,I20977120 am: 96597de6f5 am: 8a1896303d
am: 68ac843b95

Change-Id: Ibce4a474461c6e89ee6aa9d4b1a5d7ef1c88d27f
27dfb7ca6c71e7eb5dd1f7a7994bfdd4944f046f 17-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "AdapterService: Keep lists for profile states"
96597de6f55c3c3c0d9425a6983805c8f42f296a 17-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge changes Ia873b2c1,I20977120

* changes:
AdapterServiceTest: Re-initialize Config after test
ProfileServiceTest: Call AdapterService.initNative
5d1f91bd0d29b1b371c6f73ede6c679036e1611c 17-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Merge "Add missing Avrcp.doQuit() call during A2dpService stop()" am: 809eb2234b am: 9ff11a705e
am: ab65b0deaa

Change-Id: Ib54a0bafb1c5e5ba285fe18e164051dcdd81de8c
bceb51ca01959f3871648a6f68aa9f2779f1910b 26-Jan-2018 Myles Watson <mylesgw@google.com> PBAP: Use a message to signal CONTACTS_LOADED

Bug: 72435402
Test: runtest bluetooth
Connect and disconnect to a car kit
Change-Id: Ia23d18acf20d4edd090fb55eb53fd972a388a64f
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
48aa4e83f5c7842612e2feb034b0751e09792853 16-Feb-2018 Myles Watson <mylesgw@google.com> PBAP: Move notify to Authenticator.java

Bug: 73333333
Test: Connect to a carkit with PBAP, runtest bluetooth
Change-Id: I0f619b6bb012b2362bcb5c5fe0910aede30406b2
bap/BluetoothPbapAuthenticator.java
bap/PbapStateMachine.java
9785fcd4c7035e0988827a3d3dd25f8a3d888de2 16-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Add missing Avrcp.doQuit() call during A2dpService stop()

During graceful shutdown of A2DP, proper cleanup of AVRCP
requires calling both Avrcp.doQuit() and Avrcp.cleanup() .

Also, reorder the AVRCP-related operations inside A2dpService.start()
and A2dpService.stop():
- Avrcp.make() before preparing the A2DP state machines
- Avrcp.doQuit() and Avrcp.cleanup() after shutting down the A2DP state
machines.
This reordering is needed to avoid a race condition during
A2dpService graceful shutdown:
A2dpStateMachine -> A2dpService.setAvrcpAudioState() ->
mAvrcp.setA2dpAudioState()
while right before the last call mAvrcp was assigned to null
inside stop().

Bug: 73547689
Test: Manual (enable/disable Bluetooth)
Unit tests pass
Change-Id: I8b30a0ff840cf73e8e9cce06b52659b2a17cac5b
2dp/A2dpService.java
2e5213f0d5f71cc90f542a395ba62ccf44048f55 16-Feb-2018 Myles Watson <mylesgw@google.com> Merge "PBAP: Get ready to reload contacts on user switch" am: a191bb23d9 am: 0496c3698f
am: d32281b64e

Change-Id: Ia82d82b700ed9680e0d542ebad3ad579490888c4
75b64427d7ba22d0f1ca3049eb6dd4686f5f57c5 29-Jan-2018 Myles Watson <mylesgw@google.com> AdapterService: Keep lists for profile states

Track ProfileService objects instead of strings
Document Profile functions
Reset Config.Init after AdapterServiceTest
Call initNative and cleanupNative in ProfileServiceTest

Bug: 72435402
Test: runtest bluetooth
Change-Id: I611ac68e55c5e5273aae3ea9f52342534cf00b83
tservice/AdapterService.java
tservice/ProfileService.java
e9ec5b81672199838f5f9a2223f7b574b3270311 16-Feb-2018 Myles Watson <mylesgw@google.com> Merge "MAP: Remove redundant cleanup() method" am: 6de7471c16 am: 81c41c9dae
am: c16649b349

Change-Id: Ic3f0e2da6ca02a15970359ac57023c6438c8ab85
84b74f21ad79819fbbabd703ebdeb6ff69f917d6 26-Jan-2018 Myles Watson <mylesgw@google.com> PBAP: Get ready to reload contacts on user switch

PbapService:
- Use ACTION string constants to avoid null checks
- Remove the parameters for savePbapParams
- Remove unnecessary try blocks

PbapUtils:
- Reduce the scope of local variables
- Rename static variables s<VariableName>
- Remove dead code
- Avoid a null-pointer exception in nameTmp mName comparison

Bug: 72435402
Test: runtest bluetooth
Connect and disconnect to a car kit
Change-Id: I15531abfe7eb9c76788eed301f9356d60c7a6829
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
0a84fe805c8057e21d550a93dcb9ab5f290b3f10 15-Feb-2018 Myles Watson <mylesgw@google.com> ProfileServiceTest: Call AdapterService.initNative

Bug: 70585142
Test: runtest bluetooth \
-c com.android.bluetooth.btservice.ProfileServiceTest
Change-Id: I20977120fcf5e0fa835bd286ef851d92850143ea
tservice/AdapterService.java
6de7471c16fc8bcad371998c7351742f66ac6273 16-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "MAP: Remove redundant cleanup() method"
872993fe8ecad40e4e859203ec7b3c7196e19abe 16-Feb-2018 Jack He <siyuanh@google.com> Merge "A2DP: Dump state machine message verbatim" am: 57482afccf am: ead12ef76a
am: 6aa9e0e9da

Change-Id: Ia4e70ab4526aa9af468e5b01bb6dadd19f43a252
2a588384515fcb51baa8267fd93b06960e21ae36 16-Feb-2018 Nitin Shivpure <nshivpur@codeaurora.org> Merge "PAN: Notify PAN devices connection state to UI" am: af8dd4192b am: 72dbf5163a
am: 093242035c

Change-Id: I7e6fd10e8f1f0a814c9518bc2a74daf31d711d5a
57482afccf23bb473532e6b2d5b54f912b8a3a4d 15-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "A2DP: Dump state machine message verbatim"
3fc999f67240013b2e95988b55551ff4313fe27c 29-Jan-2018 Nitin Shivpure <nshivpur@codeaurora.org> PAN: Notify PAN devices connection state to UI

Usecase:
1) Try to connect to remote device (where tethering is disabled)
2) Perform BT on off whiel above is ongoing

Expected Beahviour
UI shows correct status as connected/disconnected based on device is connected or
disconnected with remote device

Observed Result
DUT UI shows connected, even when remote device is not connected with DUT

Root Cause:
BluetoothPan.ACTION_CONNECTION_STATE_CHANGED is not broadcasted when BT is turned off
while Pan state is Connecting

Fix:
1) Notify PAN devices connection state to UI during BT turn off.
2) Update proper role during handlePanDeviceStateChange so as to stop Tethering or
Reverse Tethering as the case may be during BT off time if enabled.

Test: UI is informed of PAN connection status during BT turning off state as well

Fixes: 73018139
Change-Id: I4b1413d68418c6675b8638d3f14e04aece84d3d4
an/PanService.java
22504cc056e6d899a17ac1fda14a61a3f4e47995 15-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Merge "Add missing A2dpStateMachine lookup when processing native events" am: a2963a8426 am: 745b096a6d
am: d236989744

Change-Id: Idc3656a44efeb754260c28ea2e5ef306405cb3cf
3a0b78291e49d5e7189883830964ccfef847f5fb 15-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Add missing A2dpStateMachine lookup when processing native events

Fixed a bug in the code after messageFromNative() was refactored
to create state machine entries only when connecting to a device.
Because of that bug, some events (Audio State and Codec Changed updates)
were not processed properly.

Also added unit test to capture similar issues in the future:

Test: Manual with switching codec configuration in Developer options
Unit test:
runtest bluetooth --test-class com.android.bluetooth.a2dp.A2dpServiceTest \
--test-method testProcessAudioStateChangedCodecConfigChangedEvents
Bug: 73379307
Change-Id: I58f42acb4e7e0d312a04ede49d7538c42e210333
2dp/A2dpService.java
f99278cb3d41aa457583dc533b859ef75d0dd91c 15-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Merge "Update PhonePolicy to support Multi-A2DP/Multi-HFP" am: 75530add0f am: bdecc797d3
am: eb8fd97fc0

Change-Id: I008f1e3b305638d8a1fc0c02868c2dcb1524f48d
308c9274fa8e70c498feacc7599435a476689372 15-Feb-2018 Jack He <siyuanh@google.com> A2DP: Dump state machine message verbatim

* Override StateMachine.getLogRecString(Message) method so that state
machine messages are dumped verbatim into dumpsys output
* A2dpStackEvent will be dumped automatically via the toString() method

Bug: 72102258
Test: adb shell dumpsys bluetooth_manager
Change-Id: I12dedb1a6ee790572072e589e7d480198043b2a7
2dp/A2dpStateMachine.java
44ef48a20624b290ae614af344c802d6e749eba2 14-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Update PhonePolicy to support Multi-A2DP/Multi-HFP

Remove checks for A2DP and HFP that prevent auto-connecting a profile to
a second device if there is already a connected device for this profile.

Test: Manual with specific headset models
Added unit test:
runtest bluetooth \
--test-class com.android.bluetooth.btservice.PhonePolicyTest \
--test-method testAutoConnectMultipleDevices
Bug: 72125048
Change-Id: I3017f5c99609516d3483800f2e72b56ea857d37c
tservice/PhonePolicy.java
c483d2b7c902c275bee1f0b47f268865a7f8e0e9 14-Feb-2018 Hansong Zhang <hsz@google.com> Merge "A2DP: Close audio socket when set active device to null" am: d398ff3ad5 am: 9039eb2d53
am: 03e105a9da

Change-Id: I5f66a9e678686799e229ea327ac4996d5fa3b1c5
b72d284f162ef6169b74a4808683d39b188a35db 02-Feb-2018 Hansong Zhang <hsz@google.com> A2DP: Close audio socket when set active device to null

Bug: 72701090
Test: Carkits with A2DP
Change-Id: I5466a97296124b244549b3e218dd203132442695
2dp/A2dpNativeInterface.java
2dp/A2dpService.java
b37984f6f6faeef1e5579f28fa26c753a0559001 14-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Merge "Perform all start/stop A2dpService operations in start() and stop() methods" am: f733fda1e7 am: 2d8561b8c5
am: b0237b2f65

Change-Id: I6c251bcae5dd39055bbc28a4bb74f236e10a5326
fb232fae9b603a317e6891bced17527759c994cb 14-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Merge "Update the A2dpService logic for creating/deleting state machine instances" am: b9489c346f am: 126d094fa3
am: 8a1955c538

Change-Id: Ib787513b5364c298243b326f8d8ddce13cc42b18
a75a48708dcdfd82079c64c7fbb5ad94f7783b83 13-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Perform all start/stop A2dpService operations in start() and stop() methods

* The A2dpService.start() and stop() methods now contain all
start/stop operations.
* The order of the operations in stop() is reverse of the order of
the operations in start()
* Remove A2dpService() default class constructor: it is empty and not
necessary.

Test: Manual: (re)start A2DP, connect/disconnect to a headset
Unitests: runtest bluetooth
Bug: 72948646
Bug: 73205770
Change-Id: I4ed0fb24a972140cc82aaf465d8ec1142ab02722
2dp/A2dpService.java
7b52eb7550500a570937c6164018005b14ea359b 12-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Update the A2dpService logic for creating/deleting state machine instances

* Create a new state machine instance for native stack events only if the
event is CONNECTION_STATE_CONNECTED or CONNECTION_STATE_CONNECTING
* Add an early check to reject connect() request if there are too many
connected devices.
* Fixed the logic inside updateOptionalCodecsSupport() so it cannot
create a new state machine instance
* Unbonding a device will remove the state machine instance only
if the device is disconnected
* If a device is disconnected, remove the state machine if
the device is already unbond

Also:
* Renamed canConnectToDevice() to connectionAllowedCheckMaxDevices()
* Add new method A2dpService.getDevices() - used only for testing
* Add a missing transition in the A2dpStateMachine from Connected
to Disconnecting on A2dpStackEvent.CONNECTION_STATE_DISCONNECTING
event.
* Fix the logic for checking the maximum number of state machines
to avoid DoS attack
* Add checks that bond state events and native stack events
contain a device
* Change the A2dpServiceTest setting to use MAX_CONNECTED_AUDIO_DEVICES
of 5 by default.
* Add internal mechanism in A2dpServiceTest to
- waitForNoIntent() - Wait and verify that no intent has been received
- verifyNoConnectionStateIntent() - Wait and verify that no connection
state intent has been received
* Add unit tests:
- testOutgoingConnectPriorityOff()
- testMaxConnectDevices()
- testCreateStateMachineStackEvents()
- testDeleteStateMachineUnbondEvents()
- testDeleteStateMachineDisconnectEvents()
* Add a new helper method TestUtils.getTestDevice()
* Minor cleanup: arguments renaming, etc.

Bug: 73212853
Test: Unit tests added:
runtest bluetooth --test-class com.android.bluetooth.a2dp.A2dpServiceTest
Change-Id: I484fcc04b7ce800df1a0e1cf8930816edae6ab91
2dp/A2dpService.java
2dp/A2dpStateMachine.java
3e15e2221fb28b6477823993a6d5160891a8d7d3 13-Feb-2018 Joseph Pirozzo <pirozzoj@google.com> Merge "MAP Client Exception at shutdown" am: fd9c6bb4a8 am: 762909af30
am: 788c8c203e

Change-Id: I59ae227831bd1f330ebccef19bb79bdb6a78e874
98d172dcf6c15868f9fd95201c71659631e7b9ba 13-Feb-2018 Joseph Pirozzo <pirozzoj@google.com> MAP Client Exception at shutdown

When turning the Bluetooth adapter off, if there were messages being
processed by the MasClient they could result in a null pointer exception
being thrown if the associated state machine had already been cleaned
up. sendMessage actually checks the status of the handler before
sending the message.

Bug: 68300350
Test: turn BT adapter off while MAP is processing messages.
Change-Id: I2f30901453c4ebf3938b5b55b5475470684072d1
apclient/MasClient.java
0a7bc485bb0f7c930916272529aeb69770a28c84 13-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Merge changes from topics "bt-a2dp-service-ok-to-connect", "bt-a2dp-service-connect-sink-uuid-check" am: 81b72ae864 am: 02fa3c19fb
am: e6d55d7e2f

Change-Id: I580657202be7eef47607351ebf14f48fc10749bc
d10ab28690932ef3e3ab04c48db49fe532e1c23c 13-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Merge "Refactor usage of synchronized inside A2dpService" am: 1ae7ab68f3 am: 26ac0cae30
am: 6921b0c22f

Change-Id: Ieddd0de0209fc8900a36ede77380d0ba3b7ab566
cb20bfd931a9497cfddf47bdd244b7a4fa1a28f7 11-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Moved okToConnect() from A2dpStateMachine to A2dpService

Also:
* Updated the corresponding unit test.
* Removed unnecessary "context" argument to A2dpStateMachine constructor

Bug: 73205770
Test: Unit tests pass
Change-Id: Ideb854bc1b2a3b909d3bf14103f27372949f8e3f
2dp/A2dpService.java
2dp/A2dpStateMachine.java
7bc598f48019c96dbdc6d28185e17f6934b1702a 11-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Update A2dpService.connect() to check correctly for A2DP Sink UUID

Previously, the A2DP Sink UUID check was applied only if the
remote device contained A2DP Source UUID as well.

Also:
- Use AdapterService to obtain the UUIDs of a device.
This makes it easier to write UUID-related unit tests.
- Added a new unit test.

Bug: 73207565
Test: Manual. New unit test added:
runtest bluetooth --test-class com.android.bluetooth.a2dp.A2dpServiceTest \
--test-method testOutgoingConnectMissingAudioSinkUuid
Change-Id: I651a6b176956042681834cba0ff74819bee3e73e
2dp/A2dpService.java
3de1208d526d40a3c686980031c7c9e2f94b2afd 11-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Refactor usage of synchronized inside A2dpService

Remove unnecessary "synchronized" for some of the methods, and use
"synchronized (mStateMachines)" instead.

Bug: 73205770
Test: Manual - A2DP streaming to headsets
Change-Id: I0922d0af4260cb7b2ff8d9bb5d985c134605db8f
2dp/A2dpService.java
895dd807a214323156caa73a9dc36bb40bc91ea1 12-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Merge "Remove unnecessary null pointer initialization for class variables" am: c7759c2c6c am: 4592934a54
am: d01637b54b

Change-Id: I02eea331a8fd5320a71a70ef54fa56b6a06bfd73
c72f1a03add7d6b727fa222cfc1424dfe01ac746 11-Feb-2018 Pavlin Radoslavov <pavlin@google.com> Remove unnecessary null pointer initialization for class variables

In Java, the class variables have default initialization - null
for pointers.

Also, removed unnecessary template arguments when creating templetized
objects:
OLD:
List<BluetoothDevice> devices = new ArrayList<BluetoothDevice>();
NEW:
List<BluetoothDevice> devices = new ArrayList<>();

Test: code compilation
Bug: 73205770
Change-Id: Ib983ee40df6bc5bb250ed23fa05a92c6b0365a5a
2dp/A2dpService.java
2dp/A2dpStackEvent.java
2dp/A2dpStateMachine.java
0dfed07bb8628bcd461753a0fdfc8b16a45da1b1 11-Feb-2018 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix LE filters for 32 and 128-bit UUID service data" am: 8a8b8f416f am: 8307d24b0d
am: 95136a9392

Change-Id: I5d556ce0def0b8dc31f75f54eeea79c0b019d753
d7b46bee161bc686d380dcb46117fd7b945a167c 10-Feb-2018 Jakub Pawlowski <jpawlowski@google.com> Fix LE filters for 32 and 128-bit UUID service data

Test: manual
Change-Id: I10457f88b6d688a26f5dd46712512cb948343ba0
att/ScanFilterQueue.java
6f361501d05ef81e60c6b8f6dab34259f023f559 07-Feb-2018 vnori <vnori@google.com> Merge "When a sent-notification is delivered, return error code as mentioned in SmsManager." am: 2efae8f18f am: 0b137275ac
am: 34fc5471e0

Change-Id: Ie04951a92ab4725d3131c73fb3a7c3e492e71024
6c9f5c4be626f4a368259e25835f8967c368cc77 07-Feb-2018 Jack He <siyuanh@google.com> Merge "HFP: Dump state machine message verbatim" am: 2cf8147a15 am: 16a1920412
am: c9f23f3a38

Change-Id: Iaf7b71b5845068209d82c2f457c34b653f7c2b44
c0fdb394f6c11422c00500abf6de504982a239f1 07-Feb-2018 vnori <vnori@google.com> Merge "Fix non-working sent-notification. This is copy of the change reviewed (on internal repo) ag/3553436" am: 78199557d5 am: 6f9a3a359d
am: ab55c277aa

Change-Id: Ia5987e240a988d7caa8d844b7f42da160f607d9f
9a256f2564aa10d8e35f54fa3c845f94c914b242 07-Feb-2018 Vasu Nori <vnori@google.com> When a sent-notification is delivered, return error code
as mentioned in SmsManager.

Otherwise, messaging apps won't like it.

Bug: 71910324
Test: tested manually
Change-Id: I0c069887bafb93169be09e244e9201a50a1804a9
apclient/MceStateMachine.java
2cf8147a157e063a4cd746ef247ad2936212332b 07-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "HFP: Dump state machine message verbatim"
78199557d56c48025f169c1fb9b1dc1324c388fa 06-Feb-2018 vnori <vnori@google.com> Merge "Fix non-working sent-notification. This is copy of the change reviewed (on internal repo) ag/3553436"
764073b18d2a0a44a021325db841a6b33e26241b 03-Feb-2018 Jack He <siyuanh@google.com> HFP: Dump state machine message verbatim

* Override StateMachine.getLogRecString(Message) method so that state
machine messages are dumped verbatim into dumpsys output
* Use StringBuilder to build strings in getLogRecString(Message) and in
HeadsetStackEvent.toString() to avoid costly String copy
* Optimize HeadsetStackEvent.getTypeString() to return static string
directly
* Create HeadsetMessageObject base class to define toString() and
buildString() interfaces
* Add buildString() methods to:
- HeadsetDeviceState
- HeadsetCallState
- HeadsetClccResponse
- HeadsetVendorSpecificResultCode
- HeadsetStackEvent
* Split above classes into individual files

Bug: 72896133
Test: make, adb shell dumpsys bluetooth_manager
Change-Id: I319af5103168d41adf75feb2f0adad88c1c41e5f
fp/HeadsetCallState.java
fp/HeadsetClccResponse.java
fp/HeadsetDeviceState.java
fp/HeadsetMessageObject.java
fp/HeadsetPhoneState.java
fp/HeadsetStackEvent.java
fp/HeadsetStateMachine.java
fp/HeadsetVendorSpecificResultCode.java
e91d68a23527ad293b75ce7cc9c7447b9716701e 06-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Metrics: Remove handler for --proto-java-bin flag in dumpsys"
887ad1c4a2fbdf30b46ef05c10cffce8fe46257a 06-Feb-2018 Tobias Thierer <tobiast@google.com> Merge "Remove unused variable." am: 7fd347b538 am: 06791f6d7d
am: 7b1486c9d2

Change-Id: Id96918a07f2687bf701abb5e0cd7d8c1dce9438e
7fd347b53862932868f3d19767e89329c2a9ab44 06-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Remove unused variable."
e9670c4370c81c6b715bddd75a42e34d6d45feee 06-Feb-2018 Tobias Thierer <tobiast@google.com> Remove unused variable.

An unused variable was referring to the type Hashtable.Entry,
which is not part of the Android API and should probably have
been Map.Entry anyway. This CL removes it and fixes the imports.

Test: Treehugger
Change-Id: Iff792cacb9bcfefdccd80f881a379a390cb92c91
fpclient/HeadsetClientStateMachine.java
6c31b6820f0e09aea334cc655ae208ac06bd942a 06-Feb-2018 Jack He <siyuanh@google.com> Merge "Initialize static service reference properly" am: f4ab7b5491 am: ca7360a8a9
am: 59490f42a7

Change-Id: Ie2799ff8a28d85be421ea09fa9fdede807d0bd7c
36d4ec0660e761a116c4e3882592ced81cf18ebb 05-Feb-2018 Jack He <siyuanh@google.com> Metrics: Remove handler for --proto-java-bin flag in dumpsys

* All usages of --proto-java-bin flags are removed
* The handler for --proto-java-bin should therefore be removed as well

Bug: 33693818
Test: make, metrics app integration test
Change-Id: I944a09c2161f4a810e8c7266d2c81660e32bfd03
(cherry picked from commit 758b9cb9c259f74c86808ca31b9c145f869cd8cb)
tservice/AdapterService.java
bd90909c4ef180602ac088758ffdc13d37d24629 03-Feb-2018 Jack He <siyuanh@google.com> Initialize static service reference properly

* Change I10ea7dabcb2e0d296384d6f9a60683569bdef3f8 changes the meaning
of isAvailable() in ProfileService. As result, many service's static
instance references no longer get assigned properly
* This CL fixes those issue for:
A2dpSinkService
AvrcpControllerService
HeadsetClientService
HidHostService
MapClientService
PanService
PbapClientService
* This CL also adds a number of tests to start and stop each
ProfileService and do some profile specific verification such as
verifying HeadsetClientService.getHeadsetClientService()'s return
result is not null
* Adds a TestUtils class to include common test routines such as:
setAdapterService(), clearAdapterService(), startService(),
stopService()
* Remove setting to null statements in tearDown() method as JUnit4
runner will nullify fields by default

Fixes: 72816382
Test: 1) enable all profiles in config.xml 2) runtest -j32 bluetooth
Change-Id: If39c44097d5cfbf0d606dda20e5b8cdb565b5764
2dp/A2dpService.java
2dpsink/A2dpSinkService.java
vrcpcontroller/AvrcpControllerService.java
att/GattService.java
dp/HealthService.java
fpclient/HeadsetClientService.java
id/HidDeviceService.java
id/HidHostService.java
ap/BluetoothMapService.java
apclient/MapClientService.java
apclient/MnsService.java
pp/BluetoothOppService.java
an/PanService.java
bap/BluetoothPbapService.java
bapclient/PbapClientService.java
ap/SapService.java
6ebf3e48a841a81985e72064fefd55f67891f663 06-Feb-2018 Vasu Nori <vnori@google.com> Fix non-working sent-notification.
This is copy of the change reviewed (on internal repo) ag/3553436

Bug:71910324

Test: tested w/ KitchenSink. Sent a message to another phone and
received the sent-notification. Saw a notification pop-up on Mojave
when a new message is received.

Change-Id: I3bc25c95383530448e81f284fe6c609c7249a60b
apclient/MapClientService.java
apclient/MapUtils.java
apclient/MasClient.java
apclient/MceStateMachine.java
apclient/MnsService.java
758b9cb9c259f74c86808ca31b9c145f869cd8cb 05-Feb-2018 Jack He <siyuanh@google.com> Metrics: Remove handler for --proto-java-bin flag in dumpsys

* All usages of --proto-java-bin flags are removed
* The handler for --proto-java-bin should therefore be removed as well

Bug: 33693818
Test: make, metrics app integration test
Change-Id: I944a09c2161f4a810e8c7266d2c81660e32bfd03
tservice/AdapterService.java
bbb165b6ce2bf364ee1840c77450bdba61098d5e 04-Feb-2018 Myles Watson <mylesgw@google.com> Merge "ProfileService: Remove log() wrapper" am: ba0eec9681 am: 34c8e95d63
am: 66a53b196b

Change-Id: I922f2c4d75698e21a2ccca2e2c19f0869757b7fc
41fd1ee6c45a9b92d7c5713cd1ed8e0ea30b89f0 04-Feb-2018 Hansong Zhang <hsz@google.com> Merge "PBAP: Fix NullPointerException in stop()" am: 8a2cef49c3 am: 6b155b10d7
am: da3d90250c

Change-Id: Ifc6e3da88327243933d255ce70f16d6d53f6ed62
dd5ac8b166a6c7ab04533cb5a9f5b4c9d827f5f4 04-Feb-2018 Stanley Tng <stng@google.com> Merge "Add function to update LE connection parameters" am: 6b621700b6 am: a1235f1c6b
am: 5cd44c0012

Change-Id: I51552030bfd596fd447288e007bb7925db5d70f4
9ef25f7b8ab60851df666e06360558d6eb55e7ab 03-Feb-2018 Myles Watson <mylesgw@google.com> Merge "btservice: Log names for adapter states" am: 21e710fa3b am: 8bdf036826
am: 453eb2c692

Change-Id: I85652dfe617c1feaad4e41a0d3ef6a7cf4bfc6bc
ba0eec9681d6f107a6629deb665d2436d6673920 03-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "ProfileService: Remove log() wrapper"
8a2cef49c38005680c66113e134f629064c3f0ed 03-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Fix NullPointerException in stop()"
6b621700b68d1559dca18b0e515fcf51a08b574e 03-Feb-2018 Stanley Tng <stng@google.com> Merge "Add function to update LE connection parameters"
776a51b650f0b0239758ee28a20af749b13e17a3 03-Feb-2018 Hansong Zhang <hsz@google.com> PBAP: Fix NullPointerException in stop()

Check mSessionStatusHandler and mHandlerThread != null before
invocation.

Test: Carkits with PBAP
Bug: 69417672
Change-Id: Id4443bff525a21267a3008ac5e53888148a8bed9
bap/BluetoothPbapService.java
63d2bddfd4ce85a9d3bff6d8646a5d1a8dce9438 25-Jan-2018 Myles Watson <mylesgw@google.com> MAP: Remove redundant cleanup() method

Reformat the code
Make constants package private

Bug: 72435402
Test: runtest bluetooth
Change-Id: Id6844817a4e586b3a686f13ebbc18708771a33af
ap/BluetoothMapService.java
cc53d5b283998856074811118c392e3384cf64c1 26-Jan-2018 Myles Watson <mylesgw@google.com> ProfileService: Remove log() wrapper

log() was used infrequently and saved very little code.

Bug: 72435402
Test: runtest bluetooth
Change-Id: I45ef997e5b1b9d616750dff041fe03ff3e123a17
tservice/ProfileService.java
dp/HealthService.java
id/HidHostService.java
an/PanService.java
21e710fa3bf2c17868c10919305ff88d595f37ef 03-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "btservice: Log names for adapter states"
e03937e3d102b8e2147794de3ea3c9168f9f0a29 02-Feb-2018 Myles Watson <mylesgw@google.com> Merge "ProfileServices: Remove getName() overrides" am: 0115fe3bfb am: 394209da97
am: 7cf4208c4a

Change-Id: Ie9e9a280aecd920cb4e887e843580c5e47e4a524
20868936772c44673fe0216a774a8e1b85d6b963 01-Feb-2018 Myles Watson <mylesgw@google.com> btservice: Log names for adapter states

Bug: 67460963
Test: runtest bluetooth, Toggle Bluetooth
Change-Id: Iead5eb4f1844157a02d256fc4e9e1902001a01f1
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
baa4495e5b4c2abfdc9523a9846c8ac8937a7b30 02-Feb-2018 Jeremy Klein <jlklein@google.com> Merge "Revert LOW_POWER ble scan interval to 512/5120ms." am: 23069485c8 am: b6f04e98ac
am: cda81bd325

Change-Id: I492a7bb847cc9820b873e53e39a378f790b45493
42c9d3c51f91159172c4a601fc4b27628adf2a4a 31-Jan-2018 Myles Watson <mylesgw@google.com> ProfileServices: Remove getName() overrides

Remove the overrides and make getName() public so that it
can be used in tests.

Bug: 70585142
Test: runtest bluetooth \
-c com.android.bluetooth.btservice.ProfileServiceTest
Change-Id: Ic6005d7a33be144a7fdf9ad520c03e754abff401
2dp/A2dpService.java
2dpsink/A2dpSinkService.java
vrcpcontroller/AvrcpControllerService.java
tservice/ProfileService.java
att/GattService.java
dp/HealthService.java
fp/HeadsetService.java
fpclient/HeadsetClientService.java
id/HidHostService.java
an/PanService.java
bapclient/PbapClientService.java
78e31317a17040031c9c8e15f64c0ecec4064391 02-Feb-2018 Jack He <siyuanh@google.com> Merge "Metrics: Dump Java and native metrics together" am: 92e6123e22 am: 6a8aa991d2
am: 29102156ae

Change-Id: Ib4bca65761f03dc063231c72fbdbca40ba6c6fcf
23069485c8af4ad342e5a80560cd99b56f114c2b 02-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Revert LOW_POWER ble scan interval to 512/5120ms."
6b8495092c4091db94292c62bd7b49cee5a6c3eb 08-Jan-2018 Jeremy Klein <jlklein@google.com> Revert LOW_POWER ble scan interval to 512/5120ms.

Changing the LOW_POWER scan interval back to the settings from O
and earlier. An experiment is being run in parallel to determine
battery impact of various parameter configurations.

Bug: 62491228
Test: Manual. Just changing a parameter here.
Change-Id: I4cf3715868434e063f87bc5f3800a1ddeb7d4ce6
att/ScanManager.java
16c991302afbf71ea0ef0438b423f50e27fb699d 01-Feb-2018 Jack He <siyuanh@google.com> Metrics: Dump Java and native metrics together

* Both Java and native metrics are dumped when calling
"dumpsys bluetooth_manager --proto-bin".
* "dumpsys bluetooth_manager --proto-java-bin" will always dump an empty
protobuf after this change.
* Native metrics is dumped directly to Java layer as a byte array that can be
directly merged to Java BluetoothLog.
* Native layer initially dumps metrics as std::string. The content of
std::string is copied to Java layer as byte array

Bug: 33693818
Test: adb shell dumpsys bluetooth_manager --proto-bin
SL4A metrics tests: BtMetricsTest, BtFunhausMetricsTest
Change-Id: I89d8f283f5d9d2145f80c6878fd0896fa5e7dafb
tservice/AdapterService.java
df3b4dab1a017b9ef518c4db3df277e2e2cbf372 05-Jan-2018 Stanley Tng <stng@google.com> Add function to update LE connection parameters

As part of new SL4A tests for LE CoC to measure data throughput
performance, this commit will add a function to enable the CoC Facade
to modify the LE Connection Parameters especially the Connection
Intervals.

Test: Ran the new ACTS Tests for LE CoC
Bug: 70683224
Change-Id: I3aed497cd221aad6bdd593890eb61273cac6ab47
att/GattService.java
75085bd8a2a324c96cd65ad87bd50a299fe269e7 01-Feb-2018 Jack He <siyuanh@google.com> Merge "HFP: Only remove state machine when device is unbonded and disconnected" am: 13e18be236 am: 28158e738c
am: 5174d39ab2

Change-Id: I0cdf5efea82bf03561144873ce6916e5b7a63120
caa5d6ab09bf61f4379413299ae1ab436c503710 27-Jan-2018 Jack He <siyuanh@google.com> HFP: Only remove state machine when device is unbonded and disconnected

SUMMARY:
* Remove a state machine only when a device is both unbonded and
disconnected
* Add HeadsetServiceAndStateMachineTest to verify this behavior
* Reject API connect() attempt when device does not have headset UUIDs

DETAILS:
* A state machine is no longer useful if the associated device is no
longer bonded. However, sometimes the device may get disconnected
after it is unbonded. Therefore, we should only remove a state machine
when the device is both unbonded and disconnected.
* Also, we should only allow an HeadsetService.connect() API call when
there is at least one headset UUID present.
* HeadsetServiceAndStateMachineTest is added to integerate both
HeadsetService and HeadsetStateMachine to complete a set of
semi-integration tests. This new set of tests allows us to verify
whether a connect() API call will eventually trigger a connectHfp() to
the native interface, utilizing all logic in the middle.
* However, we do need to assume certain timing condition in such
semi-integration test. 250ms is set as a limit for any state machine
based message handling, which should be enough for most modern day
Android devices.
* We have to use AdapterService instead of BluetoothDevice to get bond
state, device name, and so on since we want to be able to mock these
methods and BluetoothDevice class is final.
* Thus, this CL also adds a new parameter to HeadsetStateMachine during
construction so that it has a reference to AdapterService suppplied
through its constructor. This is to make sure that entire HFP stack
uses the same reference of AdapterService obtained by HeadsetService.

Bug: 72529611
Test: disconnect and then quickly unpair device
Change-Id: I49ec70d60e257ffd4484e536bdb66d6da7b3b377
tservice/AdapterService.java
fp/HeadsetObjectsFactory.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
6e33724d4bbd67881276c173ade19b6b11d4f0c2 30-Jan-2018 Chenjie Yu <cjyu@google.com> Merge "Report cumulative values for Bluetooth controller activity"
607683227ecacd2817a86897c670f6bd907af37a 28-Jan-2018 Pavlin Radoslavov <pavlin@google.com> Re-enable the A2DP unit tests

* Update/fix the A2dpServiceTest and A2dpStateMachineTest unit tests
to accomodate usage of A2dpService.canConnectToDevice()
* Use a better mechanism to start/stop A2DP service in A2dpServiceTest
* Replace usage of when(...).thenReturn(...) with doReturn(...).when(...)
for Mockito stubbing
* Update A2dpService's inners visibility for testing

Fixes: 72460491
Test: runtest bluetooth -c com.android.bluetooth.a2dp.A2dpServiceTest
runtest bluetooth -c com.android.bluetooth.a2dp.A2dpStateMachineTest
Change-Id: I31ebb2acf561561ad648501490dd5a6c1edb366a
2dp/A2dpService.java
8a3b38d249c9f363acba23cca7f473d44448a645 27-Jan-2018 Pavlin Radoslavov <pavlin@google.com> Simplify the setA2dpService() implementation so it is less error prone

This fixes A2DP connectivity issue.

Previously, the setA2dpService() was checking whether the A2dpService
itself was available. However, setA2dpService() is called
during A2dpService.start(), hence at that time the service is not
ready yet.
In the past, setA2dpService() worked because ProfileService.isAvailable()
was returning true even before the corresponding service had finished
the start() execution.

Also, simplify the getA2dpService() error handling.

Fixes: 72574372
Test: Manual
Change-Id: I52f86f24bba2309e3ed979ba6bf64a9bf9e1fb78
2dp/A2dpService.java
2fcf45e2fca90ca20380959ee1224dca23c74d56 26-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Add support for Multi-A2DP state machines per device"
e0cda4210b51f608a2c18cd1f128757b60e39222 09-Jan-2018 Pavlin Radoslavov <pavlin@google.com> Add support for Multi-A2DP state machines per device

* Remove mStateMachine and use a single A2dpStateMachine instance per device
* Cleanup/simplify A2dpStateMachine internals - the BluetoothDevice per
state machine doesn't change.
* Send the state changed broadcast message on enter() in a new state
This fixes timing ordering issue exposed by some of the unit tests
* Remove a state machine when bonding for a device is removed
* Add a mechanism to set the active device
* Add a mechanism to track the maximum number of connected devices
* Updated the codec-related APIs to take a BluetoothDevice argument:
- getCodecStatus()
- setCodecConfigPrefereice()
- enableOptionalCodecs()
- disableOptionalCodecs()
* Add A2dpServiceTest unit tests for A2dpService
* Add ActiveDeviceManager that is responsible for keeping track of the
connected devices and select which device is active.

Also:
* Updated the JNI codec-related calls to use const reference
instead of a pointer
* Additional cleanup

Bug: 69269748
Test: Manual and unit tests
Change-Id: If379f0aa1403de09c485d4adb0dfdfe73190cbf9
Merged-In: If379f0aa1403de09c485d4adb0dfdfe73190cbf9
(cherry picked from commit 6e5900e06c3f53e41a995137dc37dfcc2711bd34)
2dp/A2dpCodecConfig.java
2dp/A2dpNativeInterface.java
2dp/A2dpService.java
2dp/A2dpStackEvent.java
2dp/A2dpStateMachine.java
tservice/ActiveDeviceManager.java
tservice/AdapterService.java
d2d9f6254ae19b81a834266b2cb3ba1e1ab1e152 22-Dec-2017 Myles Watson <mylesgw@google.com> ProfileService: Add user intent receiver

Let profiles know when a user switches or is unlocked.
Refactor doStart and doStop.
Document dump, dumpProto, and println.

Bug: 67460963
Bug: 72435402
Test: Add debug logging and switch users
runtest -j32 bluetooth
-c com.android.bluetooth.btservice.ProfileServiceTest

Change-Id: I10ea7dabcb2e0d296384d6f9a60683569bdef3f8
tservice/ProfileService.java
apclient/MapClientService.java
a08d7327b23d2c2192c2ab9f010d6f494c11699b 07-Jan-2018 Hansong Zhang <hsz@google.com> PBAP: multiple device support

* For each new connection, start a PBAP State Machine, and immediately
start accepting next incoming connection
* Store the map from BluetoothDevice to PbapStateMachine
* Use a unique number among range(1000000, 2000000) for the notification
ID in each PBAP State Machine
* Remove BroadcastReceiver for ACL_DISCONNECTED intent because this
event is already handled with OBEX close event

Bug: 69417672
Test: carkits with PBAP
Change-Id: Ie0d61220b0dba30a30167d932ac65b67c736f88d
bap/BluetoothPbapService.java
bap/PbapStateMachine.java
ad8e3e87324283e5b96f7858f082a872770ab8dc 25-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Remove dead code and update Constants.java"
6968ada72bacae31c7d443f56d38955ed1b7131d 25-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Limit try scope in ObexServerSession"
f83387636b19b3ed0500c0c294ed2f19951a4903 22-Dec-2017 Myles Watson <mylesgw@google.com> OPP: Remove dead code and update Constants.java

Remove unused debugging options.

Test: Use Bluetooth to transfer an image between two phones
Change-Id: I0ff0e6632955787f4e259fcf5f38784583263d80
pp/BluetoothOppService.java
pp/Constants.java
79cd1a86171c772516d79c640bc244bcffee2960 03-Jan-2018 Myles Watson <mylesgw@google.com> OPP: Limit try scope in ObexServerSession

getHeader calls throw IOException, limit try/catch block to those calls.
Return early instead of using preReject and saving the return type.

Remove UNACCEPTABLE_SHARE_INBOUND_TYPES. There's no point of having a
blacklist and a whitelist.

Test: File transfer sanity test
Change-Id: I64ab3a3a4f498d2e1bce5ca8a12b58660eba0dca
pp/BluetoothOppObexServerSession.java
585849072ac508a2c5993b59f5101112f31a2edd 23-Jan-2018 Myles Watson <mylesgw@google.com> btservice: Remove unused reference-counting logic

Remove overridden finalize() methods which are now unused.

Bug: 67460963
Test: runtest -j32 bluetooth
Change-Id: I290e4c37faba202e5ddb7d866d331b804357517a
tservice/AdapterService.java
tservice/ProfileService.java
532359bf15250dea275badbf5a3845799e4cdf4a 24-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Retrieve scan interval and window lengths from Settings.Global."
67ccceab9600aaeec6dc34658c45c074de39aa38 28-Nov-2017 Jack He <siyuanh@google.com> HFP: Add support for Multi-HFP (1/2)

* Create one HeadsetStateMachine for each HFP/HSP device during the
following event:
- CONNECT request sent from API
- CONNECTION_STATE_CHANGED event from stack
* Use a HashMap to manage these state machines
* Removed synchronized label for methods in HeadsetService because state
machines are lazy initialized instead of being created in the
beginning
* Remove code in HeadsetStateMachine that used to deal with multiple
headset devices. Instead, move these logic to HeadsetService
* System state update is sent to one device at a time from the Java
layer and updates from HFP/HSP devices are synced among them
* SCO audio is restricted to one device at a time
* In-band ringtone is disabled when multiple devices are connected
* Audio paramters are device specific and are cached within each device's
state machine. It is only set to the audio framework in AudioOn state
* Reject connection request when number of connections goes above limit
* Added unit tests for HeadsetService to test multi-device scenario
* Add HeadsetObjectsFactory to ease mocking during unit tests

Bug: 68952570
Test: runtest -j40 bluetooth, native unit tests, HFP regression for 1
device, simple tests for multiple devices
Change-Id: Id22c5cbddfc4f9f95e35f035fcab6c4a5d797ebf
tils.java
tservice/AdapterService.java
tservice/ProfileService.java
fp/HeadsetNativeInterface.java
fp/HeadsetObjectsFactory.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStackEvent.java
fp/HeadsetStateMachine.java
fp/HeadsetSystemInterface.java
ef377dcfdd408b276b25a69f72d1b30a097e28cc 23-Jan-2018 Kai Wang <kwangsudo@google.com> Merge "PBAP update TIMES_CONTACTS after pull CallLog"
1e84ce248b355d39855c62a20570af0456301089 09-Jan-2018 kai <kwangsudo@google.com> PBAP update TIMES_CONTACTS after pull CallLog

Update RamContacts.TIMES_CONTACTS in Contacts DB after we pull Call
history.

Bug: 65018938
Test: 1 Connect phone with Mojave
2 After call logs show on Mojave, check Contacts DB
Change-Id: I20dc26e1079501b4423fbad98dc737dbf9c3001a
(cherry picked from commit 0dcbd0d0376b468bfd985339f469b7da5bf789a3)
bapclient/CallLogPullRequest.java
bapclient/PbapClientConnectionHandler.java
8bfe6b0a6c2d473d309c5f13adb2a6db1a0403c7 07-Dec-2017 Myles Watson <mylesgw@google.com> AdapterService: Only clear sAdapterService once

Pass the current AdapterService to clearAdapterService().
Call cleanup() in the unit test.

Bug: 67460963
Test: Toggle Bluetooth
runtest -j32 bluetooth -c com.android.bluetooth.btservice.AdapterServiceTest
Change-Id: Icdaac794e3cdb24d49b4727e762773fb58dd660c
tservice/AdapterService.java
ef1279dc436adaf9681b88acf7cf5d1239ba1574 20-Jan-2018 Arthur Hsu <arthurhsu@google.com> Reland: Prevent sending broadcasts for non-changing properties.

This CL prevent sending broadcast for bluetooth device in case property
actually was not changed. This behaviour may depend on bluetooth layer
implementation details however it is good to have such guard here.

Original CL: ag/2955737
Reland
https://android-review.googlesource.com/c/platform/packages/apps/Bluetooth/+/587833

Bug: 72176003,72175603,66917724
Test: Sailfish BT connect to headset ok
Change-Id: Ib83ebccd928610094b771681a142672544cb12cc
tservice/RemoteDevices.java
ac267c66d13eef000fb4e80583b1cc55695d09c3 11-Jan-2018 Chenjie Yu <cjyu@google.com> Report cumulative values for Bluetooth controller activity

Test: manual test
Change-Id: I730e9f9720005dc6719e4da4a5a4996c79d64e17
tservice/AdapterService.java
36a33b0b96ef7add2d05dd2abddc7691f0504c75 19-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Add ProfileConfig class to Config"
7a76a71588546ab8d772819a9e2cacbf6c324ca1 22-Dec-2017 Myles Watson <mylesgw@google.com> OPP: Remove markBatchFailed with no arguments

Test: Use Bluetooth to transfer an image between two phones
Change-Id: I5ab87c1a90fc79e622a31a6cdfd9b78fde43c40a
pp/BluetoothOppTransfer.java
642541ce6cceb831821e01b0044987c139513701 19-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Revert "Prevent sending broadcasts for non-changing properties.""
568abb4016dfb23d5b92b734769ee4c4b7bcebad 19-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Fix multiple instances of BT file transfer ongoing dialog"
a5748bdcbb28f24d2e3754d741c16fca6bbd191d 19-Jan-2018 Jack He <siyuanh@google.com> Revert "Prevent sending broadcasts for non-changing properties."

This reverts commit f338b873a77de77ed7ba2f46c1ab5dd23a7c1ba2.

Bug: 72175603
Change-Id: I380105442d338eea045e11e004bad2c9b39ba87d
Test: compile, pair and connect to headsets on a local build
tservice/RemoteDevices.java
3946690ce5bb8bfbee358101be2d782a7673df0a 27-Mar-2012 zhangbin.yin <zhangbin.yin@sonymobile.com> Fix multiple instances of BT file transfer ongoing dialog

If during multiple BT file transfer dialog is displayed
several times from status bar, then it takes as many
taps to cancel the transfer.

* Add Intent.FLAG_ACTIVITY_CLEAR_TOP flag to clear previous
poped up dialog.
* Unregister the Content Observer whenever the file
transfer completes.

Bug: 28872363
Test: manual
Change-Id: I6bffe28bcd6973ddf52cfff063961e1981d139dc
pp/BluetoothOppReceiver.java
pp/BluetoothOppTransferActivity.java
91d59ca7152d6d71778fc56129960cbeba6eed7d 18-Jan-2018 Hemant Gupta <hemantg@codeaurora.org> MAP: Fix New Message status when maxListCount is 0

Precondition:
All messages in phone are already read.

Usecase:
1) Establish Map Session with Carkit.
2) Send Get MessageListing request from carkit
with maxListCount as 0 and.>0

Issue:
MAP server sends New Message as ON in get MessageListing
response even if there are no unread messages.

Root Cause:
Incorrect Condition to check if there are unread messages.

Fix:
Corrected the condition depending on read status
for corresponding message.

Test: Checked if new messages status is properly updated to
remote carkit in above scenario.

Fixes: 72141024
Change-Id: I1d328d8681de101ce845e8af91ebdc0df663f84d
ap/BluetoothMapMessageListing.java
021f9aab597864835420d9b974b0829c01f04c2e 05-Jan-2018 Myles Watson <mylesgw@google.com> Add ProfileConfig class to Config

Force synchronization between the class, the bit mask, and the
profile-supported flag.

Test: toggle Bluetooth
Change-Id: Id488cd9c671761b5a7079f815d0f73d569bbc4ce
tservice/Config.java
8484ac95735db4d43d41c87f9248eeb0e1f168e3 18-Jan-2018 Pavlin Radoslavov <pavlin@google.com> Change getMaxConnectedAudioDevices() to public

The method should be public, otherwise it cannot be used within Bluetooth
itself.

Test: Code compilation
Bug: 64767509
Change-Id: I4e973fca924a9dfb91c363db4899587778a343a8
tservice/AdapterService.java
83cd83a8526773546221e1419d852c2d733bd402 18-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Added internal API getMaxConnectedAudioDevices()"
eeef8d69e16407013592a21732e04257667bf6b6 18-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Bluetooth in band ring"
cb781a47d0feacc12e0ce716f6f2d770ce730a27 17-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "GATT: Standardize date in dump()"
7711b289b9255d19c2f0eba62309bf9f377930fc 17-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "OBEX Server Socket: Don't reject connection"
a2499f5726e0aa4110b452c8566b1cdacefb97a0 17-Jan-2018 Pavlin Radoslavov <pavlin@google.com> Added internal API getMaxConnectedAudioDevices()

The API can be used to obtain the maximum number of connected
devices for A2DP or HFP.

Test: Manual
Bug: 64767509

Change-Id: I20242585f6343ecfac21353d3c6194641d1f63af
tservice/AdapterProperties.java
tservice/AdapterService.java
7621506c7ade0a034f1cb77f5c1215db103768db 16-Jan-2018 Hansong Zhang <hsz@google.com> OBEX Server Socket: Don't reject connection

OBEX Server socket should not reject new connection; instead, the user
should reject new connection if the user cannot handle it.

Bug: 72006198
Test: carkits MAP, PBAP; phones with OPP

Change-Id: I99a766daf4b5a17b25a652c4ef131e7ba7df26c8
bexServerSockets.java
ap/BluetoothMapMasInstance.java
apclient/MnsObexServer.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppService.java
bap/BluetoothPbapService.java
3376fb589d0279b58f42986a3e13d4498dbf2c4f 16-Jan-2018 Myles Watson <mylesgw@google.com> GATT: Standardize date in dump()

Match the output in logcat/bug reports.

"MM-dd HH:mm:ss"

Last 5 scans :
01-17 17:40:52 - 5977ms Filter 7 results (6)
01-17 17:41:19 - 5964ms Filter 8 results (6)
01-17 17:41:19 - 77019ms Filter 0 results (5)
01-17 17:42:37 - 5964ms Filter 8 results (6)
01-17 17:42:37 - 208533ms Filter 0 results (5)

Test: adb shell dumpsys bluetooth_manager
Change-Id: Ie0d4ae38abd08de9526cfd1bed5c7adcc460af19
att/AppScanStats.java
f3f976aa1ef651f0555598b2847318e0bee31559 16-Jan-2018 Myles Watson <mylesgw@google.com> OPP: Standardize date in dump()

Match the output in logcat/bug reports.

"MM-dd HH:mm:ss"

Profile: BluetoothOppService
Shares:
01-16 22:38:40 -> 0/1800301
01-16 22:39:23 -> 0/1800301
01-17 17:43:34 -> 1800301/1800301

Test: adb shell dumpsys bluetooth_manager
Change-Id: I39f904afe8a7b245cdf4fe6d1a6e93ef584f13a9
pp/BluetoothOppService.java
cf92a8d80214b2ea9f2bc54edd7d37c77477aac2 17-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Prevent sending broadcasts for non-changing properties."
8d4800be6a5ce3ba2c84952808ef28dc6eb165ee 17-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Allow adapter callback to transition state machine"
3bda9d31b4ad81fe8d91e451a6bbd05a54c2d962 17-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Correctly handle GATT as only profile supported."
2df8722189b05a48d60b1570931bfb5066ec7400 17-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "GattServer: Check for null for mServerMap.connIdByAddress"
52e1a8bcf1cd1766ac298752807f8ceaa29f006b 09-Jan-2018 Martin Brabham <optedoblivion@google.com> Add capability to disable CLCC polling

Bug: 70660604
Change-Id: I9de50ffbcbad9f9d9cf05bdaf97a0bb445f2f461
(cherry picked from commit 722ed69b234a73184feae42e37b4d0703516fb51)
fpclient/HeadsetClientStateMachine.java
2ba7e903557e98517edcd51aaf2c0f971a317862 03-Jan-2018 Joseph Pirozzo <pirozzoj@google.com> Bluetooth in band ring

Prevent the telecom service from generating a ringer if there is already
a ringer generated by a phone connected over bluetooth headset client
service.

Bug: 65673832
Test: runtest bluetooth -c
com.android.bluetooth.hfpclient.HeadsetClientStateMachineTest

Change-Id: Ie4011598c2719897afb6185f928951289ab9c731
(cherry picked from commit 396dd51efd7e51b0f61647172b76f1cc4e9c85f7)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/NativeInterface.java
fpclient/StackEvent.java
fpclient/connserv/HfpClientDeviceBlock.java
e402f0cb470f1433a50ae427495bb0b4c81238fd 12-Jan-2018 Hansong Zhang <hsz@google.com> PBAP: Return correct connection state when state machine is done

Check whether the state machine is done, and return
BluetoothProfile.STATE_DISCONNECTED when it is done.

Test: carkits with PBAP
Bug: 70939570
Change-Id: I499e152abcfdc91174745bf74dd9a295419c7001
bap/PbapStateMachine.java
995590dcce4c2b854d6c39e00942bbdf0ee55ee1 12-Jan-2018 Arthur Hsu <arthurhsu@google.com> Allow adapter callback to transition state machine

For ARC++ we need to be able to have the HAL asynchronously inform
the Bluetooth adapter state machine that the adapter has been
enabled or disabled. Add ENABLED_READY and DISABLED messages to the
OnState and OffState handlers, treating them the same as BLE_TURN_ON
and BLE_TURN_OFF messages.

Based on ag/885443

Bug: 62410651 69965109
Test: Build ok
Change-Id: I94a98735d1a6fb6b105cddd94e7e1dd5e80e700c
tservice/AdapterState.java
f338b873a77de77ed7ba2f46c1ab5dd23a7c1ba2 12-Jan-2018 Arthur Hsu <arthurhsu@google.com> Prevent sending broadcasts for non-changing properties.

This CL prevent sending broadcast for bluetooth device in case property
actually was not changed. This behaviour may depend on bluetooth layer
implementation details however it is good to have such guard here.

Original CL: ag/2955737

Bug: 66917724
Test: Build ok
Change-Id: Iaf553412ed0bf00fba4ac23bfcb82231379694cb
tservice/RemoteDevices.java
a8b93e5a56c1fb49751ff5500cc9063f05ca3e37 12-Jan-2018 Arthur Hsu <arthurhsu@google.com> GattServer: Check for null for mServerMap.connIdByAddress

We check for null for mServerMap.connIdByAddress in every places
except in SendResponse and SendNotification. This patch properly
fixes that.

Based on ag/1226721

Bug: 62409644 69965109
Test: Build ok
Change-Id: I104f9d0749af389779ecc33b30e31715b17c21c1
att/GattService.java
b04e603045f9a065750e879a900c5cb3bea2fb08 12-Jan-2018 Arthur Hsu <arthurhsu@google.com> Correctly handle GATT as only profile supported.

If GATT is the only profile enabled in config.xml, then AdapterService
will hang indefinitely since setProfileServiceState ignores GATT. This
is okay generally since GATT comes up with BLE, not with BREDR. But since
GATT is already running at this point, AdapterService will never know
that we can consider BREDR started.

Fix this by shortcutting to BREDR_STARTED in the case that we're trying
to start core services and GATT is the only supported profile.

Bug: 62415118 69965109
Test: Build ok
Change-Id: I47f7d0c21bb21773d5317fb264aa9adce8f5823e
tservice/AdapterService.java
849e344efff6be7f2d61d627bcc624f8aee23efa 11-Jan-2018 Jeremy Klein <jlklein@google.com> Retrieve scan interval and window lengths from Settings.Global.

The default values are staying the same. Reading from Settings.Global
will enable us to run an experiment tweaking these parameters to
determine impact on battery life.

Bug: 71765044
Test: Manual. Looking for existing unit tests... Any pointers?
Change-Id: Ie44d605447866f0ec6d327f4d1852f490e452eb4
att/ScanManager.java
1f7304a0df9fa7e1ccee0cd9a61933a0f9be3e8c 06-Jan-2018 Jack He <siyuanh@google.com> HFP: Add isInbandRingingEnabled() API (2/4)

* Use BluetoothHeadset.isInbandRingingEnabled() API to check whether
in-band ringing is currently enabled in the system when deciding on
audio routes for ringtone
* Implement this API in Bluetooth.apk by checking both:
1. Whether in-band ringing is supported on this platform
2. Whether in-band ringing is enabled by system properties
* The actual implementation may change in the future to reflect the
actual state of in-band ringing as the HFP stack evolves

Bug: 71646213
Test: make, toggle in-band ringing from Development Settings and observe
whether Telecom service tries to open SCO when there is an
incoming call

Change-Id: I8e41993632e0f42b5c65df7037d3eae4586b062f
fp/HeadsetNativeInterface.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
11768a00689b7fe912abb688a2e0a03a76d93566 08-Jan-2018 Myles Watson <mylesgw@google.com> Pbap: Add a null pointer guard for mServerSockets

Test: Toggle Bluetooth
Change-Id: If24685c222fc1bcebc4f496ee3f8353e5a3cb30c
bap/BluetoothPbapService.java
1a4d0d38f41cc49aa43ea9f5a8759487b1f37d1f 06-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "HFP: Add APIs for set and get active device (2/3)"
310c1d76542c64cfb64612ab91f062e1148796c4 06-Jan-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Use PbapStateMachine to handle new connection"
37bdea3793773250d6cfa7e8eff1065f159d3d2c 07-Dec-2017 Jack He <siyuanh@google.com> HFP: Add APIs for set and get active device (2/3)

1. Call BluetoothHeadset.setActiveDevice(BluetoothDevice device) to set
a connected HFP/HSP device as active.
2. Listen for BluetoothHeadset.ACTION_ACTIVE_DEVICE_CHANGED intent
that will contain the latest active device (in EXTRA_DEVICE field).
If the active device could not be changed, the EXTRA_DEVICE
field could be null.
3. If setActiveDevice() is NOT in-progress, BluetoothA2dp.getActiveDevice()
can be used. If setActiveDevice() is in-progress, the result is undefined.
4. BluetoothHeadset.setActiveDevice() could be called by some other parts of
the system, so interested parties should always listen for
BluetoothHeadset.ACTION_ACTIVE_DEVICE_CHANGED intents and prepared
for active device updates.

Bug: 68951996
Test: runtest -j40 bluetooth
Change-Id: I4471a35aa17f369bef49fbdb6f3ccaee393013b9
fp/HeadsetNativeInterface.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
4fb4bf5c9b21fc160a5c901dfe2358f780ff5dea 20-Dec-2017 Myles Watson <mylesgw@google.com> OPP: Only start the service from AdapterService

BluetoothOppProvider:
- Update comments and log messages.
- Remove startService calls; AdapterService starts OPP.
- Remove unnecessary braces from switch statements.

BluetoothOppService:
- Remove unused variables.
- Rename mBatchs -> mBatches.
- Add an empty Binder for symmetry with other profiles.

BluetoothOppTransfer:
- Remove unused PowerManager parameters.

Bug: 67460963
Test: File transfer
Change-Id: Ied9a640b96d59e6c2e6b171b0ac3c08173f0ecd7
pp/BluetoothOppProvider.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
c7ed3fe050d6393a34ec9fa4237b77a1290ebc0d 15-Dec-2017 Hansong Zhang <hsz@google.com> PBAP: Use PbapStateMachine to handle new connection

Move the connection socket part in PbapService to PbapStateMachine.

PbapService handles the following tasks:
- implementing service lifecycle methods
- starting and stoping the server socket
- managing SDP records and PbapUtils
- handling broadcast from Bluetooth PBAP permission request
- handling broadcast from PBAP OBEX challenge request
- managing wakelock
- implementing the PbapBinder interface

PbapStateMachine (new) handles the following tasks:
- sending and getting Bluetooth PBAP permission request to and from
PbapService
- sending and getting PBAP OBEX challenge request to and form
PbapService
- using PbapObexServer to handle PBAP OBEX requests
- maintaining the connection status

The Bluetooth PBAP permission request is handled by Settings; the PBAP
OBEX challenge request is handled by BluetoothPbapActivity.

Bug: 70939570
Test: carkits with PBAP
Change-Id: I77ebb7f64370326b717db64cb94c8696f74b0c5c
bap/BluetoothPbapActivity.java
bap/BluetoothPbapAuthenticator.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/PbapStateMachine.java
88439fc6f2ca6e779e27069c60aaf0f239169e24 19-Dec-2017 Pavlin Radoslavov <pavlin@google.com> Added internal API to get/set the A2DP Active Device

1. Call BluetoothA2dp.setActiveDevice(BluetoothDevice device) to set
a connected A2DP device as active.
2. Listen for BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED intent
that will contain the latest active device (in EXTRA_DEVICE field).
If the active device could not be changed, the EXTRA_DEVICE
field could be null.
3. If setActiveDevice() is NOT in-progress, BluetoothA2dp.getActiveDevice()
can be used. If setActiveDevice() is in-progress, the result is undefined.
4. BluetoothA2dp.setActiveDevice() could be called by some other parts of
the system, so interested parties should always listen for
BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED intents and prepared
for active device updates.

Bug: 71555243
Test: Manual
Change-Id: I860d1aba716d75856c3e9e022948a1b4b3be18bf
2dp/A2dpService.java
2dp/A2dpStateMachine.java
b2ea23021af9b3376695cee9c11126a44ff64ec2 13-Dec-2017 Fen Wang <fen.wang@sony.com> Add to receive BTHF_CALL_STATE_DISCONNECTED at HFP

When the call is disconnected, the BTHF state is changed to IDLE and
SCO connection is disconnected before playing disconnect tone. So the
disconnect tone can't be sound from BTHS.

Add DISCONNECTED state for HFP and keep the state until disconnect tone
sounds from BT.

Test: manual - Checked whether the disconnect tone is sound from the BTHS
Bug: 69645337
Change-Id: Iec361649e7d9f233a63a9d8b32a5048a05104c94
fp/HeadsetHalConstants.java
35547a186af9d7ac1338a254a7d7c734c6dca9df 04-Jan-2018 Kai Wang <kwangsudo@google.com> Merge "AvrcpCtrSM check BrowseNode"
201a1383c5163a7d9e25d8d1a78ab0561d18b061 12-Dec-2017 kai <kwangsudo@google.com> AvrcpCtrSM check BrowseNode

Make sure BrowseNode is not null before we use it.

Bug: 70563386
Test: Connect IPhone with Mojave
Change-Id: I4d32800826049a3b51ece4f8ee8e4a16ed73fe31
(cherry picked from commit cc34c90a15e1d75a13228682ef13dbbb32b9298e)
vrcpcontroller/AvrcpControllerStateMachine.java
d50846ec7e18543c17e699965b1feded69ba6d47 03-Oct-2017 Jakub Pawlowski <jpawlowski@google.com> Advertising Filtering: send all filters in one batch (1/2)

Bug: 67371480
Test: sl4a FilteringTest
Change-Id: I79c54b6d8c8fb3bdee204bb95a11073b7da99d0b
att/ScanFilterQueue.java
att/ScanManager.java
a6f62f30e057b1c508949ffb16bfe8a614e6e4f8 15-Dec-2017 Vasu Nori <vnori@google.com> Allow multiple connections on MAP profile.

Bug: 68750354
Test: tested manually. 2 Phones paired on MAP profile. Auto received
messages from both phones and displayed notifications. Checked the state
with "adb shell dumpsys bluetooth_manager" - shows 2 phones connected
on MAP

internal change-id: I7ab75160a339eb9fe73f840f8df616ed9ca78208

Change-Id: I3b3e5518e869bdd8c4778f1031009decb3765eec
apclient/MapClientService.java
apclient/MapUtils.java
apclient/MceStateMachine.java
apclient/MnsService.java
99642a1451db362062a1ff8238832ba21e0a0676 02-Jan-2018 Vasu Nori <vnori@google.com> Migrate a change from internal master branch to aosp/

internal master branch change id: ag/3303533
Test: tested manually.

Change-Id: Ib90ab6f3ec5f3797da8ef90241bab109f2221d54
apclient/MceStateMachine.java
apclient/obex/RequestSetMessageStatus.java
9fec8848a1bef6968ef857791d77cf2be0dc2e47 23-Dec-2017 Myles Watson <mylesgw@google.com> SAP: Make cleanup public again

The CL with ID Ic122e86c0893e972de0d1908c18217c049450378 inadvertently changed
the cleanup() to protected.

Change-Id: Ic7517fd31ff98806190113edaac17436db2cda17
Test: build
ap/SapService.java
fab73240af22c6a52b53d3ccd30be35580c5c7b9 22-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Set the size of the database to 50 shares"
2ea27ea97c7d4cc117564322af68acab6ebaf8a8 22-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "ProfileService: Change cleanup() to return void"
f2d0635dc7036f7ea70b3e34930c8ee70f541d51 22-Dec-2017 Myles Watson <mylesgw@google.com> OPP: Set the size of the database to 50 shares

Test: send an image
Change-Id: I709b643af8890dc49d05e7202174d8a950f3e6e7
pp/Constants.java
1d02dfb51693b14a569e068cea70aa268ade9a59 21-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "BluetoothHidDevice: rename onIntrData to onInterruptData (3/5)"
bc46b434e6869f79f2cfa27e8c09818f33f85b69 21-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Add dumpsys output"
927dc604e1bc561227d11a4a96d1643d912150ca 21-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Add filter support for Owner contact"
3551a50db0f009e92e566e747a02aa36c7f4f2ee 21-Dec-2017 Myles Watson <mylesgw@google.com> OPP: Add dumpsys output

Dump the size and direction for recent shares.

Profile: BluetoothOppService
Shares:
12.20@15:24:25: -> 27/27B
12.20@15:42:00: <- 1647024/1647024B
12.20@16:12:54: <- 1116437/1116437B
12.21@07:24:38: <- 1752058B/3067823

Test: adb shell dumpsys bluetooth_manager
Change-Id: Ia87638d50de69a8cda4ca65d0fb3fc9710ec94e9
pp/BluetoothOppService.java
e48a80aa18e123e7d66e55bfe339adac77c44e3a 15-Dec-2017 Hansong Zhang <hsz@google.com> PBAP: Split startSocketListeners()

* Rename startSocketListeners() to prepareServerSocket().
* prepareServerSocket() is only used to indicate it can accept a
new connection. It no longer
- disconnects current OBEX session;
- starts the server socket;
- makes SDP record;
- calls BluetoothPbapUtils.fetchPbapParams().
* Instead, the callers of startSocketListeners() handle the rest:
- service.start() explicitly starts the server socket, makes SDP
record, and calls fetchPbapParams();
- stopObexServerSession() just disconnects the current OBEX session
and indicates that it is OK to accept a new connection;
- onAcceptFailed() closes the server socket, cleans up SDP record,
and then does the same thing as server.start().

Test: carkit with PBAP
Bug: 69417672
Change-Id: Ib5fe14835a77b0de69d476a74227fa6f78bfa698
bap/BluetoothPbapService.java
970d01527efa5606701c5b1f4942a56c47814eab 08-Dec-2017 Myles Watson <mylesgw@google.com> ProfileService: Change cleanup() to return void

Bug: 67460963
Test: toggle Bluetooth
Change-Id: Ic122e86c0893e972de0d1908c18217c049450378
2dp/A2dpService.java
2dpsink/A2dpSinkService.java
vrcpcontroller/AvrcpControllerService.java
tservice/AdapterService.java
tservice/ProfileService.java
att/GattService.java
dp/HealthService.java
fp/HeadsetService.java
fpclient/HeadsetClientService.java
id/HidDeviceService.java
id/HidHostService.java
ap/BluetoothMapService.java
apclient/MapClientService.java
pp/BluetoothOppService.java
an/PanService.java
bap/BluetoothPbapService.java
bapclient/PbapClientService.java
ap/SapService.java
d7d9791fbc44d663377032377d78c8895d345e7d 07-Dec-2017 Myles Watson <mylesgw@google.com> ProfileService: Report error when start() returns false

Test: build
Change-Id: Icc1183a6dc5fdce6e15dd3a477448ad02544ac76
tservice/ProfileService.java
469a840f86435b6c038a827cc40e04022b5722c9 21-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Add cleanUpServerSocket helper and remove unused code"
69415f7c76c8833017645aa3c684d78d6021d5e6 13-Dec-2017 Hemant Gupta <hemantg@codeaurora.org> PBAP: Add filter support for Owner contact

Use case:
1. Add the user account which has contacts with Photos,
Make sure owner vCard has photo added.
2. Run PTS (TC_PSE_PBB_BV_31_C & TC_PSE_PBD_BV_36_C).

Result:
User account related test cases getting failed.

Root Cause:
While retrieving vcard, filter support for owner vcard was missing.

Fix:
Filter Owner contact fields as per filter attribute request
from PBAP client before sending owner vcard.

Test: test cases passes with above change
Fixes: 70604167
Change-Id: If737b86854d4a15673b29cc5dcfb0338dc663c55
bap/BluetoothPbapObexServer.java
2935473ed673edca9aff22607241d754d73e970e 21-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Make notifications local-only"
cd04215b82e91803a82c2c826de35658aeebe0e5 19-Dec-2017 Hansong Zhang <hsz@google.com> BluetoothHidDevice: rename onIntrData to onInterruptData (3/5)

Bug: 63384609
Test: make
Merged-In: Ie5fa3af7ef6d97fc3185cab86591d31432539ec3
Change-Id: Ie5fa3af7ef6d97fc3185cab86591d31432539ec3
(cherry picked from commit d8de561daea8e11ec3bc86acc65cf6df1a7aa87d)
id/HidDeviceNativeInterface.java
id/HidDeviceService.java
da342209c4d6421be6ec25e430f7e8ac828722b2 19-Dec-2017 Marie Janssen <jamuraa@google.com> Make notifications local-only

Notifications from Bluetooth shouldn't be seen on external devices like
watches - they don't make sense to accept on those devices.

Test: while connected to watch, connect phone to carkit
Bug: 34612389
Change-Id: Ie1e3044db0677832bbfba52dfc5932d309dec100
pp/BluetoothOppNotification.java
bap/BluetoothPbapService.java
ap/SapServer.java
9f5375bef79cd050ce3616eedc316bb4eaa0fb31 02-Sep-2015 Eri Kasamatsu <eri.x.kasamatsu@sonymobile.com> PBAP: Add SOUND property support to vCard 2.1

Add SOUND property support to vCard 2.1.

Fixes: 29891901
Test: manual
Change-Id: I32cea3ed3281e9f539de475d6d777e4b9b08c49a
bap/BluetoothPbapVcardManager.java
00bac0c867db92336ac808fc8c6f845fa2849023 14-Dec-2017 Hansong Zhang <hsz@google.com> PBAP: Add cleanUpServerSocket helper and remove unused code

* Remve broadcast receiver for BluetoothAdapter.ACTION_STATE_CHANGED.
When Bluetooth adapter status changed, lifecycle method will be called.
* Remove mAdapter != null check.
* Remove unused private fields.
* Remove MSG_SESSION_DISCONNECTED because it is replaced by
MSG_SERVERSESSION_CLOSE.
* Add helper method cleanUpServerSocket().
* Limit the scope of private fields.

Test: carkits with PBAP
Bug: 69417672
Change-Id: I8c144fa1c500db18c18e87cf20ec63c4223d2878
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
1c0b19d06b9dc40e8335c8332853333b2a678041 04-Dec-2017 Jack He <siyuanh@google.com> HFP: Add method to disable inband ringing through BSIR (2/2)

* Add sendBsir(boolean, BluetoothDevice) to turn
in-band ringtone feature ON and OFF dynamically during a service
level connection with a headset
* Added missing mutex lock in native interface as well

Bug: 70173881
Test: make
Change-Id: I5e0744367c07d0448c72ce15fa6f60ffbd5f4995
fp/HeadsetNativeInterface.java
50b51beb3bd0885ced514d1bcfda3050f60833ff 20-Nov-2017 Jack He <siyuanh@google.com> HFP: Split system interactions into HeadsetSystemInterface

* Split the interactions with other system services including but not
limited to Audio, Power, Telecom, to a single class,
HeadsetSystemInterface
* This allows us to synchronize system service calls in one place as
they might come from separate state machines
* This also allows us to use a single SystemInterface instance for all
running state machines so that each state machine does not need to
create its own copy of the system interface objects
* Removing SET_MIC_VOLUME and INTENT_BATTERY_CHANGED messages from
HeadsetStateMachine as they can be handled externally
* Adding INTENT_CONNECTION_ACCESS_REPLY message as this needs to be
handled within the state machine asynchronously
* Use private classes instead of anonymous classes in HeadsetPhoneState

Bug: 68952570
Bug: 70678594
Test: runtest -j40 bluetooth, testplans/details/133403/3975
Change-Id: I98642a2296cf90c74c002fb254c6ace4785d898b
fp/AtPhonebook.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
fp/HeadsetSystemInterface.java
383b5cd300376b2351df39761815c289423d8a2b 14-Dec-2017 Myles Watson <mylesgw@google.com> AdapterService: Make finalize() public

Bug: 70633745
Test: GCE HFP Instrumentation tests
Change-Id: Iafc7036849f4a2dbf3540f3104d8cf2db9aa21fe
tservice/AdapterService.java
7ac05916e9f99c527ed28dbc029b2e6aa132e861 13-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "MAP: Update API name used during Socket Listening."
71f70164a0044b0f5c26847def4eecfd0a306102 13-Dec-2017 Hiroki Yamamoto <Hiroki.A.Yamamoto@sony.com> OPP: Notify NFC of that the transfer still alive per a certain period

Nfc Handover initiated transfer with large size file fails
because NFC cannot receive a notification within its timeout period.

In order to avoid this issue, update the transfer status
per a certain period to notify NFC of that the transfer is still alive.

Test: Send/Receive a large size file by AndroidBeam
Fixes: 64380121
Change-Id: I99530ce0fbcbacfcb8d178a285fbe6a49df954c1
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
pp/Constants.java
814cfc132b92a026b1e09b5e84e993580bc58df6 13-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "AdapterService: Small refactor and fix log errors"
38f09bcc65d899c75be41aad952e40aee3182a6c 13-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "MAP: Add content transfer encoding property for MMS body"
0b6d5c73058af2c4be043d250a1cd3c1acab364c 13-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "MAP: Send message without persisting to avoid duplicate entries."
7a232155aead03ca01471812ddb5b9481c8e587e 13-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "PAN: Delete disconnected PAN device from map"
0d50ea7a84277a91cd9da6ae15ab222e831cf427 13-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Handle Stale Data Exception"
aeb3d757c00a5e70c67e565f6dc2885de12d4e38 08-Dec-2017 Jack He <siyuanh@google.com> AdapterService: Small refactor and fix log errors

* In multiple instances, setValue(value) which set mValue to value
prints log with existing value instead of the incoming new value.
This CLs corrects this issue in enable() and setAdapterService()
* Use range based for loop when possible
* Compare GattService class name by calling GattService.class.getName()
or getSimpleName() instead of using the raw string
* Remove redundant logic in dump()
* Make mUidTraffic final as it is never re-assigned

Test: make, runtest -j40 bluetooth, turnning Bluetooth on/off
Change-Id: I707dff79373a70c5f14d9c136e8fa05752a74f42
tservice/AdapterService.java
366ca99dba774cb7a41fd5453cf905d3db437155 23-Nov-2017 Hemant Gupta <hemantg@codeauora.org> MAP: Send message without persisting to avoid duplicate entries.

Usecase:
1) Establish MAP session
2) Send message from carkit

Issue:
Message entry seen twice in messaging app.

Root Cause:
Message written to database was duplicated using
telephony API.

Fix:
use API SmsManager.sendMultipartTextMessageWithoutPersisting which
wont rewrite message in database.

Test: Message duplication is not seen after applying the above change.

Fixes: 70270156
Change-Id: Ib0472a190bd0779cbd54f5163e66016de12be869
ap/BluetoothMapContentObserver.java
24c949c9dae49eef113eca6e2ea3c9aa4b7ae24e 17-Oct-2017 Hemant Gupta <hemantg@codeauora.org> PAN: Delete disconnected PAN device from map

Usecase:
1) Pair and connect DUT (PANU) to remote device (RD1) in NAP role.
2) Disconnect DUT and remote device (RD1).
3) Disable BT on remote device (RD1).
4) Enable BT Tethering on DUT and enable Wifi connection or SIM data to act as
backhaul so that DUT acts in NAP Role
5) Pair and connect DUT with remote device (RD2) in PANU role and browse internet.
6) Disconnect DUT and RD2.
7) Intiate connection from DUT to RD1 (It should fail after page connection timeout of 5 sec).
8) Connect from RD2 to DUT and try to browse internet.
9) Disconnect DUT connection from RD2.
10) Connect from RD2 to DUT.

Failure:
Browsing is not working with remote (RD2) PANU Device.

Fix:
Remove pan device from hashmap with out considering previous state of remote device.

Test: Remote device can browse internet without issues as per usecase above.

Fixes: 70559095
Change-Id: I28c8014a6ca0c22b7d15000b23fe8b12feb75026
an/PanService.java
54ba08e04553d9fc600846bd653cf3d83480a18c 15-Nov-2017 Hemant Gupta <hemantg@codeauora.org> OPP: Handle Stale Data Exception

Use case:
1. Share numerous files
2. Wait for complete
3. View completed transfers
4. Before opening the transfer history click on home button
5. Repeat above steps numerous times

Failure:
Crash in com.android.bluetooth
Msg: StaleDataException, Attempting to access a
closed Cursor Window

Root cause:
Some rare cases after pausing activity also cursor
is trying to fetch values from OPP DB.

Fix:
Catch Cursor Exception to avoid crash in opp profile
and break loop If we get at least one finished transfer
from DB to avoid UN necessary iterations.

Test: Stale Data Exception not observed as per above usecase.
Fixes: 35013626
Change-Id: I9c76638c162e9433b0aa17b99711557ba8f9ef07
pp/BluetoothOppTransferHistory.java
873086e4994b83ee35622e2f6d3a1f08a955cc63 09-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> MAP: Update API name used during Socket Listening.

Since MAP supports 1.2, update API name from startRfcommSocketListeners
to startSocketListeners since both L2CAP and RFCOMM sockets are being
used for listening in MAP 1.2 code.

Test: Code builds.

Fixes: 35013632
Change-Id: I6f12f91b6869bd94692157d26eeef36515f294c1
ap/BluetoothMapMasInstance.java
ap/BluetoothMapService.java
212ebc52dc0906186ba80cbc5b1a9d2553108751 12-Dec-2017 Hemant Gupta <hemantg@codeaurora.org> MAP: Add content transfer encoding property for MMS body

Usecase:
1) Establish Map Session with Remote Carkit.
2) Send Get Mesage request from remote for MMS message
with multi mime parts.

Issue:
MMS bMessage content like datetime or sender is not
displayed in valid readable text format.

Root Cause:
CONTENT-TRANSFER-ENCODING bMessage property is not applied
to MMS body part.

Fix:
Add CONTENT-TRANSFER-ENCODING for bMessage body of MMS.

Test: datetime and subject are properly seen on Audi A6 carkit.

Fixes: 70545852
Change-Id: Iee8bb29709e0403e481701e4a49cf1f926f41f96
ap/BluetoothMapbMessageMime.java
122e077f24750ee0e7fd650cbfa832edeb216d07 08-Nov-2017 Jack He <siyuanh@google.com> HFP: Redesign HeadsetStateMachine

* Remove unused variables and unused states for single connected device
* Remove unnecessary default values
* Use final keyword whenever we could
* Move state transition broadcasts into enter() method of states
* Created Disconnecting, AudioConnecting, AudioDisconnecting state to be
more explicit about state tracking
* Create HeadsetStateBase class to implement methods shared among all
states such as state aware logging, previous state tracking and
crash on illegal state transitions
* Created ConnectedBase class to implement sharable methods among four
connected states: Connected, AudioConnecting, AudioOn,
AudioDisconnecting. They share common handler for functional messages
besides connection events.
* Created helper methods to translate event value to string
* Created unit tests to verify every individual state transitions based
on the state diagram drawn offline

Bug: 68952425
Test: make, runtest bluetooth
Change-Id: If2c8878e86a4c34fcc27b625dcd7a3153e8e0daa
fp/HeadsetHalConstants.java
fp/HeadsetNativeInterface.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
d32a52193befc7d46d375043e59c1b3333bcbba7 12-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Make BluetoothPbap implement BluetoothProfile (2/3)"
3418324f384b9a2402b2f7e2772da83e24066496 11-Dec-2017 Kai Wang <kwangsudo@google.com> Merge "AvrcpCtrSM send INTERNAL_CMD_TIMEOUT"
bb2a6719d64cc3384470863655a29de76116e8c2 06-Dec-2017 Joseph Pirozzo <pirozzoj@google.com> Prepare Media Session

Update A2DP Sink such that when the associated media session is prepared
audio focus is acquired and streaming is permitted to begin from either
the phone or car until another app takes permanent media focus.

Bug: 69833231
Test: Manually run all associated music apps.
Change-Id: I9e180b0558d80b8f4185c6cc724aeaf833891df5
2dpsink/A2dpSinkService.java
2dpsink/A2dpSinkStateMachine.java
2dpsink/A2dpSinkStreamHandler.java
2dpsink/mbs/A2dpMediaBrowserService.java
44d4be016d3c81e1d4bc468cbaae1ccc8578c6a7 30-Nov-2017 kai <kwangsudo@google.com> AvrcpCtrSM send INTERNAL_CMD_TIMEOUT

When we go to MoveToRoot and GetFolderList state, we should send
MESSAGE_INTERNAL_CMD_TIMEOUT. So we can go back to the mConnected
state, if we do not get the response or timed out to execute the
request.

Bug: 68018990

Test: 1 Select any song and start playing
2 Change song track while browsing playlists
Change-Id: I1426a1410c736674ec8731e5ff2cec7835a545a1
(cherry picked from commit 0ccfb23b360dde05deaa9f4b3a60db701db9e52c)
vrcpcontroller/AvrcpControllerStateMachine.java
2d8f322d3a7a6fc50b6786f0a9eae41c907d280f 09-Dec-2017 Hansong Zhang <hsz@google.com> Make BluetoothPbap implement BluetoothProfile (2/3)

* Changed methods names and signatures in Binder and service to support
getConnectedDevices(), getDevicesMatchingConnectionStates(),
getConnectionState()

* Add BluetoothDevice parameter to disconnect()

Test: test with carkits
Bug: 69417672
Change-Id: I47df76472937498659a09e22c89913e8284324ac
bap/BluetoothPbapService.java
9510cb2fc2a171112add10d7519d125ea9af9708 08-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "HID Device: add unit test cases"
c09b31cd77c3bc6d26771665aaff5d7142785d50 04-Dec-2017 Hansong Zhang <hsz@google.com> HID Device: add unit test cases

* Add unit test for replyReport(), reportError(), connect(), and
disconnect()
* Add unit test for callback methods to user app: onGetReport(),
onSetReport(), onSetProtocol(), onIntrData(), onVirtualCableUnplug()
* Force unregister the app before each test case
* Move assignment of HidDeviceNativeInterface from the constructor to start()

Bug: 69045106
Test: run instrumentation test
Change-Id: I0dff3f6a7e77d5a56b0beb528d208923f1df8123
id/HidDeviceService.java
b84959643bd2a986eb55f27e5d0c840728b18cee 07-Dec-2017 Jack He <siyuanh@google.com> HFP: Remove dead code in HFP profile

The following hidden API methods are not implemented by the stack and
should be removed:
- getBatteryUsageHint()
- acceptIncomingConnect()
- rejectIncomingConnect()

The following hidden API methods are no longer needed due to lack of
usage and should be removed:
- enableWBS()
- disableWBS()
- bindResponse()

Bug: 70336991
Test: make
Change-Id: I84c5555879597857a45f370d8de82d67cbd4e379
fp/HeadsetNativeInterface.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
345ea03be2b69dadf5d510c5bd1d1958bb71f682 06-Dec-2017 Xin Li <delphij@google.com> DO NOT MERGE: Merge Oreo MR1 into master

Exempt-From-Owner-Approval: Changes already landed internally
Change-Id: I7bca968d7f2d34c553ca69bbc703e610627c8ded
20d671e562d6363a5e27714b0faad5670a6cd0cc 06-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Remove BluetoothHidDeviceAppConfiguration (3/4)"
2265dd38bf4445ed0c4d3f2fb96c0745333649c1 06-Dec-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Fix to handle incomplete message listing object sent."
am: cf77de70d0

Change-Id: Iba865fa374eb3cd9d221223cca31c06800b7459b
08bd0c2cea77c6873a6dbf12fed5492a469ee204 06-Dec-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "PBAP: Sort vCardListing results when order is alphabetic"
am: 476850b2d0

Change-Id: I5b2f2c98dc6723045f9d55545b16365de80633f1
b914280c65d31868c8fa5311507a29c896d0d2cd 06-Dec-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Serialize closeService to prevent ANR's"
am: 68dc9527e1

Change-Id: Ife8c7b579a14496fc7ab75fbaef41f02f1fb7065
cf77de70d0dedf426cec075bbc36dae72cbe9b6c 06-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "MAP: Fix to handle incomplete message listing object sent."
476850b2d0cac3415691b8a05b22ba8a20ab33af 06-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Sort vCardListing results when order is alphabetic"
2aeba34a2dbb09d509a982dedd1689164317886a 24-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> MAP: Fix to handle incomplete message listing object sent.

Usecase:
1) Establish Map Session with Remote Carkit.
2) Send MesageListing request from remote.
(Can be seen with getMessage Email, folderListing
email)
Note: Incomplete MessageListing object is sent only
when listing object size is between A and B where
A = (MaxPacketSize - HeaderArray_A_Size - 6) where
HeaderArray_A contains only CONNECTION_ID and
HeaderArray_A_Size = 5;
B = (MaxPacketSize - HeaderArray_B_size - 6) where
HeaderArray_B contains CONNECTION_ID and APPLICATION
PARAMETERS
HeaderArray_B_Size = 37;

Issue:
Incomplete message listing object is sent in this rare
case.

Root Cause:
Application parameter header size was not taken into
consideration while sending MaxPacketSize when outputstream
(PrivateOutputStream) was created from ServerOperation.

Fix:
Create output stream instance (of ServerOperation) after all
reply headers are created in MAP side. This will set correct
MaxPacketSize in PrivateOutputStream.

Test: After following above steps issue is not seen.

Bug: 69726554
Change-Id: I2ea8864e4ff704935883044929f7d9225f2c47b4
ap/BluetoothMapObexServer.java
8f2c1b8e9d2b6fbc8e74cd2e6e389f00fca71f08 30-Jun-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Serialize closeService to prevent ANR's

Usecase
1) Connect from carkit
2) Perform BT on/off
3) Repeat step(s) 1 and 2 repeatedly multiple times

Issue:
ANR observed on Bluetooth.

Rootcasue:
Issues in map code, explained below

Fix
- Mark MAPService state to stopped while closeService is ongoing.
This will avoid extra shutdown message in stop() and fix a relevant
NPE.
- Do not block for AcceptThread(s) cleanup during shutdown. Fix the
handler thread blocking to handle BT TURN OFF timeout exception.

Test: ANR not obseved after performing above usecase.

Bug: 35013633
Change-Id: I065a13193200d3aa358abe5d82f1343244b05b97
ap/BluetoothMapMasInstance.java
ap/BluetoothMapService.java
957359d03118d958f1eb21e36a442f1ee47edd8c 17-Apr-2017 Hemant Gupta <hemantg@codeaurora.org> PBAP: Sort vCardListing results when order is alphabetic

Usecase:
Send Get request from PBAP client for vCardListing with search
attribute as "number" and order is "alphabetic".

Issue:
vCardListing returned from Pbap Server doesn't follow alphabetic
order.

Root Cause:
Set of values fetched for the given number(Search Value) are ordered
by Contact_ID in the cursor query.

Fix:
Sort the entries alphabetically before writing vCardListing response
if order is set to alphabetic from Pbap client.

Test: After sending alphabetical search, verified that the received vcard
listing was in alphabetical order.

Bug: 37412583
Change-Id: Iff3d1f4aac998ef85b5cef862fd427cb8a57bdb4
bap/BluetoothPbapObexServer.java
721aadecdb5d6aec3a3fc6534de24293cacc83de 05-Dec-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "PBAP: Handle PBAP Disconnection when contacts are not loaded"
am: 444e340b76

Change-Id: Ic77b79bcd7746d0bb4e1e3d8aa52bea00f418164
dd94d2f7e0fae1f22c643d684070a67ed8b3197b 01-Dec-2017 Hansong Zhang <hsz@google.com> Remove BluetoothHidDeviceAppConfiguration (3/4)

Test: HID Device SL4A Test
Bug: 69981563
Merged-In: I68c4cd5663539f7fb56cacd4f5a6613a865f7df1
Change-Id: I68c4cd5663539f7fb56cacd4f5a6613a865f7df1
id/HidDeviceService.java
668166cd4bcfe22a3907409ac771f41512ddbd54 01-Dec-2017 Hemant Gupta <hemantg@codeaurora.org> PBAP: Handle PBAP Disconnection when contacts are not loaded

Usecase:
1) Establish PBAP session.
2) Send Disconnect-Connect before Pbap service message handler
processes LOAD_CONTACT completely.

Issue:
Connect operation after immediate disconnect fails.

Root Cause:
stopObexServerSession is not processed as service message
handler is processing LOAD_CONTACT leading mConAccepted
to be true when next connect is recieved.

Fix:
loadAllContacts() is handled from new thread instead
of main thread.

Test: Checked if PBAP can be connected as per above usecase.

Bug: 66990891
Change-Id: If6fafe166752e5c7c4cded25a112223d4c3d0be9
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
c7d3a6d2c12132e9bc0fa400a04a7c53b1888e8e 04-Dec-2017 Hemant Gupta <hemantg@codeauora.org> Merge "MAP: Add defaults and fix sender_name"
am: 1d750e56dd

Change-Id: I12dd2f6f4c30d030d52d4cc7aabdd5c28a0077b2
94570f31c274fedc71611834d4c4af78d6a7a71e 15-Jun-2016 Hemant Gupta <hemantg@codeauora.org> MAP: Add defaults and fix sender_name

- Correct senderName parameter attribute name to "sender_name".
Add length check to limit the characters allowed for this
attribute value to 256, as per the Spec.
- Set default SMS type to SMS_GSM.
- Set default subject, address values to empty for extended
MNS event report to handle cases for null valued fetched from db.

Test: MAP functionality works fine.

Bug: 35590443
Change-Id: I3dc787dbf420dbab030713c035a16d935ab64149
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
eb9527236a420570c40848ab92035fed066f1b70 02-Dec-2017 Hansong Zhang <hsz@google.com> Merge "HID Device Service: check whether the caller is the registered app"
am: bb397c463c

Change-Id: I1489d9dae93c48ac84075f9b9550cf5103016565
bb397c463cdde5266e8333cfe774398806802f73 02-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "HID Device Service: check whether the caller is the registered app"
5fed27a96f263473e8f4c2d2f2a0b29e5e54aa79 28-Nov-2017 Hansong Zhang <hsz@google.com> HID Device Service: check whether the caller is the registered app

* Checks whether the methods in HID Device service is called by the
registered app. Only the registered app can invoke methods in HID
Device service through binder interface.
* Use Binder.getCallingUid() instead of
BluetoothHidDeviceAppConfiguration to verify the caller.
* Fix HID Device unit tests.

Bug: 63384609
Test: Use 2 HID Device apps. Register one app. Send_report with the
unregistered app

Change-Id: I5cf1509000517ce349112c7bccb2dbe22920c838
id/HidDeviceService.java
4318060e0d9ab5a1234360f7874abdc40d226852 01-Dec-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Add local support for file transfer error text."
am: 5088378c9b

Change-Id: I2e7d4d586d653aa99d95110ed8238287f9659778
f32107c94f3b6389dc18a5c3ede9ffd202e57cd6 01-Dec-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Add local support for file transfer error text.

Usecase:
1) Set Language on DUT to Turkish.
2) Transfer a file > 4GB and observe

Expectation:
Error message if any should be shown in system laguage set on DUT.

Observation:
Error message is displayed in English instead of Turkish

Fix:
Show file limit message through localized version of getString()
instead of as hardcoded item from code.

Test: Checked that error mesage is not displayed in english if DUT
system language is different from english.

Bug: 38186567
Change-Id: I62c1f24696389fe844623573b877b1fd78210f8b
pp/BluetoothOppSendFileInfo.java
1f2bca0939c30177abb56363b7097ab99af62b77 30-Nov-2017 Hansong Zhang <hsz@google.com> Merge "Extract native methods and add unit tests for HID Device"
am: 7c00bc59b9

Change-Id: I171aea6be0ad99dc07da7e017b67f206969e7c06
187c8e9731024304c5907611b03abcb6ab144bec 17-Nov-2017 Hansong Zhang <hsz@google.com> Extract native methods and add unit tests for HID Device

* Isolated JNI native interface in a separate class
HidDeviceNativeInterface so that is can be mocked
when testing HidDeviceService
* Add singleton setter and getter for HidDeviceService
* Use BluetoothDevice object instead of address in HidDeviceService
* Add unit tests for HID Device service

Test: HID Device unit test passes; SL4A test passes
Bug: 69045106
Change-Id: I28cffe1fa1469199d98062b5b52b136697b4cb91
tservice/ServiceFactory.java
id/HidDeviceNativeInterface.java
id/HidDeviceService.java
7b996cc563884d2e4db598e3ffc0dbaff5b8fcd7 29-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "HID: Send Connection change broadcast to all users"
am: cf663af1e5

Change-Id: I4441835b54935af71193c8f41a563d884932f988
036b5f16d90411be69a9e931db20f88c3d80cc9d 28-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> HID: Send Connection change broadcast to all users

Issue Description:
Steps:
1) Create a sub-user and switch to it.
2) Connected to a HID device via BT(Keyboard BKB50).
3) Check the BT icon on the status bar.

Actual Result:
At step 3, BT icon shows the device is not connected.

Expected Result:
At step 3, BT icon shows the device is connected.

Root Cause:
SystemUI can't receive the broadcast of HID connection state change
in sub-user.

Fix:
Use sendBroadcastAsUser() instead of sendBroadcast() for connection
change.

Test: Tested that BT icon shows connected after HID connection.

Bug: 62683719
Change-Id: I9eeac34dd31c7a4acb15d71b8bf8eb4cf97680a2
id/HidHostService.java
ff26640de99d2694a8de4f451a68aea0254e375b 29-Nov-2017 Ajay Panicker <apanicke@google.com> Merge "Add a MediaPlayerWrapper for Google Play Music"
am: f966f24821

Change-Id: Ie0285fe4ab597a063a602f77102fef47f5908ed3
d961c7811a632a467d4ee38ab7ba6469c0fc5ae2 17-Nov-2017 Ajay Panicker <apanicke@google.com> Add a MediaPlayerWrapper for Google Play Music

Google Play music hides metadata behind a special key in a special way.
This class adds a compatibilty wrapper that lets AVRCP retrieve data
from Google Play Music in a standard way.

Bug: 63117921
Test: See that we retrieve metadata from Google Play Music
Change-Id: I8890c9aa8d275b8382d250de57d9cd5f28b84295
ewavrcp/GPMWrapper.java
ewavrcp/MediaPlayerWrapper.java
8b97b42ab58d5bd94ca92ad6f4c567550512d67b 29-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Support only default telephony SMS TYPE"
am: c8086a659c

Change-Id: I428a27eb90adf5a37911aa1bfa2a22f2b6fd4c83
c8086a659c1791fec862356eb0b8752e1b0914b9 29-Nov-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "MAP: Support only default telephony SMS TYPE"
2c99e21c3a59990b1a3ff286276d21db550ee835 29-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Add support for queing same file during ongoing transfer."
am: e3e927908a

Change-Id: Idd9bbb73a57ec574919ad5207cb75c4bc013ae8f
13023df54a20447ca7a1514daa38d28dce3d89d2 29-Nov-2017 Hemant Gupta <hemantg@codeauora.org> Merge "OPP: Clear all BT Notification while switching off BT"
am: 22c3eb6629

Change-Id: I95964870de3c28c4ae1d2ac6a815d974448321ee
e3e927908a6b431a4787ebe3897fe75103a6a333 29-Nov-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Add support for queing same file during ongoing transfer."
22c3eb6629408267753d226c452faa9b4e7d35df 29-Nov-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Clear all BT Notification while switching off BT"
baa410ddef80f415de3e7453703d8763123643ac 30-May-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Support only default telephony SMS TYPE

Precondition:
DUT supports CDMA network.

Usecase:
1) Connect to BMW 2232 Carkit from DUT.
2) Type message on carkit and press send

Expectation:
Carkit displays sending success

Observed Result:
Car kit does not show "sent successfully" notification after SMS was sent.

Root Cause:
Wrong message handle info encoded in pushMessage response for GSM even when DUT
can support only CDMA message type.

Fix:
Use proper encoding for message handle based on DUT supported message type in push
message response.

Test: Carkit can show success for message sent from carkit.

Bug: 35589951
Change-Id: I5e545ff4ab220654f3cabebca5a40e1be5e3745a
ap/BluetoothMapObexServer.java
2f8fdcf88ef785fff8805e00daa21c01a4de79b2 27-Nov-2017 Kai Wang <kwangsudo@google.com> Merge "AvrcpControllerSM update PlayerList"
am: 7afeb98514

Change-Id: I942613dfceb82e9d38afbcbb0a124ca940b460fb
155d7a148b5e9fa02f05dfa5ad46ada2160a4fb9 27-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Only call failPendingMessages() when unlocked"
am: 12193cd2d0

Change-Id: Id0bb2a1d511f8aa4ddabaf3f5737c0f715b80d05
7afeb985144db7b0edf595f973d3dd2bf9d66bf9 27-Nov-2017 Kai Wang <kwangsudo@google.com> Merge "AvrcpControllerSM update PlayerList"
12193cd2d0f8cc37c797dda6ff5d641031263065 27-Nov-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "MAP: Only call failPendingMessages() when unlocked"
e24d24d30a2ce57c3389182aac0fd57c45e49db8 23-Nov-2017 Hemant Gupta <hemantg@codeauora.org> OPP: Clear all BT Notification while switching off BT

Use Case:
1.From a remote, send a file to DUT.
2.The incoming file request is present in notifications menu.
3.Now turn off the BT on the receiver side.

Failure:
Incoming file request is still present even after turning off BT.

Fix:
All BT related notification will be cleared from notification bar while BT is
being turned OFF. Otherwise, incoming file notification will be displayed on
notification bar even though BT is OFF.

Test: Incoming file notifications are removed after BT is turned off.

Bug: 35985175
Change-Id: I03eb47dbba99d3862e79237e085051c641d487e0
pp/BluetoothOppNotification.java
pp/BluetoothOppService.java
2bc9bebe120c038322463513724a1cd560f8dd0e 25-Nov-2017 Ajay Panicker <apanicke@google.com> Merge "Initial commit of MediaPlayerWrapper"
am: 8fed7a4e80

Change-Id: I77702b2c194ca2d301b5a30c1e282c8fb6b27c1b
803f540d100a2d5d966e6017b820cb7ddfc2d813 02-Nov-2017 Ajay Panicker <apanicke@google.com> Initial commit of MediaPlayerWrapper

MediaPlayerWrapper is the compatibility layer for the updated AVRCP
profile. This patch implements a class that ensures that Media Updates
from a Media Player are consistent and all information is synced.

Bug: 68854188
Test: "runtest bluetooth -c com.android.bluetooth.avrcp.MediaPlayerWrapperTest"

Change-Id: If19579d77ae7a0900b08cd47be2da3065752694e
ewavrcp/MediaPlayerWrapper.java
9e4c6effb9f73a1a68972223462ee9b29d9f2f51 22-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "PBAP: Handle '-' in TEL field properly when custom TAG is used."
am: ec5908df29

Change-Id: Ia05d2efe67e30bde8a5d0b7f3c75e9651e65caf3
42affe355c7bd687bc42602e21ee6e3c4ecd1fb6 16-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> PBAP: Handle '-' in TEL field properly when custom TAG is used.

Precondition:
DUT has some contacts stored along with phonenumber(s) stored
with custom tag option.

Usecase:
1) Connect with carkit supporting PBAP
2) Send download phonebook from carkit

Expectation:
Carkit is able to show all phonebook contacts and numbers stored on DUT

Observation:
Carkit is unable to show some phonenumbers stored with custom tag option.

Issue:
For Contacts with custom Tel field, "-" is deleted from tag syntax.
Proper Format: X-TAG:<TEL_Number>
Received Format : XTAG:<TEL_Number>

Issue:
For Contacts with custom Tel field, "-" is deleted from tag syntax.
Proper Format: X-TAG:<TEL_Number>

Root Cause:
"-" is getting deleted from TEL number and "X-TAG" as well when
custom tag is used for contact.

Fix:
remove "-" only from TEL number without removing it from "X-TAG".

Test: Tested that carkit is able to show all contacts/numbers properly
stored even with custom fields.

Bug: 37712333
Change-Id: Id4cafa5de44e90a215c18053c872e9b40792eba3
bap/BluetoothPbapVcardManager.java
7bc8a862843040d5f40b0a92a28d701ed2afe6ef 20-Nov-2017 Jack He <siyuanh@google.com> Merge "Extract dependencies for HeadsetStateMachine"
am: c0fdf23a6e

Change-Id: Idd21374124b235f1412e2e39ce235ac0e8d59e6f
0420b4fe3c7794139218821fab49f7f149d0075e 08-Nov-2017 Jack He <siyuanh@google.com> Extract dependencies for HeadsetStateMachine

* Isolated JNI native interface in a separate class
HeadsetNativeInterface so that is can be mocked when testing
HeadsetStateMachine
* Moved HeadsetStateMachine.StackEvent out as HeadsetStackEvent
* Restructured create(), start(), stop() and cleanup() methods in
HeadsetService to create looper from a handler thread instead of using
looper from main thread
* Added Javadoc to create, start, stop, and cleanup methods in
ProfileService

Bug: 69005831
Test: runtest -j40 bluetooth
Change-Id: I7f68f734281415290ca5ca7fab8b20a6ee4a59fc
tservice/ProfileService.java
fp/AtPhonebook.java
fp/HeadsetNativeInterface.java
fp/HeadsetService.java
fp/HeadsetStackEvent.java
fp/HeadsetStateMachine.java
5e59090acf38cd8cc2041f2a6d9db765732f40c3 18-Nov-2017 kai <kwangsudo@google.com> AvrcpControllerSM update PlayerList

Update the PlayerList when we got Track_Changed.

Bug: 67604427
Test: 1 Pair phone with Mojave, play music from Google Play Music
check the music app name
2 Streaming music from other Music apps, open drawer check
music app name

Change-Id: I657fe88f73dd85598a9e51147ff6eed9f151cbdf
(cherry picked from commit 30cd7c70a5ed9059a72a390111cc8719a285df36)
vrcpcontroller/AvrcpControllerStateMachine.java
a0754856fa0a20cd8a39990683930a97d74f0041 17-Nov-2017 Hansong Zhang <hsz@google.com> Merge "PBAP: remove dead code"
am: 73a15aac4a

Change-Id: I5968983c53a08df05e02799d5a629655665dfebd
efc3244d37cb023546da52ded805efd004b4a65e 16-Nov-2017 Hansong Zhang <hsz@google.com> PBAP: remove dead code

* SocketAcceptThread, and its helper method initSocket(),
closeServerSocket(), are never used.
* Private method setUserTimeoutAlarm() is never used.
* Private fields mRemoveTimeoutMsg, mPermission, mSdpSearchInitiated,
mIsRegisteredObserver are never used.

Bug: 69417672
Test: Test with carkits supporting PBAP. Functioinality should be
unchanged.

Change-Id: I8a0051dbf3e80e9b1c873fd38b97d88e5cfc5dec
bap/BluetoothPbapService.java
4f729983b79023a42a84a124248cc2fd39b51d0e 03-Dec-2015 Hemant Gupta <hemantg@codeaurora.org> OPP: Add support for queing same file during ongoing transfer.

Steps:
1. Push a file from DUT to remote.
2. while transfer is ongoing, try to push the same file
to some other remote.

Failure:
Pop up displayed Unkown file not sent.

Fix:
Add support to send same file multiple times. Otherwise,if
same file is queued for sending after first transfer succeeds
queued instances of the same file gets removed and error is shown
as failed to send the file.

Test: Same file can be transferred successfully if queued during active
ongoing transfer.

Bug: 35014157
Change-Id: Ic86277b4e28a93481c3b89e65644878bd644e6ff
pp/BluetoothOppManager.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppUtility.java
3dd06c4b8bdac390a6c42f11f1f6a68d8c4f14c0 17-May-2017 Hemant Gupta <hemantg@codeaurora.org> MAP: Only call failPendingMessages() when unlocked

Usecase:
1) Enable Direct boot mode in DUT.
2) Reboot DUT and connect to remote device in Locked state.
3) Disconnect from remote device(with failed pending messages).

Issue:
Exception while moving pending messages from outbox to failed.

Root Cause:
As database is not accessible in Direct Boot Mode, it results in
fatal exception while trying to move messages from outbox to failed
when remote disconnects and DUT is still not unlocked.

Fix:
Prevent failPendingMessages if device is not unlocked in Direct
Boot Mode.

Test: Checked if BT does not crash during remote disconnection in
direct boot mode

Bug: 38382980
Change-Id: I616ed3bfb2e390c420658b8927de547ad70d1bea
ap/BluetoothMapContentObserver.java
d98a04fbf989bcc62088f11addd672513668508f 15-Nov-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Update the codec-related JNI calls to contain the remote Device address"
am: 7c4334cbff

Change-Id: Iee055c5c7b5b035ebcd2bfc93d80a87fc4fdc973
daa23c048664f885ffdf9b3baf52261409ec3f0c 15-Nov-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Clean up A2DP State Machine"
am: 428f760bac

Change-Id: I27c2aa0bc09295ed55c29be5971f6ea615462022
1a5532f2043cc2eaf136a35eace240f8bebd9bbe 10-Nov-2017 Pavlin Radoslavov <pavlin@google.com> Update the codec-related JNI calls to contain the remote Device address

Also, normalize the order of the A2DP-related JNI callbacks to
list the remote device address first.

Bug: 68993365
Test: Manual - A2DP streaming to headset
Change-Id: I7a64f6cac4dabfbc2f5c36f96f8c36ba162948ac
2dp/A2dpNativeInterface.java
2dp/A2dpService.java
2dp/A2dpStackEvent.java
2dp/A2dpStateMachine.java
2dpsink/A2dpSinkStateMachine.java
9bc5f45cf286ad42d48bee2c3f3bfebb859748cf 07-Nov-2017 Pavlin Radoslavov <pavlin@google.com> Clean up A2DP State Machine

* Cleaned up existing A2dpStateMachine class and added extra logs
* Isolated JNI native interface in a separate class A2dpNativeInterface
so it is easier to mock it
* Moved StackEvent related info to a separate class A2dpStackEvent
* Added unit tests for the A2DP State Machine

Bug: 68993365
Test: Unit tests added; Manual: A2DP connect/disconnect/streaming
Change-Id: I6e3441fd4f453f5a200e661461feb407d4d2150e
2dp/A2dpNativeInterface.java
2dp/A2dpService.java
2dp/A2dpStackEvent.java
2dp/A2dpStateMachine.java
2a6413656e017115b4c59cd660719e5a40a28f8e 14-Nov-2017 Myles Watson <mylesgw@google.com> Merge "Revert "OPP: Clear all BT Notification while switching off BT""
am: 3eab96c29a

Change-Id: Ib5e2330a44054e2cecd6280e79b42296797d6ec1
37e938e3f8798634105b2aeba6879a38eaa99946 14-Nov-2017 Myles Watson <mylesgw@google.com> Revert "OPP: Clear all BT Notification while switching off BT"

This reverts commit 8c56e99172602022edb4f3e8c6fb1d64c0728a71.

Bug: 69311866
Change-Id: Ia12779d6486803931be3662e56310b5f178a02b8
pp/BluetoothOppNotification.java
pp/BluetoothOppService.java
ead1fcca9ad71b0a4cfb7751228a01a7d9133b99 14-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Clear all BT Notification while switching off BT"
am: d939391582

Change-Id: I30ee84a03426b13a3bc3e86e159980a49eba5b6e
58181ad911e64c1b66cf42b3a0b41c592ce7d9c3 14-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Show remote device local (Alias) name."
am: 3cee899ee5

Change-Id: I755bd9467776704148ffd8784a28e0cd714f76ed
d9393915825e0928ef43ebcbf9c13485de93b579 14-Nov-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Clear all BT Notification while switching off BT"
84df5050bb2db34b9caeb67774caf3896a22c30f 01-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Show remote device local (Alias) name.

Steps:
1) Pair sender (Remote) and Receiver (DUT) devices.
2) On Receiver device (DUT) rename paired device "sender" to "sendername"
3) From sender device (Remote), send file via OPP to Receiver (DUT).
4) Check OPP Notification on Receiver device (DUT).

Failure:
Device displayed incoming request from "sender".

Expected result:
The device should display incoming request from "sendername".

Fix:
Show remote device alias name if available.

Test: DUT displayed modified name with above change.
Bug: 68739798
Change-Id: Ie2c6363b24fbbf78d5aee4088791c183fc934ef9
pp/BluetoothOppManager.java
f15674e8ec14066b4b1fd33199916dda78ea74b5 14-Nov-2017 xutianguo <xutianguo@xiaomi.com> Merge "GATT: Fix NoSuchElementException when flush batch scan results"
am: be12cf72a0

Change-Id: Ibb89ed7abe6be85c09bcf0f29df543aef7b8a384
8c56e99172602022edb4f3e8c6fb1d64c0728a71 06-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Clear all BT Notification while switching off BT

Use Case:
1.From a remote, send a file to DUT.
2.The incoming file request is present in notifications menu.
3.Now turn off the BT on the receiver side.

Failure:
Incoming file request is still present even after turning off BT.

Fix:
All BT related notification will be cleared from notification bar while BT is
being turned OFF. Otherwise, incoming file notification will be displayed on
notification bar even though BT is OFF.

Test: Incoming file notifications are removed after BT is turned off.

Bug: 35985175
Change-Id: Ib501eb1241668436dc0ff995e61885d481636258
pp/BluetoothOppNotification.java
pp/BluetoothOppService.java
28764ee0ea018e857363a5381748fa1af4a3ed70 02-Nov-2017 xutianguo <xutianguo@xiaomi.com> GATT: Fix NoSuchElementException when flush batch scan results

Should check batch clients sets iterator has next element or
not before invoke the next method.

Test: Turn on Bluetooth and search BLE devices

Change-Id: I9f6a21f5b1a3a444f84154686bd62b40efee38d0
Signed-off-by: xutianguo <xutianguo@xiaomi.com>
att/ScanManager.java
8b640dbf504a9cd363b75109b9c01ae128069ae7 13-Nov-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFP client status update"
am: 90fd76498d

Change-Id: I87233b7b3d714c43e571fc09bdbed8c3a1b7db0b
90fd76498d9e7d7e12310f437dac60132ec36a04 13-Nov-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFP client status update"
4175986bc90c2dc3d9ff773ffa8533e17204dc02 09-Nov-2017 Joseph Pirozzo <pirozzoj@google.com> HFP client status update

When call events happen request the updated status from the Audio
Gateway immediately rather than waiting until a preset timer has
expired.

Bug: 68884780
Test: runtest bluetooth; make and end phonecalls and verify that the
UI updates promptly.

Change-Id: I619fbc447d53fc87af55b2616f9258dde399b1e7
(cherry picked from commit 7e00a402b76c9167784fe90c6d24fc88c42f5c5b)
fpclient/HeadsetClientStateMachine.java
752bf3306322a060168db3fd37579ce5adc9fce6 11-Nov-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Move connectSocket into IBluetoothSocketManager (2/3)"
am: 66643fc5d9

Change-Id: I3c0ee48e3fc5dbeb30b47f39a0c20a322ccf449b
b55d95722f214cc5221d5821224f3b9191f2257c 06-Nov-2017 Jakub Pawlowski <jpawlowski@google.com> Move connectSocket into IBluetoothSocketManager (2/3)

Bug: 68359837
Test: none
Merged-In: I90d7d0bfe52eaf1c77b2733d1c2a6a714417b0bc
Change-Id: I90d7d0bfe52eaf1c77b2733d1c2a6a714417b0bc
tservice/AdapterService.java
8dca5befbb9822e533cb38a6e7b058b8390a79f2 10-Nov-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Move createSocketChannel into IBluetoothSocketManager (2/3)"
am: 1d3a645a23

Change-Id: I00a4b5fec9a44bd9b36dc9c7eac59a26d97024ed
1d3a645a232afb98e25e03b614332ca6f9738bfd 10-Nov-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Move createSocketChannel into IBluetoothSocketManager (2/3)"
ad4a7e332ac93c60bb7d7a79b7abcbaf6fe471d5 09-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "SAP : Prevent crash during turn on Airplane mode"
am: d5ce422276

Change-Id: I3b5b28fc7ef2cf6684d5b19a8acd33fb419980c4
cd8a16d63059d6d901faea637c8dfbc133123c6f 09-Nov-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Add IBluetoothSocketManager (2/3)"
am: ed7050fad3

Change-Id: I081f3d4a4fca84b8136cb53b4fa013caf3450ac0
d5ce422276d2582258248fa0b0c1bf0aa6bcb83e 09-Nov-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "SAP : Prevent crash during turn on Airplane mode"
ad311b268c0467cc5e6860ac6660da24385a4dc7 04-Nov-2017 Jakub Pawlowski <jpawlowski@google.com> Move createSocketChannel into IBluetoothSocketManager (2/3)

Bug: 68359837
Test: none
Change-Id: I14c75be60a31302140d4041a505e9cd1c7ed4d22
tservice/AdapterService.java
ed7050fad3d3e180fff90770644c3ccab42374b4 09-Nov-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Add IBluetoothSocketManager (2/3)"
82f53b59fdf51133c20fb0d091c8394f6cd6d539 09-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "SAP: Handle disconnect indication message type properly"
am: 6c9f0e678a

Change-Id: Ic17aa7c1be77e00161e7b4fce69826562e7ab6db
6efa0b49242a7d2b8ed3539fa72c89cd1d55858d 09-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Clear Ongoing Notification after transfer complete."
am: 48b93b3112

Change-Id: I3067c0975324f1d5c2e31f4368a55df0dea1487e
a52920f84d778d68fe737d6569f017fae48198c8 01-Jun-2017 Hemant Gupta <hemantg@codeaurora.org> SAP : Prevent crash during turn on Airplane mode

Use Case:
1. Initiate SAP connection from Remote Device.
2. Turn on Airplane mode to disable BT when SAP Client
is connected on DUT.
3. Repeat steps 1 and 2.

Error log :

Line 16: 03-13 13:57:31.559 3368 3569 V SapServer: in sendDisconnectInd()
Line 17: 03-13 13:57:31.559 3368 3569 D SapServer: Cleaning up before force disconnecting rfcomm
Line 19: 03-13 13:57:31.559 3368 3569 D SapServer: Waiting for deinit to complete
Line 20: 03-13 13:57:31.563 3368 3386 W BluetoothAdapterService: setProfileServiceState() -
Stopping service com.android.bluetooth.sap.SapService
Line 33: 03-13 13:57:31.936 3368 3368 W BluetoothAdapterService: onProfileServiceStateChange() -
Profile still running: com.android.bluetooth.sap.SapService
Line 34: 03-13 13:57:31.937 3368 3368 W BluetoothAdapterService: onProfileServiceStateChange()
serviceName=com.android.bluetooth.sap.SapService, state=10, doUpdate=true
Line 42: 03-13 13:57:32.310 3368 3569 E AndroidRuntime: java.lang.IllegalArgumentException:
Receiver not registered: com.android.bluetooth.sap.SapServer$1@dbf974b
Line 46: 03-13 13:57:32.310 3368 3569 E AndroidRuntime: at com.android.bluetooth.sap.
SapServer.run(SapServer.java:463)
Line 46: 03-13 13:57:32.310 3368 3569 E AndroidRuntime: at com.android.bluetooth.sap.
SapServer.run(SapServer.java:463)
Line 46: 03-13 13:57:32.310 3368 3569 E AndroidRuntime: at com.android.bluetooth.sap.
SapServer.run(SapServer.java:463)

Failure:
"Unfortunately, Bluetooth share has stopped" error comes.

Root cause :
RIL Deinit is not completed because of un-expected turn of BT.

Fix:
Decrement the count of the latch, to release all waiting threads
when BT is turned off during active sap connection.

Test: Checked manually if no crash in BT as per above usecase.

Bug: 62411305
Change-Id: Ib36430c56935efa9de5ce7f8b18eddc9cea47662
ap/SapServer.java
6c9f0e678aa707dbf8d6424a54f57bf4ec35b28f 09-Nov-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "SAP: Handle disconnect indication message type properly"
0eab1c87e9a0b26e3f61dcc46681a0a20f9cb745 03-Nov-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Clear Ongoing Notification after transfer complete.

Use Case:
1.Push any file from BM3 dongle to DUT.
2.Accept it on DUT and let the transfer begin.

Error:
Drag down the notification bar and notice that even after
the file is transferred, progress is stuck at 99%.

Root cause:
In Android O clearing of ongoing notification is done on reception of
disconnect from remote. Since BM3 as remote device does not disconnect the
OPP connection, progress bar is stuck at 99%.

Fix:
Clear ongoing notification after file sent successfully without waiting
disconnect request to prevent abnormal UI behaviour.

Test: Issue is not reproducible after stress testing with above change.
Bug: 68832852
Change-Id: Ic514af19de1d554f9299c5daf74fc0d046a67009
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppUtility.java
b9222dd963d4695ce6f3b727eef4b9cbe4a978cd 23-Jun-2017 Hemant Gupta <hemantg@codeaurora.org> SAP: Handle disconnect indication message type properly

Usecase:
1) Connect DUT with Mecapp PC App supporting SAP
2) When SAP is connected, remove SIM card on DUT.

Expected Behaviour:
DUT should send disconnect indication to remote device

Observed behaviour:
DUT not sending disconnect indication to remote device

Root Cause:
DUT is not handling the message type for disconnection received
from RIL layer properly.

Fix:
Use correct message type for disconnect indication from RIL in
handleRilInd() API
(SapMessage.ID_DISCONNECT_IND -> SapMessage.ID_RIL_UNSOL_DISCONNECT_IND).

Test: Checked if disconnect indication is sent out when SIM card is removed.
Bug: 62937720
Change-Id: Ib63b7290d9f7c7af57ee25401d5bcfb7ba600b07
ap/SapMessage.java
ap/SapServer.java
6ee073644c93b2b184f7c9031e8074d28fb70af1 09-Nov-2017 Jakub Pawlowski <jpawlowski@google.com> Merge changes I66e611a3,I9e1dbcf4
am: 4e0ec9cb48

Change-Id: I34bbe37cccc7d254bfc4ab8381d3f13b5b9610cc
80eeb8f531f05c8badf305b575cfd00113e1cb35 01-Nov-2017 Jakub Pawlowski <jpawlowski@google.com> Add IBluetoothSocketManager (2/3)

Add IBluetoothSocketManager native Binder implementation. Thanks to it
we'll skip jni to native calls, and need to re-serialize data manually.

Bug: 68359837
Test: none
Change-Id: I83fef2749ba8fd6a157869b0987d19daee061156
tservice/AdapterService.java
4e0ec9cb48f3656c6f96e20150c604ab462777fc 09-Nov-2017 Jakub Pawlowski <jpawlowski@google.com> Merge changes I66e611a3,I9e1dbcf4

* changes:
Add permission helpers for native Binder
Cache foreground user, rather than obtaining it on each call
ba4466d521ba27015e6742d80c4176b032ba4cdb 09-Nov-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFP-Client: Set current device to null after firing broadcast"
am: 9bd9a73f5b

Change-Id: I7a81c7a0220a57f472b02a7006380fcf8abfc3c1
58cdc21bcdc90adb8f8dd629881a192ad26c977b 09-Nov-2017 Jack He <siyuanh@google.com> HFP-Client: Set current device to null after firing broadcast

* Otherwise, the device in the broadcast will be null

Bug: 68722902
Test: runtest bluetooth
Change-Id: Ie3c97b46c3188376eea562252cbb6a84f71cb4f5
fpclient/HeadsetClientStateMachine.java
d717e1a925cce9e7ca45c5fc4ed7a36e28aaa16d 04-Nov-2017 Jakub Pawlowski <jpawlowski@google.com> Add permission helpers for native Binder

These will be used in upcoming patches, implementing native Binder
methods.

Bug: 68359837
Test: compilation
Change-Id: I66e611a3cf1b0411c03f4eb9416272b8e18ae270
tservice/AdapterService.java
3f20771a830a5f33a33168abfc6345782304d890 02-Nov-2017 Jakub Pawlowski <jpawlowski@google.com> Cache foreground user, rather than obtaining it on each call

Bug: 68359837
Test: enable bluetooth, switch user, enable/disable bluetooth
Change-Id: I9e1dbcf44aee1d07cb37d4ded3eb8f3076d4a24d
tils.java
tservice/AdapterService.java
dfc313aebd0ad1c73130acc128337d7594169f5a 07-Nov-2017 Xin Li <delphij@google.com> Merge commit '1f487b182c495da40a404bcc1ce04763a45a50ca' from
oc-mr1-dev-plus-aosp into stage-aosp-master

Change-Id: I30866e08761de3375fbf589aeb84a5142838242c
b4db71d3822ccf252fe09a7490f532c3b4fadd0c 06-Nov-2017 Pavlin Radoslavov <pavlin@google.com> Remove executable file mode bit from source code files

Test: Code compilation
Change-Id: I4fb1648607dda9c647ab6cd771a59db0caf9b5b2
2dp/A2dpService.java
2dp/A2dpStateMachine.java
fp/AtPhonebook.java
fpclient/HeadsetClientStateMachine.java
ap/BluetoothMapUtils.java
an/PanService.java
2d31ea65ce41b5d41f20fa144cc0dd7844e4cb3b 07-Jun-2017 Hemant Gupta <hemantg@codeaurora.org> SAP: Prevent leak during turn off BT

Use Case:
1. Initiate SAP connection and disconnection from Remote Device.
2. Do this for 3-4 times
3. Do BT off, and check logs.

Error leak:
JHwRemoteBinder: BinderProxy is being destroyed but the application did not call unlinkToDeath to
unlink all of its death recipients beforehand. Releasing leaked death recipient:
com.android.bluetooth.sap.SapRilReceiver$SapProxyDeathRecipient
BluetoothAdapterService: handleMessage() - Message: 1
BluetoothAdapterService: handleMessage() - MESSAGE_PROFILE_SERVICE_STATE_CHANGED
BluetoothAdapterService: processProfileServiceStateChanged() - serviceName=com.android.bluetooth.
sap.SapService isTurningOn=false isTurningOff=true isBleTurningOn=false isBleTurningOff=false

Failure:
"Observed SAP Binder related leaks in log cat logs".

Fix:
Unlink previously linked death notification to avoid leak
in profile

Test: Checked after the above usecase to see if no memory leak error is seen in logs.

Bug: 62412151
Change-Id: Ic2a4d96c0a30c45eca08a65921693b386a193d69
ap/SapRilReceiver.java
ca5c3a3e1cbc19fd1d4dafc6349ee690567880e7 03-Nov-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Fix PhonePolicyTest timeout"
928f14463ee51192039abef856495ecce418fe01 03-Nov-2017 Jack He <siyuanh@google.com> Fix PhonePolicyTest timeout

* PhonePolicyTest used to run too long (26 seconds plus) because it
needs to wait for the reconnect timeout
* This CL fixes the test by
1) Moving common setup code into setUp() method
2) Using TestLooperManager to manually execute delayed handler
messages immediately after they are posted

Bug: 68818803
Test: runtest -i -j40 bluetooth; adb shell am instrument -w -e
timeout_msec 300000 -e class
'com.android.bluetooth.btservice.PhonePolicyTest'
'com.android.bluetooth.tests/android.support.test.runner.AndroidJUnitRunner'
Change-Id: I4789e3427e1a5729be6f620d39da539f76767e57
tservice/PhonePolicy.java
613b895140fe8fed5797a2fa30d26735a21c1bfb 02-Nov-2017 Jakub Pawlowski <jpawlowski@google.com> Simplify checkCaller

com.android.systemui uid is not changing, it's enough to get it once.

Bug: 68359837
Test: compilation
Change-Id: I1d33179c08b62b4e3b0739d5e68b2d1bbfe1cc7a
tils.java
tservice/AdapterService.java
2ffecf58d83814027d33ff84d026277fac050199 01-Nov-2017 Joseph Pirozzo <pirozzoj@google.com> Conference Call at connection

If there is an ongoing conference call at Bluetooth HFP connect make
sure that it gets registered with telecom.

Bug: 35423819
Bug: 67034276
Test: start a conference call then connect Bluetooth.
Change-Id: I8ca42769e16b6cf2b15aa87747ff01fbf5918220
(cherry picked from commit f9badc6f621c4b48bb624aff59b89f6d3a9bda0a)
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/HfpClientDeviceBlock.java
fd46302a0c065a0454368045f43cf92874d0026a 01-Nov-2017 Jack He <siyuanh@google.com> Fix bugs uncovered by HeadsetClientStateMachineTest

* State change broadcast should always happen after actual state
transitions. Therefore, state change broadcast should only happen in
enter() and exit() methods of states, except when no actual state
transition is involved. Otherwise, there is a race condition between
state change broadcast and actual state transition. If user of state
machine sends message for new state indicated by the broadcast, the
state machine may still be in previous state and hence result is
undefined depending on timing condition.
* This CL fixes this issue by moving all state
change broadcasts to enter() and exit() methods of individual states
and log previous state in exit()
* Also, messages that are supposed to be executed in the next state
should be sent using deferMessage() instead of sending message after
transitionTo() is called
* Remove some unused variables from HeadsetClientStateMachine
* Unified HeadsetClientStateMachine.start()/stop() into setUp() and
tearDown() methods in HeadsetClientStateMachineTest
* Fixed testIncomingPriorityAccept to keep up with recent change:
I6c5a7ee9eb4e10f5f649794546acde5ec4b297aa
* Use explicit intent matcher instead of matching any intents for the
above fixed test

Bug: 68722902
Test: build, run unit tests
Change-Id: Iccbaec9df0abfc9136e5b86b450151b13b45cfa7
fpclient/HeadsetClientStateMachine.java
dd8a4734c111521f87f9770753d20e90db3f8f10 31-Oct-2017 Jack He <siyuanh@google.com> Test: Fix broken tests in RemoteDevicesTest

* Refactor RemoteDevices.java to apply dependency injection design
pattern: User an explicity looper passed through the class constructor
so that a user of the class can choose which thread it runs on
* By default, it runs on the main service thread in AdapterService.java
* During test, it runs on a HanlderThread created during the test
* A TestLooperManager is used to mannually intercept and execute
messages on the handler to guarantee timing consistency

Bug: 67942165
Test: runtest -i -j40 bluetooth; adb shell am instrument -w -e timeout_msec 300000
'com.android.bluetooth.tests/android.support.test.runner.AndroidJUnitRunne

Change-Id: Ieab21b428e74eb84766a7be835d1bf07471743bc
tservice/AdapterService.java
tservice/RemoteDevices.java
407f643240e288dac33eb7663e1909b45909eb45 30-Oct-2017 Hemant Gupta <hemantg@codeauora.org> MAP: Fix IOT specific msgListing issue with BenzCarkit.

Benz NTG4.5 carkit in MCE role fail to list messages
when Messages-Listing XML object include standalone,
encoding and xml version flags in the beginning of
final XML output.
Add a IOT specific check to remove these flags before
responding with final messagesList from MSE.

Test: IOT issues are not observed with specific carkits and normal MAP
functioanlity works fine with non blacklisted devices.

Bug: 34960344

Change-Id: I4d0d6e4a86538a04a576c7d138a85ed5233b4cf3
eviceWorkArounds.java
ap/BluetoothMapMessageListing.java
ap/BluetoothMapMessageListingElement.java
aea575cd13d20cae7761a7dd3e6c3e32666f061f 06-Jul-2017 Hemant Gupta <hemantg@codeaurora.org> MAP: Fix to handle crash when transparent flag is set.

Usecase:
1) Establish MAP session with Event Notification ON.
2) send message from carkit with transparent flag set
to true

Issue:
Bluetooth crashes while deleting message when transparent
flag is set.

Root Cause:
content resolver is unable to get provider to
delete message at specified uri.

Fix:
Modify the message uri to be deleted to SMS content URI
as follows
Format: "content://sms/<sms_index>"

Test: Checked if no crash after performing above usecase.

Bug: 63550557
Change-Id: Ifc3e563fc9574c2f9d11128a3c6be2a6e741bfb0
ap/BluetoothMapContentObserver.java
bbf12fd9e5f4b7b48a8569756abc73c15fa4b929 27-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Enable HID Device Profile Service (1/2)"
26a83b09cd5b88de193008d35982603ef72afe0e 27-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "MAP: Handle following IOT Specific or remote issues :"
b718113e8a88cbf386e15226929a740fa1969b7c 14-May-2015 Hemant Gupta <hemantg@codeaurora.org> MAP: Handle following IOT Specific or remote issues :

- Fix Message Display issue with PCM carkit.
PCM carkit is unable to parse message if carriage
return(\r) is present in it and displaying
incomplete message. Add change to remove carriage
return (\r) from message to fix this IOT issue.

- Fix Message Display issue with FORD SYNC carkit.
FORD SYNC carkit is unable to parse message if line
feed (\n) is present in it and displaying incomplete
message. Add change to remove line feed (\n) from
message and keep only carriage return (\r) in the
message, to fix this IOT issue.

- Fix Subject Display issue with HONDA Carkit.
Honda Carkit always masks subject field in message
listing and hence always shows a blank subject in UI.
Add change to always send subject field in Messagelisting
for honda carkit,so that it can show proper subject fields
in UI and better user experience.

- Fix Message Display issue with SYNC carkit.
SYNC carkit is unable to parse message if line feed
('\n') is present in the message body end. It can
parse line feed's present in the middle of the message
body. Add change to remove trailing line feed (\n)
present in the message body, to fix this IOT issue.

- Fix Message Display issue with Brezza ZDI carkit.
Brezza ZDI carkit is unable to parse message if &amp; &lt;
and &gt; are present in the message body.
Add change to replace them by &, < and > resp. in the message body,
to fix this IOT issue.

Test: IOT issues are not observed with specific carkits and normal MAP
functioanlity works fine with non blacklisted devices.

Bug: 34960344
Change-Id: Ieaf257095875fadb0ae46dc91b4e1e79aaf9931c
eviceWorkArounds.java
ap/BluetoothMapContent.java
ap/BluetoothMapMessageListing.java
ap/BluetoothMapbMessageSms.java
3cba84487d81edf42befb0b3238fc879cbc27f92 27-Sep-2017 Hansong Zhang <hsz@google.com> Enable HID Device Profile Service (1/2)

* Enable the HID device profile service. The service is implemented in
the native Bluetooth stack.

* Change the behavior of HidDevService.onUnbind(). It also unregisters
the app.

Bug: 63384609
Test: Build. Test with SL4A.

Change-Id: I185d52bcf3f74a9abfc9ed28259a0495c5f0f56e
id/HidDeviceService.java
c7a435888cc32e220af87bbf3eedb184699ff331 11-May-2017 Hemant Gupta <hemantg@codeaurora.org> PBAP: Send correct Get response when storage is locked.

Precondition:
1) DUT is in Direct Boot mode, and user has not unlocked.
2) DUT is connected to carkit supporting PBAP

Usecase:
Carkit sends request for get phonebook size or get phonebook.

Expected Result:
DUT should return error as Service unavailable as per BT PBAP Spec,
instead of sending 0 as length of phonebook, or sending xml with
no vcard in above usecase.

Observed behaviour:
DUT sends 0 as length of phonebook, and sends empty xml for phonebook request.

Fix:
During get request from carkit, return OBEX_SERVICE_UNAVAILABLE error if DUT is in
direct boot mode.

Test: Checked if error code is sent out when storage is not accessible in Direct
boot mode.

Bug: 38302549
Change-Id: I906cf7cef5caf650d0bea6bdf0ff71100ecf761a
bap/BluetoothPbapObexServer.java
619d303daecea9d34c433c32efcba09c0b71c129 27-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Close InputStream properly"
9aa080c0f33ade89998ed7c4c95bec1174e67fa5 27-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Rename Bluetooth HID Service"
f0429c92669aa388785a97f00985d63a83e509c2 26-Oct-2017 Hansong Zhang <hsz@google.com> Rename Bluetooth HID Service

Rename the Bluetooth HID Host and Device Service to make them more
clear. Also change the corresponding name for jni and config values.

Service:
HidService -> HidHostService
HidDevService -> HidDeviceService

JNI:
com_android_bluetooth_hid -> com_android_bluetooth_hid_host
com_android_bluetooth_hidd -> com_android_bluetooth_hid_device

res/values/config.xml:
profile_supported_hid -> profile_supported_hid_host
profile_supported_hidd -> profile_supported_hid_device

Test: with devices using HID Service.
Bug: 68055651

Change-Id: I8b51a923a31fb3baab599537c942d933f859b41f
tservice/BondStateMachine.java
tservice/Config.java
tservice/PhonePolicy.java
tservice/ServiceFactory.java
id/HidDevService.java
id/HidDeviceService.java
id/HidHostService.java
id/HidService.java
b33347d9a646229340570f160cb1ffa3e3099902 04-May-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Update batch status when sdp failed

Use case:
1) Pair with remote device
2) Turn off Bluetooth of the remote device
2) From the DUT send a file to device from the
list of Paired device.

Failure:
Failure:
There is no error message poped up on the phone for failure of transfer.
Even after turning on the BT on the remote device resend the file still can
NOT send successfully unless Turn off and on the Bluetooth on the phone.

Reproducibility : 5/5

Fix:
Update the current batch status as failed when receive invalid sdp
record and send transfer complete event with status as failure.

Test: Checked if file sending is successful after remote device is turned back on
after initial failed transfer and user gets notificaiton of failure.

Bug: 37978462
Change-Id: I02581ee779624b17e7deedaaacaf91922c47f70c
pp/BluetoothOppTransfer.java
14b2caf25dc463d43f387b80fe1aaab5a5532ac8 01-May-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Close InputStream properly

Use case :
1. Select many files and sent to remote device.
2. Donot accept the files on remote device and let
it timeout.

Failure:
Client didn`t close the input stream.

Root Cause:
While closing output stream, I/O Error occurs because of
timeout which in turn leads remote device to close transport
and thereby preventing DUT from closing the FD.

Fix:
Catch Exception in closing OutputStream, and proceed with closing
File Info to prevent leak.

Test: Tried to send file and check if file is closed properly
during timeout exception preventing any FD leak.

Bug: 37838688
Change-Id: I0499e95e010814a3de49f16de8ce563c5515e991
pp/BluetoothOppObexClientSession.java
fb7244393f6f3c14045d726e3c958403a7392519 25-Oct-2017 Pavlin Radoslavov <pavlin@google.com> AVRCP: Print more info for Absolute Volume Control blacklist

The AVRCP runtime blacklisted devices for absolute volume control
are printed in the bluetooth_manager dumpsys section with extra info:
the date and the reason the device was blacklisted:

AVRCP:
...
Runtime Blacklisted Devices (absolute volume):
XX:XX:XX:XX:XX:XX Time: 2017/10/24 18:22:00 Reason: MSG_ADJUST_VOLUME

The reason can be:
- MSG_ADJUST_VOLUME
- MSG_SET_ABSOLUTE_VOLUME
- MSG_ABS_VOL_TIMEOUT

If a device was blacklisted before this change, the reason is printed
as "Unknown":
YY:YY:YY:YY:YY:YY Reason: Unknown

Bug: 63480852
Test: Manual
Change-Id: I0e6e95029d7b6d6754f0575673357da4f729fd15
vrcp/Avrcp.java
ded973620f204f11f20d40928735a4d87e00afed 18-Sep-2017 Hansong Zhang <hsz@google.com> AVRCP: Thread-safe mHandler invocation

* Handler object may become null between null check and actual
invocation if using an instance private variable.

* The solution to this problem without locking is to assign existing
handler variable to a local final variable before the null check.

* Make sure that handler is not null before invoking the handler.

* In AvrcpMessageHandler.handleMessage(), replace mHandler with this.

* In doQuit(), replace Loop.quit() with Loop.quitSafely().

Bug: 64566509
Test: Manual, test AVRCP with carkit. Shortly after disconnecting the
AVRCP service, try remote control commands.
Change-Id: Ib5ac399a30a5cefb17b3977103dea3d60e855cef
vrcp/Avrcp.java
7011cac606d235dd88e3684088db1b3f8b720054 21-Sep-2017 Pulkit Bhuwalka <pulkitb@google.com> Get Bluetooth Class of Device

Return Bluetooth CoD value back to the caller

Bug: 36015415
Test: Verified fetching of COD from test app on flashed device,
after modification and after after reboot.

Change-Id: I1ce08cf1797168b3979b064559cf01b06fbef4b1
tservice/AdapterProperties.java
tservice/AdapterService.java
914489de4753001ee7a11ce6813c12d026915032 24-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Persist Bluetooth CoD config value across reboot"
9578412c18cef1e0a34dbf191e2c9f279a3d2a73 21-Oct-2017 Hansong Zhang <hsz@google.com> Change Bluetooth HID Profile Name (2/6)

Make the Bluetooth HID profile name consistent with the Bluetooth HID
service name.

BluetoothInputHost → BluetoothHidDevice
BluetoothInputDevice → BluetoothHidHost
IBluetoothInputHost → IBluetoothHidDevice
IBluetoothInputDevice → IBluetoothHidHost
BluetoothProfile.INPUT_HOST → BluetoothProfile.HID_DEVICE
BluetoothProfile.INPUT_DEVICE → BluetoothProfile.HID_HOST

(Cherry-picked from commit 55de8aa2568cd4952394a64802f79b2a00f84eaa)
Merged-In: I3157cb4272f0c7456f7eac0593f1a6f98f2ff7f9
Test: make
Change-Id: I3157cb4272f0c7456f7eac0593f1a6f98f2ff7f9
tservice/AdapterProperties.java
tservice/Config.java
id/HidDevService.java
id/HidService.java
752616a42dc20f0388806a2b69691e5dc1319acc 23-Oct-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "Cleanup Phone Accounts"
9a32b08420f90c938f848aa300ba4e8fdac8b70e 26-Sep-2017 Pulkit Bhuwalka <pulkitb@google.com> Persist Bluetooth CoD config value across reboot

This CL creates a new Settings value for Bluetooth CoD so that it may
persist across reboots. Once the adapter is up, it sets the CoD value to
the one stored in the config.

Bug: 36015415
Test: Verified by storing a value through a test app and restarting the
machine to ensure it's picked up.

Change-Id: I00aaa35197e43af7460f478c0f9c8e0ceec55579
tservice/AdapterService.java
tservice/AdapterState.java
25ea9a72a72b3186fc3e589c2e472ef94d05397b 20-Oct-2017 Joseph Pirozzo <pirozzoj@google.com> Cleanup Phone Accounts

At startup remove any already existing HFP phone accounts that may be
left over from an unclean shutdown.

Bug: 62365716
Test: Connect 2 phones, hard power cycle, turn off bt on one of the
phones, make sure that only the newly connected phone has an account via
dumpsys telecom.

Change-Id: I009b7eac176a71712257dca1961fca3b8d802dd4
(cherry picked from commit deaf590f20623295daa861edc2815dfe535ba6ef)
fpclient/connserv/HfpClientConnectionService.java
ae1624151b8fa74f73bca8c9e2c95646abc2e439 20-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Enable BVRA client"
bb0af2de44c1ed4833bc0b9bd833047f31e489c0 20-Oct-2017 Kai Wang <kwangsudo@google.com> Merge "AvrcpControllerSM auto play"
a4cca006f948b1a2a3f36fd857f4ad837376b4ea 06-Oct-2017 Joseph Pirozzo <pirozzoj@google.com> Enable BVRA client

Add implementation to startVoiceRecognition and stopVoiceRecognition.

Bug: 38485187
Test: act.py -tc BtCarHfpTest:test_bluetooth_voice_recognition_assistant
Change-Id: Icdecdb41c0353871ca1afc32b2d7ffa01172c0c3
(cherry picked from commit a323e1643d6a01be7cec16eeaa65b281acbcd941)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/NativeInterface.java
fpclient/StackEvent.java
3f83e6f39c5d116248991311796ca046707181d2 10-Oct-2017 Hansong Zhang <hsz@google.com> Fix logging for HID host and device service

* Use constant String for log tag
* Added warning messages for registerApp() and unregisterApp() failures
in HidDevService
* Added some loggings for HidService
* Changed some logging levels for HidDevService

Test: build
Change-Id: I19fd40387cfce5d371f49e45e775cf151ba79195
id/HidDevService.java
id/HidService.java
d5a85ea362e281a5af3d58994138a90a7eda27fe 12-Oct-2017 kai <kwangsudo@google.com> AvrcpControllerSM auto play

When get MESSAGE_PROCESS_TRACK_CHANGED, media palyer start playing
automatically and update Metadata.

Bug: 66919606
Test: 1 Pair and connect with an iPhone
2 Start playing any song
3 Browse and select another song

Change-Id: Ic2470fed715a50deafd087fff0676ba583c2a514
(cherry picked from commit 4b88ad401e06e898916c23d546592dfc9a860e39)
vrcpcontroller/AvrcpControllerStateMachine.java
e2f0e0fce32c77e0ac097b5b14dead5102959b82 12-Oct-2017 Jack He <siyuanh@google.com> [Manual] Fix checkstyle errors (2/2)

* Mannually fixed several styles errors that cannot be corrected through
automatic formatter

Bug: 63597465
Test: make checkbuild, no functional changes
Change-Id: Idc1763b6be431f8cb3bc5f6807973e45512d99ef
tils.java
vrcpcontroller/AvrcpControllerService.java
vrcpcontroller/AvrcpControllerStateMachine.java
att/GattService.java
ap/BluetoothMapContentObserver.java
pp/BluetoothOppObexServerSession.java
c4fbd756e2645147470c486ae96f2253f5e13a52 12-Oct-2017 Jack He <siyuanh@google.com> [Script] Fix checkstyle errors (1/2)

Format code using Intellij to conform to CheckStyle requirements

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: I70cd2ab8e5e6d5428ab1556658735b0d83f4fb15
luetoothObexTransport.java
bexRejectServer.java
bexServerSockets.java
ignedLongLong.java
tils.java
2dp/A2dpService.java
2dp/A2dpStateMachine.java
2dpsink/A2dpSinkService.java
2dpsink/A2dpSinkStateMachine.java
2dpsink/A2dpSinkStreamHandler.java
2dpsink/mbs/A2dpMediaBrowserService.java
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpConstants.java
vrcp/AvrcpHelperClasses.java
vrcp/BrowsedMediaPlayer.java
vrcp/mockable/MediaController.java
vrcpcontroller/AvrcpControllerService.java
vrcpcontroller/AvrcpControllerStateMachine.java
vrcpcontroller/AvrcpPlayer.java
vrcpcontroller/BrowseTree.java
vrcpcontroller/PlayerApplicationSettings.java
vrcpcontroller/RemoteDevice.java
vrcpcontroller/TrackInfo.java
tservice/AbstractionLayer.java
tservice/AdapterApp.java
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
tservice/Config.java
tservice/JniCallbacks.java
tservice/PhonePolicy.java
tservice/ProfileObserver.java
tservice/ProfileService.java
tservice/RemoteDevices.java
tservice/ServiceFactory.java
att/AdvertiseHelper.java
att/AdvertiseManager.java
att/AdvtFilterOnFoundOnLostInfo.java
att/AppScanStats.java
att/ContextMap.java
att/FilterParams.java
att/GattDebugUtils.java
att/GattService.java
att/HandleMap.java
att/PeriodicScanManager.java
att/ScanClient.java
att/ScanFilterQueue.java
att/ScanManager.java
dp/HealthService.java
fp/AtPhonebook.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
fpclient/HeadsetClientHalConstants.java
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/NativeInterface.java
fpclient/StackEvent.java
fpclient/connserv/HfpClientConference.java
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientConnectionService.java
fpclient/connserv/HfpClientDeviceBlock.java
id/HidDevService.java
id/HidService.java
ap/BluetoothMapAccountItem.java
ap/BluetoothMapAccountLoader.java
ap/BluetoothMapAppObserver.java
ap/BluetoothMapAppParams.java
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapConvoContactElement.java
ap/BluetoothMapConvoListing.java
ap/BluetoothMapConvoListingElement.java
ap/BluetoothMapFolderElement.java
ap/BluetoothMapMasInstance.java
ap/BluetoothMapMessageListing.java
ap/BluetoothMapMessageListingElement.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapService.java
ap/BluetoothMapSettings.java
ap/BluetoothMapSettingsAdapter.java
ap/BluetoothMapSettingsDataHolder.java
ap/BluetoothMapSmsPdu.java
ap/BluetoothMapUtils.java
ap/BluetoothMapbMessage.java
ap/BluetoothMapbMessageEmail.java
ap/BluetoothMapbMessageMime.java
ap/BluetoothMapbMessageSms.java
ap/BluetoothMnsObexClient.java
ap/MapContact.java
ap/MmsFileProvider.java
ap/SmsMmsContacts.java
apclient/MapClientService.java
apclient/MasClient.java
apclient/MceStateMachine.java
apclient/MnsObexServer.java
apclient/MnsService.java
apclient/obex/BmessageBuilder.java
apclient/obex/BmsgTokenizer.java
apclient/obex/EventReport.java
apclient/obex/ObexTime.java
apclient/obex/RequestGetFolderListing.java
apclient/obex/RequestGetMessage.java
apclient/obex/RequestGetMessagesListing.java
apclient/obex/RequestPushMessage.java
pp/BluetoothOppBatch.java
pp/BluetoothOppBtEnableActivity.java
pp/BluetoothOppBtEnablingActivity.java
pp/BluetoothOppBtErrorActivity.java
pp/BluetoothOppFileProvider.java
pp/BluetoothOppHandoverReceiver.java
pp/BluetoothOppIncomingFileConfirmActivity.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppManager.java
pp/BluetoothOppNotification.java
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppPreference.java
pp/BluetoothOppProvider.java
pp/BluetoothOppReceiveFileInfo.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppSendFileInfo.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppTransferAdapter.java
pp/BluetoothOppTransferHistory.java
pp/BluetoothOppUtility.java
pp/BluetoothShare.java
pp/Constants.java
pp/TestActivity.java
an/BluetoothTetheringNetworkFactory.java
an/PanService.java
bap/BluetoothPbapActivity.java
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapConfig.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
bap/BluetoothPbapVcardManager.java
bapclient/Authenticator.java
bapclient/BluetoothPbapRequestPullPhoneBook.java
bapclient/BluetoothPbapVcardList.java
bapclient/CallLogPullRequest.java
bapclient/ObexAppParameters.java
bapclient/PbapClientConnectionHandler.java
bapclient/PbapClientService.java
bapclient/PbapClientStateMachine.java
bapclient/PhonebookEntry.java
bapclient/PhonebookPullRequest.java
bapclient/PullRequest.java
ap/SapMessage.java
ap/SapRilReceiver.java
ap/SapServer.java
ap/SapService.java
dp/SdpManager.java
til/DevicePolicyUtils.java
til/Interop.java
5e95f126db04694ccfdbf526a5060c8ad54eabf7 19-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Extract metadata info from MediaPlayer.Queue added by Google Play Music"
36c251d5ac206f5ca4999311a99f0f8827c87102 19-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Assorted fixes for CheckStyle" am: 62d0939605 am: 462d38d00d
am: 5133d9de3f

Change-Id: I72b38a95cf2f14be149d40eae8b3ca9c53f6f91c
462d38d00d8f20e42698429379db0a6c9c439eef 19-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Assorted fixes for CheckStyle"
am: 62d0939605

Change-Id: I579175952844a6a72cff8f28e2eadd9790a176cb
f1874435d6516ee6facf51c2a08ffa5b1938c35c 30-Jun-2017 Ajay Panicker <apanicke@google.com> Extract metadata info from MediaPlayer.Queue added by Google Play Music

Bug: 63117921
Test: Test with BMW carkit which grabs next song info and see full metadata
TestTracker: 95441
Change-Id: I78f54e7dd4f9f46c6c5dfc7fbb9400d7214d23cc
(cherry picked from commit 141eb4655cd1341641326d89bc16d87626baee84)
Merged-In: I9d30d162a13fb6416f3b4140aa5238f7e0e928f2
Merged-In: I78f54e7dd4f9f46c6c5dfc7fbb9400d7214d23cc
vrcp/AddressedMediaPlayer.java
76a12d7e679ae48f8ab73e01b33fb7c8f077a210 11-Oct-2017 Jack He <siyuanh@google.com> [Manual] Assorted fixes for CheckStyle

* Inner class constructor does not need private modifier to be hidden
* Fixed unused tags or mis-typed tags
* Move comments out from if-else body
* Add spaces between ';' and comments
* Simplified conditionals that were not fixed automatically by scripts

Bug: 63597465
Test: make checkbuild, no functional changes
Change-Id: Iaaebf4ab3840973e44dc3310d39961db89281d5e
2dp/A2dpService.java
2dp/A2dpStateMachine.java
vrcpcontroller/PlayerApplicationSettings.java
vrcpcontroller/TrackInfo.java
att/GattService.java
dp/HealthService.java
fp/AtPhonebook.java
fp/HeadsetStateMachine.java
ap/BluetoothMapAccountLoader.java
ap/BluetoothMapAppObserver.java
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapSmsPdu.java
ap/BluetoothMapUtils.java
ap/BluetoothMapbMessage.java
ap/BluetoothMapbMessageMime.java
apclient/obex/EventReport.java
pp/BluetoothOppProvider.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapVcardManager.java
dp/SdpManager.java
f73ec1cff3babd6f032f2d4f546dd77622d97539 18-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Rename non-public non-static variables to mCamelCase" am: d4403f0598 am: a4b787844c
am: 2a5d33ca0e

Change-Id: I0b04a7d355ce55b09fbf6f701e94e3c64f1d62d1
a4b787844cfe0b8dbb27049c82732c1acb38e207 18-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Rename non-public non-static variables to mCamelCase"
am: d4403f0598

Change-Id: I66eb9641c68813798f37b1d9e7db7d00c226f1fb
d4403f0598a3c31a5ab5750373ecce95d7dfe0f5 18-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "[Manual] Rename non-public non-static variables to mCamelCase"
7e3fc7353fe5672fdb4fce1446bfb8720ba6b89a 18-Oct-2017 Jack He <siyuanh@google.com> Merge "AdapterProperties: Crash on invalid state transition" am: b1ae4411c0 am: 00abe0dccd
am: 6df4a03420

Change-Id: I907f82d7da6c0c864e0ab25865c7642cc04faf96
00abe0dccdd89b054504e8ef6183052dbe06c44b 18-Oct-2017 Jack He <siyuanh@google.com> Merge "AdapterProperties: Crash on invalid state transition"
am: b1ae4411c0

Change-Id: I46d151e5df6cdce375abd4461a5cbd8dedf7fca6
b1ae4411c02995d5cf7535eff2b6f47321a4eb86 18-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "AdapterProperties: Crash on invalid state transition"
f47e0a3b1976d5190c6077e912eff1647c7fbe96 18-Oct-2017 Andre Eisenbach <eisenbach@google.com> Merge "Revert "Always send KEYCODE_MEDIA_PLAY_PAUSE""
am: 799c063e24

Change-Id: Ib3b6a74304f7f1df16a96deb0a9b8357d05710f6
8bc413b0b749ea9df59e858493273e05087fe887 11-Oct-2017 Jack He <siyuanh@google.com> [Manual] Rename non-public non-static variables to mCamelCase

* Run "instance field naming convention" inspection in Intellij
* Rename variables that are non-public non-static to m + Camel Case
* Renaming is done through refactor tool in Intellij
* Private variables are renamed to m + Camel Case
* Non-private variables are added with public modifier to indicate that
they are accessed externally as well

Bug: 63597465
Test: make checkbuild, no functional changes
Change-Id: I88400ac99fa1ba084cdfa35600bd3c23f1dd1a33
bexServerSockets.java
2dp/A2dpStateMachine.java
2dpsink/A2dpSinkStateMachine.java
2dpsink/mbs/A2dpMediaBrowserService.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcp/BrowsedMediaPlayer.java
vrcpcontroller/AvrcpControllerStateMachine.java
tservice/RemoteDevices.java
att/AdvertiseManager.java
att/AppScanStats.java
att/CallbackInfo.java
att/ContextMap.java
att/GattService.java
att/HandleMap.java
att/PeriodicScanManager.java
att/ScanClient.java
att/ScanManager.java
fp/AtPhonebook.java
fp/HeadsetStateMachine.java
fpclient/HeadsetClientStateMachine.java
fpclient/StackEvent.java
fpclient/connserv/HfpClientDeviceBlock.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapConvoListing.java
ap/BluetoothMapMasInstance.java
ap/BluetoothMapMessageListing.java
ap/BluetoothMapbMessageMime.java
ap/BluetoothMnsObexClient.java
apclient/MasClient.java
apclient/MceStateMachine.java
apclient/MnsObexServer.java
apclient/obex/BmessageParser.java
apclient/obex/MessagesFilter.java
pp/BluetoothOppManager.java
pp/BluetoothOppNotification.java
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
pp/TestActivity.java
an/PanService.java
bap/BluetoothPbapActivity.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
bap/BluetoothPbapVcardManager.java
bapclient/PbapClientConnectionHandler.java
ap/SapRilReceiver.java
ap/SapServer.java
ap/SapService.java
dp/SdpManager.java
til/Interop.java
799c063e243d653ca8e0cdc7e9f60a5058709966 18-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Revert "Always send KEYCODE_MEDIA_PLAY_PAUSE""
10b57de1c81fb1cb4f3c3b1629e56e615c8923d4 18-Oct-2017 Jack He <siyuanh@google.com> Merge "PBAP: Disable SIM card contact supported" am: 442ad534b7 am: d286642d2d
am: 3563be26ff

Change-Id: Ib40506ee864650ef3c1a016c49c888ea0797cda7
e7bbf6a2153ffc102fe26d59262a4d09a73bffd3 18-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Fix static field names" am: c0c914dfdb am: ad53082f03
am: 1eef7eebe6

Change-Id: Id87120cdff7c80a0d49ce5741b129d61d132c6f0
105ffe9be542cdea85d6a7d69724f607d902dda3 19-Sep-2017 Jack He <siyuanh@google.com> AdapterProperties: Crash on invalid state transition

Bug: 65591907
Test: Regression test on each profile
Change-Id: Ife62b58183ce0cd885c59ec726cf36d9c7a1be49
tservice/AdapterProperties.java
d286642d2df3b5e2eb00d93848dd5669e00addc6 18-Oct-2017 Jack He <siyuanh@google.com> Merge "PBAP: Disable SIM card contact supported"
am: 442ad534b7

Change-Id: Id330115b7eb19ce31d076cb7bc7f8a4621239aab
ad53082f035532597530026ef42b7e72c7c45aab 18-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Fix static field names"
am: c0c914dfdb

Change-Id: I3b96a76009f80f28f5a51fa91090cf28d70f5246
442ad534b7dc6c396eda2187d7403df26de1ccf3 18-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Disable SIM card contact supported"
a866464adb6362983568a81ef198e88b8d94ea31 17-Oct-2017 Andre Eisenbach <eisenbach@google.com> Revert "Always send KEYCODE_MEDIA_PLAY_PAUSE"
am: e85822729c

Change-Id: I7f2f7279324eee635eda34f3d1e8c1259eb378a0
1bd017d12cf16ecd52fb486722e300790bddeefc 11-Oct-2017 Jack He <siyuanh@google.com> [Manual] Fix static field names

* Run 'static' field naming convention inspection in Intellij
* Use regex s[A-Z][A-Za-z\d]*, the same one in CheckStyle
* Change non-public variable names to sCamelCase
* Add final modifier to constants

Bug: 63597465
Test: make checkbuild, no functional changes
Change-Id: I395bf3e11c2932b36cda471ca088dc5345b0f378
2dp/A2dpService.java
tservice/Config.java
tservice/RemoteDevices.java
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/NativeInterface.java
ap/BluetoothMapService.java
ap/BluetoothMapSettingsAdapter.java
ap/BluetoothMapSettingsDataHolder.java
ap/BluetoothMapSmsPdu.java
ap/BluetoothMapUtils.java
ap/BluetoothMapbMessage.java
apclient/MnsService.java
apclient/obex/Request.java
pp/BluetoothOppManager.java
pp/BluetoothOppPreference.java
pp/BluetoothOppReceiveFileInfo.java
pp/Constants.java
pp/TestActivity.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
bap/BluetoothPbapVcardManager.java
bapclient/CallLogPullRequest.java
dp/SdpManager.java
til/Interop.java
b0c32d352b5dbfc957f38aad6faddf1337fdeb76 17-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Pass all scans to battery stats"
9bdbe9e309810d117c80328288a1819d39d8e7c8 17-Oct-2017 Andre Eisenbach <eisenbach@google.com> Revert "Always send KEYCODE_MEDIA_PLAY_PAUSE"

Due to double debounce delays in the media framework as well as Google Play Music (to enable double-tap-to-skip feature), this introduces a delay in switching play state.

Reverting for now and will focus on synchronizing play state instead.

This reverts commit 86950ad23a3463f1ecea3b37ecab2678170e0929.

Bug: 64006398
Change-Id: Ib314da388c85af5dfb66326802ab062a32c52792
Fixes: 67853947
vrcp/Avrcp.java
e85822729c985ca537d5f9943ed12f37976bfbaf 17-Oct-2017 Andre Eisenbach <eisenbach@google.com> Revert "Always send KEYCODE_MEDIA_PLAY_PAUSE"

Due to double debounce delays in the media framework as well as Google Play Music (to enable double-tap-to-skip feature), this introduces a delay in switching play state.

Reverting for now and will focus on synchronizing play state instead.

This reverts commit e69fc83ad46b1e0c60a1beb59a1c241935282945.

Bug: 64006398
Fixes: 67853947
Change-Id: I1c866906726c19e12de869c9ccdea6d06b069291
vrcp/Avrcp.java
c5ccdd2bd532f696659f5ffcab9ec11817e07bc9 16-Oct-2017 Jack He <siyuanh@google.com> PBAP: Disable SIM card contact supported

* In BluetoothPbapObexServer.java's onGet() method, the logic says that
we do not currently support syncing contacts from SIM card, but yet
our PBAP SDP record indicates such support.
* When car kits receive such SDP record, they will try getting SIM card
contacts from us, and we will reply with OBEX_HTTP_NOT_ACCEPTABLE
* This cause certain car kit to disconnect PBAP from us, resulting in
unfinished phonebook sync

Bug: 67084846
Test: Test connect PBAP to car kit
Change-Id: I0f892714e5f7669224bd696ddc93f7cda2d95e4f
bap/BluetoothPbapService.java
542c465e304b0a1c039bbae818682793bd58fc83 17-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Fix local variable names" am: eb60d9eb3d am: d15dc79713
am: 4c7fed14d5

Change-Id: Iad0cbecf10d89d4fe978a762c3cde1dd0f052da8
0e65fab1858d04c9be682cacfde9e49297b42e02 17-Oct-2017 Vinay Kalia <vinaykalia@google.com> Merge "Catch exception" am: 123f338f14 am: 54ff7c47aa
am: bc517f4be1

Change-Id: I7e2a8b0aab47021518738d953651be27840a4903
d15dc79713bf4d1a4588aa891ce3d86bb3c3cde2 17-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Fix local variable names"
am: eb60d9eb3d

Change-Id: I266e9afd552bc4e158cc906a005a073a36eb01b3
eb60d9eb3d24863a116a100eeacc9d94790fdd5d 17-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "[Manual] Fix local variable names"
54ff7c47aa5c71861eab4132a6b6447a4fc95d70 17-Oct-2017 Vinay Kalia <vinaykalia@google.com> Merge "Catch exception"
am: 123f338f14

Change-Id: If4e2c3425a2f504d6fc231901caff9b1d081d120
ddd9c7de15bdb40666a1c7c5ecfa5160944df923 21-Jul-2017 Ajay Panicker <apanicke@google.com> Pass all scans to battery stats

Also let battery stats know if the scan that was just stopped
was optimized or not.

Bug: 63456783
Test: runtest -x frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
Change-Id: Ic8308cdfe8654a7628fd6181dde9898483f528aa
Merged-In: Ic8308cdfe8654a7628fd6181dde9898483f528aa
(cherry picked from commit d5078f2b255eafb78881f39e23ae329f8515db58)
att/AppScanStats.java
5ef52da260f8b4c1baed22bceb2983a694bb022c 11-Oct-2017 Jack He <siyuanh@google.com> [Manual] Fix local variable names

* Run "Local variable naming convention" inspection in Intellij
* Fix warnings through automatic refactoring
* Move certain constant local variables out as a "private static final"
variable at class level

Bug: 63597465
Test: make checkbuild, no functional changes
Change-Id: Ifa97e8c8dc2c76a4456d26d5f53294efcb9955ac
bexServerSockets.java
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/BrowsedMediaPlayer.java
tservice/AbstractionLayer.java
tservice/AdapterService.java
att/AdvertiseManager.java
att/GattDebugUtils.java
att/GattService.java
att/PeriodicScanManager.java
att/ScanManager.java
fp/HeadsetStateMachine.java
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapbMessage.java
ap/BluetoothMapbMessageMime.java
apclient/MceStateMachine.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppNotification.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppService.java
pp/BluetoothOppUtility.java
pp/TestActivity.java
an/PanService.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
bap/BluetoothPbapVcardManager.java
ap/SapServer.java
ap/SapService.java
d7d3d689c2aa49db2a6aa3b452065ae4aba5d586 14-Oct-2017 Vinay Kalia <vinaykalia@google.com> Catch exception

removeOnUidImportanceListener can throw IllegalArgumentException.
Catch this exception.

BUG: 67774107
Test: BLE applications

Change-Id: I6b6dc029aa40b14c7b602da5c290c4e3b7f4d6f8
att/ScanManager.java
575bead8e32ad01088965b1ef732e18a65bd234a 15-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Remove redundant 'public' modifier" am: 98613f27b5 am: 6d9389915f
am: d416cffa50

Change-Id: I25f999ecd1dce964ad7abf66249777e5244d355f
07318ab285e600a9a744893e0567faac34b016e4 15-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Rename methods and classes" am: 3669be9599 am: 52795e29ef
am: 1dc4857c25

Change-Id: I88ea4bd7a66e72266c4a00b9436f227a4d7b9fa2
6fa182eddcc38ac511e0265747297d50e85dea90 15-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Fix static variable names" am: 9be7c667e5 am: 95fe47e563
am: cc036a8f21

Change-Id: I99d30eef8e8a3721487316935c304c5dda322866
27abd5f5e84a852761531d2682df0244baab5afc 15-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Remove empty blocks" am: 8bbf8049c8 am: 3799bd36fb
am: afe17a8af5

Change-Id: Id279a26cd66a0616f3ad7d1e4d7e8afbced863bf
6d9389915f12d868090a31e3b9b334e32a6815af 15-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Remove redundant 'public' modifier"
am: 98613f27b5

Change-Id: Ied826d9fe2388f6694f0aefefd2b6744761a7552
52795e29efed1c1bb787abfbae00d4a7ecb6ac52 15-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Rename methods and classes"
am: 3669be9599

Change-Id: I77ad83fe0f2ccf2ca26579e9995904c9ffe372aa
95fe47e563091d41faecb141ddf1c0455ba111cf 15-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Fix static variable names"
am: 9be7c667e5

Change-Id: Ifc99b8367a31405bc24f172e9b93cc8cfdd715ba
3fa6ec78cc26a312f8335ca5d375ab8f2a904ae7 15-Oct-2017 Jack He <siyuanh@google.com> Merge "MAP-MNS: Cleanup sdp record on service shutdown"
am: 684ce8097a

Change-Id: I21dc628d2cf67be4135fe181b0477e691d8b49ba
3799bd36fbe03dcfece4106ff55b5f3d6a10763b 15-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Remove empty blocks"
am: 8bbf8049c8

Change-Id: I10a0d6f0afda677962c6fe52ab99e4c46c2975dc
cfb2fffbbad03441779441a16e31f039ded2ad5f 15-Oct-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Remove sdp record during BT off to prevent leak"
am: 981d56a927

Change-Id: I23930137990d2972746fc1da17a8772fd3b6c2e2
eabd919ff023476c2f9f4bd58878db4d42048fb5 15-Oct-2017 Jack He <siyuanh@google.com> MAP-MNS: Cleanup sdp record on service shutdown
am: e645119f54

Change-Id: I52ece059be361c982049cffe8bf1d95d2b557c91
9977fc3bcd1b5985efbba61bed03fa7a916b12cc 15-Oct-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Remove sdp record during BT off to prevent leak
am: 05e4723143

Change-Id: I90655073a1731f6f94afe0f9f0283d457285ca9c
d04c0a8609b39f891d5787f051b1dfb105ceee93 11-Oct-2017 Jack He <siyuanh@google.com> [Manual] Remove redundant 'public' modifier

* Remove redundant 'public' modifier from non-public classes'
constructors
* Fixes all occurances labeled as "Redundant 'public' modifier' by
CheckStyle

Bug: 63597465
Test: make checkbuild, no functional changes
Change-Id: I45ece6deafa612fee36e06877065c903815466d2
bexServerSockets.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcp/BrowsedMediaPlayer.java
vrcpcontroller/TrackInfo.java
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/ProfileObserver.java
att/AdvertiseManager.java
att/AppScanStats.java
att/GattService.java
att/PeriodicScanManager.java
dp/HealthService.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fpclient/HeadsetClientService.java
id/HidDevService.java
id/HidService.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapbMessage.java
apclient/MnsObexServer.java
apclient/obex/FolderListing.java
apclient/obex/MessagesListing.java
apclient/obex/Request.java
apclient/obex/RequestGetFolderListing.java
apclient/obex/RequestGetMessage.java
apclient/obex/RequestGetMessagesListing.java
apclient/obex/RequestPushMessage.java
apclient/obex/RequestSetNotificationRegistration.java
apclient/obex/RequestSetPath.java
pp/BluetoothOppManager.java
pp/BluetoothOppNotification.java
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppProvider.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppTransferActivity.java
pp/TestActivity.java
an/PanService.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
bapclient/BluetoothPbapObexAuthenticator.java
bapclient/BluetoothPbapObexTransport.java
bapclient/BluetoothPbapRequest.java
bapclient/BluetoothPbapRequestPullPhoneBook.java
bapclient/BluetoothPbapVcardList.java
bapclient/PbapClientService.java
dp/SdpManager.java
til/Interop.java
79198672967336dc5a989489544aada8c2997349 11-Oct-2017 Jack He <siyuanh@google.com> [Manual] Rename methods and classes

* Rename vCard to VCard to comply with Java naming convention
* Rename methods to start with lower case letter and then camel case

Bug: 63597465
Test: make checkbuild, no functional changes
Change-Id: Ib13e9cbf2737eef7e9819896c9c8e210f36eb432
2dpsink/A2dpSinkStateMachine.java
tservice/AdapterService.java
tservice/AdapterState.java
att/GattService.java
ap/BluetoothMapAppParams.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapbMessage.java
ap/BluetoothMnsObexClient.java
bap/BluetoothPbapVcardManager.java
e645119f54517c3c59762b7b8634c63fb8e53635 13-Oct-2017 Jack He <siyuanh@google.com> MAP-MNS: Cleanup sdp record on service shutdown

* Obtain, check and save SdpManager instance
* Save SdpHandle and remove SDP record on stop()

Bug: 67753878
Test: build
Change-Id: I21f45c553ee1ff3fdf4bde71d4dcc1c0c62c3871
(cherry picked from commit 780f9cea48424646af1c5f9b3a53cabbe8e57d6c)
Merged-In: I21f45c553ee1ff3fdf4bde71d4dcc1c0c62c3871
apclient/MnsService.java
384f7f30055726c9248f9cfa6ec035e01e1510da 13-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Rename method parameters using Java naming conventions" am: 20d7ae1f61 am: 5fed196b54
am: e54f135468

Change-Id: I54c934c66a23a27d1861a05a9ee4a129e80f6848
7588f85e23f10b3dbe2d8069aecfdf3fa3707e84 11-Oct-2017 Jack He <siyuanh@google.com> [Manual] Fix static variable names

* Run "Constant naming convention" inspection in Intellij
* Rename static final variables to CONSTANT_NAME

Bug: 63597465
Test: make checkbuild, no functional changes
Change-Id: I1c655a44af91036e9739715fb5e29844e8d90a1e
2dpsink/mbs/A2dpMediaBrowserService.java
vrcpcontroller/AvrcpControllerStateMachine.java
fpclient/HeadsetClientHalConstants.java
fpclient/HeadsetClientStateMachine.java
pp/BluetoothOppNotification.java
pp/BluetoothOppObexClientSession.java
05e47231433c62c072129dcc1865ab04b66f591a 10-Aug-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Remove sdp record during BT off to prevent leak

Step by Step procedure:
===================
1. DO file transfer using OPP.
2. Turn off BT.
3. Turn on BT.
4. Repeat above 4 steps for multiple times.

Expected Result:
================
File transfer should get success.

Actual Result:
==============
Instead of OPP request, observed MAP authentication dialog popped up.

Reproducibility:
==============
very rare

Root cause:
===========
There is a leak in security manager record even though socket is closed.
AS there could be two entries with same PSM ( one for MAP and other for OPP ),
when there is an incoming connection for OPP, it may take MAP entry as it is first
and goes ahead with high security which is not expected.

Fix:
====
Assign proper value to SDP handle to remove SDP record created dynamically
for OPP server during off state. without this call, there is a leak in sdp
layer in the stack as sdp record is never removed, even though socket is closed.

Test: Checked above use-case and no error is seen.

Bug: 64595692
Change-Id: I5d7692485d7422079be6b16d7cf3663f3ae500a3
Merged-In: I5d7692485d7422079be6b16d7cf3663f3ae500a3
(cherry picked from commit b59ab229cb431a7caa9cffe8c66a83fd1278976e)
pp/BluetoothOppService.java
780f9cea48424646af1c5f9b3a53cabbe8e57d6c 13-Oct-2017 Jack He <siyuanh@google.com> MAP-MNS: Cleanup sdp record on service shutdown

* Obtain, check and save SdpManager instance
* Save SdpHandle and remove SDP record on stop()

Bug: 67753878
Test: build
Change-Id: I21f45c553ee1ff3fdf4bde71d4dcc1c0c62c3871
apclient/MnsService.java
8338d4b25c6aaed432b5a8ecf6637cd8c16211fb 11-Oct-2017 Jack He <siyuanh@google.com> [Manual] Remove empty blocks

* Remove
- Empty if block
- Empty else block
- Empty statement

Bug: 63597465
Test: make checkbuild, no functional changes
Change-Id: Ida742e1812b2b2dce826233cf3ea137530e17ac7
vrcpcontroller/AvrcpControllerStateMachine.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapbMessage.java
apclient/obex/BmessageParser.java
981d56a927f0f3c232d3bcebea372c75eddec206 13-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Remove sdp record during BT off to prevent leak"
5fed196b5475b2418a6d34b19e360e3f1e3fdb10 13-Oct-2017 Jack He <siyuanh@google.com> Merge "[Manual] Rename method parameters using Java naming conventions"
am: 20d7ae1f61

Change-Id: Ie4b2ddf152e6adbf2725e7786a447941d6206558
b59ab229cb431a7caa9cffe8c66a83fd1278976e 10-Aug-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Remove sdp record during BT off to prevent leak

Step by Step procedure:
===================
1. DO file transfer using OPP.
2. Turn off BT.
3. Turn on BT.
4. Repeat above 4 steps for multiple times.

Expected Result:
================
File transfer should get success.

Actual Result:
==============
Instead of OPP request, observed MAP authentication dialog popped up.

Reproducibility:
==============
very rare

Root cause:
===========
There is a leak in security manager record even though socket is closed.
AS there could be two entries with same PSM ( one for MAP and other for OPP ),
when there is an incoming connection for OPP, it may take MAP entry as it is first
and goes ahead with high security which is not expected.

Fix:
====
Assign proper value to SDP handle to remove SDP record created dynamically
for OPP server during off state. without this call, there is a leak in sdp
layer in the stack as sdp record is never removed, even though socket is closed.

Test: Checked above use-case and no error is seen.

Bug: 64595692
Change-Id: I5d7692485d7422079be6b16d7cf3663f3ae500a3
pp/BluetoothOppService.java
b7461b17cad5476a7a528cbf2a0b9c9706c6faef 11-Oct-2017 Jack He <siyuanh@google.com> [Manual] Rename method parameters using Java naming conventions

* Run "Method parameter naming convention" inspection in Intellij with
maximum parameter name length set to 100
* Rename method parameters using the refactor tool in Intellij based on
Java naming convention
* e.g. ind_id -> indId

Bug: 63597465
Test: make checkbuild, no functional changes
Change-Id: Id2161345524d888cbddb0ce2387e9f1aadf1e9c6
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcpcontroller/AvrcpControllerService.java
tservice/AdapterService.java
att/AdvertiseManager.java
att/AdvtFilterOnFoundOnLostInfo.java
att/FilterParams.java
att/GattDebugUtils.java
att/GattService.java
att/PeriodicScanManager.java
att/ScanFilterQueue.java
att/ScanManager.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
fpclient/HeadsetClientStateMachine.java
fpclient/NativeInterface.java
id/HidService.java
ap/BluetoothMapContentObserver.java
an/PanService.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapVcardManager.java
ap/SapRilReceiver.java
dp/SdpManager.java
til/Interop.java
1e88ee6fe3710da31193e223fc51ab2e76885399 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Fixed assorted string usage issues" am: ee165459bb am: 03e8462bc8
am: b8662b20d5

Change-Id: I0555dcc4a4f512b98d3a8d2f9f4dfc38eacc2721
03e8462bc89507aa1f521b7ded47122f832cb6f5 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Fixed assorted string usage issues"
am: ee165459bb

Change-Id: I8d3b63ec6737f4d5f3fcb33d0ec882c373677c72
c27337ca60901fad583a96e84973af6ba379f3ef 11-Oct-2017 Jack He <siyuanh@google.com> [Script] Fixed assorted string usage issues

* Case 1
- Strings.equals("") or Strings == "" should be replaced with
Strings.isEmpty()
- Fixed using "'Strings.equals("")' inspection

* Case 2
- Strings should never be compared with == unless we explicitly want to
compare whether they are the same instance which is rarely the case
- Objects.equals(A, B) does both null checks and equals() compare. Thus
it is a safe replacement for our current usage
- Fixed using "String comparision using '==' instaed of 'equals()'
inspection in Intellij and accept automatic fixes

* Case 3
- String + "" is useless and should be removed
- Fixed using "Concatenation with empty string' inspection

* Case 4
- String.toString() is redundant
- Removed using 'Redundant 'String.toString()' inspection'

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: Ib44d8b5dd53125eb21afa0e3d0ff6a728f67dbb8
fp/AtPhonebook.java
ap/BluetoothMapAccountLoader.java
ap/BluetoothMapAppObserver.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapbMessage.java
ap/BluetoothMapbMessageMime.java
apclient/obex/EventReport.java
apclient/obex/MessagesFilter.java
pp/BluetoothOppObexServerSession.java
pp/TestActivity.java
bap/BluetoothPbapVcardManager.java
bapclient/PhonebookEntry.java
8aa3d3f302c13efc001649bfed373165f8c53202 12-Jul-2017 Ajay Panicker <apanicke@google.com> Send the now playing list changed events after media updates

Bug: 63585280
Test: Test with BWM carkit and see in snoop logs that now playing list changes
happen after addressed player changes

CL updated with follow-up changes from the following CLs:
72225a3acbc643aa162acbc77c56ab49679af1d9
093a2e4d9aeaecb0d51d8b7c74b4466d368c31cf

Change-Id: I79766077d8531dab5716902c4a25363dc0197442
Merged-In: I79766077d8531dab5716902c4a25363dc0197442
(cherry picked from commit be8be56f089b759ae08f3e822fbea20993ed4b16)
vrcp/Avrcp.java
2f30d891dd14fc84041f4834d45c5631329c6746 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Remove empty finally block" am: cf14f35407 am: 527a4fc43b
am: 5741eada38

Change-Id: I091f5327de4b8222d2bfae7c892536810b8fa36b
527a4fc43b130573c33769d1d83664dd7abbca1a 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Remove empty finally block"
am: cf14f35407

Change-Id: Iaa01b409ef10552a329e1fe8a95a2519d908c767
f9dbbfb910b3593ba25c4e444cd4ad7e31fa122b 11-Oct-2017 Jack He <siyuanh@google.com> [Script] Remove empty finally block

* Empty 'final' block inspection in Intellij
* Accept automatic fixes

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: I6d86299e1d68a508401eee6305b32ad194131c1f
ap/BluetoothMapContent.java
8a9fae192155e74329b7109ff3ccebab4e0d7527 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Remove final modifier from private methods" am: 8d2b3e7f77 am: eba20c9c0b
am: baa868bc37

Change-Id: Ie11211e91e657af4da7ea3a7f57439eeb67ec358
9be5be3b4982d515991177f84b413c75d64f8f17 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Remove unnecessary interface modifiers" am: 0cb8e36851 am: 4c6e4b2fb8
am: 7aafe64ab1

Change-Id: I12b0606ad1b7f54ea436c3ea3b114f3e7ea9ed96
a7c6eaab69b811efc80b88a9306291f6dca0492e 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Add @Override annotations to overriden methods" am: beae4d0081 am: 8c0b70c1f9
am: 1e8b94fe61

Change-Id: Id5eabf98d7154f1c916ce781a5790d8acb40a314
c2dbf3cb39696536e9ef4c47318e59b567fe392a 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Remove redundant conditional expressions" am: c278acfeba am: 168a547f4f
am: c93ba2a277

Change-Id: I09cf13dea486287e167079f338b545db931d59ea
4e849ad1239322c64bef43607b2c402802de2672 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Simplify pointless boolean expressions" am: 92bf44cbd8 am: 04b5f9e63f
am: 5bf08ff95b

Change-Id: I1816f708a8ebb4c553a91b4dc699abb9484fe17e
eba20c9c0bffb0c32736ad6708e8517e299dce5d 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Remove final modifier from private methods"
am: 8d2b3e7f77

Change-Id: Idda24a2424bd9f3e81de8c1d90d3609816478089
4c6e4b2fb8424ceeb13c542c6905c1992fc20026 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Remove unnecessary interface modifiers"
am: 0cb8e36851

Change-Id: Ide6c83bab8271acfba762a7c2c6f8c90b52615a8
4f714d9d47ddf0b1ca64a181d6f677e5be74094a 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Replace C-style array declarations with Java style" am: 69cf218669 am: 3060ea7a20
am: 38ed94421b

Change-Id: I63f2bef4bcf71c81c28cb5ece43b976c9c82f867
8c0b70c1f96344d1490d24eec53b9cc346950e4d 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Add @Override annotations to overriden methods"
am: beae4d0081

Change-Id: I071d5e721401ed9e53030a7a80f4c07cd0947b13
fb8484e12c1a970bc96ce233c2ab48dcd21c7ddc 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Sort modifiers according to JLS" am: 15f43fec23 am: 4be091f19f
am: a8b422397f

Change-Id: I842768a90e45c510f4baa3b0a96e17f417409fd9
168a547f4f8fa1a5926cc7fdb37f9f7acb24388f 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Remove redundant conditional expressions"
am: c278acfeba

Change-Id: Icb2b91df50cb68607730c727edb767cddae0acc2
8d2b3e7f77623cc02f746fdba8c4061736a4e5e3 12-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "[Script] Remove final modifier from private methods"
04b5f9e63f3fa3d35110080a33011a5eade05b1f 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Simplify pointless boolean expressions"
am: 92bf44cbd8

Change-Id: I41bacc9ccae2469773c5cf2eee84c7c2863c9483
0cb8e3685127539f457b636999393b223e89a315 12-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "[Script] Remove unnecessary interface modifiers"
beae4d0081b03ce6e8d418cb03171b5f4540b486 12-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "[Script] Add @Override annotations to overriden methods"
3060ea7a203096807ece9672c0a9a332ffdc187a 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Replace C-style array declarations with Java style"
am: 69cf218669

Change-Id: Ic1560044eaafe7171c81bf7d6ba0c52897934afd
4be091f19fa1f2383a47ceacafaae0e661a65670 12-Oct-2017 Jack He <siyuanh@google.com> Merge "[Script] Sort modifiers according to JLS"
am: 15f43fec23

Change-Id: I76dea67cd4ba7ce4d72e5f48aac7a1fd2553d5cf
c278acfeba50cd07511eba36113dd0af1128742b 12-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "[Script] Remove redundant conditional expressions"
92bf44cbd81905af6310ab45017b610451320d61 12-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "[Script] Simplify pointless boolean expressions"
69cf2186693fae024e3988f1e44b1a9ffa585944 12-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "[Script] Replace C-style array declarations with Java style"
15f43fec2303ce43d89b2b1d5f79dd97574a7e9d 12-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "[Script] Sort modifiers according to JLS"
f64ec30ab5de7d6bba8f8c799436304fa0b53db4 12-Oct-2017 Andre Eisenbach <eisenbach@google.com> Merge "Always send KEYCODE_MEDIA_PLAY_PAUSE"
am: 3249810e04

Change-Id: Iab55cc8407456e792b0c236850c538cbc0ea111a
86950ad23a3463f1ecea3b37ecab2678170e0929 28-Sep-2017 Andre Eisenbach <eisenbach@google.com> Always send KEYCODE_MEDIA_PLAY_PAUSE

Instead of sending _PLAY or _PAUSE as requested by an AVRCP controller,
forward only KEYCODE_MEDIA_PLAY_PAUSE. That way, if the remote device is
not correctly tracking the playback state, the media player will pause
or resume playback in a manner consistent with a users expectations.

Change-Id: Ibc2e542c799fa500f07dbc62408015e74cd6799e
Merged-In: Ibc2e542c799fa500f07dbc62408015e74cd6799e
Fixes: 64006398
Test: Manual; play audio; issue PLAY/PAUSE commands from headphones
(cherry picked from commit e69fc83ad46b1e0c60a1beb59a1c241935282945)
vrcp/Avrcp.java
0e75413b8e0b79efd3d03d0a27bd1bd06a3b7b12 11-Oct-2017 Jack He <siyuanh@google.com> [Script] Remove final modifier from private methods

* Private methods should not be declared final as there is no way to
override them
* In Java there is no C++ 'const' like method modifiers that mark a
method as not modifying the instance content
* Run 'private' method declared 'final' inspection in Intellij and
accept automatic fixes to remove the modifier

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: I57fb646ac592adc0fac36ec7d2552d63a96d239e
ap/BluetoothMapMasInstance.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapService.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppProvider.java
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
ap/SapService.java
4afb3daff459edf52a47f8c67030bf5bc08b9dfe 11-Oct-2017 Jack He <siyuanh@google.com> [Script] Remove unnecessary interface modifiers

* Fix with "Unnecessary interface modifiers" inspection in Intellij

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: Iec25d3b09f6b2b0ce8d66884f81fb35f22320183
ObexConnectionHandler.java
vrcp/AvrcpMediaRspInterface.java
tservice/ProfileService.java
pp/BluetoothOppBatch.java
2fbb1d97d08d5d72fe824e543c714e56cd7be236 10-Oct-2017 Jack He <siyuanh@google.com> [Script] Add @Override annotations to overriden methods

* Run "Missing @Override annotation" inspection in Intellij and perform
automatic fixes

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: I3607581a0538ecce382dbb68742f40662bca6cad
luetoothObexTransport.java
2dp/A2dpService.java
2dpsink/A2dpSinkService.java
2dpsink/A2dpSinkStreamHandler.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcpcontroller/AvrcpControllerService.java
vrcpcontroller/TrackInfo.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/ProfileService.java
att/GattService.java
dp/HealthService.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
id/HidService.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapConvoContactElement.java
ap/BluetoothMapConvoListingElement.java
ap/BluetoothMapMessageListingElement.java
ap/BluetoothMapService.java
ap/BluetoothMapSettingsAdapter.java
ap/BluetoothMapbMessageEmail.java
ap/BluetoothMapbMessageSms.java
ap/MmsFileProvider.java
apclient/MapClientService.java
pp/BluetoothOppBtEnableActivity.java
pp/BluetoothOppBtErrorActivity.java
pp/BluetoothOppHandoverReceiver.java
pp/BluetoothOppIncomingFileConfirmActivity.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppNotification.java
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppTransferHistory.java
pp/TestActivity.java
an/BluetoothTetheringNetworkFactory.java
an/PanService.java
bap/BluetoothPbapActivity.java
bap/BluetoothPbapAuthenticator.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
ap/SapRilReceiver.java
ap/SapService.java
32638a06dfe717fd133c5de9bcaa31204632796c 11-Oct-2017 Jack He <siyuanh@google.com> [Script] Remove redundant conditional expressions

* a ? true : false -> a
* a ? false : true -> !a
* Fixed using "Redundant conditional expression" inspection in Intellij
* a ? true : b -> a || b
* a ? false : b -> !a && b
* Fixed using "Simplifiable conditional expression" inspection in
Intellij

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: If2ef6a1188260b8c76ea99f7a922f1f1f5fe82ab
fpclient/connserv/HfpClientConnectionService.java
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
pp/BluetoothOppLauncherActivity.java
32a94e2fdbaa66fb26bd0be2425b55151b5e493b 10-Oct-2017 Jack He <siyuanh@google.com> [Script] Simplify pointless boolean expressions

* Run "Pointless boolean expression inspection" in Intellij
* Fix issues like
a == false -> !a
a == true -> a
a != true -> !a
a != false -> a

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: I303e8ee7c1cb0d76ccd86edcb08c6e763e2aa7ea
bexServerSockets.java
2dp/A2dpStateMachine.java
vrcp/Avrcp.java
vrcp/BrowsedMediaPlayer.java
att/GattService.java
fp/HeadsetStateMachine.java
ap/BluetoothMapAccountLoader.java
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapConvoListing.java
ap/BluetoothMapConvoListingElement.java
ap/BluetoothMapFolderElement.java
ap/BluetoothMapMasInstance.java
ap/BluetoothMapMessageListingElement.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapService.java
ap/BluetoothMapSettingsAdapter.java
ap/BluetoothMapSmsPdu.java
ap/BluetoothMapbMessageMime.java
ap/BluetoothMnsObexClient.java
pp/BluetoothOppTransferActivity.java
bap/BluetoothPbapObexServer.java
bapclient/PbapClientConnectionHandler.java
ap/SapMessage.java
ap/SapServer.java
dp/SdpManager.java
0612fada88b00a9896feeb9e7a16d5e3e41114f2 10-Oct-2017 Jack He <siyuanh@google.com> [Script] Replace C-style array declarations with Java style

* Type a[] should be replaced with Type[] a;
* This is achieve through running automatic code cleanup in Intellij
using "C-style array declaration" inspection

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: Ie5507e392b6714c3269f25fd31f85b2bcc4dc6e9
tservice/PhonePolicy.java
att/AdvtFilterOnFoundOnLostInfo.java
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapUtils.java
ap/BluetoothMapbMessage.java
ap/BluetoothMapbMessageMime.java
pp/BluetoothOppSendFileInfo.java
pp/TestActivity.java
bap/BluetoothPbapVcardManager.java
dbf5c4e1c9e57fa6e5cc96ee9f442da8aa391a5d 10-Oct-2017 Jack He <siyuanh@google.com> [Script] Sort modifiers according to JLS

* Correct order is:
1. public
2. protected
3. private
4. abstract
5. default
6. static
7. final
8. transient
9. volatile
10. synchronized
11. native
12. strictfp
* This is achieve through running automatic code cleanup in Intellij
using "Missorted modifiers" inspection

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: Id9c8a3c6bf1195b43d986c4324da94ca8c44367f
bexRejectServer.java
bexServerSockets.java
tils.java
2dp/A2dpStateMachine.java
2dpsink/A2dpSinkStateMachine.java
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcp/mockable/MediaController.java
vrcpcontroller/AvrcpControllerService.java
vrcpcontroller/AvrcpPlayer.java
vrcpcontroller/RemoteDevice.java
tservice/AbstractionLayer.java
tservice/AdapterService.java
tservice/PhonePolicy.java
att/AdvertiseManager.java
att/GattDebugUtils.java
att/GattService.java
att/PeriodicScanManager.java
dp/HealthService.java
fp/HeadsetHalConstants.java
fp/HeadsetStateMachine.java
fpclient/HeadsetClientHalConstants.java
fpclient/StackEvent.java
id/HidDevService.java
id/HidService.java
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapFolderElement.java
ap/BluetoothMapMasInstance.java
ap/BluetoothMapSmsPdu.java
ap/BluetoothMapUtils.java
apclient/MnsObexServer.java
apclient/MnsService.java
apclient/obex/BmessageBuilder.java
apclient/obex/BmessageParser.java
apclient/obex/BmsgTokenizer.java
apclient/obex/EventReport.java
apclient/obex/MessagesFilter.java
apclient/obex/Request.java
an/PanService.java
bap/BluetoothPbapService.java
bapclient/BluetoothPbapObexAuthenticator.java
bapclient/BluetoothPbapRequest.java
dp/SdpManager.java
c0e86b3dbf0caf8aae5f40f51fcccb7962b917bc 12-Oct-2017 sqian <shuoq@google.com> Merge "Add missing break statement in Sap message handling" am: 225b6a286d am: 5555886ba4
am: 8767ddc6fe

Change-Id: I96983d89d106beecd03199de42006af31d3694fa
5555886ba40e894b0069a808c60c501f7fbe08f4 11-Oct-2017 sqian <shuoq@google.com> Merge "Add missing break statement in Sap message handling"
am: 225b6a286d

Change-Id: I7cbbc37a14956ec27e8ad8e56f3ea5c911dfca60
be4187cfcd14388571f8604c3b29761dc8c5c0d0 11-Oct-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Fix the logic for re-generating / updating the AVRCP PlaybackState"
am: bc07fc244f

Change-Id: Ic556bf448af2e9724588dec4775bd2460fa29347
66f0c5fc70739b5c4d90685dede27dfd9ec25756 09-Oct-2017 sqian <shuoq@google.com> Add missing break statement in Sap message handling

Bug: 67468803
Test: Treehugger
Change-Id: Ia589369197a6efeffb93684bf5f6f699c7f3bdb9
Merged-In: Ia589369197a6efeffb93684bf5f6f699c7f3bdb9
ap/SapServer.java
c1f493c129b571e7dfca4e384a6a33e10e956ac2 11-Oct-2017 Myles Watson <mylesgw@google.com> Avrcp: Sync mirror-aosp-master and stage-aosp-master am: 630fc91b52
am: 50a97461b4

Change-Id: I118ebe66e618a1a37893c818c737fdf8d421b429
d9d81278d93b7922cb426784457b6c7b5ab2da41 02-Oct-2017 Pavlin Radoslavov <pavlin@google.com> Track the AudioManager Playback state to update the AVRCP playback state

* If the AudioManager playback configuration shows that one of the
player's state is PLAYER_STATE_STARTED (as received in a callback
from the AudioManager), then set the AVRCP state to
PlaybackState.STATE_PLAYING
* Don't suppress AVRCP playback state change when no track change

Bug: b/63151260
Bug: b/66029010
Test: Manual with Bose SoundSport FW v1.3.0
Change-Id: I0878ba26a78a7e5ef52ec033386300b777a39c67
(cherry picked from commit 76aab6dba7956b15c6daafe99b6dddab3eb028a0)
(cherry picked from commit a24231afabc31d1e7c903441108e19931d52a599)

Second Cherry-pick due to an accidental skip during a merge-conflict.
vrcp/Avrcp.java
630fc91b52f0b834cb3e8fe9756098f66111c990 09-Oct-2017 Myles Watson <mylesgw@google.com> Avrcp: Sync mirror-aosp-master and stage-aosp-master

There is a delta between mirror-aosp-master and stage-aosp-master.

This is probably due to a large number of commits being merged at once
by the auto-merger. This CL synchronizes the two branches again.

Test: git diff
Change-Id: I9d30d162a13fb6416f3b4140aa5238f7e0e928f2
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/BrowsedMediaPlayer.java
5b98f3fb852002c91a54488a4e30126631a09f42 10-Oct-2017 Pavlin Radoslavov <pavlin@google.com> Fix the logic for re-generating / updating the AVRCP PlaybackState

Bug: 67582168
Bug: 63151260
Bug: 66029010
Test: Manual with FordFocus carkit
Change-Id: Idc4c4cd42156dba3907b76c5a379ab1da4d1ec7e
(cherry picked from commit 5e600b2e36234f267aa2b2c171f0f4edf8fa65f1)
vrcp/Avrcp.java
b9bf1f8b6125b842032bad73fc0cb3430d4cbc63 10-Oct-2017 Pavlin Radoslavov <pavlin@google.com> Fix the logic for re-generating / updating the AVRCP PlaybackState
am: 5e600b2e36

Change-Id: Idf7dcc063190f91b3e506212f2bad49047dee942
5e600b2e36234f267aa2b2c171f0f4edf8fa65f1 10-Oct-2017 Pavlin Radoslavov <pavlin@google.com> Fix the logic for re-generating / updating the AVRCP PlaybackState

Bug: 67582168
Bug: 63151260
Bug: 66029010
Test: Manual with FordFocus carkit
Change-Id: Idc4c4cd42156dba3907b76c5a379ab1da4d1ec7e
vrcp/Avrcp.java
a24231afabc31d1e7c903441108e19931d52a599 02-Oct-2017 Pavlin Radoslavov <pavlin@google.com> Track the AudioManager Playback state to update the AVRCP playback state

* If the AudioManager playback configuration shows that one of the
player's state is PLAYER_STATE_STARTED (as received in a callback
from the AudioManager), then set the AVRCP state to
PlaybackState.STATE_PLAYING
* Don't suppress AVRCP playback state change when no track change

Bug: b/63151260
Bug: b/66029010
Test: Manual with Bose SoundSport FW v1.3.0
Change-Id: I0878ba26a78a7e5ef52ec033386300b777a39c67
(cherry picked from commit 76aab6dba7956b15c6daafe99b6dddab3eb028a0)
vrcp/Avrcp.java
7f96d22a19b244813def9661c22e188fd3ba9c4a 07-Oct-2017 Pavlin Radoslavov <pavlin@google.com> Track the AudioManager Playback state to update the AVRCP playback state
am: 76aab6dba7

Change-Id: I0fd9f829c5275446a3c8be594c47c2992a2130af
76aab6dba7956b15c6daafe99b6dddab3eb028a0 02-Oct-2017 Pavlin Radoslavov <pavlin@google.com> Track the AudioManager Playback state to update the AVRCP playback state

* If the AudioManager playback configuration shows that one of the
player's state is PLAYER_STATE_STARTED (as received in a callback
from the AudioManager), then set the AVRCP state to
PlaybackState.STATE_PLAYING
* Don't suppress AVRCP playback state change when no track change

Bug: b/63151260
Bug: b/66029010
Test: Manual with Bose SoundSport FW v1.3.0
Change-Id: I0878ba26a78a7e5ef52ec033386300b777a39c67
vrcp/Avrcp.java
f6a7a5e91602153251d775e5e271c7142f3e6d89 04-Oct-2017 Jack He <siyuanh@google.com> PBAP: Clean up SDP record when closing service

* PBAP SDP record was never cleaned up when PBAP service is closed,
resulting in stacked SDP records for PBAP.
* This CL groups cleanup statements into one method and calls it during
onAcceptFailed() and closeService()
* onAcceptFailed() will clean up SDP, shutdown server sockets before
starting a new server socket again
* startSocketListeners() will fail if SDP record already exist before it
starts, caller is responsible in cleaning up the SDP record
* Also, if SDP record is valid, mAdapter should never be null and the
check is unnecessary.

Bug: 67381100
Test: Pair with car kit and repeatly toggle Bluetooth ON/OFF
Change-Id: Ibff32289ca3e082b2a56f79d99c0e8dded728b83
(cherry picked from commit ee4d3dc76249ea6569a6998bea78d1e68215e0fe)
bap/BluetoothPbapService.java
cab7cf41b902c6577908bc4b30f5934c929f7823 05-Oct-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Adapter: Reset adapter connection states when BR/EDR is ready" into oc-mr1-dev
cc177b2e499d8b222241884b09a83cd13ef9c002 05-Oct-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Print the runtime blacklisted devices for AVRCP absolute volume control"
am: 9de2838be6

Change-Id: Iedffd4e2b118dedb0da1355f7a7391c80505ba43
9de2838be60c3a8786f7f93587adcb342e66bbb3 05-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Print the runtime blacklisted devices for AVRCP absolute volume control"
7d1a40e68fa99bb7b93c7ade84429a2bed2c0067 05-Oct-2017 Jack He <siyuanh@google.com> Merge "A2DP Revert "Move A2dp State to Disconnected when BT is Turned OFF"" am: efc0a6d3ca am: f7b452c865
am: 2f36c1b806

Change-Id: Ib16c32841884e0efcc59f0aa52d762ebf44d90eb
2f36c1b80638c01f4a6b93aeefa8a769e533bab2 05-Oct-2017 Jack He <siyuanh@google.com> Merge "A2DP Revert "Move A2dp State to Disconnected when BT is Turned OFF"" am: efc0a6d3ca
am: f7b452c865

Change-Id: I9d0d1a12ca258dd116c90dbaeeeaf88e7f8983c0
f7b452c86580bfcd2da9412cf34763fc8f6c5cb2 05-Oct-2017 Jack He <siyuanh@google.com> Merge "A2DP Revert "Move A2dp State to Disconnected when BT is Turned OFF""
am: efc0a6d3ca

Change-Id: I36d8daaf06141b69edcde6146d26065ed7d6a30f
efc0a6d3caa875832920c12041adf05f8243021b 05-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "A2DP Revert "Move A2dp State to Disconnected when BT is Turned OFF""
aad52567f7c3d4b88868f4dab95c148675c91816 04-Oct-2017 Pavlin Radoslavov <pavlin@google.com> Print the runtime blacklisted devices for AVRCP absolute volume control

The AVRCP runtime blacklisted devices for absolute volume control
are printed in the bluetooth_manager dumpsys section:

AVRCP:
...
Runtime Blacklisted Devices (absolute volume):
XX:XX:XX:XX:XX:XX
YY:YY:YY:YY:YY:YY

If there are no blacklisted devices, then:
...
Runtime Blacklisted Devices (absolute volume):
None

Bug: 63480852
Test: Manual
Change-Id: I01242b681c81b802ce44719a304b525292eaeb01
(cherry picked from commit 32638175c01351b88bbbc5628825db2d62bd1a89)
vrcp/Avrcp.java
ead7a83286f19cbe2021c15b88d3bd54e5934e2d 05-Oct-2017 Jack He <siyuanh@google.com> Merge "PBAP: Clean up SDP record when closing service" am: f90bd2eb44 am: b0c9fc0e28
am: 2a386bf541

Change-Id: I182008662b3da099c19e7fef8ee836bf7fbc070f
2a386bf541f5ccd234e21e89c7a30723efd8a01c 05-Oct-2017 Jack He <siyuanh@google.com> Merge "PBAP: Clean up SDP record when closing service" am: f90bd2eb44
am: b0c9fc0e28

Change-Id: I59a3016c660a0d499197503883f7c025908e2ea2
b0c9fc0e2886dc316af9e3e4f1e51d03c3b301bc 05-Oct-2017 Jack He <siyuanh@google.com> Merge "PBAP: Clean up SDP record when closing service"
am: f90bd2eb44

Change-Id: Ifdde35b1d4dc8eb5472437b10e292e78afe48d7c
389e2558db2d3a1218c257a04d473f63bf74a38f 05-Oct-2017 Pavlin Radoslavov <pavlin@google.com> Print the runtime blacklisted devices for AVRCP absolute volume control
am: 32638175c0

Change-Id: I96a3be73fb4da071b61b37d2ebd2c6c045159bd8
cd167fbf3e335ff253ee72ab72cc8860d853c069 05-Oct-2017 Jack He <siyuanh@google.com> Merge "Adapter: Reset adapter connection states when BR/EDR is ready" am: 32bedeacae am: df4f658d3f
am: 090faaef52

Change-Id: I63633559deb855f18a63eee98d0c641f6610ff23
f90bd2eb447fa2ae95abe79ff9ee67e1be7dda7c 05-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Clean up SDP record when closing service"
090faaef52092b7aefe8a40f023ee53839afba1c 05-Oct-2017 Jack He <siyuanh@google.com> Merge "Adapter: Reset adapter connection states when BR/EDR is ready" am: 32bedeacae
am: df4f658d3f

Change-Id: I40275949cc5a8a12fc48668efceb8b716c469e04
df4f658d3f7996db8d98b92324c3b90be0d14364 05-Oct-2017 Jack He <siyuanh@google.com> Merge "Adapter: Reset adapter connection states when BR/EDR is ready"
am: 32bedeacae

Change-Id: I105b7f38362945d882648a50363790aea716aff5
b4a3b38c404cfd0bc39ae0922d2d3e9a72b2d6bf 03-Oct-2017 Jack He <siyuanh@google.com> Adapter: Reset adapter connection states when BR/EDR is ready

* Set adapter connection state to BluetoothAdapter.STATE_DISCONNECTED on
in onBluetoothReady() callback
* Reset reference counters for profile states including
mProfilesConnected, mProfilesConnecting, mProfilesDisconnecting and
mProfileConnectionState table
* Log discovery start and cancel event

Bug: 65591907
Bug: 66869063
Test: Turn off Bluetooth while devices are connected
Change-Id: Ia2feabbb155ea167a285b1c321532c0d7f3aa0ea
(cherry picked from commit 577298d63aad0acb987c29e61c008456a747ca79)
tservice/AdapterProperties.java
tservice/AdapterService.java
577298d63aad0acb987c29e61c008456a747ca79 03-Oct-2017 Jack He <siyuanh@google.com> Adapter: Reset adapter connection states when BR/EDR is ready

* Set adapter connection state to BluetoothAdapter.STATE_DISCONNECTED on
in onBluetoothReady() callback
* Reset reference counters for profile states including
mProfilesConnected, mProfilesConnecting, mProfilesDisconnecting and
mProfileConnectionState table
* Log discovery start and cancel event

Bug: 65591907
Bug: 66869063
Test: Turn off Bluetooth while devices are connected
Change-Id: Ia2feabbb155ea167a285b1c321532c0d7f3aa0ea
tservice/AdapterProperties.java
tservice/AdapterService.java
ee4d3dc76249ea6569a6998bea78d1e68215e0fe 04-Oct-2017 Jack He <siyuanh@google.com> PBAP: Clean up SDP record when closing service

* PBAP SDP record was never cleaned up when PBAP service is closed,
resulting in stacked SDP records for PBAP.
* This CL groups cleanup statements into one method and calls it during
onAcceptFailed() and closeService()
* onAcceptFailed() will clean up SDP, shutdown server sockets before
starting a new server socket again
* startSocketListeners() will fail if SDP record already exist before it
starts, caller is responsible in cleaning up the SDP record
* Also, if SDP record is valid, mAdapter should never be null and the
check is unnecessary.

Bug: 67381100
Test: Pair with car kit and repeatly toggle Bluetooth ON/OFF
Change-Id: Ibff32289ca3e082b2a56f79d99c0e8dded728b83
bap/BluetoothPbapService.java
d17bd2d2ba3293a0bb094ec4fc79c65688e88c39 04-Oct-2017 Jack He <siyuanh@google.com> A2DP Revert "Move A2dp State to Disconnected when BT is Turned OFF"

Original change ID: I17bc620551bf735f39327eff59102c14551bcf26

There is a race condition in A2DP state machine where state transition
to Connected state may not complete before doQuit() is called. In this
case, state machine has sent state transition going from CONNECTING to
CONNECTED, whereas doQuit() will see the state as CONNECTING and will
send a state transition intent going from CONNECTING TO DISCONNECTED,
causing a disruption in the state transition.

* This CL reverts and older commit that created this behaviour as no
other profiles send this intent during doQuit. Currently, when
Bluetooth is turned off, the turning OFF intent should supersede all
other profile state change intent until further changes are made to
all profiles.
* That is, if BluetoothAdapter.ACTION_STATE_CHANGED intent's EXTRA_STATE
extra is STATE_OFF, all existing profile states are invalidated and
defaulted to DISCONNECTED
* This is the behaviour for all profiles at this moment until plans are
made to change it

Bug: 67419965
Test: Pair and repeatly toggle Bluetooth
Change-Id: I81b28067af031818c8668c9bd6fd1d807ad7fb8f
2dp/A2dpStateMachine.java
32638175c01351b88bbbc5628825db2d62bd1a89 04-Oct-2017 Pavlin Radoslavov <pavlin@google.com> Print the runtime blacklisted devices for AVRCP absolute volume control

The AVRCP runtime blacklisted devices for absolute volume control
are printed in the bluetooth_manager dumpsys section:

AVRCP:
...
Runtime Blacklisted Devices (absolute volume):
XX:XX:XX:XX:XX:XX
YY:YY:YY:YY:YY:YY

If there are no blacklisted devices, then:
...
Runtime Blacklisted Devices (absolute volume):
None

Bug: 63480852
Test: Manual
Change-Id: I01242b681c81b802ce44719a304b525292eaeb01
vrcp/Avrcp.java
3f0f649943b70507f8d528ffde75ffde3d4f7161 04-Oct-2017 Hemant Gutpa <hemantg@codeaurora.org> Merge "PBAP: Set Pbap connection state to DISCONNECTED on ACL_DISCONNECT." am: 69d4a880af am: f77af59a29
am: b139f92bc4

Change-Id: I0cf0660c68d6f150e5729f73ec25f51151778bcb
f26d22afe1c80d3e541dd70d4a7808c62c453ba5 04-Oct-2017 Satish Kodishala <skodisha@codeaurora.org> Merge "HFP: Reset max index if greater than number of Phone Book entries" am: 88f9f6b84e am: 5f9aad1ce9
am: 9b13a79b84

Change-Id: I8de63d8a2e0a72a33cf7ab3ed29fd1fe65166ae2
b139f92bc4c446c8369ea0ea2d50a9cb71bd81c8 04-Oct-2017 Hemant Gutpa <hemantg@codeaurora.org> Merge "PBAP: Set Pbap connection state to DISCONNECTED on ACL_DISCONNECT." am: 69d4a880af
am: f77af59a29

Change-Id: Ic9058ae081fdc7cdea0f4f34abdb0a81b560df12
9b13a79b843c340e82c28f9f65a3870c854f1271 04-Oct-2017 Satish Kodishala <skodisha@codeaurora.org> Merge "HFP: Reset max index if greater than number of Phone Book entries" am: 88f9f6b84e
am: 5f9aad1ce9

Change-Id: Ice3a19ae19c3228eeb045b93a7cabd18de829e3f
000c9bdec8980a971dd8e978b779dc7e4bae5386 04-Oct-2017 Jack He <siyuanh@google.com> Merge "PBAP: Use ACTION_CONNECTION_STATE_CHANGED intent" am: d6d31a24f2 am: cb96941120
am: 8dd0ffc8d5

Change-Id: I56465469b159d6103a3afd6d061ce324bf7a0457
f77af59a29728c0f19e1a4cb46ea61b1338823c5 04-Oct-2017 Hemant Gutpa <hemantg@codeaurora.org> Merge "PBAP: Set Pbap connection state to DISCONNECTED on ACL_DISCONNECT."
am: 69d4a880af

Change-Id: Iad6f8d09206c73747a57cdf57335183a25aff654
5f9aad1ce975a5d582bd4feddafd5fd1dc2fdfec 04-Oct-2017 Satish Kodishala <skodisha@codeaurora.org> Merge "HFP: Reset max index if greater than number of Phone Book entries"
am: 88f9f6b84e

Change-Id: I58876c1f4302792d4f8ff3f93f7670b5814eb0fd
8dd0ffc8d58df4eddcaf209ccaf1d616c6fca805 04-Oct-2017 Jack He <siyuanh@google.com> Merge "PBAP: Use ACTION_CONNECTION_STATE_CHANGED intent" am: d6d31a24f2
am: cb96941120

Change-Id: I7e493ec02906cb0cd65adf9657d5105291d62af6
69d4a880af51125f4703dfb4da920f7b66ec238d 04-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Set Pbap connection state to DISCONNECTED on ACL_DISCONNECT."
88f9f6b84e1403f7214a46bd9624424f8966f716 04-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "HFP: Reset max index if greater than number of Phone Book entries"
cb9694112071d11905e4f2d149f19d2afa24f6e9 04-Oct-2017 Jack He <siyuanh@google.com> Merge "PBAP: Use ACTION_CONNECTION_STATE_CHANGED intent"
am: d6d31a24f2

Change-Id: I08db3565a6c9cb72c50107eb1f6bc065034e9388
f84ced0c01e6a582bfba63635be38ccc1e161da5 21-Sep-2017 Satish Kodishala <skodisha@codeaurora.org> HFP: Reset max index if greater than number of Phone Book entries

Use case:
1. Pair and connect to car kit supporting Phone book download
using AT commands eg Skoda Octavia 1.6.
2. Sync call history from car kit UI.

Failure:
Some times, phone just sends OK to AT+CPBR command though
there are entries in the call history.

Root cause:
When car kit requests for more number of entries than actually
present in the phone, we just send OK and don't send any results.

Fix:
When max index in AT+CPBR command is greater than number of entries
in phone book, reset the max index to the number of entries and send
available entries.

Bug: 66358394
Change-Id: I5c106b67d2696108f165c37d543c84fad724852c
fp/AtPhonebook.java
328d1b6933d978e68389165d601818bd152a8635 14-Sep-2017 Hemant Gutpa <hemantg@codeaurora.org> PBAP: Set Pbap connection state to DISCONNECTED on ACL_DISCONNECT.

Usecase:
1) Establish Pbap session with Pbap client.
2) Remote goes out of range or turns off BT so that
Pbap server receives ACL_DISCONNECTED

Issue:
Pbap connection state is not changed to STATE_DISCONNECTED.

Root Cause:
stopObexServerSession() is not invoked from ServerSession
close event to set the state to STATE_DISCONNECTED.

Fix:
Handle the case to set state to STATE_DISCONNECTED on
receiving intent ACL_DISCONNECTED.

Test: PBAP is now always restarted in case of ACL disconnect
leading to no issues in PBAP reconnection as confirmed after
following above usecase.

Bug: 65714305
Change-Id: I2af5c0a691d393a9aae869811109453d06021b70
bap/BluetoothPbapService.java
4aee91ad137fd2f3d64ee4eef9a78fdf2b7e72ef 03-Oct-2017 Jack He <siyuanh@google.com> PBAP: Use ACTION_CONNECTION_STATE_CHANGED intent

* Use ACTION_CONNECTION_STATE_CHANGED to broadcast connection state
change to comply with BluetoothProfile interface requirement
* Use BluetoothProfile.STATE_* variables to represent connection
states for PBAP profile
* Receive this intent in AdapterProperties to track PBAP state change
in profile state reference counter

Bug: 63873163
Test: Connect to car kits
Change-Id: Ie0eb775ae7f7a55cd0c2ad96858feec18b73ab6f
tservice/AdapterProperties.java
bap/BluetoothPbapService.java
8bbaa9fb93337335d1108bea069747172d2e555f 03-Oct-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Remove unused gattClientScanFilterDeleteNative" am: 7f90f9168f am: a1cb1ac112
am: 99646819fb

Change-Id: I6cb408b80266cf415976687ccb74f254a5975886
99646819fb72ec7848b88cbe2d60b942ae3606d1 03-Oct-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Remove unused gattClientScanFilterDeleteNative" am: 7f90f9168f
am: a1cb1ac112

Change-Id: I36ed6f9cb9ab664b85f8161ddfe217f6fa7b08f5
a1cb1ac112300630c69ef423e12f6a27aef1639b 03-Oct-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Remove unused gattClientScanFilterDeleteNative"
am: 7f90f9168f

Change-Id: I62af20d3e018368d0f68cff965b70f6a4458feda
69e8a253467e7870d044de9bc58c5801f2dd3c10 30-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Remove unused gattClientScanFilterDeleteNative

Test: compilation
Bug: 67058417
Change-Id: Id83f0abdbd04a050318a1ce4b2bdeea5e20e454e
att/ScanManager.java
202e8613bb0dff776d715ccad85b0168d28a7736 02-Oct-2017 Andre Eisenbach <eisenbach@google.com> Always send KEYCODE_MEDIA_PLAY_PAUSE
am: e69fc83ad4

Change-Id: Ie3ffb727cf6ae2af2fe7d8ac2857291438690926
e69fc83ad46b1e0c60a1beb59a1c241935282945 28-Sep-2017 Andre Eisenbach <eisenbach@google.com> Always send KEYCODE_MEDIA_PLAY_PAUSE

Instead of sending _PLAY or _PAUSE as requested by an AVRCP controller,
forward only KEYCODE_MEDIA_PLAY_PAUSE. That way, if the remote device is
not correctly tracking the playback state, the media player will pause
or resume playback in a manner consistent with a users expectations.

Change-Id: Ibc2e542c799fa500f07dbc62408015e74cd6799e
Fixes: 64006398
Test: Manual; play audio; issue PLAY/PAUSE commands from headphones
vrcp/Avrcp.java
2275db80db70fb7630bfa617faeb3d82373f0d32 29-Sep-2017 Vinay Kalia <vinaykalia@google.com> Merge "Fix connection time for GATT clients" am: 531cc43952 am: 16151acdb7
am: 765c037a03

Change-Id: I17bf6c1a21d63da736ba0adcc15899795415ae7b
765c037a03dbab4b4cd9e20174eedd02352bcbfb 29-Sep-2017 Vinay Kalia <vinaykalia@google.com> Merge "Fix connection time for GATT clients" am: 531cc43952
am: 16151acdb7

Change-Id: I879f8768ccfdf270be1aa5c646b026755097d203
16151acdb7bef3186971b65d9584b7053f37bbc5 29-Sep-2017 Vinay Kalia <vinaykalia@google.com> Merge "Fix connection time for GATT clients"
am: 531cc43952

Change-Id: I793c5b40026ace44170240d1351027ff78a36f05
99d01e04b0a52f4cf4e1e4a1d1eb70a171f3a5e2 14-Sep-2017 Vinay Kalia <vinaykalia@google.com> Fix connection time for GATT clients

Conenction time was not logged correctly in bluetooth_manager
dumpsys. Fix this by adding the wall clock time when connection
started and the elapsed time in ms for which the connection has
been active.

BUG: 65543218
Test: Tested with VR headset.
Change-Id: I756f3f807bd3e3c61cadc00567e367941bc3f021
att/AppScanStats.java
att/ContextMap.java
10dd6e2b0924ead9ebf9347b0b97eea904116077 29-Sep-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Printed the modified AVRCP features in case a device is blacklisted" am: 0a75773f97
am: 576a897ae0

Change-Id: I1e4719cd78ee7a68b7fb243fecad4d96a25c1e2d
1a3a54dc6b349a6560317eb58166b8b3f956c69d 29-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Set the AVRCP absolute volume control initial volume to 50% for all devices" into oc-mr1-dev
ecd248e2cba1d54326b3fadbc966204e28a99d0f 29-Sep-2017 Pavlin Radoslavov <pavlin@google.com> Printed the modified AVRCP features in case a device is blacklisted
am: 2167443fa8

Change-Id: Id62c618dfb044f82269065551445a05ad8d4f3cf
576a897ae0a0b9233a4d835660c2aeb6c4d13ce0 29-Sep-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Printed the modified AVRCP features in case a device is blacklisted"
am: 0a75773f97

Change-Id: Ie27f43935b08d1de20026ed58c91b98b0221e3fa
2167443fa83241273d2ccb36b72f0906e3c5338a 29-Sep-2017 Pavlin Radoslavov <pavlin@google.com> Printed the modified AVRCP features in case a device is blacklisted

Bug: 63480852
Test: Manual
Change-Id: I6c53d014bd8eaf3789df824b21fd827e66f10389
(cherry picked from commit 414480de643b551c1d2dd7db971cc24cff29a605)
vrcp/Avrcp.java
414480de643b551c1d2dd7db971cc24cff29a605 29-Sep-2017 Pavlin Radoslavov <pavlin@google.com> Printed the modified AVRCP features in case a device is blacklisted

Bug: 63480852
Test: Manual
Change-Id: I6c53d014bd8eaf3789df824b21fd827e66f10389
vrcp/Avrcp.java
e410aeb8bf4f9e3491bb117160d480a150b05d54 28-Sep-2017 David Rim <davidrim@google.com> Merge "Enable bluetooth a2dpsink to request audio focus from source" am: b35be832f5 am: 0eafe3be18
am: 1e0c656c26

Change-Id: I1023598d31dc747c92872955d5ee1a5440d23296
1e0c656c26e4ea9305e19515e4f6bb7b9647e962 28-Sep-2017 David Rim <davidrim@google.com> Merge "Enable bluetooth a2dpsink to request audio focus from source" am: b35be832f5
am: 0eafe3be18

Change-Id: I0b6c52a04caa6cab60a51c41f76e1786ca426674
0eafe3be185ea0b38469725c605a1f619dfa4898 28-Sep-2017 David Rim <davidrim@google.com> Merge "Enable bluetooth a2dpsink to request audio focus from source"
am: b35be832f5

Change-Id: Ibc4bf9da6ed3a87955a504172dc60da6f5e33b50
b35be832f50ad31e2b100fea1344136a32173d60 28-Sep-2017 David Rim <davidrim@google.com> Merge "Enable bluetooth a2dpsink to request audio focus from source"
956992dd61227490b958cdd87a6ffe1505be8ea0 28-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "GATT: Thread-safe ClientHandler invocation" am: 9f6f58ffab am: d3a5834439
am: a50680df13

Change-Id: I74cd15335e930b4b8aab92e46f0204dabe6eadb4
a50680df13f0b379e151ad8d34fe828e77509e96 28-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "GATT: Thread-safe ClientHandler invocation" am: 9f6f58ffab
am: d3a5834439

Change-Id: If9cb26a2b6f65532f6ae7b34e39879820d06ef30
d3a58344392bb7d9f2d17805bbfbc55b17d9e6c4 28-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "GATT: Thread-safe ClientHandler invocation"
am: 9f6f58ffab

Change-Id: I175576199697eaa67b06d65fc987b053945aaa9a
880574badbb1b42613520c416bccc05fb459584d 22-Sep-2017 xutianguo <xutianguo@xiaomi.com> GATT: Thread-safe ClientHandler invocation

Handler could be null when do cleanup in main thread, then NPE
will happen if the ClientHandler thread is still processing
messages.

Bug: 66544093
Test: Enable Bluetooth and search Bluetooth devices, turn off the
Bluetooth and repeat above steps.

Change-Id: Ie8a0d71236bd96e31b5524bcc4690796ad34d68f
Signed-off-by: xutianguo <xutianguo@xiaomi.com>
att/ScanManager.java
88029bd464b3caaf95eecab15dc18b3d73aa12b0 28-Sep-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Set the AVRCP absolute volume control initial volume to 50% for all devices" am: f427803a7d am: ed1bedf1c1
am: 7cbd426bd8

Change-Id: I5be1b1e497680e7311feb47d3d41a62715225ecf
7cbd426bd8941102ecf03182ca3cc67697086cca 28-Sep-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Set the AVRCP absolute volume control initial volume to 50% for all devices" am: f427803a7d
am: ed1bedf1c1

Change-Id: Ic9ed122cb6b7ee70b8f07cc087e53226b7511722
9ef4a582ed78ae48b867012ea53ba3cec79a31f7 26-Sep-2017 Pavlin Radoslavov <pavlin@google.com> Set the AVRCP absolute volume control initial volume to 50% for all devices

* Introduced a new configuration value named
"a2dp_absolute_volume_initial_threshold_percent" that can be used to
specify the absolute volume control initial value as a percent of
the maximum volume level.

Valid values are in the [0, 100] interval, and the default value is 50%.

* Marked the existing configuration "a2dp_absolute_volume_initial_threshold"
as @deprecated.

Bug: 65754094
Test: Manual test with devices that have different numbers of volume steps
Change-Id: I449c5de52c68e66a3c01721bf6324f3090cfc33c
(cherry picked from commit 241337c1482c484e1a3a5fb24bc642937ab1a47c)
vrcp/Avrcp.java
ed1bedf1c128f850812bf7a6ec5d506b1fefa814 28-Sep-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Set the AVRCP absolute volume control initial volume to 50% for all devices"
am: f427803a7d

Change-Id: I068667419bd7f16382ac2eccc5f021e968642e72
241337c1482c484e1a3a5fb24bc642937ab1a47c 26-Sep-2017 Pavlin Radoslavov <pavlin@google.com> Set the AVRCP absolute volume control initial volume to 50% for all devices

* Introduced a new configuration value named
"a2dp_absolute_volume_initial_threshold_percent" that can be used to
specify the absolute volume control initial value as a percent of
the maximum volume level.

Valid values are in the [0, 100] interval, and the default value is 50%.

* Marked the existing configuration "a2dp_absolute_volume_initial_threshold"
as @deprecated.

Bug: 65754094
Test: Manual test with devices that have different numbers of volume steps
Change-Id: I449c5de52c68e66a3c01721bf6324f3090cfc33c
vrcp/Avrcp.java
8a2890005aa9cf9f486854cc06fcd6e1da78ee65 27-Sep-2017 Pulkit Bhuwalka <pulkitb@google.com> Merge "Modify Bluetooth Class of Device from Android stack" am: 67530d09bc am: af64a7b3c6
am: 74d013667f

Change-Id: Iebff94e30d4e06519f686f8d14279fe6bc655047
74d013667f0ef4b36a6a4a02c15d615429e6a4bc 27-Sep-2017 Pulkit Bhuwalka <pulkitb@google.com> Merge "Modify Bluetooth Class of Device from Android stack" am: 67530d09bc
am: af64a7b3c6

Change-Id: I7dbaf73a09bb23d099667e84786b6761c49bc207
506af9a1e7d412b7df6e6c1fb1b77e7d311f430c 13-Jul-2017 Hall Liu <hallliu@google.com> Defer sending NETWORK_STATE_AVAILABLE to headset

When the phone comes into service, don't report the state of the device
as being in-service until the sim is fully loaded.

Change-Id: I1ebfefc580b32d06bc249de343277d1714116f13
Fixes: 37301718
Test: manual (pop sim out, pop sim in)
(cherry picked from commit c51c87b3713a5bd9650d42e0a807a4291bb09fb0)
fp/HeadsetPhoneState.java
7b03b06716b593324efe1a690eaad17eee5368dc 27-Jun-2017 Hall Liu <hallliu@google.com> Defer sendDeviceStateChanged until SIM config loaded

When a sim is inserted, the service state will change before all the
data is fully available. To prevent the headset from seeing bad data,
wait until the sim config is fully loaded before calling
sendDeviceStateChanged.

Change-Id: I49831b8b1e494b2263cbc543c187b170faaaaca0
Fixes: 37301718
Test: manual
(cherry picked from commit 487fb02a65fafa5689a037460875470ae1b4e209)
fp/HeadsetPhoneState.java
428c04a43668a88ddf74fb51150d21ee4b80755c 11-Jul-2017 Marie Janssen <jamuraa@google.com> A2DP: Only unregister receiver if we registered

If A2DP isn't ever started, A2dpService.cleanup() would try to unregister
when we are not registered.

Bug: 63061079
Test: none
Change-Id: I7229625f19c07dddeb58d7ee0787c83f0164e3e8
(cherry picked from commit 6a5c11bb626571ec8049733743a5e65e7845a67d)
2dp/A2dpService.java
af64a7b3c6a23b0b88fc738672ebf6d74cb7cbbd 27-Sep-2017 Pulkit Bhuwalka <pulkitb@google.com> Merge "Modify Bluetooth Class of Device from Android stack"
am: 67530d09bc

Change-Id: I69780d89605c9938b61a533ac1c1291a2c06ac92
f71053d42b6d40fd95f566f30f007d827d5c4f32 27-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "HFP: Implement toString for HeadsetPhoneState" am: 2707f3d77a am: 2205269f62
am: f9babd68eb

Change-Id: I37085bd6196f994e0a805d976c894f35f463aadf
f9babd68eba430cbfccd2466f2c8174c7577116e 27-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "HFP: Implement toString for HeadsetPhoneState" am: 2707f3d77a
am: 2205269f62

Change-Id: Ic3c7337e7b79a8b90bd6978a0be6e6354f8b8803
b7a63ecf4a23fa20e61d269715bee736dacaed30 17-Aug-2017 Pulkit Bhuwalka <pulkitb@google.com> Modify Bluetooth Class of Device from Android stack

Bug: 36015415
Test: Modified Class of Device using sample app and verified device icon
change when discovering from a remote device.

Change-Id: Ida07827b375039629f9e19e2ec0a4ff61b1e0fb4
tservice/AdapterProperties.java
tservice/AdapterService.java
2205269f626af53805715121e3829f2a57ddfe7e 27-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "HFP: Implement toString for HeadsetPhoneState"
am: 2707f3d77a

Change-Id: I21540f5ddadcdf89d860dbf0257f3e1bc0e19866
3ed2ffc8eef065d0f85d197d0d302972230a7566 20-Sep-2017 xutianguo <xutianguo@xiaomi.com> HFP: Implement toString for HeadsetPhoneState

Test: Run adb shell dumpsys bluetooth_manager and check the output.

Change-Id: I35fd89fd6d61e13a7a1b5347550476aabfd0dea1
Signed-off-by: xutianguo <xutianguo@xiaomi.com>
fp/HeadsetPhoneState.java
79b08a1c2c1610d78bd5a0d351597e1147281254 26-Sep-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "A2DP sink audio focus" am: 8984609cb5
am: 3edef16b00

Change-Id: I751d9b9832383eb2671c5a406ac4e49ddbed0eb1
3edef16b00df8c6c292453a1134ae19f854cf473 26-Sep-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "A2DP sink audio focus"
am: 8984609cb5

Change-Id: I662998dd60a0267fc81969fd9fe2383019982107
597356381e0aa89b908094c9cfcd94f30bfd124d 15-Sep-2017 Joseph Pirozzo <pirozzoj@google.com> A2DP sink audio focus

Update AudioFocusRequest to receive notification on
AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK.

Bug: 38389934
Test: stream music over Bluetooth and play Nav guidance, observe music
is ducked.

Change-Id: I1b4d33fd63cc6033c06bf24ac0f9a41aeeaf292d
Merged-In: Id0403116019e46191508ed9a4f6f627467db1726
(cherry picked from commit c1a28a6353131f59c23865440ee37a7e208d7d2c)
2dpsink/A2dpSinkStreamHandler.java
7b4e50147d5b34af712e1016451ac119fe6bbdb6 23-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "SAP: Initialize mIntentReceiver to null" into oc-mr1-dev
541c55b73c30621de84490c94aaa94b35c1b7687 23-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "HFP: Fix headset state transition on device replacement" into oc-mr1-dev
6273ddaaeb0c9f07c89357e3e5c3ca22c4e10a9c 23-Sep-2017 Jack He <siyuanh@google.com> Merge changes from topic "bt-fix-phone-policy-limit-retry" am: 21e8f30d61 am: 136b9d5122
am: 8c1c14e59f

Change-Id: Ibb9db2b628e7dc9c4e5d2c598312f3a96bb85736
8c1c14e59f5a4d87913661ebbc7143b1d5b789e4 23-Sep-2017 Jack He <siyuanh@google.com> Merge changes from topic "bt-fix-phone-policy-limit-retry" am: 21e8f30d61
am: 136b9d5122

Change-Id: I700bab9fc058731a45a331ee3b6c40c2c641bea2
136b9d5122a4de0a581a48302d5cad8cfe81cbf0 23-Sep-2017 Jack He <siyuanh@google.com> Merge changes from topic "bt-fix-phone-policy-limit-retry"
am: 21e8f30d61

Change-Id: I1c70fe36dc6136f8e5492efcaa55ce1085db2975
ff5b7361a8db715a092bf93346408d342ebd354a 22-Sep-2017 Jack He <siyuanh@google.com> PhonePolicy: Retry HFP and A2DP once only

* Limit HFP and A2DP profile retries to once only

Bug: 32998946
Test: build, pair and connect with headset and car kit
Change-Id: I1c1ec48bbbbe8d97664eca81aac8267e3659a6fc
(cherry picked from commit 2cc754651ee7245e62fa247b1ca85acb6889e79e)
tservice/PhonePolicy.java
f1dffb6abedde44d51e60515e0d95f726c82a8fa 22-Sep-2017 Jack He <siyuanh@google.com> Merge "SAP: Initialize mIntentReceiver to null" am: 9e90561b73 am: 2393a01ea7
am: a0af46288c

Change-Id: Ic56ea7d1c38be788d579aa5dc0af649650264882
b7cafbaa7a50e61c5e473a874c14ea050f5c38ab 22-Sep-2017 Jack He <siyuanh@google.com> PhonePolicy: Logging and logic refactor

* Do not log arrays by reference
* Do not log intent by reference

Bug: 32998946
Test: make, no functional change
Change-Id: If1d20c1d7ff221a27b0b516a37c919d192efb363
(cherry picked from commit d94f6ddab1f088340d197086949409c144ec2b0a)
tservice/PhonePolicy.java
69e5b58697f1b315be21e8755ffdd8e0b00bdd93 22-Sep-2017 Jack He <siyuanh@google.com> Merge "HFP: Fix headset state transition on device replacement" am: 4958f55216 am: 306d6d6b93
am: e962bb58b5

Change-Id: I6219b00e1ed1ea72ab84ac7d6afe365c44335dda
4db373c52aed2c792a74e3fb47b54d5c1daa3d96 22-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix ScannerMap leak" am: acf5c9a589 am: 2337aeaace
am: bbbf0bcb87

Change-Id: Ie6a0401dd3e31f9f8b68cb1715da945d1f00a8cc
acbe70b65d63cc7ece88216b0053eef5e0062032 22-Sep-2017 Jack He <siyuanh@google.com> HFP: Fix headset state transition on device replacement

* When a new HFP device connected to replace the current one, we should
only send one intent going from CONNECTED to DISCONNECTING
* Change Icb1a7215ff6d9491afbb5f7f203ca0a2c6b7f43a introduces an extra
intent that broke this flow, resulting in overall state mismatch

Bug: 65591907
Test: Connect to one HFP device and then connect to another HFP device
the first one is connected

Change-Id: Id0879abbe6924d29a098876d1d312b739a38337a
(cherry picked from commit 6e5266383faba478f418ceb0b0b5fd086a5f66b2)
fp/HeadsetStateMachine.java
a169df6d977b08b6ad20f38f111665abac44199c 21-Sep-2017 Jack He <siyuanh@google.com> SAP: Initialize mIntentReceiver to null

* When SAP server quits, it uses mIntentReceiver to determin whether it
has be registered or not. However, it won't be null if it is
initialized to an instance of BroadcastReceiver
* This change creates SapServerBroadcastReceiver class and only assign
mIntentReceiver to its instance in the constructor.

Bug: 66230053
Fixes: 66230053
Test: build
Change-Id: I65e587f98ffcc334372c5f8770a499f9ae265358
(cherry picked from commit 7553e937b3769e07e5f189666370211061849b6a)
ap/SapServer.java
2cc754651ee7245e62fa247b1ca85acb6889e79e 22-Sep-2017 Jack He <siyuanh@google.com> PhonePolicy: Retry HFP and A2DP once only

* Limit HFP and A2DP profile retries to once only

Bug: 32998946
Test: build, pair and connect with headset and car kit
Change-Id: I1c1ec48bbbbe8d97664eca81aac8267e3659a6fc
tservice/PhonePolicy.java
d94f6ddab1f088340d197086949409c144ec2b0a 22-Sep-2017 Jack He <siyuanh@google.com> PhonePolicy: Logging and logic refactor

* Do not log arrays by reference
* Do not log intent by reference

Bug: 32998946
Test: make, no functional change
Change-Id: If1d20c1d7ff221a27b0b516a37c919d192efb363
tservice/PhonePolicy.java
a0af46288ce7939f492e45aa11411f85f7c999f9 22-Sep-2017 Jack He <siyuanh@google.com> Merge "SAP: Initialize mIntentReceiver to null" am: 9e90561b73
am: 2393a01ea7

Change-Id: I09248c286f91c2df11a186e851201051a4037e0b
e962bb58b53d83e7c9133b111e6e357ec3fd6a6f 22-Sep-2017 Jack He <siyuanh@google.com> Merge "HFP: Fix headset state transition on device replacement" am: 4958f55216
am: 306d6d6b93

Change-Id: I91a39929cb69b6e773b0e4f3d5f310bd2bdfa336
2393a01ea7fe6af3f156c20182bf1c6baf989d08 22-Sep-2017 Jack He <siyuanh@google.com> Merge "SAP: Initialize mIntentReceiver to null"
am: 9e90561b73

Change-Id: I4d101f46bdc5a85e9359e6d8b9c3fb1c17b0c7c3
306d6d6b93fabbf49ca54bbb2fc2c19b4ae67d0e 22-Sep-2017 Jack He <siyuanh@google.com> Merge "HFP: Fix headset state transition on device replacement"
am: 4958f55216

Change-Id: Ic8a1495e1fb0ce0bbcd606f357dd18499836ad47
9e90561b733e2a6d90f5db92f9bf7bc874cf8227 22-Sep-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "SAP: Initialize mIntentReceiver to null"
6e5266383faba478f418ceb0b0b5fd086a5f66b2 22-Sep-2017 Jack He <siyuanh@google.com> HFP: Fix headset state transition on device replacement

* When a new HFP device connected to replace the current one, we should
only send one intent going from CONNECTED to DISCONNECTING
* Change Icb1a7215ff6d9491afbb5f7f203ca0a2c6b7f43a introduces an extra
intent that broke this flow, resulting in overall state mismatch

Bug: 65591907
Test: Connect to one HFP device and then connect to another HFP device
the first one is connected

Change-Id: Id0879abbe6924d29a098876d1d312b739a38337a
fp/HeadsetStateMachine.java
7553e937b3769e07e5f189666370211061849b6a 21-Sep-2017 Jack He <siyuanh@google.com> SAP: Initialize mIntentReceiver to null

* When SAP server quits, it uses mIntentReceiver to determin whether it
has be registered or not. However, it won't be null if it is
initialized to an instance of BroadcastReceiver
* This change creates SapServerBroadcastReceiver class and only assign
mIntentReceiver to its instance in the constructor.

Bug: 66230053
Test: build
Change-Id: I65e587f98ffcc334372c5f8770a499f9ae265358
ap/SapServer.java
bbbf0bcb873a75bc6e81df05d619646c57e6d5bb 22-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix ScannerMap leak" am: acf5c9a589
am: 2337aeaace

Change-Id: Iadcb0359bde1b3292b63f73b7c6f7586bb75d7c8
2337aeaace1e50d563fe18ac706e1368518e21ce 22-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix ScannerMap leak"
am: acf5c9a589

Change-Id: Ied30efea9ca4ea8f8ecac7454ca0a277422f2f74
0ef420c2f9c6ef362e3e26bc4f15e40a3aad8a10 22-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Fix ScannerMap leak

The entry should be added only after we check if app was scanning too
frequently

Test: compilation
Change-Id: If650d0e577a0497d1268d09bea62c02f9b56d675
att/GattService.java
17fb558cf51dbcf34feadd022116c7d87524b2d8 29-Aug-2017 Ajay Panicker <apanicke@google.com> Use the current item in the existing queue rather than using metadata

GPM adds additional info into the bundle under a specific key which contains
extra metadata. When a carkit (Magneti BMW does this) requests UID 0 with
getItemAttributes, we would construct a queueItem out of the current song.
This breaks with GPM as the metadata returned from getMetadata() from their
MediaController would not be filled or contain this additional bundle. Instead
always use updateNowPlayingList as it can construct a queue with all the info
we have.

Bug: 65166802
Test: Test switching playlists in GPM with Magneti BWM and see that more info
other than the song title shows up.
Change-Id: Ie96b3a5eccb94b86337936c913c3e81b67745362
(cherry picked from commit b8d861656aa343ebec4c099cbf8fb468f2012be5)
vrcp/AddressedMediaPlayer.java
85aee8a39e8ca855b1b42724bca710aa1bfa6a7f 24-Aug-2017 Ajay Panicker <apanicke@google.com> Don't reject notifications and wait until new addressed player is ready (1/2)

There are some carkits like the ones found in the 2016 Honda CRZ and some
Audi's that do not follow the spec and do not honor reject pending notification
messages after switching players. This causes an issue whenever you switch
players, the metadata freezes due to the fact that the carkit never re-registers
for new track changed notifications. This patch removes the reject notification
and reorders the current notifications.

Bug: 64142363
Test: Test with Audi S7 and 2016 Honda CRZ and see that switching players works
TestTracker/105391/3975
Change-Id: Ifcc236c54ccbec8e8ec0bd7f16e62e4282361bac
(cherry picked from commit 67c982aed4e67772e155f934c2055c72b83f1f22)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
69ff4deec22f9b7375905608dc07a0a84c480c52 31-Jul-2017 Ajay Panicker <apanicke@google.com> Check if now playing list is updated by comparing the current queue (1/3)

Bug: 64686424
Test: Connect to carkit and see that NowPlayingChanged only gets sent when the queue changes
Change-Id: I5da15e466462eaf88ab4918af38c19231adaeea3
(cherry picked from commit ef56c5471dda0dc624d99a18506f8c9330ed8327)
vrcp/AddressedMediaPlayer.java
42b19bc308e155b52e735e38efca42d5c7c6a699 24-Aug-2017 Ajay Panicker <apanicke@google.com> AVRCP: Only send the active player for media player listings

Some carkits will try to connect to the first player in the media player
list (Harman BMW) while other carkits will try to connect to the last player
in the listing (Magneti BMW). Send only one player in the listing so that
it doesn't matter if it connects to the first or the last.

Bug: 64991621
Bug: 64749777
Test: Connect to Harman BMW and see that the player listing only has one entry
with multiple players installed, on Magneti carkit see that the carkit
sets the current addressed player instead of a player that wasn't
addressed

Change-Id: Ia8410473a5642bcc4ac7d1986c8c647fb7a4d78d
(cherry picked from commit 82cfeee4ed9139eeb55e6823d9b721ba17db8b25)
vrcp/Avrcp.java
7a44bb23aadc107c369d230fb96f4ce3374f3f5b 10-Aug-2017 Ajay Panicker <apanicke@google.com> Fix IndexOutOfBounds exception due to incorrect media player start index

Before, if there were no addressed players there would be an index
out of bounds exception due to accessing past the end of the array
as position zero would be skipped. Now set start index to 0 if there
is no addressed player.

Bug: 64440498
Test: Connect to carkit with only one player
Change-Id: I76bf4a872e9722ca7cc6b1ca90f88200a72c8c27
(cherry picked from commit f73db9bf71badd648320cac0074169e009562d77)
vrcp/Avrcp.java
5e5cfd5f5e651367111c5553230e066fc6817942 08-Aug-2017 Ajay Panicker <apanicke@google.com> AVRCP: Ignore addressed player changed to telecom

* During a phone call, com.android.server.telecom is chosen by the media
framework as the addressed player. It listens to media button presses
to control various call functions.
* Bluetooth uses Hands Free Profile (HFP) instead of media buttons to
control phone calls. Therefore, Bluetooth does not need to interact
with telecom's HeadsetMediaButton during a call.
* Moreover, switching addressed player during SCO codec negotiation
confuses some car kits, making HFP not functional.
* This CL ignores addressed player change to telecom.

Bug: 64043110
Test: Make a phone call while playing music, AVRCP and HFP regression
Change-Id: If01b84275f8aab23d793e321f71b6b46e8e926aa
(cherry picked from commit c833de68eb3f5a82db6e83166e18504e83e5d035)
vrcp/Avrcp.java
04ba1bcd82fd1faf9bae27d1926f8c6c34c77c42 08-Aug-2017 Ajay Panicker <apanicke@google.com> Prevent stack crash if there is only one player and it isn't active

Bug: 64440498
Test: Connect to carkit at boot with only one available player
Change-Id: Iaea363cb406ae6117550274fe0695b2391f0eedf
(cherry picked from commit 99a0131b4119f35685a953e056f56512fa1bb74a)
vrcp/Avrcp.java
161e0982aabc648c6c0d7fe90fc37ae820ee1243 08-Aug-2017 Ajay Panicker <apanicke@google.com> Allow AVRCP to send playback state when resumed from pause

Bug: 64457876
Test: Pause a song then try resuming it
Change-Id: I486882945f6e2707d7eae92cb45d0305eeee6f20
(cherry picked from commit 86859c32964ab3dd66f6085604c3578e1f6b78ff)
vrcp/Avrcp.java
37bcf3ae37352c9185d789986e904ffccb9ee8df 04-Aug-2017 Ajay Panicker <apanicke@google.com> Return on available players changed and clear state for addr player changed

Bug: 2662710
Test: Switch players soon after boot and see that available players changed
doesn't get sent twice
Change-Id: I41713b82d98707330453d2afa328f0d4d7cbc291
vrcp/Avrcp.java
9c2ff5bb5082c653ee91d336dcd7f95e4c25e833 04-Aug-2017 Ajay Panicker <apanicke@google.com> Initialize the Browsable Player list at user unlock instead of boot complete

Bug: 34471252
Test: Code compiles and the browsable player list is built earlier in the boot process
Change-Id: I664e0dbaecade43df58ce464a634306db2910f5b
(cherry picked from commit eb829bbfa257c84c4f8fa589b54791e3f413b486)
vrcp/Avrcp.java
754c469a24029e5b9a1c921fb91e3799937eb918 04-Aug-2017 Ajay Panicker <apanicke@google.com> Grab all packages that support browsing instead of connecting to them one by one

This prevents sending an excess amount of Available Players Changed
notifications.

Bug: 34471252
Test: Connect to carkit and switch players, see that number of addressed player
changed notifications is consistant with boot time
Change-Id: Ic9409dc262f951cd22a5eb44cf2c44e0375908de
(cherry picked from commit 1111f243441532aefeadf322a9ab9800e330007b)
vrcp/Avrcp.java
cb00f2feb8405508707e41e463a79bf77eac7bc7 04-Aug-2017 Ajay Panicker <apanicke@google.com> Send the playback state changes to playing only after track changed

Bug: 34471252
Test: On BMW carkit, see that it waits to get item attributes until after
the state is playing
Change-Id: Ie27514b42a18d7906abde7741112b3d213c8bd63
(cherry picked from commit 3211ee063dc32e07ab00d94312637dd7c27d2bba)
vrcp/Avrcp.java
05723ee9e6619814876a6cce5004d11b38c3f648 03-Aug-2017 Ajay Panicker <apanicke@google.com> Update the now playing list after AddrPlayerChanged

The now playing list needs to be updated since the AddrPlayerChanged
notification resolves the NowPlayingList changed notification. This is
to prevent sending an update immediatly after the notification was rejected.

Bug: 34471252
Test: Connect to carkit and switch players and see that the notification
changed event wasn't sent after a reject
Change-Id: Ifb05d9bcca53a71aff737fa8875fd308fa516ec7
(cherry picked from commit 3616b7ce7be6abaca5eef876e055155f9e8a3b1f)
vrcp/Avrcp.java
cd1345961b7211ef6d130bd88b672835b52b3f60 04-Aug-2017 Ajay Panicker <apanicke@google.com> Remove dependency on delay by ignoring invalid playback states

Remove the dependency on delaying for a media update by instead
using the playback state and current metadata to determine current
song status.

Bug: 34471252
Test: Switch players on BMW carkit
Change-Id: I25532d6e47fbecc1357b78ce189cb9f411ecc256
(cherry picked from commit 093a2e4d9aeaecb0d51d8b7c74b4466d368c31cf)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
2a9aba641d081621a373b56171938994447040e3 11-Jul-2017 Ajay Panicker <apanicke@google.com> Send available players changed with addressed player changed

Also reorder the available players list so that the current addressed
player is always the first item in the list.

Bug: 63585280
Test: Test with BMW carkit and see switching from GPM to Spotify works
Change-Id: Ifdec331d608a511fc2560167270c4a4ea25fffa7
(cherry picked from commit cc75e0ce509baa8e9cd27c38327c786b46b164ac)
vrcp/Avrcp.java
b9033e97b2a2a28c8dde45ff2be0b5b2fb64ebc7 20-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AdapterProperties: change log level and wording" into oc-mr1-dev
ebc3ca9751d34915dac3ef08811949385ccc9389 20-Sep-2017 Jack He <siyuanh@google.com> Merge "AdapterProperties: change log level and wording" am: 05211ae763 am: ee5089b3ac
am: 3b82870bd9

Change-Id: I57371d607e32aa60343de811d5c0c79eaadf7181
3b82870bd9c4d6ce20ad78eb06108282518f20c6 20-Sep-2017 Jack He <siyuanh@google.com> Merge "AdapterProperties: change log level and wording" am: 05211ae763
am: ee5089b3ac

Change-Id: I9a57c6ab05896b9061b5e2da453ed0e1c66faf57
ee5089b3acf3edf4ffdcab811fbbc7d2e052f791 20-Sep-2017 Jack He <siyuanh@google.com> Merge "AdapterProperties: change log level and wording"
am: 05211ae763

Change-Id: Icbafe2e9820ea760ea61b5923995e834bfedffc4
05211ae7636857ee795c9dd1ebd028b04274515d 20-Sep-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "AdapterProperties: change log level and wording"
838ad8cdf5b2d148dedd67e3c76c9be80e70024b 20-Sep-2017 Jack He <siyuanh@google.com> AdapterProperties: change log level and wording

* When state transition goes from CONNECTED to DISCONNECTED or
from DISCONNECTED to CONNECTED, it is abnormal, but still falls into
some normal use case such as sudden disconnection
* This CL changes the log level to warning and reword it to "abnormal"

Bug: 65591907
Test: make, no functional change
Change-Id: I90b801281dde6c5a5c349568dc8e0c4a740b4db6
tservice/AdapterProperties.java
233b9b1bedc74fbb64ff24fe85320aa56b4ae345 20-Sep-2017 Jack He <siyuanh@google.com> AdapterProperties: change log level and wording

* When state transition goes from CONNECTED to DISCONNECTED or
from DISCONNECTED to CONNECTED, it is abnormal, but still falls into
some normal use case such as sudden disconnection
* This CL changes the log level to warning and reword it to "abnormal"

Bug: 65591907
Test: make, no functional change
Change-Id: I90b801281dde6c5a5c349568dc8e0c4a740b4db6
(cherry picked from commit 9373b795b05f1e3d694e59f9e50c38b7cfa58d7c)
tservice/AdapterProperties.java
87a2709ed577be0620d40c9633c1cf9143305805 20-Sep-2017 Jack He <siyuanh@google.com> Merge "PAN: No observable state transition when PAN is rejected" am: 1224a0ca02 am: a144d60c08
am: 9c72b0f4fc

Change-Id: Ic0555ccd0b68b00b695d450526a4af9504b44e85
9c72b0f4fc569da61dc336b32d5941ef067d98ff 20-Sep-2017 Jack He <siyuanh@google.com> Merge "PAN: No observable state transition when PAN is rejected" am: 1224a0ca02
am: a144d60c08

Change-Id: I5fccaaa3467ab18376a5e387efa2ae22ac680eef
a144d60c08ec2af631030a4c1a8de4cf41f3bcf2 20-Sep-2017 Jack He <siyuanh@google.com> Merge "PAN: No observable state transition when PAN is rejected"
am: 1224a0ca02

Change-Id: I281458dd20cf6a0074c0cd5e6d958e38154d61a2
3602fadc0ac62728025a568eb87f1e7479b28849 19-Sep-2017 Jack He <siyuanh@google.com> PAN: No observable state transition when PAN is rejected

* When a incoming PAN connection is rejected, there should be no
observable state transitions as intents to external packages
* Current sequence of events:
- 1. Incoming PAN, DISCONNECTED -> CONNECTED
- 2. Reject PAN, reset to DISCONNECTED, disconnect PAN, device removed
from mPanDevices
- 3. Disconnect pending, DISCONNECTED -> DISCONNECTING, ignored, device
not removed from mPanDevices
- 4. Disconnect complete, DISCONNECTING -> DISCONNECTED, currently not
ignored, resulting in PAN state transition error
* Sequence of events after this fix
- 1. Incoming PAN, DISCONNECTED -> CONNECTED
- 2. Reject PAN, reset to DISCONNECTED, disconnect PAN, device removed
from mPanDevices
- 3. Disconnect pending, DISCONNECTED -> DISCONNECTING, ignored, device
removed from mPanDevices, reset state to DISCONNECTED
- 4. Disconnect complete, DISCONNECTED -> DISCONNECTED, ignored, no
observable state transition

Bug: 65854008
Fixes: 65854008
Test: PAN regresstion test, testplans/109528/3975
Change-Id: I2eda16e717f8b9d54c737615ee0cf3f0a1bed6d1
(cherry picked from commit d35a228933873eabf05353a8abe4ed925acd108d)
an/PanService.java
d35a228933873eabf05353a8abe4ed925acd108d 19-Sep-2017 Jack He <siyuanh@google.com> PAN: No observable state transition when PAN is rejected

* When a incoming PAN connection is rejected, there should be no
observable state transitions as intents to external packages
* Current sequence of events:
- 1. Incoming PAN, DISCONNECTED -> CONNECTED
- 2. Reject PAN, reset to DISCONNECTED, disconnect PAN, device removed
from mPanDevices
- 3. Disconnect pending, DISCONNECTED -> DISCONNECTING, ignored, device
not removed from mPanDevices
- 4. Disconnect complete, DISCONNECTING -> DISCONNECTED, currently not
ignored, resulting in PAN state transition error
* Sequence of events after this fix
- 1. Incoming PAN, DISCONNECTED -> CONNECTED
- 2. Reject PAN, reset to DISCONNECTED, disconnect PAN, device removed
from mPanDevices
- 3. Disconnect pending, DISCONNECTED -> DISCONNECTING, ignored, device
removed from mPanDevices, reset state to DISCONNECTED
- 4. Disconnect complete, DISCONNECTED -> DISCONNECTED, ignored, no
observable state transition

Bug: 65854008
Test: PAN regresstion test, testplans/109528/3975
Change-Id: I2eda16e717f8b9d54c737615ee0cf3f0a1bed6d1
an/PanService.java
008d165988145a8e0568eb85011741836b702f9b 19-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AdapterProperties: Logging and logic refactor" into oc-mr1-dev
06345734abfbcc4ec572b7e34aea7c55c5fbd0f5 19-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Close mServerSockets when shutting down service" into oc-mr1-dev
19fb4558b020c2c84ae2f0f0546ea7ee19cd7cbf 19-Sep-2017 Jack He <siyuanh@google.com> Merge "AdapterProperties: Logging and logic refactor" am: 2e15feb950 am: 4a47b7e0e3
am: 9db7eff6c0

Change-Id: I7a196c3ca512e0e2903004b9b901fc1b139433da
9db7eff6c096664975bc78a3124c04930f861be5 19-Sep-2017 Jack He <siyuanh@google.com> Merge "AdapterProperties: Logging and logic refactor" am: 2e15feb950
am: 4a47b7e0e3

Change-Id: Ibedb9e1e9d53b53ae7f3f871af207284e8b94748
4a47b7e0e306844f36a95b47c3787d140338f0cd 19-Sep-2017 Jack He <siyuanh@google.com> Merge "AdapterProperties: Logging and logic refactor"
am: 2e15feb950

Change-Id: Ifa092d83270d34b1f114e52e42c659b1af934024
2e15feb950cfced232801b42ae66eab383ef34e7 19-Sep-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "AdapterProperties: Logging and logic refactor"
996c1b2c95244596804e03e6f46c6077d72093ab 19-Sep-2017 Jack He <siyuanh@google.com> Merge "PBAP: Close mServerSockets when shutting down service" am: 37f265833f am: b31178403a
am: 61d06700da

Change-Id: I77cd342ee570c55a635adeaf2e7487758c8c7646
61d06700da1c7d282ab1abb2585c5cd79eedbe6b 19-Sep-2017 Jack He <siyuanh@google.com> Merge "PBAP: Close mServerSockets when shutting down service" am: 37f265833f
am: b31178403a

Change-Id: Ie10a05201e7a33b760ad1f750677e68f6ec46bcd
d691ccc7632567fbba9557a8750943523802d860 15-Sep-2017 Jack He <siyuanh@google.com> AdapterProperties: Logging and logic refactor

* Add more logging in AdapterProperties to track profile and adapter
connection state changes
* Removed unnecessary actions in AdapterProperties intent filter
* Use switch instead of if-else-if statements in AdapterProperties
broadcast receiver

Bug: 65591907
Test: make, pair with Bluetooth devices
Change-Id: I105e718d9c5c698bddd6a5d1ce60b2826e6e5f85
(cherry picked from commit 01332bf3ef3e6a342471aef5c108cfacee8cfd13)
tservice/AdapterProperties.java
b31178403a448e32d2b02ee96921419883c7cd36 19-Sep-2017 Jack He <siyuanh@google.com> Merge "PBAP: Close mServerSockets when shutting down service"
am: 37f265833f

Change-Id: I16e2afcb29f5fa350ffa16b89c2fdb309e42b4f0
064fad7de9e0939cd39ed4c95b11b984717ed7f9 16-Sep-2017 Jack He <siyuanh@google.com> PBAP: Close mServerSockets when shutting down service

Bug: 65851259
Test: Turn Bluetooth ON/OFF, connect/disconnect with car kit
Change-Id: Id3c0ec2799b7d83cbc7439fac05f09d86bb31505
(cherry picked from commit fb5510afbc627c89f067833d769c19c95dc843a6)
bap/BluetoothPbapService.java
fb5510afbc627c89f067833d769c19c95dc843a6 16-Sep-2017 Jack He <siyuanh@google.com> PBAP: Close mServerSockets when shutting down service

Bug: 65851259
Test: Turn Bluetooth ON/OFF, connect/disconnect with car kit
Change-Id: Id3c0ec2799b7d83cbc7439fac05f09d86bb31505
bap/BluetoothPbapService.java
bdfca231d45f4ee38992df6e98a43a4d74e0e202 18-Sep-2017 Kai Wang <kwangsudo@google.com> Merge "A2dpSink stopFluorideStreaming" am: 647cb2df55 am: be9e68e60f
am: 1950bac731

Change-Id: I79fb51aa5e414737ef9d01c062bd7f07299ff383
1950bac7317278893bd97f944039b062f1b96658 18-Sep-2017 Kai Wang <kwangsudo@google.com> Merge "A2dpSink stopFluorideStreaming" am: 647cb2df55
am: be9e68e60f

Change-Id: I7191647827c1258609bbe4369d73c5173750c6dc
be9e68e60fc116d8112ab34ba98605dad16af12f 18-Sep-2017 Kai Wang <kwangsudo@google.com> Merge "A2dpSink stopFluorideStreaming"
am: 647cb2df55

Change-Id: I87cbe9402d6b5684ec938d54ee3721bce0e5172c
b8f2c708191ab9b31eaff709d4767f3e4fa03164 12-Sep-2017 xutianguo <xutianguo@xiaomi.com> Fix potenial NPE in PhonePolicy

NPE might happen in PhonePolicy since HeadsetService could be null.

Bug: 65842557
Fixes: 65842557
Test: Connect Bluetooth devices and check A2DP/HeadSet profiles

Change-Id: Ib90147b407bc80675ba027f4c6cac94ae39a1d7b
Signed-off-by: xutianguo <xutianguo@xiaomi.com>
(cherry picked from commit eb2e34735003388606ff66988634d012049cdcd0)
tservice/PhonePolicy.java
01332bf3ef3e6a342471aef5c108cfacee8cfd13 15-Sep-2017 Jack He <siyuanh@google.com> AdapterProperties: Logging and logic refactor

* Add more logging in AdapterProperties to track profile and adapter
connection state changes
* Removed unnecessary actions in AdapterProperties intent filter
* Use switch instead of if-else-if statements in AdapterProperties
broadcast receiver

Bug: 65591907
Test: make, pair with Bluetooth devices
Change-Id: I105e718d9c5c698bddd6a5d1ce60b2826e6e5f85
tservice/AdapterProperties.java
97247e48647ba70b91c4ebeb4c0e8bc4be94ac16 16-Sep-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "A2DP sink audio focus" into oc-mr1-dev
am: 1d13231205

Change-Id: Id0403116019e46191508ed9a4f6f627467db1726
b9d954f6d88872e07347e712a5f5da9db0e632b5 16-Sep-2017 Andre Eisenbach <eisenbach@google.com> Merge "Don't reject notifications and wait until new addressed player is ready (1/2)" into oc-dr1-dev
am: 03e16a77b7

Change-Id: I0cfa805e1aea6b5cde6620f91d9dbff3dc2d87c1
03e16a77b77c3a081cfaa31445967f83e8301bf3 16-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Don't reject notifications and wait until new addressed player is ready (1/2)" into oc-dr1-dev
ee17270444b9abc2711fc6323513a8d589515f0c 16-Sep-2017 Andre Eisenbach <eisenbach@google.com> Don't reject notifications and wait until new addressed player is ready (1/2)

There are some carkits like the ones found in the 2016 Honda CRZ and some
Audi's that do not follow the spec and do not honor reject pending notification
messages after switching players. This causes an issue whenever you switch
players, the metadata freezes due to the fact that the carkit never re-registers
for new track changed notifications. This patch removes the reject notification
and reorders the current notifications.

Bug: 64142363
Test: Test with Audi S7 and 2016 Honda CRZ and see that switching players works
TestTracker/105391/3975
Change-Id: Ifcc236c54ccbec8e8ec0bd7f16e62e4282361bac
Merged-In: Ifcc236c54ccbec8e8ec0bd7f16e62e4282361bac
(cherry picked from commit 67c982aed4e67772e155f934c2055c72b83f1f22)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
e5528ec2c195619ca1706e539df16c65f0b984bd 01-Sep-2017 Jack He <siyuanh@google.com> HFP: Fix regressions in HFP state machine

* When we reject an incoming HF connection, we should notify the event
to other parts of the stack so that hanlders such as PhonePolicy could
react to the event such as attempting A2DP connection
* During SLC establishment, when remote device sends an unexpected
command, we should still try to handle them, but generate a warning
message to help debugging

Bug: 65246419
Test: connect with car kits and headsets, testplans/105951
Change-Id: I51f861a11948e5bfe3a0e0a58cee072f1eef4f5c
Merged-In: I51f861a11948e5bfe3a0e0a58cee072f1eef4f5c
(cherry picked from commit bc67ac7b9ef7a6b33fc550257b75726d86641923)
(cherry picked from commit 081c0e3696690dc3d98a54c0863dc9cc95248897)
fp/HeadsetStateMachine.java
c1a28a6353131f59c23865440ee37a7e208d7d2c 15-Sep-2017 Joseph Pirozzo <pirozzoj@google.com> A2DP sink audio focus

Update AudioFocusRequest to receive notification on
AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK.

Bug: 38389934
Test: stream music over Bluetooth and play Nav guidance, observe music
is ducked.

Change-Id: I1b4d33fd63cc6033c06bf24ac0f9a41aeeaf292d
2dpsink/A2dpSinkStreamHandler.java
b4777ebc8aed51449423d35e0fbd7226a30c1587 08-Sep-2017 kai <kwangsudo@google.com> A2dpSink stopFluorideStreaming

prevent startFluorideStreaming from being enabled when
Bluetooth disconnect and reconnect

Bug: 65416395
Test: 1 connect bluetooth, play music on car kit, disconnect
and reconnect bluethooh from phone, tap play on phone.
2 connect bluetooth, play music on car kit, disconnect
and reconnect bluethooh from car kit, tap play on phone.

Change-Id: Iab2d9ec910e07e9580769ed7a38f798fdf87c2b5
(cherry picked from commit 32c4d0721c51c498519559a9f435389ef7ed822f)
2dpsink/A2dpSinkStateMachine.java
abdb59e0bc88c6ddbbc5ae670ceecb1076f208a1 15-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix included service parsing (2/3)" am: c38d1fc76f am: 94477ce77d
am: 3ba50d4c33

Change-Id: I3aaa860b270976814f89d8dce328d23f3f34df4c
3ba50d4c3382393a8440889cf226ed31de858a2b 15-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix included service parsing (2/3)" am: c38d1fc76f
am: 94477ce77d

Change-Id: I2d3da5eb120f6390576f5f484ade3c5d515bba16
94477ce77d4e5f052efa806de0fe81d68d729d20 15-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix included service parsing (2/3)"
am: c38d1fc76f

Change-Id: I04c9f0568079d23bbcba7054f126f50559fc8f7b
66c7e8d099cdb4be40af91256cff4133453003a5 14-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Fix included service parsing (2/3)

Bug: 65637368
Test: sl4a GattIncludedServiceTest
Change-Id: Iab6b7d693ea426ba7b50b87024aed767a39966cf
att/GattService.java
0ebb5a5fcdc7b2f17b3dfaeeaa6766600f4f42e6 14-Sep-2017 vnori <vnori@google.com> Merge "consider the situations where the device has only one volume level set." am: b74ae7ee47 am: 7d11e8de77
am: 36496391df

Change-Id: I71379d620319a82f61628a2ba2951a5085117c2b
3674b89692f5bd37d35c10a2e6d08f533d5169d1 14-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix included service handling" am: 59d9617edd am: 90608d8d37
am: 4897b90ce1

Change-Id: I26b86ebf9676228a08890e1a949bc95090377921
36496391dfb09a7c646e7ba2d1426c4774acefd5 14-Sep-2017 vnori <vnori@google.com> Merge "consider the situations where the device has only one volume level set." am: b74ae7ee47
am: 7d11e8de77

Change-Id: I533f4806b8b562a8a496822848de79a6e34a983d
4897b90ce1b4eff963c80ab493e7d81e180296b0 14-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix included service handling" am: 59d9617edd
am: 90608d8d37

Change-Id: Ib7ab137cc6f963a669505afe0b921cb559903cf2
7d11e8de77bd5a5a7bf68393a1e43a05ed2ff302 14-Sep-2017 vnori <vnori@google.com> Merge "consider the situations where the device has only one volume level set."
am: b74ae7ee47

Change-Id: I3c3f958f75580f3b7ed4822af2053d6100077ffb
90608d8d37c3fe62e5392155281493dfecdbd1cc 14-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix included service handling"
am: 59d9617edd

Change-Id: Ie5e34bb7c1539c7e84112fb3feceac6bf9189ded
b74ae7ee47d5d8dd907d95dd11ef7bee7640adb6 14-Sep-2017 vnori <vnori@google.com> Merge "consider the situations where the device has only one volume level set."
d26a3de6fcda5b53ddbeb4cac70777d6aaad9f17 13-Sep-2017 Vasu Nori <vnori@norinori.mtv.corp.google.com> consider the situations where the device has only one volume level set.

Bug: 65125561
Test: runtest bluetooth -c
com.android.bluetooth.hfpclient.HeadsetClientStateMachineTest doesn't
crash now

Change-Id: I3474e60f04732c60de215a41125a9436c5ff122c
fpclient/HeadsetClientStateMachine.java
eb5548e7779933cc99b0c601640be11a07d33fdf 13-Sep-2017 Jakub Pawlowski <jpawlowski@google.com> Fix included service handling

GattService.addService have a bug causing 0 to be always passed as
included service handle.

This issue was introduced in commit
05405f01802e6b5210575ad348ca441edb5cfb8b

Bug: 65637368
Test: manual
Change-Id: Idfe65cba65f26e704589dc4083767bebc691f007
att/GattService.java
att/HandleMap.java
45d227e34338f802d44f03f34946da38d7b2af10 12-Sep-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "AVRCP getConnectedDevices" am: 4d62e0aceb
am: d8be4be5f1

Change-Id: Ic25fd986be48945dee9a1182297f375f5bd27064
68bd5a74f915355f183028395c4980df588d9aa0 12-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "Fix potenial NPE in PhonePolicy" am: 5595b34ecc am: 5de2d57390
am: 3193357c3a

Change-Id: I113276c31a55d4369e4980ea0c5cb092b1b71f53
d8be4be5f1ce6b26e773751f7b1e61b6e2467b66 12-Sep-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "AVRCP getConnectedDevices"
am: 4d62e0aceb

Change-Id: I96d83d4729382fc20fb42af163de2e4bf1661076
3193357c3a62f739780b3718552b0e91354ea12f 12-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "Fix potenial NPE in PhonePolicy" am: 5595b34ecc
am: 5de2d57390

Change-Id: I8dd502a549a19a5f3e8152f8b8c14d7fd59d088b
5de2d573900620f7f3face94b1f4d991850875b7 12-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "Fix potenial NPE in PhonePolicy"
am: 5595b34ecc

Change-Id: I00e40c25297fba451250a8d0bbc10174e4004f1e
4d62e0acebfb34db84e24d756bcff7f8b49ea1ee 12-Sep-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "AVRCP getConnectedDevices"
eb2e34735003388606ff66988634d012049cdcd0 12-Sep-2017 xutianguo <xutianguo@xiaomi.com> Fix potenial NPE in PhonePolicy

NPE might happen in PhonePolicy since HeadsetService could be null.

Bug: NA
Test: Connect Bluetooth devices and check A2DP/HeadSet profiles

Change-Id: Ib90147b407bc80675ba027f4c6cac94ae39a1d7b
Signed-off-by: xutianguo <xutianguo@xiaomi.com>
tservice/PhonePolicy.java
c65865e15d7ffd254a16a8cc0b1afd0e8b68fa70 01-Sep-2017 Joseph Pirozzo <pirozzoj@google.com> AVRCP getConnectedDevices

Utilize the same connectedDevice list rather than asking the
avrcpService for the list multiple times possibly yielding different
lists.

Bug: 63103934
Test: Insert delays and disconnect BT while in the middle of sending
play/pause commands.

Change-Id: Ib6016d853cf1e7e72923df851e7a17752bfee07d
Merged-In: I85b6ce47b1724557b298c54e0a73bef8849ac3ba
(cherry picked from commit 673e4dc38242dcdfcd294e720dd392d8b1fd68c1)
2dpsink/A2dpSinkStreamHandler.java
27be37540f1e9aa6e706feec8aeb6dd310d0ab8a 08-Sep-2017 Vinay Kalia <vinaykalia@google.com> Merge "Adapt scan settings based on client state." am: ceba91f888 am: ac93e44121
am: 7b6ea47db0

Change-Id: I93bc4b95dca452c074045f30b4d6da03721da2e8
7b6ea47db083b9f8835fde605eefe4b9d35dab7c 08-Sep-2017 Vinay Kalia <vinaykalia@google.com> Merge "Adapt scan settings based on client state." am: ceba91f888
am: ac93e44121

Change-Id: Ifbe0ef2b00982cedffe33447321737e01fef4088
ac93e44121b4b29e3da5009a3f6d863570f9010d 08-Sep-2017 Vinay Kalia <vinaykalia@google.com> Merge "Adapt scan settings based on client state."
am: ceba91f888

Change-Id: I8db384e3763f10239d525cd7c5caf629d25995c7
ceba91f88893687fb82165a54f81c9d8688b43f0 08-Sep-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Adapt scan settings based on client state."
ed76bdc532e61420ffd97e3716212947b2afb939 08-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix Bluetooth crash when open the opp transfer history on the lock screen" into oc-mr1-dev
bfd43f2b526918300318f10ffd253c25e8e285f7 08-Sep-2017 Amith Yamasani <yamasani@google.com> Merge "Check permissions when registering a scan pending intent" into oc-mr1-dev
am: aca5dfe45a

Change-Id: I92ec3cf237c6af48070d8c8df11928b9ae0ae97e
aca5dfe45aa230b71bb682657b32ab1067196964 08-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Check permissions when registering a scan pending intent" into oc-mr1-dev
bcbffb1f331e312d53db1f657213eec1a26fd4ab 22-Aug-2017 ilbeom.kim <ilbeom.kim@lge.com> Fix Bluetooth crash when open the opp transfer history on the lock screen

BluetoothOppTransferHistory was using the deprecated managedQuery
to get the cursor. The managedQuery was deprecated in API level 11.
Changed managedQuery to contentResolver.query() to resolve the issue.

Test: The following procedure:
1. Enable pattern lock on DUT (receiver phone)
2. Send an image file via Bluetooth from another phone
3. Accept the file transfer on DUT
4. Wait until file transfer is completed
5. Open the received file history from the lock screen (double-tap)

Bug: 63747089
Change-Id: I6def857579ec96c10f3d22260ccba30f9ef4a57e
(cherry picked from commit ee124ba31cd435ea000e544edc273756133ffef9)
pp/BluetoothOppTransferHistory.java
23e628612ffe95e2840cda7977248f26d2efc3b0 08-Sep-2017 ilbeom.kim <ilbeom.kim@lge.com> Merge "Fix Bluetooth crash when open the opp transfer history on the lock screen" am: e9873d32f2 am: a4eb50eaa7
am: c2e87b0211

Change-Id: I4ce6d1e143caa5f07887ea678e1fd33ef4798ca2
c2e87b0211990f5a690667a03f7f85a68566ca3a 08-Sep-2017 ilbeom.kim <ilbeom.kim@lge.com> Merge "Fix Bluetooth crash when open the opp transfer history on the lock screen" am: e9873d32f2
am: a4eb50eaa7

Change-Id: I63864e350825764cc633e2807abd042c8413fa07
a4eb50eaa7a9f59cb02fce88a6852a4bb9c8ac5c 08-Sep-2017 ilbeom.kim <ilbeom.kim@lge.com> Merge "Fix Bluetooth crash when open the opp transfer history on the lock screen"
am: e9873d32f2

Change-Id: I9e7cd985e078798fc45222019c01223897ce8031
dd26298bbf5d4b034f27db60d0aceba3902d5c86 05-Sep-2017 Amith Yamasani <yamasani@google.com> Check permissions when registering a scan pending intent

Check the permissions when registering and use them when
starting the scan.

Bug: 65013767
Test: Manually modify the cts test to not include the permission
and ensure the scan results are not delivered.

Change-Id: Id9322182ae65a3e5fc5158a09d77c7ca28b2be2d
att/ContextMap.java
att/GattService.java
ee124ba31cd435ea000e544edc273756133ffef9 22-Aug-2017 ilbeom.kim <ilbeom.kim@lge.com> Fix Bluetooth crash when open the opp transfer history on the lock screen

BluetoothOppTransferHistory was using the deprecated managedQuery
to get the cursor. The managedQuery was deprecated in API level 11.
Changed managedQuery to contentResolver.query() to resolve the issue.

Test: The following procedure:
1. Enable pattern lock on DUT (receiver phone)
2. Send an image file via Bluetooth from another phone
3. Accept the file transfer on DUT
4. Wait until file transfer is completed
5. Open the received file history from the lock screen (double-tap)

Bug: 63747089
Change-Id: I6def857579ec96c10f3d22260ccba30f9ef4a57e
pp/BluetoothOppTransferHistory.java
0f28f65fd50777b20efdac9d1d3364f1c39df456 18-Jan-2016 Satish Kodishala <skodisha@codeaurora.org> HFP AG: Fix the condition to check if SCO is connected

Two headsets hs1, hs2 are connected and SCO is created with
hs2. If hs1 is disconnecting, we move to MultiHFPending state
from AudioOn state and then move back to AudioOn state. We
should check for audio state and SCO device instead of
checking if we are in AudioOn state.

Test: 1. Create connection from DUT to HS1
2. Create connection from DUT to HS2
3. Make MT call on DUT and accept from DUT
4. Now disconnect HS1 from DUT
testplans/106586

Bug: 63740200
Bug: 35657481
Change-Id: I4956541ec234d6ebc76a8b1478b7caa132c44605
(cherry picked from commit 65d4db9db787d4553c4b42044e3bfa5f5910b8a9)
fp/HeadsetStateMachine.java
081c0e3696690dc3d98a54c0863dc9cc95248897 01-Sep-2017 Jack He <siyuanh@google.com> HFP: Fix regressions in HFP state machine

* When we reject an incoming HF connection, we should notify the event
to other parts of the stack so that hanlders such as PhonePolicy could
react to the event such as attempting A2DP connection
* During SLC establishment, when remote device sends an unexpected
command, we should still try to handle them, but generate a warning
message to help debugging

Bug: 65246419
Test: connect with car kits and headsets, testplans/105951
Change-Id: I51f861a11948e5bfe3a0e0a58cee072f1eef4f5c
(cherry picked from commit bc67ac7b9ef7a6b33fc550257b75726d86641923)
fp/HeadsetStateMachine.java
7c197fc135c4dad4f7d6d8353c7495be464c832f 07-Sep-2017 Ayan Ghosh <abghosh@codeaurora.org> Merge "Proper handling of A2DP connetion timeout scenarios" am: d517b5583d am: 51bff73bd5
am: de4599f015

Change-Id: I5789b5ecd5702fd1de19a873d3b3ec5f802fa219
de4599f015d24aa6c2d6381527103d93cde4706a 07-Sep-2017 Ayan Ghosh <abghosh@codeaurora.org> Merge "Proper handling of A2DP connetion timeout scenarios" am: d517b5583d
am: 51bff73bd5

Change-Id: I611627424634f5229d6b91da4e8bfeb37d39d45f
51bff73bd5d4b9bff5c7df57dd74b05870cb5c7e 07-Sep-2017 Ayan Ghosh <abghosh@codeaurora.org> Merge "Proper handling of A2DP connetion timeout scenarios"
am: d517b5583d

Change-Id: I60dc7990aefc00079b00141ce76971ee6d56454b
5e4b34c770e1e4992578dec143005f092f08709b 12-Jun-2014 Ayan Ghosh <abghosh@codeaurora.org> Proper handling of A2DP connetion timeout scenarios

- Remove connect time-out when moved to Connected/Disconnected
instead of Pending state.
- Initiate disconnect on timer expiry.
- When initiating incoming/outgoing connections, there is a
possiblity that CONNECT_TIMEOUT for outgoing connection
happens after successfully connected to other incoming
connection and thus this timeout will be received in Connected
state. We need to clear the target device and update the
connection state to ensure external apps update their states
accordingly.

Test: 1. Initiate outgoing connection to HS1 which is in OFF state
2. Do incoming connection to DUT.

Bug: 35414834
Change-Id: Ie866db651376ae74f3f6c03c204121eff13db89d
2dp/A2dpStateMachine.java
3e62fe619485f9fb53c89d4516c8319bf0d0886d 07-Sep-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "AVRCP getConnectedDevices" into oc-mr1-dev
am: f00155c9bd

Change-Id: I85b6ce47b1724557b298c54e0a73bef8849ac3ba
f00155c9bd48754fa9b2efd3872d1db67cf8e78e 07-Sep-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "AVRCP getConnectedDevices" into oc-mr1-dev
772e847bf293d0864ebc87a33114df02838fea1e 06-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "OPP: catch IllegalArgumentException exception to avoid FC" am: 5f84d86ca1 am: 6da13a21ae
am: 580e5f3dd0

Change-Id: Icbdc30527c93f0f8e17243ed23fcc7257bef546e
bf5b4a2a889aad00f85c4865036d90086bc7cbb4 06-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "OPP: Format transfer percentage using DecimalFormat" am: 0443f7ab11 am: 48a440e6f0
am: f165304f64

Change-Id: Ice4678e4f4d607dd2c5572049f6113586ed311cf
580e5f3dd0ce9503d74d59e09ca485bf2c7b9b02 06-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "OPP: catch IllegalArgumentException exception to avoid FC" am: 5f84d86ca1
am: 6da13a21ae

Change-Id: Id680a9590da2a233dfe3459913c57008701965c0
f165304f6466adc873c492c8b54ccb47363fc368 06-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "OPP: Format transfer percentage using DecimalFormat" am: 0443f7ab11
am: 48a440e6f0

Change-Id: I95f67fa7866f4d1f1a87314f19a379b9490eda3a
6da13a21ae7bce9cc739e927fb90689b3d6ecbfe 06-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "OPP: catch IllegalArgumentException exception to avoid FC"
am: 5f84d86ca1

Change-Id: Idec112f95ca7c4053fc303949de286272f9ebf90
48a440e6f02de2299b4578bb6a0ae553874fb4d7 06-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "OPP: Format transfer percentage using DecimalFormat"
am: 0443f7ab11

Change-Id: I7a7a939354a954b464733c1fe306bcd752de427e
5f84d86ca1a82041010d298741e3af343e88feaf 06-Sep-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: catch IllegalArgumentException exception to avoid FC"
bd90a9d3f10b623fa053cfc4f9ce3ad130d20d5f 31-Aug-2017 xutianguo <xutianguo@xiaomi.com> OPP: Format transfer percentage using DecimalFormat

The percentage text should be displayed in suitable
style in specific language.

Bug: 65226679
Test: Change language to Arabic and do Bluetooth sharing, the
percentage text is displayed in the correct style.

Change-Id: I3318610530122a25457adc0abc2e15196bea7d73
Signed-off-by: xutianguo <xutianguo@xiaomi.com>
pp/BluetoothOppUtility.java
438218f014a184ee17098175e39ef765a6608211 09-Aug-2017 Vinay Kalia <vinaykalia@google.com> Adapt scan settings based on client state.

If BLE scanning client goes into non-foreground state then force
SCAN_MODE_LOW_POWER scan settings for this client. Restore the original
scan settings if the scanning client comes back to foreground.

Update scanning interval/window numbers for more power savings.

Test: Ran following tests manually:
1: Foreground to background transition (and vice-vera) of an
application doing filtered scans.
2: Foreground to background transition (and vice-vera) of an
application doing unfiltered scans.
3: Screen on-off (and vice-versa) while an application is doing
filtered scans.
4: Screen on-off (and vice-versa) while an application is doing
unfiltered scans.
5. Repeated above tests for all modes: Opportunistic, low power,
balanced and low latency.
6. Measured power improvements for updated scanning interval/window
numbers.

BUG: 38198694
BUG: 62491228
Change-Id: Id80fcdcae6021667232339dc1f637f3903b2fc05
att/ScanClient.java
att/ScanManager.java
cc37847027c5c1ceae6a833ca77f0a31a4ac8811 01-Sep-2017 xutianguo <xutianguo@xiaomi.com> OPP: catch IllegalArgumentException exception to avoid FC

Obex HeaderSet will throw IllegalArgumentException when the
file size is bigger than 0xFFFFFFFFL.
Sometimes user try to share a oversize file with Bluetooth,
Bluetooth APP will forceclose if we don't handle this exception.

Bug: 65272955
Test: Try to share some oversize files with Bluetooth, no FC
observed, instead of informing error message.

Change-Id: I0934536387e926bc70d759acf4b77b5c3d936c8f
Signed-off-by: xutianguo <xutianguo@xiaomi.com>
pp/BluetoothOppObexClientSession.java
07b46dfd4d1e6d3ca86d41b99a4b1bd03984edcb 06-Sep-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Remove handling for ACTION_MESSAGE_DELIVERY" am: b805ffe8b0 am: 47f7e9a83c
am: db39dc6f13

Change-Id: Id6bd5b59720c24b1ec65bcd78825bf9bfefd011f
db39dc6f13d31f54f81e2b3382f761c41da9cff9 06-Sep-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Remove handling for ACTION_MESSAGE_DELIVERY" am: b805ffe8b0
am: 47f7e9a83c

Change-Id: I6cbcc8c32343d5b403df9481e3002f2a957ec8a1
47f7e9a83c62deee5ea08094e74b0de5cf9c4c57 06-Sep-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Remove handling for ACTION_MESSAGE_DELIVERY"
am: b805ffe8b0

Change-Id: I4964b9fd54e3841ef1f483ad573219ec58cf47d2
b805ffe8b0b8c0dcb18099d562b8ec51fb46e74d 06-Sep-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "MAP: Remove handling for ACTION_MESSAGE_DELIVERY"
b88ce166cb3cea2fce5758815cb4ed934fa0bfc3 06-Sep-2017 Satish Kodishala <skodisha@codeaurora.org> Merge "HFP AG: Fix the condition to check if SCO is connected" am: a6e171067c am: 5420eea2ef
am: 8fbc2e322d

Change-Id: Ib5cdcb32f45dc85aaccdd62a63e77124b466f2f4
8fbc2e322d5abb4010e81e30efeb680d852b983d 06-Sep-2017 Satish Kodishala <skodisha@codeaurora.org> Merge "HFP AG: Fix the condition to check if SCO is connected" am: a6e171067c
am: 5420eea2ef

Change-Id: I33408e0790c08081dfd4ccfbfdbc75a6fbe64492
5420eea2ef18d68e6239bef323522d25c7bcd1c5 06-Sep-2017 Satish Kodishala <skodisha@codeaurora.org> Merge "HFP AG: Fix the condition to check if SCO is connected"
am: a6e171067c

Change-Id: Ib9a0f3e7f1350179572c4b605403d54aad99e2cb
3403730e123eaa18883377592d03f9af1b52cff5 21-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> MAP: Remove handling for ACTION_MESSAGE_DELIVERY

Precondition:
DUT connected to any remote device supporting MAP Client

Usecase
1) Send SMS to invalid number from MAP Client using DUT as MAP Server

Expectation
1) Message sending fails and error event received at MAP Client
2) Only 1 failed message entry is seen in failed message folder of DUT.

Observation
2 entries of failed message are seen in failed folder of DUT

Root Cause
Movement of message to Failed Folder is already handled in SMS app
so handling it again in BT MAP code causes duplicate failed entry for same
SMS

Fix
Remove handling of message movements for ACTION_MESSAGE_DELIVERY in BT MAP code
since as per MAP specification movement of SMS from outbox folder to failed folder
on Sending Failure event is only recommended and not mandatory.
Same is already handled in MMS application code both for success and failure
case.

Test: Duplicate entries are not created for SMS for failure or success cases.

Bug: 35625080
Change-Id: I3f74a0dd5504e13f65f1ab6bafac4115b1698fe3
ap/BluetoothMapContentObserver.java
65d4db9db787d4553c4b42044e3bfa5f5910b8a9 18-Jan-2016 Satish Kodishala <skodisha@codeaurora.org> HFP AG: Fix the condition to check if SCO is connected

Two headsets hs1, hs2 are connected and SCO is created with
hs2. If hs1 is disconnecting, we move to MultiHFPending state
from AudioOn state and then move back to AudioOn state. We
should check for audio state and SCO device instead of
checking if we are in AudioOn state.

Test: 1. Create connection from DUT to HS1
2. Create connection from DUT to HS2
3. Make MT call on DUT and accept from DUT
4. Now disconnect HS1 from DUT

Bug: 63740200
Bug: 35657481
Change-Id: I4956541ec234d6ebc76a8b1478b7caa132c44605
fp/HeadsetStateMachine.java
94a7e95eb34c48032911d2be10eee165e3f2ac57 05-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "Bluetooth: Thread-safe state machine's cleaning-up." am: 493a0024f9 am: 9bb475def6
am: 386de5aecd

Change-Id: I355ca80a3fbff2d47aa600c3888eb50a3165f71f
386de5aecd470886ba65b71782bc3c3cfa7b1405 05-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "Bluetooth: Thread-safe state machine's cleaning-up." am: 493a0024f9
am: 9bb475def6

Change-Id: I327a5d5a9eb93ebe9cbe8ac5d2fb2697a113c689
9bb475def6319dd6b91cab00db2759cba6000f80 05-Sep-2017 xutianguo <xutianguo@xiaomi.com> Merge "Bluetooth: Thread-safe state machine's cleaning-up."
am: 493a0024f9

Change-Id: I4f1f41f12fc022acff9c8cc57f571030036c9daa
01bd635018223d88d1d6afe6f1f9309851906b69 05-Sep-2017 Ajay Panicker <apanicke@google.com> Use the current item in the existing queue rather than using metadata
am: b8d861656a

Change-Id: I25224ee96adc9e5e793bc9337558fa99f953528d
f36540ab3e5e2e133aae8d1d9e7301fb37349314 29-Aug-2017 xutianguo <xutianguo@xiaomi.com> Bluetooth: Thread-safe state machine's cleaning-up.

* The AdapterService object might be null when the state machine
thread is still in working state, and it has been set to null
in main thread, which is called in AdapterService's cleanup.
* AdapterState and BondStateMachine both have this defect.
* We should do part cleanup work in onQuitting method of StateMachine.

Bug: 65132355

Test: Make bluetooth turn on/off stress test, passed.

Change-Id: I86bb6176ef75ff95b293f0ed73ce35db62b7add1
Signed-off-by: xutianguo <xutianguo@xiaomi.com>
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
51ed6a554b0a8b322e9154ef3b5b18315dc62148 05-Sep-2017 Kai Wang <kwangsudo@google.com> Merge "AVRCP controller browse" am: 41d9226851
am: 3695768b8f

Change-Id: Idb0713084c7f25ff740f43658d0037034df8c3b0
3695768b8fc3d3621ff22fbdad6c0eaf9b1f736b 05-Sep-2017 Kai Wang <kwangsudo@google.com> Merge "AVRCP controller browse"
am: 41d9226851

Change-Id: Ia8de8342040fec545a923136d612774b0b27994f
41d9226851d0eb9fd26f5c17d824b70877f4e917 05-Sep-2017 Kai Wang <kwangsudo@google.com> Merge "AVRCP controller browse"
b8d861656aa343ebec4c099cbf8fb468f2012be5 29-Aug-2017 Ajay Panicker <apanicke@google.com> Use the current item in the existing queue rather than using metadata

GPM adds additional info into the bundle under a specific key which contains
extra metadata. When a carkit (Magneti BMW does this) requests UID 0 with
getItemAttributes, we would construct a queueItem out of the current song.
This breaks with GPM as the metadata returned from getMetadata() from their
MediaController would not be filled or contain this additional bundle. Instead
always use updateNowPlayingList as it can construct a queue with all the info
we have.

Bug: 65166802
Test: Test switching playlists in GPM with Magneti BWM and see that more info
other than the song title shows up.
Change-Id: Ie96b3a5eccb94b86337936c913c3e81b67745362
vrcp/AddressedMediaPlayer.java
d0c67fee17c5c8daa8e2d8fa5f895aa8348945a1 02-Sep-2017 Ajay Panicker <apanicke@google.com> Merge "Add timestamp to rejected calls for PBAP" am: 82ef803216 am: b9867ab834
am: 3ff827663f

Change-Id: Ib9cca1a821582b2563b72d7e2dededc0a21c7876
3ff827663f67e1427c055a693d1ac34a428c52ec 02-Sep-2017 Ajay Panicker <apanicke@google.com> Merge "Add timestamp to rejected calls for PBAP" am: 82ef803216
am: b9867ab834

Change-Id: I12ca5ed18976bdab4945a45e5337096819dbb8f2
b9867ab834db037a5852e37dcd57352a5e00e20f 02-Sep-2017 Ajay Panicker <apanicke@google.com> Merge "Add timestamp to rejected calls for PBAP"
am: 82ef803216

Change-Id: Iae199eea842565141d2e4ecb90b4d9d2a663b37d
228d402643019482081637023d628794a08d32ea 11-Aug-2017 kai <kwangsudo@google.com> AVRCP controller browse

onConnect and disconnect update the player list

Bug: 62105073
Test: 1 disconnect bluetooth, check the player list
2 connect bluetooth, check the player list, kill bluetooth audio
app and repeat

Change-Id: I27ea0eaebd90bddc952fc6445697796897d7cf07
Merged-In: I5a0ed5a3d8f02911d2077d9d99b427eeaddf4dbd
(cherry picked from commit 01bd404e9da77cf3eb3f65336b16458861c08ee0)
2dpsink/mbs/A2dpMediaBrowserService.java
vrcpcontroller/AvrcpControllerService.java
873c94d5fa898a240630fc6c1666b7b476f1bb4c 02-Sep-2017 Ajay Panicker <apanicke@google.com> Add timestamp to rejected calls for PBAP

Bug: 64379209
Test: Reject a call on test device and see that the call log has a timestamp
for the call.

Change-Id: I422cba8e28567c0364e13dab4452c97df1c9b76c
(cherry picked from commit 1cd940fc4b49320cd11324d1c533b4ffe90f8ac7)
bap/BluetoothPbapCallLogComposer.java
1cd940fc4b49320cd11324d1c533b4ffe90f8ac7 02-Sep-2017 Ajay Panicker <apanicke@google.com> Add timestamp to rejected calls for PBAP

Bug: 64379209
Test: Reject a call on test device and see that the call log has a timestamp
for the call.

Change-Id: I422cba8e28567c0364e13dab4452c97df1c9b76c
bap/BluetoothPbapCallLogComposer.java
10d70d2dc5f2a1ffbfd5af765cf3f36be47a03dd 01-Sep-2017 Jack He <siyuanh@google.com> Merge "HFP: Fix regressions in HFP state machine" am: 6436b20252 am: 0ca3d162d9
am: 583c546ee9

Change-Id: I6ca5c8ea27257a6a2f42170d32a9763ba3164dab
583c546ee9755a4b401ee9d35a4656b3311823a5 01-Sep-2017 Jack He <siyuanh@google.com> Merge "HFP: Fix regressions in HFP state machine" am: 6436b20252
am: 0ca3d162d9

Change-Id: Ia60f9e4bd979b0dbd2dd50b97d7631b8d5b7ae6b
0ca3d162d994b412138938a3ec30a6ac1fee9dc9 01-Sep-2017 Jack He <siyuanh@google.com> Merge "HFP: Fix regressions in HFP state machine"
am: 6436b20252

Change-Id: Ie9201a21adc693445dbf8c5f53ece4041b6ca3d9
6436b20252812e54ab0528c5268719873b5f14fc 01-Sep-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "HFP: Fix regressions in HFP state machine"
673e4dc38242dcdfcd294e720dd392d8b1fd68c1 01-Sep-2017 Joseph Pirozzo <pirozzoj@google.com> AVRCP getConnectedDevices

Utilize the same connectedDevice list rather than asking the
avrcpService for the list multiple times possibly yielding different
lists.

Bug: 63103934
Test: Insert delays and disconnect BT while in the middle of sending
play/pause commands.

Change-Id: Ib6016d853cf1e7e72923df851e7a17752bfee07d
2dpsink/A2dpSinkStreamHandler.java
c092ffd21bbcda0f76fb46680397600c9930227d 01-Sep-2017 Kai Wang <kwangsudo@google.com> Merge "AVRCP controller browse" into oc-mr1-dev
am: c1e2b74469

Change-Id: I5a0ed5a3d8f02911d2077d9d99b427eeaddf4dbd
679f6e3c452c30d4818393c033d2abf2a84d0bf6 30-Aug-2017 Jack He <siyuanh@google.com> PBAP: Reduce logging to verbose for PBAP entries

Bug: 65080314
Test: build, no functional changes
Change-Id: I93d9338f98193e2d72711de27ce47932e699de13
(cherry picked from commit 53ab13fe905f4145ba503c03b84a807acbc3abbc)
bap/BluetoothPbapObexServer.java
c1e2b74469dd3832a0c915af330ff7cf2d2dc87c 01-Sep-2017 Kai Wang <kwangsudo@google.com> Merge "AVRCP controller browse" into oc-mr1-dev
5a0f415fe329b086fc0af05547d3ed8c376463df 01-Sep-2017 Ajay Panicker <apanicke@google.com> Merge "Don't reject notifications and wait until new addressed player is ready (1/2)" into oc-mr1-dev
am: cb4d98e70f

Change-Id: Ic5e4d74a0d9996a455ddb79d0b84833b21b4bcdb
67c982aed4e67772e155f934c2055c72b83f1f22 24-Aug-2017 Ajay Panicker <apanicke@google.com> Don't reject notifications and wait until new addressed player is ready (1/2)

There are some carkits like the ones found in the 2016 Honda CRZ and some
Audi's that do not follow the spec and do not honor reject pending notification
messages after switching players. This causes an issue whenever you switch
players, the metadata freezes due to the fact that the carkit never re-registers
for new track changed notifications. This patch removes the reject notification
and reorders the current notifications.

Bug: 64142363
Test: Test with Audi S7 and 2016 Honda CRZ and see that switching players works
TestTracker/105391/3975
Change-Id: Ifcc236c54ccbec8e8ec0bd7f16e62e4282361bac
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
648f246eec1822af761b510b0244dba6a416d7a8 01-Sep-2017 Hansong Zhang <hsz@google.com> Merge "MAP: Fix bugs in SDP search result handling" am: 652e345ac4 am: 99e395f40c
am: cbb33999db

Change-Id: Ic49a56a9737d5db9273946b18185b5fdd3f6213c
cbb33999db1275785c6916d722c545d7814e8785 01-Sep-2017 Hansong Zhang <hsz@google.com> Merge "MAP: Fix bugs in SDP search result handling" am: 652e345ac4
am: 99e395f40c

Change-Id: I4b93d3986044d90d1e60d689923a47a0c05e3cd4
99e395f40ccf721c96fa033bbf357f3fb77c79d3 01-Sep-2017 Hansong Zhang <hsz@google.com> Merge "MAP: Fix bugs in SDP search result handling"
am: 652e345ac4

Change-Id: Ieeae675b35272783d6c040522f7e0c0d7904e7f5
98af4b741c4ccfa78fd8f02499c1068658e26cc3 18-Jul-2017 Jack He <siyuanh@google.com> MAP: Fix bugs in SDP search result handling

* Without any SDP record indicating support for 1.1 and 1.2, the default
version for MAP-event-report XML message should be 1.0 instead of 1.2
* Support for various MAP features should consider both local and remote
MapSupportedFeatures bit mask
* Move handling of MapSupportedFeatures in BluetoothMapContentObserver
to one place

Bug: 35389912
Test: make, test MAP with carkit
Change-Id: Ice66d7e82e1a7446915207bea9012ed93f2474c7
ap/BluetoothMapContentObserver.java
ap/BluetoothMapMasInstance.java
bc67ac7b9ef7a6b33fc550257b75726d86641923 01-Sep-2017 Jack He <siyuanh@google.com> HFP: Fix regressions in HFP state machine

* When we reject an incoming HF connection, we should notify the event
to other parts of the stack so that hanlders such as PhonePolicy could
react to the event such as attempting A2DP connection
* During SLC establishment, when remote device sends an unexpected
command, we should still try to handle them, but generate a warning
message to help debugging

Bug: 65246419
Test: connect with car kits and headsets
Change-Id: I51f861a11948e5bfe3a0e0a58cee072f1eef4f5c
fp/HeadsetStateMachine.java
44cbbaa59858c3d384df17fdcb330a303caed4f9 31-Aug-2017 Jack He <siyuanh@google.com> Merge "PBAP: Reduce logging to verbose for PBAP entries" am: 6b01c8cad2 am: 4acc61adba
am: 55e2c84530

Change-Id: Ia58f7c15d9fc7be8b487520d54e3adbf0ab3ce11
55e2c84530f479cbb45e05544f2f8adc1e39a0a9 31-Aug-2017 Jack He <siyuanh@google.com> Merge "PBAP: Reduce logging to verbose for PBAP entries" am: 6b01c8cad2
am: 4acc61adba

Change-Id: I75158765c19425385def6a534aa1aab8aaeee712
4acc61adba725ef32a7b227c8d4d90ac3f6f867d 31-Aug-2017 Jack He <siyuanh@google.com> Merge "PBAP: Reduce logging to verbose for PBAP entries"
am: 6b01c8cad2

Change-Id: Icabe4128dbc79ee22c3ccdffea6dd071aa4163e8
53ab13fe905f4145ba503c03b84a807acbc3abbc 30-Aug-2017 Jack He <siyuanh@google.com> PBAP: Reduce logging to verbose for PBAP entries

Bug: 65080314
Test: build, no functional changes
Change-Id: I93d9338f98193e2d72711de27ce47932e699de13
bap/BluetoothPbapObexServer.java
9173a211740656f5a7a85de11e0c2fa5ab5ab853 30-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFPClient call disconnect cause" am: 0e2c4bd2ed
am: cdcf9032d2

Change-Id: I0785a9663bf2a0d265a5f628f414d85b3dea008e
cdcf9032d21cc0c38d0dfc073921c6a91db43137 30-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFPClient call disconnect cause"
am: 0e2c4bd2ed

Change-Id: I6bc5d5cf32dbde7231a6b32c7135ecabef53e54e
01bfc88ae70fb64714141b0109cb3ec0c082e9b1 30-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFPClient call disconnect cause" into oc-mr1-dev
am: b72c741164

Change-Id: Iab8cb33c9609d552185dc730175545aef0efae76
b72c741164b0e9a9d3d86ecdd4468f37ac33d22a 30-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFPClient call disconnect cause" into oc-mr1-dev
322e4d5fdfe6f9b9f754852a23aa82bb84bbd2e3 29-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> HFPClient call disconnect cause

When a phone call goes from Alerting to Terminated make sure that it
goes into the missed call log rather than the incomming call log.

Bug: 64936887
Test: Receive an incomming phonecall terminate it before answering from
any point, ensure that the record shows up in Missed call log.

Change-Id: Ia650da56e6753f72bbd8d2f344efe90104889d48
Merged-In: Iab8cb33c9609d552185dc730175545aef0efae76
(cherry picked from commit 051174ca0897b2a8c280c0f74f53d58aac9facaa)
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientDeviceBlock.java
051174ca0897b2a8c280c0f74f53d58aac9facaa 29-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> HFPClient call disconnect cause

When a phone call goes from Alerting to Terminated make sure that it
goes into the missed call log rather than the incomming call log.

Bug: 64936887
Test: Receive an incomming phonecall terminate it before answering from
any point, ensure that the record shows up in Missed call log.

Change-Id: Ia650da56e6753f72bbd8d2f344efe90104889d48
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientDeviceBlock.java
01bd404e9da77cf3eb3f65336b16458861c08ee0 11-Aug-2017 kai <kwangsudo@google.com> AVRCP controller browse

onConnect and disconnect update the player list

Bug: 62105073
Test: 1 disconnect bluetooth, check the player list
2 connect bluetooth, check the player list, kill bluetooth audio
app and repeat

Change-Id: I27ea0eaebd90bddc952fc6445697796897d7cf07
2dpsink/mbs/A2dpMediaBrowserService.java
vrcpcontroller/AvrcpControllerService.java
e1373b55ce6139d70b890f8d4b5fdcaa2608cc76 29-Aug-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix GATT client leakage when scan is throttled (1/2)" am: 184e444d1c am: 2d42b15312
am: ef71498996

Change-Id: I50c02027377a804f44e8b8d67bd05b233a5fc14a
ef714989962a28ccd003ff3a07af12484343299d 29-Aug-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix GATT client leakage when scan is throttled (1/2)" am: 184e444d1c
am: 2d42b15312

Change-Id: I2f46fe767cc3be23963d3c166117f7ad479eae93
9a8b93d512bfcfda3d9d2c676e6657538871754a 28-Aug-2017 Jakub Pawlowski <jpawlowski@google.com> Fix GATT client leakage when scan is throttled (1/2)

Currently, scan throttling happens after client is registered, but
before the scan is started. This might lead to scan client being leaked.
This patch fixed that by moving check before client registration.

Bug: 64887233
Test: manual
Change-Id: I96e7698a126b41c4fd5e2ce11d1c9084fd560dfc
Merged-In: I96e7698a126b41c4fd5e2ce11d1c9084fd560dfc
(cherry picked from commit 7d0fe2d612a7cc522af1ee3837e3b96d27b58a33)
att/GattService.java
2d42b153129a9d760c5b38b285458fe673777e2b 29-Aug-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix GATT client leakage when scan is throttled (1/2)"
am: 184e444d1c

Change-Id: I5ce345938b885905d6bb1c6cd1da50ea1c7769eb
621089e0664c3153bca852ed5c3e374aedf0cf82 28-Aug-2017 Ajay Panicker <apanicke@google.com> Merge "Check if now playing list is updated by comparing the current queue (1/3)" into oc-mr1-dev
am: d962ca53a2

Change-Id: I27f8e2c9435011f86c811d9d079c37b3b36d1452
7d0fe2d612a7cc522af1ee3837e3b96d27b58a33 28-Aug-2017 Jakub Pawlowski <jpawlowski@google.com> Fix GATT client leakage when scan is throttled (1/2)

Currently, scan throttling happens after client is registered, but
before the scan is started. This might lead to scan client being leaked.
This patch fixed that by moving check before client registration.

Bug: 64887233
Test: manual
Change-Id: I96e7698a126b41c4fd5e2ce11d1c9084fd560dfc
att/GattService.java
8c8777ab3e5f9c468e0406e2873514d37ee3454f 25-Aug-2017 Ajay Panicker <apanicke@google.com> AVRCP: Only send the active player for media player listings
am: 37b7b5b41a

Change-Id: I280229c38b441b0809226c6e5bade4c4ce58640d
37b7b5b41a1ef3a872b93fd292a6c8129b34f347 24-Aug-2017 Ajay Panicker <apanicke@google.com> AVRCP: Only send the active player for media player listings

Some carkits will try to connect to the first player in the media player
list (Harman BMW) while other carkits will try to connect to the last player
in the listing (Magneti BMW). Send only one player in the listing so that
it doesn't matter if it connects to the first or the last.

Bug: 64991621
Bug: 64749777
Test: Connect to Harman BMW and see that the player listing only has one entry
with multiple players installed, on Magneti carkit see that the carkit
sets the current addressed player instead of a player that wasn't
addressed

Change-Id: Ia8410473a5642bcc4ac7d1986c8c647fb7a4d78d
(cherry picked from commit 82cfeee4ed9139eeb55e6823d9b721ba17db8b25)
vrcp/Avrcp.java
ef56c5471dda0dc624d99a18506f8c9330ed8327 31-Jul-2017 Ajay Panicker <apanicke@google.com> Check if now playing list is updated by comparing the current queue (1/3)

Bug: 64686424
Test: Connect to carkit and see that NowPlayingChanged only gets sent when the queue changes
Change-Id: I5da15e466462eaf88ab4918af38c19231adaeea3
vrcp/AddressedMediaPlayer.java
671149a36a4a5479a41f49e09b348ce258c9383d 24-Aug-2017 Ajay Panicker <apanicke@google.com> AVRCP: Only send the active player for media player listings
am: 82cfeee4ed

Change-Id: I9b7ceb3b5b5511388e0ebac4cc8cf2ac4205d7ee
82cfeee4ed9139eeb55e6823d9b721ba17db8b25 24-Aug-2017 Ajay Panicker <apanicke@google.com> AVRCP: Only send the active player for media player listings

Some carkits will try to connect to the first player in the media player
list (Harman BMW) while other carkits will try to connect to the last player
in the listing (Magneti BMW). Send only one player in the listing so that
it doesn't matter if it connects to the first or the last.

Bug: 64991621
Bug: 64749777
Test: Connect to Harman BMW and see that the player listing only has one entry
with multiple players installed, on Magneti carkit see that the carkit
sets the current addressed player instead of a player that wasn't
addressed

Change-Id: Ia8410473a5642bcc4ac7d1986c8c647fb7a4d78d
vrcp/Avrcp.java
4515e214eca671896fbb5870f9b8d542773a458a 21-Aug-2017 Mallikarjuna GB <gbmalli@codeaurora.org> Merge "Properly update profile connection state" am: 0b4d65d712 am: 14e18cdd57
am: 3ebe6c6b88

Change-Id: I5a136464b3ca60ddaa09e28baefaff88a6efe954
17e1238aa577a105f4d1dcbf3bbaed6831a55b0e 21-Aug-2017 Mallikarjuna GB <gbmalli@codeaurora.org> Properly update profile connection state
am: 348b6390d7

Change-Id: I689dbd5597a253e98f77d97c38acfb71277522cc
14e18cdd57fff45a34b83b70ea2162212a58f296 21-Aug-2017 Mallikarjuna GB <gbmalli@codeaurora.org> Merge "Properly update profile connection state"
am: 0b4d65d712

Change-Id: I6560567be184ca4e03f6f8e0ec166ca57ae45a96
348b6390d7344299573cf230ee74160f5d53994a 23-Jun-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Properly update profile connection state

When DUT is toggled between various paired Headsets Connection
state is not updated properly in some scenarios. This is causing
Bluetooth icon to be in connected state even when no Headsets are
connected.

With this patch we will broadcast connection states in case of
failure and will make sure connected, connecting, disconnecting
devices count is never negative.

Test: Toggle between various paired devices in settings
Bug: 35657640
Change-Id: Icb1a7215ff6d9491afbb5f7f203ca0a2c6b7f43a
(cherry picked from commit 921e34fc7ffd18b4f831bbcf0cf38e7268a00613)
2dp/A2dpStateMachine.java
tservice/AdapterProperties.java
fp/HeadsetStateMachine.java
921e34fc7ffd18b4f831bbcf0cf38e7268a00613 23-Jun-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Properly update profile connection state

When DUT is toggled between various paired Headsets Connection
state is not updated properly in some scenarios. This is causing
Bluetooth icon to be in connected state even when no Headsets are
connected.

With this patch we will broadcast connection states in case of
failure and will make sure connected, connecting, disconnecting
devices count is never negative.

Test: Toggle between various paired devices in settings
Bug: 35657640
Change-Id: Icb1a7215ff6d9491afbb5f7f203ca0a2c6b7f43a
2dp/A2dpStateMachine.java
tservice/AdapterProperties.java
fp/HeadsetStateMachine.java
314c27fb5673a680184eb62b9f94023e6bbf8f90 17-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFP client volume control" am: 639e30b222 am: 00e5589c75
am: c8b307fbe9

Change-Id: I447b86e5fc9df8d86854db2ef9c123a7bdafd733
00e5589c75e49b1fa5e53b39260c169d2ff59065 17-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFP client volume control"
am: 639e30b222

Change-Id: Icc907c86cc0ab198946c8adbc265c305b20149cf
639e30b222cb9e635f80f593a2e77735d658a784 17-Aug-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "HFP client volume control"
f75e83ce6667bd3b453caf8c73a8e5cae287704f 17-Aug-2017 Vinay Kalia <vinaykalia@google.com> Merge "Fix time stats in bluetooth_manager dumpsys" am: 3e506c2444 am: 14f2a23baa am: 5d46f9e1d7
am: fcd94a24f9

Change-Id: Ibe14ffec63cd79981d834b997aa127d3e0af5ff5
fcd94a24f99a3906817ccaf3163253022c4d0e95 17-Aug-2017 Vinay Kalia <vinaykalia@google.com> Merge "Fix time stats in bluetooth_manager dumpsys" am: 3e506c2444 am: 14f2a23baa
am: 5d46f9e1d7

Change-Id: I9b540c34727bf486f298bf1bb3cefd38898d5199
14f2a23baa6bc9611c9b8c7dd6287750287920a8 17-Aug-2017 Vinay Kalia <vinaykalia@google.com> Merge "Fix time stats in bluetooth_manager dumpsys"
am: 3e506c2444

Change-Id: I4c28db4259a0e3fc4e8ccb1fcfc60e0a0df27b01
54d5aab5a8b6aaae4f561b2643e6b423aad165fd 15-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> HFP client volume control

Accept volume controls from connected phone. Suport AT+VGS and +VGS
commands.

Bug: 38005564
Test: Connect a phone, start a call, change volume up and down on phone
and verify volume level on headunit changes, as well as monitor snoop
logs.

Change-Id: I8b89b2487da81cf9562598a0a5408c266e8ecc6a
Merged-In: I2015b663557631974a74835e19cb4da56182597a
(cherry picked from commit 3d35808e7d5c704b4cc4f7fe0dc1d8cafc3f1fda)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/NativeInterface.java
36bb749f3ba4ff310567e10301e32589b8860e23 17-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFP client volume control" into oc-mr1-dev
am: d4d63608ad

Change-Id: I2015b663557631974a74835e19cb4da56182597a
d4d63608ad025fefa644fa534569389c1fa3dba2 17-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFP client volume control" into oc-mr1-dev
3d35808e7d5c704b4cc4f7fe0dc1d8cafc3f1fda 15-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> HFP client volume control

Accept volume controls from connected phone. Suport AT+VGS and +VGS
commands.

Bug: 38005564
Test: Connect a phone, start a call, change volume up and down on phone
and verify volume level on headunit changes, as well as monitor snoop
logs.

Change-Id: I8b89b2487da81cf9562598a0a5408c266e8ecc6a
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/NativeInterface.java
cb5786ffece533c1aa4d6622ba896bba0cdc4e71 11-Aug-2017 Vinay Kalia <vinaykalia@google.com> Fix time stats in bluetooth_manager dumpsys

1. If an application starts an unfiltered scan on screen-off
then it is immediately suspended. However, the "Suspended Time"
for such a scan is not updated in bluetooth_manager dumpsys.
With this change "Suspended Time" is updated for such scans as below:

2017/08/10 15:04:01 - 5945ms Suspended 0 results (6)
â”” Suspended Time: 5942ms

2. Fix a bug in calculating "Total time suspended".

Test: Tested BLE scanning application with screen off.
Change-Id: I489cf5d6854e10fc25d4ce8e7817126391d0bc89
att/AppScanStats.java
att/ScanManager.java
34ea95f05bc5c93725222fcb35810c78481dd01f 10-Aug-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "HFPClient unhold conference call" into oc-mr1-dev
4b37f18cc68f5216d69368b8c8ea9b0e554e144b 10-Aug-2017 Vinay Kalia <vinaykalia@google.com> Merge "Unregister display listener" am: 0f9a644645 am: 34d17dc3d8
am: a47edcb6f1

Change-Id: Ia559e72cc83688f646fbca0681cc665352191b6f
0f231f11d5be27c120480a0d0b660eb2d495c66a 10-Aug-2017 Vinay Kalia <vinaykalia@google.com> Merge "Stop unfiltered BLE scanning on screen off" am: 258f385b43 am: da28f532aa
am: 294ac93663

Change-Id: I293c255094460de718bf8a367c5e78a8bfa4f7f6
34d17dc3d8e2b419ff7cbe3d2c091ce46c955986 10-Aug-2017 Vinay Kalia <vinaykalia@google.com> Merge "Unregister display listener"
am: 0f9a644645

Change-Id: Id9b722f59699566aa5690bf114f3f6d7d138fb52
da28f532aa910f314300c60dcb25b177c8e2c5a8 10-Aug-2017 Vinay Kalia <vinaykalia@google.com> Merge "Stop unfiltered BLE scanning on screen off"
am: 258f385b43

Change-Id: Ice9cb0dd6c69954f9639115e87353f0d3596793f
902923e1d4046df5e0270c19bd96cd397b3f4905 10-Aug-2017 Vinay Kalia <vinaykalia@google.com> resolve merge conflicts of 613fc2e89 to stage-aosp-master

Merged-In: I75f51146a8c604fed5997f7ad4a77fc89b5b5c44
Merged-In: I8a8492757191c603786f0ca275bacbf63d577459

Test: Verified this conflict resolution.

Change-Id: I0142a236327cc277f348d7188da0807983fc5132
0f9a64464557a823c59686e0da83e7c593850e31 10-Aug-2017 Vinay Kalia <vinaykalia@google.com> Merge "Unregister display listener"
f31324d5fbbdbb856edad55568f9696b4c860fb8 04-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> HFPClient unhold conference call

Allow a conference call with more than one party to be unheld. Clean up
hfp_enable logic to prevent it from being set twice in a row.

Bug: 63412812
Test: Create a multi party call on a GSM network and hold the phone
call, upon resuming audio is routed properly.

Change-Id: Ib31259eba0bbb171015f26b30a415e0539b3d0ec
Merged-In: Ie892f805ba3fe160b16b1c6d6c4453b5433004d8
(cherry picked from commit 167fd7bb638c43ac5e59f4c3a83037b617e7e336)
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/HfpClientConference.java
392e4ca414d1556e0ddd29a1f222baabbe2ab944 10-Aug-2017 Ajay Panicker <apanicke@google.com> Fix IndexOutOfBounds exception due to incorrect media player start index am: f73db9bf71
am: b03d9b5c20

Change-Id: I1ebb024d294182e71e7ac67ae146e4c50154890d
905f812c5df451b87b2bfca692c066d0843adbac 10-Aug-2017 Ajay Panicker <apanicke@google.com> Fix IndexOutOfBounds exception due to incorrect media player start index
am: f73db9bf71

Change-Id: I80a6bbf8d4566e16992cad672767dce5999a8406
b03d9b5c2087c54bccc2139a59735e70b7699e91 10-Aug-2017 Ajay Panicker <apanicke@google.com> Fix IndexOutOfBounds exception due to incorrect media player start index
am: f73db9bf71

Change-Id: Ibf4cac19ba701eb4af7ee475abd1a6aad7c3b7d4
f73db9bf71badd648320cac0074169e009562d77 10-Aug-2017 Ajay Panicker <apanicke@google.com> Fix IndexOutOfBounds exception due to incorrect media player start index

Before, if there were no addressed players there would be an index
out of bounds exception due to accessing past the end of the array
as position zero would be skipped. Now set start index to 0 if there
is no addressed player.

Bug: 64440498
Test: Connect to carkit with only one player
Change-Id: I76bf4a872e9722ca7cc6b1ca90f88200a72c8c27
vrcp/Avrcp.java
fd2280547edfedad8862cd11bb71f3284f938f4a 10-Aug-2017 Ajay Panicker <apanicke@google.com> AVRCP: Ignore addressed player changed to telecom am: c833de68eb
am: 7f10cf63cf

Change-Id: I597b81b8bb9849b5a1e63066e3fce868f0a66f1b
518fffd49524934128dbbaf4c3eb8427cfe0fea9 10-Aug-2017 Ajay Panicker <apanicke@google.com> AVRCP: Ignore addressed player changed to telecom
am: c833de68eb

Change-Id: I6c090e9a687239885e361bc944a2b748f37fc536
7f10cf63cf0f111a647c33fb828e4c9fe3546170 10-Aug-2017 Ajay Panicker <apanicke@google.com> AVRCP: Ignore addressed player changed to telecom
am: c833de68eb

Change-Id: I332514b23ac32b42b78e0c10a2ee2a8d3b1d16b2
e3193ee392318c17684d4a953a8faeb3250c9e6d 10-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFPClient unhold conference call" am: 24c71a61be am: bdb35c8826 am: 96905f9733
am: afb5e2fb00

Change-Id: Ie892f805ba3fe160b16b1c6d6c4453b5433004d8
258f385b43aa002556ec783d76104bd51cf65d19 10-Aug-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Stop unfiltered BLE scanning on screen off"
613fc2e897349d6ad8ad402339641a561186e943 10-Aug-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Improve BLE scan attribution to facilitate debugging power issues"
afb5e2fb0071ecc132248e0f630cc9ffcac31ca6 09-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFPClient unhold conference call" am: 24c71a61be am: bdb35c8826
am: 96905f9733

Change-Id: Id60c84f7cb2407f25c839b8462837944315b3aa5
bdb35c88262a50cafe8f92c26484a028185190fb 09-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFPClient unhold conference call"
am: 24c71a61be

Change-Id: I410254eeb071eba49c389ddedd6c03b71450f453
24c71a61be16a96dabeff632eb8e0c999c35436b 09-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFPClient unhold conference call"
c833de68eb3f5a82db6e83166e18504e83e5d035 08-Aug-2017 Ajay Panicker <apanicke@google.com> AVRCP: Ignore addressed player changed to telecom

* During a phone call, com.android.server.telecom is chosen by the media
framework as the addressed player. It listens to media button presses
to control various call functions.
* Bluetooth uses Hands Free Profile (HFP) instead of media buttons to
control phone calls. Therefore, Bluetooth does not need to interact
with telecom's HeadsetMediaButton during a call.
* Moreover, switching addressed player during SCO codec negotiation
confuses some car kits, making HFP not functional.
* This CL ignores addressed player change to telecom.

Bug: 64043110
Test: Make a phone call while playing music, AVRCP and HFP regression
Change-Id: If01b84275f8aab23d793e321f71b6b46e8e926aa
vrcp/Avrcp.java
f48174365b8e30bcd491d729aee236e4a86f8d37 09-Aug-2017 Vinay Kalia <vinaykalia@google.com> Merge "Unregister display listener" into oc-mr1-dev
am: 4cc29d0d72

Change-Id: Id87a7b3ad5eaff2a02e95b9ff83116c3b7b6b735
4cc29d0d72edeb8b2d1ee0828c4bd198e67a0fc7 09-Aug-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Unregister display listener" into oc-mr1-dev
503011632df946680ad2d613af553fb32880e5ca 09-Aug-2017 Ajay Panicker <apanicke@google.com> Merge "Allow AVRCP to send playback state when resumed from pause" into oc-dr1-dev
am: bc6b12956a

Change-Id: Ib04e78d3786ddf7a0ce6c93c56ac1502c720ce7a
445d36cb67390a9a432c4676a3bd1a2722de20a0 09-Aug-2017 Ajay Panicker <apanicke@google.com> Merge "Allow AVRCP to send playback state when resumed from pause" into oc-dr1-dev am: bc6b12956a
am: e20a90726e

Change-Id: I49cd4461a8d2f57b2c5ee15efde384dc5d929eb3
e20a90726e323fa112a8ad9b7b8d133d0264514d 09-Aug-2017 Ajay Panicker <apanicke@google.com> Merge "Allow AVRCP to send playback state when resumed from pause" into oc-dr1-dev
am: bc6b12956a

Change-Id: I6d95cad5f8a2df6a922f6c66a8b7ff56f8545f0e
bc6b12956a5f2ddfda003f4c0c6ad70d4ba6f12d 09-Aug-2017 Ajay Panicker <apanicke@google.com> Merge "Allow AVRCP to send playback state when resumed from pause" into oc-dr1-dev
c2d0d6bfbe193da02d4ea77691cb42c2ff2fd2d5 09-Aug-2017 Vinay Kalia <vinaykalia@google.com> Unregister display listener

Display listener must be unregistered in ScanManager::cleanup()
to avoid getting display state change callbacks between
ScanManager::cleanup() and ScanManager object destruction.

BUG: 64253576
Test: Screen on and screen off during BLE scanning.
Screen on and screen off with Bluetooth off.

Change-Id: I5b1f26696c44aaaca3720a200d85983afc8d2759
(cherry picked from commit 961b2ad08157dd383b2333160bc068030f3e9b44)
att/ScanManager.java
961b2ad08157dd383b2333160bc068030f3e9b44 09-Aug-2017 Vinay Kalia <vinaykalia@google.com> Unregister display listener

Display listener must be unregistered in ScanManager::cleanup()
to avoid getting display state change callbacks between
ScanManager::cleanup() and ScanManager object destruction.

BUG: 64253576
Test: Screen on and screen off during BLE scanning.
Screen on and screen off with Bluetooth off.

Change-Id: I5b1f26696c44aaaca3720a200d85983afc8d2759
att/ScanManager.java
319aeae6f4ebd13678b4f77375d1804978c4a1e1 20-Jul-2017 Vinay Kalia <vinaykalia@google.com> Stop unfiltered BLE scanning on screen off

Stop unfiltered BLE scans when the screen goes off.
These scans will be resumed when the screen turns on
again unless these scans are stopped by application
itself before the screen is turned on.

While screen is off, new scans are allowed to be
created but scan instances will not receive results
until the screen is turned on.

Stats in bluetooth_manager dumpsys are updated to show
suspended time as below:

LE scans (started/stopped) : 11 / 10
Scan time in ms (min/max/avg/total): 1107 / 15003 / 7623 / 83859
Total time suspended : 4257ms
Total number of results : 14
Last 5 scans :
2017/07/26 15:41:50 - 14993ms Filter 0 results (6)
2017/07/26 15:42:05 - 5021ms 0 results (6)
2017/07/26 15:42:10 - 9908ms Filter 0 results (6)
2017/07/26 15:42:20 - 5011ms 11 results (6)
â”” Suspended Time: 1193ms
2017/07/26 15:42:25 - 14990ms Filter 0 results (6)
Ongoing scans :
2017/07/26 15:42:40 - 1342ms Suspended 0 results (6)
â”” Suspended Time: 1239ms

BUG: 62264269
Test: Tested BLE scanning applications.

Change-Id: I017f0cdc0fc52a0a30d6cf870d7e688e5ff18df9
att/AppScanStats.java
att/ScanManager.java
bcdae28f17c0a8422f8d996cf68071e0245fce6e 23-Jun-2017 Vinay Kalia <vinaykalia@google.com> Improve BLE scan attribution to facilitate debugging power issues

Following changes are made to improve BLE scan dumpsys:
1. All stats in AppScanStats assumed one scan per application.
This is not true for many applications. Fix scanning stats
to support multiple scans per application:
a. Fix number of scans started/stopped counters.
b. Fix scan min/max/avg/total time.
c. Fix scan start/stop indication to batterystats.

2. Show ongoing scans as a separate list of scans.

Example:
<app-name> (Registered)
LE scans (started/stopped) : 13 / 11
Scan time in ms (min/max/avg/total): 1098 / 227509 / 19805 / 257469
Total number of results : 2623
Last 5 scans :
2017/06/26 14:55:02 - 6659ms 59 results (7)
2017/06/26 14:55:13 - 1113ms 6 results (8)
2017/06/26 14:55:14 - 10012ms Filter 0 results (8)
2017/06/26 14:55:24 - 1106ms 7 results (8)
2017/06/26 14:57:56 - 10007ms 100 results (9)
Ongoing scans:
2017/06/26 14:55:09 - 227509ms 2232 results (7)
2017/06/26 14:58:06 - 50463ms Filter 0 results (9)

Application ID : 5
UUID : xxxx

BUG: 62389939
Test: Tested a few BLE scanning applications which included misbehaving
applications.

Change-Id: Iaade4ce4bf06533415b49bc3635866b1bf0db937
att/AppScanStats.java
att/GattService.java
att/ScanManager.java
6ddf83ec8a10c5b1036d0417ee382de5d351b3c5 08-Aug-2017 Ajay Panicker <apanicke@google.com> Prevent stack crash if there is only one player and it isn't active am: 99a0131b41
am: c227403d4d

Change-Id: I50ed32f1cf1e6cc068c5778eafa415a5971ab13c
c227403d4d5452da61a7d5fedfc0f8c99dfd09bf 08-Aug-2017 Ajay Panicker <apanicke@google.com> Prevent stack crash if there is only one player and it isn't active
am: 99a0131b41

Change-Id: I4084fb3b2147b45a57b95823c9a1b48fe9c61cae
c084ff45ba312fe77e3b91e81d668ef6f8002403 08-Aug-2017 Ajay Panicker <apanicke@google.com> Prevent stack crash if there is only one player and it isn't active
am: 99a0131b41

Change-Id: I5158b1d3e684b776e058a4fa9de000088cdb3c2c
99a0131b4119f35685a953e056f56512fa1bb74a 08-Aug-2017 Ajay Panicker <apanicke@google.com> Prevent stack crash if there is only one player and it isn't active

Bug: 64440498
Test: Connect to carkit at boot with only one available player
Change-Id: Iaea363cb406ae6117550274fe0695b2391f0eedf
vrcp/Avrcp.java
86859c32964ab3dd66f6085604c3578e1f6b78ff 08-Aug-2017 Ajay Panicker <apanicke@google.com> Allow AVRCP to send playback state when resumed from pause

Bug: 64457876
Test: Pause a song then try resuming it
Change-Id: I486882945f6e2707d7eae92cb45d0305eeee6f20
vrcp/Avrcp.java
0882fb8f8f173d174573faeacadd1a9825fcc7d3 08-Aug-2017 koh.changseok <koh.changseok@lge.com> Merge "AVRCP: Fix unexpected index out of bounds exception"
am: eaebb03146

Change-Id: I26b8b0305dd77c7f6fd3c251dfe2b59fa99e004e
f789be60465a565048a0cda58a2e01f71bfabf68 07-Aug-2017 koh.changseok <koh.changseok@lge.com> AVRCP: Fix unexpected index out of bounds exception am: 3850616551
am: 1af549ddd6

Change-Id: Ia13c577816c6883555dedc95f3158ee0f81b40d3
1af549ddd662a3d1a2950d2a6dd84c5ff552ede5 07-Aug-2017 koh.changseok <koh.changseok@lge.com> AVRCP: Fix unexpected index out of bounds exception
am: 3850616551

Change-Id: I120752c67645a2854efbd2eca573207d37986fa1
f1f3a5e393f8e848d8f00b285395b9b33d497040 07-Aug-2017 koh.changseok <koh.changseok@lge.com> AVRCP: Fix unexpected index out of bounds exception
am: 3850616551

Change-Id: I5a5e4c29f6b59608f1ab5a05dcac15a8687acbd0
e91d4b292625907ccd8f1aa30a3dccf623c886e7 28-Jul-2017 koh.changseok <koh.changseok@lge.com> AVRCP: Fix unexpected index out of bounds exception

On function checkIndexOutofBounds(),
if endItem value equals to the MediaItem list,
then there will be 'IndexOutOfBoundsException'.
As sub list end value is endItem + 1,
endItem shall be smaller value than list size.

Bug: 64137660
Test: Code compiles
Change-Id: I6d2dc705451cf1f515c8fbfd4ba24ac49dc4271d
(cherry picked from commit 3850616551e6fb0a7ab0546ef68e0f74fa3536be)
vrcp/BrowsedMediaPlayer.java
3850616551e6fb0a7ab0546ef68e0f74fa3536be 28-Jul-2017 koh.changseok <koh.changseok@lge.com> AVRCP: Fix unexpected index out of bounds exception

On function checkIndexOutofBounds(),
if endItem value equals to the MediaItem list,
then there will be 'IndexOutOfBoundsException'.
As sub list end value is endItem + 1,
endItem shall be smaller value than list size.

Bug: 64137660
Test: Code compiles
Change-Id: I6d2dc705451cf1f515c8fbfd4ba24ac49dc4271d
vrcp/BrowsedMediaPlayer.java
167fd7bb638c43ac5e59f4c3a83037b617e7e336 04-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> HFPClient unhold conference call

Allow a conference call with more than one party to be unheld. Clean up
hfp_enable logic to prevent it from being set twice in a row.

Bug: 63412812
Test: Create a multi party call on a GSM network and hold the phone
call, upon resuming audio is routed properly.

Change-Id: Ib31259eba0bbb171015f26b30a415e0539b3d0ec
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/HfpClientConference.java
ff25553b660801320f6ca723ec0541ace5186ec6 04-Aug-2017 Ajay Panicker <apanicke@google.com> Return on available players changed and clear state for addr player changed am: 444761c2b6
am: a07d698611

Change-Id: Idb49857cb9fbb5e55f1d7da4c3904457fc1f5aa0
5e5a849b5f2fca9bea89dcd7f15ed583455727cc 04-Aug-2017 Ajay Panicker <apanicke@google.com> Initialize the Browsable Player list at user unlock instead of boot complete am: eb829bbfa2
am: 365cd26fbb

Change-Id: Ic21874f18ba947cc366e3fcb418f61e80909bd63
38dd9a73b542be8934242a45168b0dd10e9f38b3 04-Aug-2017 Ajay Panicker <apanicke@google.com> Grab all packages that support browsing instead of connecting to them one by one am: 1111f24344
am: c1ca41cebf

Change-Id: I6ff4c6b9c97d090932e0c919e1b1a14bdb929e5e
7bfa987338c6988480fd3f9bcf782dccecaefbe8 04-Aug-2017 Ajay Panicker <apanicke@google.com> Send the playback state changes to playing only after track changed am: 3211ee063d
am: 63b25e0d02

Change-Id: Ie8fc02d33e9ee7f9da1135597adf928fdf7c9739
5bdec69a01cff939860915191d1b546012befc86 04-Aug-2017 Ajay Panicker <apanicke@google.com> Update the now playing list after AddrPlayerChanged am: 3616b7ce7b
am: 0f663b4d53

Change-Id: I02124ae93b37eae21fc26d3f1ec1227d2b4b2d0d
eca58ce9ecb421d69805251269c17928844e36d4 04-Aug-2017 Ajay Panicker <apanicke@google.com> Remove dependency on delay by ignoring invalid playback states am: 093a2e4d9a
am: 4fd04ba37e

Change-Id: Iff8b482bfcdd46c3a45a16db858ecb16ea882997
a17df7f7729d5532eaea42e42689fa916eea114f 04-Aug-2017 Ajay Panicker <apanicke@google.com> Return on available players changed and clear state for addr player changed
am: 444761c2b6

Change-Id: Id1a61bf477487c80ff8c4b8068f3fd2c85b99fa0
a07d698611ad367579cf68ce95122f61d44495b1 04-Aug-2017 Ajay Panicker <apanicke@google.com> Return on available players changed and clear state for addr player changed
am: 444761c2b6

Change-Id: I844d0368b2b726cacbb0ee389da533fb45050a89
ddc70763bee4a1bf8166a7cf7742e489b66fddae 04-Aug-2017 Ajay Panicker <apanicke@google.com> Initialize the Browsable Player list at user unlock instead of boot complete
am: eb829bbfa2

Change-Id: I857f30cc04966179a8f86480d5ad5fedfbfe2cb6
365cd26fbb9e71493b32d2015eb401982d71bc34 04-Aug-2017 Ajay Panicker <apanicke@google.com> Initialize the Browsable Player list at user unlock instead of boot complete
am: eb829bbfa2

Change-Id: Ic3ae1de9ac1985c3ef7cbd1bbedad10d3cfbe7e1
3d91ca3cf9fdf36bcb060922be767d0c405853ac 04-Aug-2017 Ajay Panicker <apanicke@google.com> Grab all packages that support browsing instead of connecting to them one by one
am: 1111f24344

Change-Id: I7eca671c4be2205ab23e40bb82f83c30127eabfc
c1ca41cebf82a34c4b7a8584e3d6220527caa722 04-Aug-2017 Ajay Panicker <apanicke@google.com> Grab all packages that support browsing instead of connecting to them one by one
am: 1111f24344

Change-Id: I6f3857020e16d92068f2b462a1c7437c484da9f3
63b25e0d024dbf6c94a3bd7aa5ea799dc32f5b17 04-Aug-2017 Ajay Panicker <apanicke@google.com> Send the playback state changes to playing only after track changed
am: 3211ee063d

Change-Id: I36c4fb576e3bc2a69e2dd7837c293e379f2df81e
261fee808f8fb5e115446d5eb30164b60fb8929e 04-Aug-2017 Ajay Panicker <apanicke@google.com> Send the playback state changes to playing only after track changed
am: 3211ee063d

Change-Id: Ie6684109565599e4bcea9c6fa18c15a4c6200430
0f663b4d53e910e5f822752a394f76efec518f3c 04-Aug-2017 Ajay Panicker <apanicke@google.com> Update the now playing list after AddrPlayerChanged
am: 3616b7ce7b

Change-Id: I6aed5bdb93ee3bd28883fb674c1cee1b0cbda163
4c28d0aea6e4fe16c81a1667acc30033792b5282 04-Aug-2017 Ajay Panicker <apanicke@google.com> Update the now playing list after AddrPlayerChanged
am: 3616b7ce7b

Change-Id: I60aba3b908506fdfddce621a4ed7d8f00a408eef
4fd04ba37ee31634d67b51fbe8d22130bdfbe900 04-Aug-2017 Ajay Panicker <apanicke@google.com> Remove dependency on delay by ignoring invalid playback states
am: 093a2e4d9a

Change-Id: I75af8dde69abaa4b60c219b0e789748a9b691d70
e40eaf83c913d5a9c42680479c0ec331d68d7f1c 04-Aug-2017 Ajay Panicker <apanicke@google.com> Remove dependency on delay by ignoring invalid playback states
am: 093a2e4d9a

Change-Id: Iaee1b775484b1262bf8ae89f43aaa81ca1d3c083
444761c2b6460ba4d9413c8d584794dec9ce3378 04-Aug-2017 Ajay Panicker <apanicke@google.com> Return on available players changed and clear state for addr player changed

Bug: 2662710
Test: Switch players soon after boot and see that available players changed
doesn't get sent twice
Change-Id: I41713b82d98707330453d2afa328f0d4d7cbc291
vrcp/Avrcp.java
eb829bbfa257c84c4f8fa589b54791e3f413b486 04-Aug-2017 Ajay Panicker <apanicke@google.com> Initialize the Browsable Player list at user unlock instead of boot complete

Bug: 34471252
Test: Code compiles and the browsable player list is built earlier in the boot process
Change-Id: I664e0dbaecade43df58ce464a634306db2910f5b
vrcp/Avrcp.java
1111f243441532aefeadf322a9ab9800e330007b 04-Aug-2017 Ajay Panicker <apanicke@google.com> Grab all packages that support browsing instead of connecting to them one by one

This prevents sending an excess amount of Available Players Changed
notifications.

Bug: 34471252
Test: Connect to carkit and switch players, see that number of addressed player
changed notifications is consistant with boot time
Change-Id: Ic9409dc262f951cd22a5eb44cf2c44e0375908de
vrcp/Avrcp.java
3211ee063dc32e07ab00d94312637dd7c27d2bba 04-Aug-2017 Ajay Panicker <apanicke@google.com> Send the playback state changes to playing only after track changed

Bug: 34471252
Test: On BMW carkit, see that it waits to get item attributes until after
the state is playing
Change-Id: Ie27514b42a18d7906abde7741112b3d213c8bd63
vrcp/Avrcp.java
3616b7ce7be6abaca5eef876e055155f9e8a3b1f 03-Aug-2017 Ajay Panicker <apanicke@google.com> Update the now playing list after AddrPlayerChanged

The now playing list needs to be updated since the AddrPlayerChanged
notification resolves the NowPlayingList changed notification. This is
to prevent sending an update immediatly after the notification was rejected.

Bug: 34471252
Test: Connect to carkit and switch players and see that the notification
changed event wasn't sent after a reject
Change-Id: Ifb05d9bcca53a71aff737fa8875fd308fa516ec7
vrcp/Avrcp.java
093a2e4d9aeaecb0d51d8b7c74b4466d368c31cf 04-Aug-2017 Ajay Panicker <apanicke@google.com> Remove dependency on delay by ignoring invalid playback states

Remove the dependency on delaying for a media update by instead
using the playback state and current metadata to determine current
song status.

Bug: 34471252
Test: Switch players on BMW carkit
Change-Id: I25532d6e47fbecc1357b78ce189cb9f411ecc256
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
69ba1b9e533e5319b1c5ccd9c2b1a1d6080dc362 03-Aug-2017 Alexandru-Andrei Rotaru <rotaru@google.com> Merge "Allow disabling of Bluetooth tethering if DISALLOW_CONFIG_TETHERING in on" am: d5bb9ffd9d am: cb97b222d1 am: fe7dc0a6a6
am: 3b83d28236

Change-Id: Iec1f77d6c92dfe29c5640d678f150a660de6b167
3b83d282369c03cac38a1aedaa6147562d361f3f 03-Aug-2017 Alexandru-Andrei Rotaru <rotaru@google.com> Merge "Allow disabling of Bluetooth tethering if DISALLOW_CONFIG_TETHERING in on" am: d5bb9ffd9d am: cb97b222d1
am: fe7dc0a6a6

Change-Id: Idfc28fd40571fd7a10d238a50ab2bfa9c990e259
cb97b222d1ad6f6ad788aebef9fd78b2a22fe408 03-Aug-2017 Alexandru-Andrei Rotaru <rotaru@google.com> Merge "Allow disabling of Bluetooth tethering if DISALLOW_CONFIG_TETHERING in on"
am: d5bb9ffd9d

Change-Id: I9d15e3c0246bc638535a8ef0e933032102e79b97
d5bb9ffd9d9afe5c1d0548eb23d016e3ac616bbd 03-Aug-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Allow disabling of Bluetooth tethering if DISALLOW_CONFIG_TETHERING in on"
3666c8cd291105a188201a61fe80bd5da2e61cfd 01-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "Support call waiting/call swap on single phone." into oc-mr1-dev
81213340aeb174687754b657a85a4b2732967eec 01-Aug-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFP connect Audio" into oc-mr1-dev
3a5427ea82578a1cadfbc242fa0d582689b9abe3 01-Aug-2017 Vinay Kalia <vinaykalia@google.com> Stop unfiltered BLE scanning on screen off
am: 12991e6867

Change-Id: Ib46331cf880b8e978f56ec98b3a3bdf1a9ab8fcd
60487bf626ff69f4c603dcaba23d45318915f4bd 28-Jul-2017 Joseph Pirozzo <pirozzoj@google.com> Support call waiting/call swap on single phone.

Update logic to allow a second call (on a single phone) to be
answered and swapped into and out of the foreground.
Bug: 62086689
Test: Pair a phone, make two phone calls, swap them and verify proper
audio routing

Change-Id: I7ab5f368714d22c5649489540e6b71dd5b26288c
(cherry picked from commit 2cc339ea1b0cad6445bf71adf19d41407aa7f9e0)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
739d0edc69630535258722a38a4d22d26d2ccf37 02-Jun-2017 Joseph Pirozzo <pirozzoj@google.com> HFP connect Audio

Connect audio when a phonecall is started rather than relying on the
dialer to do it. Due to complexities in SCO management and audio
routing only a single call is available and so upon answering a call
from a second phone the first call is terminated rather than held.

Bug: 62086689
Test: pair and connect 2 phones via HFP then make alternating incoming
and outgoing phone calls while ensuring that only 1 call remains active
and that call's audio is routed.
Change-Id: Iabb9cd6d483135feb93592cc8f8a33e042f2c41f
Merged-In: Ib97d310f2a058aba72ea46defe50ebea74fce2d5
(cherry picked from commit e74c2decb35910e70cc984510b04af7cc87bd5bf)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/HfpClientConnection.java
12991e68679245a717ba3a94df90c57d438e259e 20-Jul-2017 Vinay Kalia <vinaykalia@google.com> Stop unfiltered BLE scanning on screen off

Stop unfiltered BLE scans when the screen goes off.
These scans will be resumed when the screen turns on
again unless these scans are stopped by application
itself before the screen is turned on.

While screen is off, new scans are allowed to be
created but scan instances will not receive results
until the screen is turned on.

Stats in bluetooth_manager dumpsys are updated to show
suspended time as below:

LE scans (started/stopped) : 11 / 10
Scan time in ms (min/max/avg/total): 1107 / 15003 / 7623 / 83859
Total time suspended : 4257ms
Total number of results : 14
Last 5 scans :
2017/07/26 15:41:50 - 14993ms Filter 0 results (6)
2017/07/26 15:42:05 - 5021ms 0 results (6)
2017/07/26 15:42:10 - 9908ms Filter 0 results (6)
2017/07/26 15:42:20 - 5011ms 11 results (6)
â”” Suspended Time: 1193ms
2017/07/26 15:42:25 - 14990ms Filter 0 results (6)
Ongoing scans :
2017/07/26 15:42:40 - 1342ms Suspended 0 results (6)
â”” Suspended Time: 1239ms

BUG: 62264269
Test: Tested BLE scanning applications.

Change-Id: I017f0cdc0fc52a0a30d6cf870d7e688e5ff18df9
att/AppScanStats.java
att/ScanManager.java
5b54bb48f9f87cde626ad55f0a9deca7c7393b4d 31-Jul-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "Support call waiting/call swap on single phone." am: b143b49138 am: eb5d9c962c
am: 2f439d45d9

Change-Id: I3c7e714696212aa818970b79f5f5372f649de4d8
eb5d9c962c4d1af963e5d6f98f2c92dd21153ba9 31-Jul-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "Support call waiting/call swap on single phone."
am: b143b49138

Change-Id: Iefb15fe29ddf3859ae50660ed668c93f5a1d93d2
2cc339ea1b0cad6445bf71adf19d41407aa7f9e0 28-Jul-2017 Joseph Pirozzo <pirozzoj@google.com> Support call waiting/call swap on single phone.

Update logic to allow a second call (on a single phone) to be
answered and swapped into and out of the foreground.
Bug: 62086689
Test: Pair a phone, make two phone calls, swap them and verify proper
audio routing

Change-Id: I7ab5f368714d22c5649489540e6b71dd5b26288c
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
b2ee78d28240cd96983c3a05bd46388c57b6408d 26-Jul-2017 Jack He <siyuanh@google.com> HFP: Reset battery level on HFP disconnect
am: 676ee3d737

Change-Id: I2e223a8438e6f42e056fdf664b43391f010eae3a
3e4fde340dc61d53ee0cad5ffb4af4ad99c06f7b 26-Jul-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFP connect Audio" am: 1a7c04346a am: 48487fea16
am: a97db01d50

Change-Id: Icada4fafa400439072552d55a281008b417f476d
48487fea166f83a92ba8304e90cbc145ad25be52 26-Jul-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "HFP connect Audio"
am: 1a7c04346a

Change-Id: I04f140e4396a418cc61b6c1b0a1e73cc607e793f
1a7c04346af8f5196a015d2f8bdb8a2192a5cb76 26-Jul-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "HFP connect Audio"
676ee3d73750377d23ba484e7072074f6fa07918 26-Jul-2017 Jack He <siyuanh@google.com> HFP: Reset battery level on HFP disconnect

* HFP is currently the solo source for battery level indicator
* Android loses track of ongoing battery level changes in remote device
when HFP is disconnected
* Thus, remote device battery level information should be reset when
HFP is disconnected before Android can obtain battery level information
from other profiles
* Android should also send BATTERY_LEVEL_CHANGED intent with
BATTERY_LEVEL_UNKNOWN when reset happens after Android have obtained
battery level information from that remote device

Bug: 64027543
Test: Connect and disconnect HFP on Bluetooth device, unit test
Change-Id: I877a2f82311b55f09296bb39db166540ca9b973f
Merged-In: I877a2f82311b55f09296bb39db166540ca9b973f
(cherry picked from commit 02f24e8073e8f17acc77badeb83a08ca8f925b41)
tservice/RemoteDevices.java
6ce7a87b8a8a595d9fd1631e792666b7239cc7ac 26-Jul-2017 Jack He <siyuanh@google.com> Merge "HFP: Reset battery level on HFP disconnect" am: a13d5ea7ff am: e4aa1e58b7
am: f4474025c7

Change-Id: I5400a5f2eaf36b6f337db75e87c55a34a6c22235
e4aa1e58b741a5025c797da627f1c6afe87664db 26-Jul-2017 Jack He <siyuanh@google.com> Merge "HFP: Reset battery level on HFP disconnect"
am: a13d5ea7ff

Change-Id: I64f037f9797dd5cd666533d487840651685fb082
a13d5ea7ffaa26b6def0928cb62177009e375373 26-Jul-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "HFP: Reset battery level on HFP disconnect"
02f24e8073e8f17acc77badeb83a08ca8f925b41 26-Jul-2017 Jack He <siyuanh@google.com> HFP: Reset battery level on HFP disconnect

* HFP is currently the solo source for battery level indicator
* Android loses track of ongoing battery level changes in remote device
when HFP is disconnected
* Thus, remote device battery level information should be reset when
HFP is disconnected before Android can obtain battery level information
from other profiles
* Android should also send BATTERY_LEVEL_CHANGED intent with
BATTERY_LEVEL_UNKNOWN when reset happens after Android have obtained
battery level information from that remote device

Bug: 64027543
Test: Connect and disconnect HFP on Bluetooth device, unit test
Change-Id: I877a2f82311b55f09296bb39db166540ca9b973f
tservice/RemoteDevices.java
e74c2decb35910e70cc984510b04af7cc87bd5bf 02-Jun-2017 Joseph Pirozzo <pirozzoj@google.com> HFP connect Audio

Connect audio when a phonecall is started rather than relying on the
dialer to do it. Due to complexities in SCO management and audio
routing only a single call is available and so upon answering a call
from a second phone the first call is terminated rather than held.

Bug: 62086689
Test: pair and connect 2 phones via HFP then make alternating incoming
and outgoing phone calls while ensuring that only 1 call remains active
and that call's audio is routed.
Change-Id: Iabb9cd6d483135feb93592cc8f8a33e042f2c41f
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/HfpClientConnection.java
8ea5072f681d5eafeaa51c51104468bc90c1dda3 25-Jul-2017 Ajay Panicker <apanicke@google.com> Merge "Prevent floating mMediaBrowser reference"
am: f2e7cb40e4

Change-Id: I19eb4dcd0aa68fd160f1e5a613367e8ed021a0d2
405b46d085f3e24f1bd1ce299f2cd85fba3c2635 25-Jul-2017 Ajay Panicker <apanicke@google.com> Prevent floating mMediaBrowser reference

When switching to a new browser, only disconnect and change to the new
browser once connection succeeds. This will allow the old browser to be
valid and targetable until a new browser connects.

Bug: 62328135
Test: Switch between browsable players on VW carkit
Change-Id: I5701138f9adf4e8c6e08629d86583dbe87290542
(cherry picked from commit 24ff0081728d0adb11b949dcbee196a1b260e9f4)
vrcp/BrowsedMediaPlayer.java
d3ebfdba5be06ad8180f581474c12e6bec83f0c3 25-Jul-2017 Ajay Panicker <apanicke@google.com> Prevent floating mMediaBrowser reference
am: 24ff008172

Change-Id: Ic93d6d2ed12a4f2a6698acaca00c9528e8f5e9a1
3dae50784bcfe5b52fed393a239b978759c52710 25-Jul-2017 Ajay Panicker <apanicke@google.com> Prevent floating mMediaBrowser reference
am: 24ff008172

Change-Id: I1d0885a95cce8bddf80a8c302f9564aa8de9fcb7
24ff0081728d0adb11b949dcbee196a1b260e9f4 25-Jul-2017 Ajay Panicker <apanicke@google.com> Prevent floating mMediaBrowser reference

When switching to a new browser, only disconnect and change to the new
browser once connection succeeds. This will allow the old browser to be
valid and targetable until a new browser connects.

Bug: 62328135
Test: Switch between browsable players on VW carkit
Change-Id: I5701138f9adf4e8c6e08629d86583dbe87290542
vrcp/BrowsedMediaPlayer.java
a2d3c1e6246bb15f4f60ff32ac8ef5aa3bd292d6 25-Jul-2017 Ajay Panicker <apanicke@google.com> Merge "Pass all scans to battery stats" into oc-dr1-dev
am: b607f5718a

Change-Id: I5fe1a2c4cc97c18833dd6a499152714c9f5281b8
2182f1f78b2cc79acb548df65f72d84cb6f12075 25-Jul-2017 Ajay Panicker <apanicke@google.com> Merge "Pass all scans to battery stats" into oc-dr1-dev
am: b607f5718a

Change-Id: I39a9fbd2d729a76101fc440ba2dc0d091ccfdcad
b607f5718a52bf2e57fa47f4bb565e2537763570 25-Jul-2017 Ajay Panicker <apanicke@google.com> Merge "Pass all scans to battery stats" into oc-dr1-dev
600e3dc0ab4bc2dfd03086b026b473a1968df513 25-Jul-2017 Jack He <siyuanh@google.com> HFP: Indicate profile as connected after SLC is established
am: 8eb9c7aeaa

Change-Id: Ieadcc25cbc9e147541a873c28d6961c6d5689543
b73c9cd4ffd1493ea6271f1cd1ca340df001f7ff 25-Jul-2017 Jack He <siyuanh@google.com> HFP: HeadsetStateMachine logging clean-up
am: 353a14e7a8

Change-Id: I6b0d4451485e02d643541a7f3a46bd1182c22719
e41715af8176e53c030e0b012d41df0b4783bcf7 25-Jul-2017 Jack He <siyuanh@google.com> Merge changes from topic 'bt-fix-hfp-headset-state-machine' am: b8e57b0375 am: e974960c4d
am: b37e0e6e11

Change-Id: I5139cde4a200be129df4dd2bcb2168ed089bc9d5
8eb9c7aeaadd4d4f1a21fd274b1dcb4f311cf6b8 21-Jul-2017 Jack He <siyuanh@google.com> HFP: Indicate profile as connected after SLC is established

* HFP profile connection require RFCOMM connection first and then a
Service Level Connection (SLC) on top of RFCOMM
* HFP profile is only considered fully connected when SLC is
established
* Bluetooth stack currently sends
BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED when RFCOMM is
connected. Instead, it should send it when SLC is established.
* This CL fixes the above issue by sending connection state changed
intent after SLC is established.
* This CL also removes instances where emitted connection state changed
intents have same new state and previous state (i.e. no real state
change)
* Moved processSlcConnected out from headset state machine to
queryPhoneState()

Bug: 63775402
Test: HFP and HSP PTS tests, HFP regression
Change-Id: I0d4e1c17f502968e4f88f3c11c2b8001dc79f7b9
Merged-In: I0d4e1c17f502968e4f88f3c11c2b8001dc79f7b9
(cherry picked from commit 39af3989003fd06fb3da55904ee074f706e1d448)
fp/HeadsetService.java
fp/HeadsetStateMachine.java
353a14e7a85cf174d165885568fb44359590b5b1 21-Jul-2017 Jack He <siyuanh@google.com> HFP: HeadsetStateMachine logging clean-up

* Enable logging at critical code path to indicate connection status
more clearly
* Disable duplicate logging statements to reduce log spam
* Simplified method usages to reduce code size
* Remove unncessary null checks such as device null check in CONNECT
message, we should crash if device is null in CONNECT message

Bug: 63775402
Test: HFP PTS test, HFP regression, no functional changes
Change-Id: I97d3e82e3e5cf3e4e2b702f6b3d8d054e0962272
Merged-In: I97d3e82e3e5cf3e4e2b702f6b3d8d054e0962272
(cherry picked from commit c6231925ec13a432770a879c49b3c4f008ee96e1)
tservice/RemoteDevices.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
e974960c4d33844bf61ac9f2b3a9594bc77c51c7 25-Jul-2017 Jack He <siyuanh@google.com> Merge changes from topic 'bt-fix-hfp-headset-state-machine'
am: b8e57b0375

Change-Id: Ib15c181fe6ae74eb037818e677f31117a93054d4
32d67902f01d1b7d8bd37b7731e37c7a8274ddc4 24-Jul-2017 Stanley Tng <stng@google.com> Fix permission check for access to the Bluetooth device address
am: c8d55992b4

Change-Id: I4e8f2bfdffd0f1141834b47e6660fb1be50acc2f
39af3989003fd06fb3da55904ee074f706e1d448 21-Jul-2017 Jack He <siyuanh@google.com> HFP: Indicate profile as connected after SLC is established

* HFP profile connection require RFCOMM connection first and then a
Service Level Connection (SLC) on top of RFCOMM
* HFP profile is only considered fully connected when SLC is
established
* Bluetooth stack currently sends
BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED when RFCOMM is
connected. Instead, it should send it when SLC is established.
* This CL fixes the above issue by sending connection state changed
intent after SLC is established.
* This CL also removes instances where emitted connection state changed
intents have same new state and previous state (i.e. no real state
change)
* Moved processSlcConnected out from headset state machine to
queryPhoneState()

Bug: 63775402
Test: HFP and HSP PTS tests, HFP regression
Change-Id: I0d4e1c17f502968e4f88f3c11c2b8001dc79f7b9
fp/HeadsetService.java
fp/HeadsetStateMachine.java
c6231925ec13a432770a879c49b3c4f008ee96e1 21-Jul-2017 Jack He <siyuanh@google.com> HFP: HeadsetStateMachine logging clean-up

* Enable logging at critical code path to indicate connection status
more clearly
* Disable duplicate logging statements to reduce log spam
* Simplified method usages to reduce code size
* Remove unncessary null checks such as device null check in CONNECT
message, we should crash if device is null in CONNECT message

Bug: 63775402
Test: HFP PTS test, HFP regression, no functional changes
Change-Id: I97d3e82e3e5cf3e4e2b702f6b3d8d054e0962272
tservice/RemoteDevices.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
c8d55992b4fcb165c7a0eb09537b2490d848a537 21-Jul-2017 Stanley Tng <stng@google.com> Fix permission check for access to the Bluetooth device address

Bug: 63535350
Test: Manual
Change-Id: Id4aad8c06c8cc44d328dbe9e58b8015836601127
(cherry picked from commit 58a41fc32debf78416826c96c83e1d4294decc2c)
tservice/AdapterService.java
d5078f2b255eafb78881f39e23ae329f8515db58 21-Jul-2017 Ajay Panicker <apanicke@google.com> Pass all scans to battery stats

Also let battery stats know if the scan that was just stopped
was optimized or not.

Bug: 63456783
Test: runtest -x frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
Change-Id: Ic8308cdfe8654a7628fd6181dde9898483f528aa
att/AppScanStats.java
06caab032b9d7acea42fdf96bc1890db03f67fc5 21-Jul-2017 Ajay Panicker <apanicke@google.com> Merge "Send Addressed player changed responses immediatly"
am: ee71933d19

Change-Id: I9506e2f5197b2364f7702eb38ebfdf577ae0c764
24631be215e079198147676baa3b53c5e13a9c81 21-Jul-2017 Ajay Panicker <apanicke@google.com> Send Addressed player changed responses immediatly

Bug: 63721876
Test: Start music, make a call, and hang up from carkit
Change-Id: Id1ff0beb9b86da8a4c030f4d32e0588435b25723
(cherry picked from commit 72225a3acbc643aa162acbc77c56ab49679af1d9)
vrcp/Avrcp.java
a83071e2de5535180374d9387e413f3c30dc3542 21-Jul-2017 Stanley Tng <stng@google.com> Merge "Fix permission check for access to the Bluetooth device address" am: 7db5b29e45 am: b37fd21169
am: d623e8d998

Change-Id: I24640b6f522eadb01d4fa093b61e1f8f3f547767
b37fd21169d7f4abad1add37ab9f6b740703db4e 21-Jul-2017 Stanley Tng <stng@google.com> Merge "Fix permission check for access to the Bluetooth device address"
am: 7db5b29e45

Change-Id: I44f5819231f61961354b3e6e256905724bb20fe0
7d9755ea9b0e6b80a35df02550d3a7eb018ff8d7 21-Jul-2017 Ajay Panicker <apanicke@google.com> Merge "Send Addressed player changed responses immediatly" into oc-dr1-dev
am: 1ff555d89a

Change-Id: Iaddf3c2f29fd070109a47359db5f770f2f794a21
084c726f35185244756876be13b2a4e0e1dcf83a 21-Jul-2017 Ajay Panicker <apanicke@google.com> Merge "Send Addressed player changed responses immediatly" into oc-dr1-dev
am: 1ff555d89a

Change-Id: I875e47ccca425b7cd671af473c77a0a5af17b5be
1ff555d89aafe4c85fc6d2a2f9adae6b0794ed50 21-Jul-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Send Addressed player changed responses immediatly" into oc-dr1-dev
58a41fc32debf78416826c96c83e1d4294decc2c 21-Jul-2017 Stanley Tng <stng@google.com> Fix permission check for access to the Bluetooth device address

Bug: 63535350
Test: Manual
Change-Id: Id4aad8c06c8cc44d328dbe9e58b8015836601127
tservice/AdapterService.java
72225a3acbc643aa162acbc77c56ab49679af1d9 21-Jul-2017 Ajay Panicker <apanicke@google.com> Send Addressed player changed responses immediatly

Bug: 63721876
Test: Start music, make a call, and hang up from carkit
Change-Id: Id1ff0beb9b86da8a4c030f4d32e0588435b25723
vrcp/Avrcp.java
2f107fc01acfd04f80eb7868f8597872e44187eb 21-Jul-2017 Jack He <siyuanh@google.com> AVRCP: Fix deadlock between Avrcp.this and mMediaPlayerInfoList
am: 0704743e3d

Change-Id: Ifa309379572c44740849e43af430e66fa6206cd0
35bdf3f1fd7f774bb42ada798fbe0d425b8b1660 20-Jul-2017 Jack He <siyuanh@google.com> Merge "AVRCP: Fix deadlock between Avrcp.this and mMediaPlayerInfoList" am: 0e80ffec3f am: 4784885a18
am: d8ef6c15fc

Change-Id: I9652df26c6460d4a799f2a563a2c7dcc864a4324
4784885a1884ac2f218108a88d0d8907c2b84915 20-Jul-2017 Jack He <siyuanh@google.com> Merge "AVRCP: Fix deadlock between Avrcp.this and mMediaPlayerInfoList"
am: 0e80ffec3f

Change-Id: If4ce2359f18e9ac7fd617614e220c9c3727a346d
0704743e3d020c050b7eba86f79656bb3dbd9c18 20-Jul-2017 Jack He <siyuanh@google.com> AVRCP: Fix deadlock between Avrcp.this and mMediaPlayerInfoList

* addMediaPlayerInfo (acquires mMediaPlayerInfoList)
-> updateCurrentController (acquires Avrcp.this)
* onSessionDestroyed (acquires Avrcp.this)
-> removeMediaController (acquires mMediaPlayerInfoList)
* Above is a deadlock that causes ANR
* This CL moves updateCurrentController call out of the critical section
in addMediaPlayerInfo to resolve this deadlock situation

Bug: 63458678
Test: make, test connecting to Avrcp devices
Change-Id: Iaae2d1bc005a181b950d4306d0773332f6c1afef
Merged-In: Iaae2d1bc005a181b950d4306d0773332f6c1afef
(cherry picked from commit fecc92279a01e377962b9b33b02d5db0ff3d1440)
vrcp/Avrcp.java
fecc92279a01e377962b9b33b02d5db0ff3d1440 20-Jul-2017 Jack He <siyuanh@google.com> AVRCP: Fix deadlock between Avrcp.this and mMediaPlayerInfoList

* addMediaPlayerInfo (acquires mMediaPlayerInfoList)
-> updateCurrentController (acquires Avrcp.this)
* onSessionDestroyed (acquires Avrcp.this)
-> removeMediaController (acquires mMediaPlayerInfoList)
* Above is a deadlock that causes ANR
* This CL moves updateCurrentController call out of the critical section
in addMediaPlayerInfo to resolve this deadlock situation

Bug: 63458678
Test: make, test connecting to Avrcp devices
Change-Id: Iaae2d1bc005a181b950d4306d0773332f6c1afef
vrcp/Avrcp.java
fbd2fd2e7add40b10a5ec449168803e97ed1f7ea 29-Jun-2017 Alexandru-Andrei Rotaru <rotaru@google.com> Allow disabling of Bluetooth tethering if DISALLOW_CONFIG_TETHERING in on

When turning on the tethering service through Bluetooth connection
and then enabling the DISALLOW_CONFIG_TETHERING restriction from
TestDPC/User Restrinctions, it should run normally without any incidents.

Without this change, this scenario would raise a SecurityException from
bluetoothTethering(false); (file: PanService)

Bug: 27936525
Merged-In: I2df490ac28f129b369f531d106f924a88d721433
Test: manual
Change-Id: I2df490ac28f129b369f531d106f924a88d721433
an/PanService.java
04d2df36107c4ada83ab78d290444b4e3a16c82b 14-Jul-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AVRCP: UID_CHANGED response for GetItemAttributes" into oc-dr1-dev
479192aab9c011c24526c645ddcc15a92202a2de 14-Jul-2017 Hall Liu <hallliu@google.com> Defer sending NETWORK_STATE_AVAILABLE to headset
am: c51c87b371

Change-Id: I1be52052968a99830c204b7ef8dc3645d90076c4
0f8c53cec0a5438dc7af046672e88c6469356f5e 14-Jul-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: UID_CHANGED response for GetItemAttributes" am: 6939481667 am: c526c9b70b
am: ea02934a4a

Change-Id: I99cdc97f3fb74cb8e8de3ec952ba65b8d59f16d2
c526c9b70b05bd47d5e5f8734deab6115ae77dd9 14-Jul-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: UID_CHANGED response for GetItemAttributes"
am: 6939481667

Change-Id: I61cd83374c9614fdd58ac4148d1cfac1a4ca76ce
69394816672a30e39f86cd19375e11f290fa0c29 14-Jul-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: UID_CHANGED response for GetItemAttributes"
58e50a45b65eff899b284a3f51da781a3087bec4 21-Jun-2017 koh.changseok <koh.changseok@lge.com> AVRCP: UID_CHANGED response for GetItemAttributes

When we receive a GetItemAttributes command with the wrong UID counter
attribute, we should respond with UID_CHANGED. Currently our UID
counter never changes from 0, but it may in the future.

Bug: 62924455
Test: PTS test AVRCP/TG/MCN/CB/BI-05-C
Change-Id: I98b6dd879019b04c695c8dc28afab88ae0e05175
(cherry picked from commit 45551315d39fd0bc1c5a118b4728c728ce42b412)
vrcp/Avrcp.java
c51c87b3713a5bd9650d42e0a807a4291bb09fb0 13-Jul-2017 Hall Liu <hallliu@google.com> Defer sending NETWORK_STATE_AVAILABLE to headset

When the phone comes into service, don't report the state of the device
as being in-service until the sim is fully loaded.

Change-Id: I1ebfefc580b32d06bc249de343277d1714116f13
Fixes: 37301718
Test: manual (pop sim out, pop sim in)
fp/HeadsetPhoneState.java
5c4a92245cae1045f7e0d34dff67fd4d9e90ce3f 14-Jul-2017 koh.changseok <koh.changseok@lge.com> Merge "OPP: Have OBEX add 'End of Body' for a small file" am: af10a6f34e am: 1fe3a8167c
am: 9a0750a5a5

Change-Id: I0801ab91965ae520bcd16acae31af77cdeadd05f
1fe3a8167cd635f45a42bae2b3fa745fa4c99318 14-Jul-2017 koh.changseok <koh.changseok@lge.com> Merge "OPP: Have OBEX add 'End of Body' for a small file"
am: af10a6f34e

Change-Id: Ie3163a6a659d4bd0761e4cf60012f3231ca15687
291c624786927e82d2419db083b862cc04a942ee 11-Jul-2017 koh.changseok <koh.changseok@lge.com> OPP: Have OBEX add 'End of Body' for a small file

When sending a file sized smaller than 'MaxPAcketSize',
'final packet' doesn't include 'End of body' header for 'put' operation.
Therefore, some devices reply 'Bad Request' response code.

See 'startProcessing()' fucntion in OBEX library.
'OBEX_OPCODE_PUT_FINAL' will be sent without body.

Even it seems Android doesn't implement 'deleting' using 'put' operation,
Spec says 'Body' or 'End of Body' can be omitted for 'Deleting an Object'.

So Instead of changing OBEX, let's change function calling order between
'putOperation.getResponseCode()' and 'outputStream.close()' like Marshmallow OS.
'outputStream.close()' will make OBEX send all stored packets and then
finally make final packet include 'End of Body' header.

Bug: 63554262
Test: Send a file over OBEX to remote device
Change-Id: I12bc3fd801d9a714dde947eb37bad9821ebb9d79
pp/BluetoothOppObexClientSession.java
198a1bc7f518c93541f561ae71a51da059700b64 11-Jul-2017 koh.changseok <koh.changseok@lge.com> OPP: Have OBEX add 'End of Body' for a small file

When sending a file sized smaller than 'MaxPAcketSize',
'final packet' doesn't include 'End of body' header for 'put' operation.
Therefore, some devices reply 'Bad Request' response code.

See 'startProcessing()' fucntion in OBEX library.
'OBEX_OPCODE_PUT_FINAL' will be sent without body.

Even it seems Android doesn't implement 'deleting' using 'put' operation,
Spec says 'Body' or 'End of Body' can be omitted for 'Deleting an Object'.

So Instead of changing OBEX, let's change function calling order between
'putOperation.getResponseCode()' and 'outputStream.close()' like Marshmallow OS.
'outputStream.close()' will make OBEX send all stored packets and then
finally make final packet include 'End of Body' header.

Bug: 63554262
Test: Send a file over OBEX to remote device
Change-Id: I12bc3fd801d9a714dde947eb37bad9821ebb9d79
pp/BluetoothOppObexClientSession.java
94e450f34e9d0bc27a6d7263982ebc7af804cb3a 13-Jul-2017 Marie Janssen <jamuraa@google.com> A2DP: Only unregister receiver if we registered
am: 6a5c11bb62

Change-Id: I95f56a03a696ed2383f25f87f479025b4a6015db
45551315d39fd0bc1c5a118b4728c728ce42b412 21-Jun-2017 koh.changseok <koh.changseok@lge.com> AVRCP: UID_CHANGED response for GetItemAttributes

When we receive a GetItemAttributes command with the wrong UID counter
attribute, we should respond with UID_CHANGED. Currently our UID
counter never changes from 0, but it may in the future.

Bug: 62924455
Test: PTS test AVRCP/TG/MCN/CB/BI-05-C
Change-Id: I98b6dd879019b04c695c8dc28afab88ae0e05175
vrcp/Avrcp.java
6a5c11bb626571ec8049733743a5e65e7845a67d 11-Jul-2017 Marie Janssen <jamuraa@google.com> A2DP: Only unregister receiver if we registered

If A2DP isn't ever started, A2dpService.cleanup() would try to unregister
when we are not registered.

Bug: 63061079
Test: none
Change-Id: I7229625f19c07dddeb58d7ee0787c83f0164e3e8
(cherry picked from commit 03352f57934dfae89c7696455f2f6f79d4d8ad22)
2dp/A2dpService.java
c1d3f10a248bee0bbe20d83cbc8ee449c00ae2e7 13-Jul-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: workaround invalid setBrowsedPlayer id" am: 3b1c073189 am: 3f94b32678
am: d631a2d10b

Change-Id: I173abf0e057b550960c3eb19ced30c1a98e70741
3f94b32678043d5a6d255084fec91761da386066 13-Jul-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: workaround invalid setBrowsedPlayer id"
am: 3b1c073189

Change-Id: I74d022ef04caa573f5b8c910ed6134c9f2fc81f7
cb63ca088b6657757fdf6bb8f3cdb58aaee9e4c3 12-Jul-2017 Marie Janssen <jamuraa@google.com> AVRCP: workaround invalid setBrowsedPlayer id

Some carkits (Ford specifically) send SetBrowsedPlayer with an ID of 0,
which we never send. Instead of sending back Invalid ID we guess that
they want to set it to the current addressed player.

Bug: 62811071
Bug: 63057931
Test: browse with ford carkit and it works
Change-Id: I744a3193abb3663997e6143aace4fc59a4705864
(cherry picked from commit 819122df0eff426a43d175b14098339fa9f8f648)
vrcp/Avrcp.java
9d8bdd767f02d60e176ae33501950bc9d90f6aba 13-Jul-2017 Ajay Panicker <apanicke@google.com> Send the now playing list changed events after media updates
am: be8be56f08

Change-Id: I31213260546663fcc8d2e4d086eb8ac819e4c73f
be8be56f089b759ae08f3e822fbea20993ed4b16 12-Jul-2017 Ajay Panicker <apanicke@google.com> Send the now playing list changed events after media updates

Bug: 63585280
Test: Test with BWM carkit and see in snoop logs that now playing list changes
happen after addressed player changes

Change-Id: I79766077d8531dab5716902c4a25363dc0197442
vrcp/Avrcp.java
819122df0eff426a43d175b14098339fa9f8f648 12-Jul-2017 Marie Janssen <jamuraa@google.com> AVRCP: workaround invalid setBrowsedPlayer id

Some carkits (Ford specifically) send SetBrowsedPlayer with an ID of 0,
which we never send. Instead of sending back Invalid ID we guess that
they want to set it to the current addressed player.

Bug: 62811071
Bug: 63057931
Test: browse with ford carkit and it works
Change-Id: I744a3193abb3663997e6143aace4fc59a4705864
vrcp/Avrcp.java
255c5f81444bbfa18003f2a4bb87407d41aa596b 12-Jul-2017 Ajay Panicker <apanicke@google.com> Send available players changed with addressed player changed
am: cc75e0ce50

Change-Id: I37655a5e639fa7a0c27e160c63543a73652b252c
cc75e0ce509baa8e9cd27c38327c786b46b164ac 11-Jul-2017 Ajay Panicker <apanicke@google.com> Send available players changed with addressed player changed

Also reorder the available players list so that the current addressed
player is always the first item in the list.

Bug: 63585280
Test: Test with BMW carkit and see switching from GPM to Spotify works
Change-Id: Ifdec331d608a511fc2560167270c4a4ea25fffa7
vrcp/Avrcp.java
966273541bd6d080b51f9c8dbe6e96a6f9be2607 11-Jul-2017 Jack He <siyuanh@google.com> Merge "GATT: Expose opportunistic client API to Java" am: 6b5f229061 am: 910de1c2af
am: ceab52a692

Change-Id: Ieda3bf45385f42227441698fff724cc358981b6a
c0069d247f57457b91d12e298b270a821873bce5 06-Jul-2017 Jack He <siyuanh@google.com> GATT: Expose opportunistic client API to Java

* Allow Java based programs to create an opportunistic GATT client
* Such client does not hold a GATT connection. It automatically
disconnects when no other GATT connections are active for the
remote device.

Bug: 63347806
Test: make
Change-Id: I7fe789b38a25c65b5bc4f1591e406edb7742bd5b
Merged-In: I7fe789b38a25c65b5bc4f1591e406edb7742bd5b
(cherry picked from commit dbbab6bca495df9f3bbc8dd4794db810b1acd692)
att/GattService.java
910de1c2af404c3a9b232e0ad4764a439840f979 11-Jul-2017 Jack He <siyuanh@google.com> Merge "GATT: Expose opportunistic client API to Java"
am: 6b5f229061

Change-Id: I40d45a3180cb728b0c65477a2527bc75d80528b2
dbbab6bca495df9f3bbc8dd4794db810b1acd692 06-Jul-2017 Jack He <siyuanh@google.com> GATT: Expose opportunistic client API to Java

* Allow Java based programs to create an opportunistic GATT client
* Such client does not hold a GATT connection. It automatically
disconnects when no other GATT connections are active for the
remote device.

Bug: 63347806
Test: make
Change-Id: I7fe789b38a25c65b5bc4f1591e406edb7742bd5b
att/GattService.java
4013e8a454c6c5cc9f70f52f2af35730d119c065 26-Apr-2017 Joe Onorato <joeo@google.com> Turn off logspam (Bluetooth)

For more information, see https://source.android.com/source/code-style#log-sparingly

Bug: 37252687
Test: development/tools/logblame/medium_idle_test
Change-Id: I8c839eff19fa0b00d1b6a04fbb554b39010884d9
(cherry picked from commit 522633f4724154b3cdb39888989340dbb8a16758)
att/AdvertiseManager.java
att/GattService.java
att/GattServiceConfig.java
att/PeriodicScanManager.java
att/ScanManager.java
7c12b34b98d717fdfe68f5e8c94b7a01ef372f8b 27-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: use only one MediaController from a package

Some players have more than one active MediaController for some reason,
and onActiveSessionsChanged returns them both. In this case, the first
one in the list should be considered the "active" one for that player.

Test: use com.zentertain.music.player and see metadata propogate
Bug: 63058319
Change-Id: I4e72182b36642b84835275b0ded9648a38bde78b
(cherry picked from commit bc5aacf160c5cc7ff5a196c7c3c1cf62f322fc14)
vrcp/Avrcp.java
eace1237b79ccbf09eadf57a4b247a4e1517ebcf 10-Jul-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: use only one MediaController from a package" am: 2e15e66ba7 am: 2dcab1cc04
am: 96275b4d0c

Change-Id: I1c3c547ca9a9f6d0d152d6e1b8ed6c5ab56dac4b
2dcab1cc0426e10d1c5a647937f92a462a6ab8bb 10-Jul-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: use only one MediaController from a package"
am: 2e15e66ba7

Change-Id: Ib11b2468fc5be5303c217f74c86362cd1ecc9e6b
bc5aacf160c5cc7ff5a196c7c3c1cf62f322fc14 27-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: use only one MediaController from a package

Some players have more than one active MediaController for some reason,
and onActiveSessionsChanged returns them both. In this case, the first
one in the list should be considered the "active" one for that player.

Test: use com.zentertain.music.player and see metadata propogate
Bug: 63058319
Change-Id: I4e72182b36642b84835275b0ded9648a38bde78b
vrcp/Avrcp.java
fa0b9186afe9853722830e30424e57e8686b5fa7 07-Jul-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Deal with unknown signal strength level comes from Telephony" into oc-dr1-dev
9cc2dbd938b51007b8d6214672d257dc49f6b618 09-Mar-2016 rongbo.x.chi <rongbo.x.chi@sonymobile.com> Deal with unknown signal strength level comes from Telephony

According to TS27.007 8.5, GSM level 99 represents
not known or not detectable. Bluetooth doesn't take it into
consideration, so HF unit cannot display correct signal level.

Add judgement for this special case so that HF unit can match
with status bar of phone.

Bug: 28992746
Test: make
Change-Id: I951c808472dff11af5584ac66c06386d8c601bbb
Merged-In: I951c808472dff11af5584ac66c06386d8c601bbb
(cherry picked from commit a7c269cbeab5fb8d4997bfc404e7ac9713b6fb28)
fp/HeadsetPhoneState.java
9589b268e1dd24a5c6cd2689f2ffe28b0faa2722 06-Jul-2017 Jack He <siyuanh@google.com> OPP: Fix support for vCal 1.0 and iCal 2.0

* Add corresponding MIME types in AndroidManifests
text/x-vcalendar
text/calendar
* Add corresponding support flags in SDP record
* Remove one time use constants and add comments to SDP
record array
* Remove text/x-vcalendar from black list
* Removed some dead code

Bug: 63259707
Test: make, PTS test IOPT/SDAS/BV-03-I, send/receive .ics
and .vcs files over Bluetooth
Change-Id: I06d67da09050a7f5e244568e57c9685bfdf6cdd6
(cherry picked from commit bcad71fe152ffc073359b8b4f2e2ba58d4118810)
pp/BluetoothOppService.java
pp/Constants.java
c74aa900fe99d79f4d3f868e1a54f0d9463c8743 07-Jul-2017 Ajay Panicker <apanicke@google.com> Merge "Extract metadata info from MediaPlayer.Queue added by Google Play Music" into oc-dr1-dev
am: 029e8f9b00

Change-Id: I93a3c4a34661e515549123fa6d3a3cf7ab027968
8e765ef089b498d2c97cd57a1794c60fffafebe1 07-Jul-2017 rongbo.x.chi <rongbo.x.chi@sonymobile.com> Merge "Deal with unknown signal strength level comes from Telephony" am: 2327cfc525 am: 5075a3dd49
am: 351970b755

Change-Id: I5e84f3a2d6ce3187038fead3c9b8bbb5e09123da
5075a3dd49d2458f0b913d02cca68fe769c41bc5 07-Jul-2017 rongbo.x.chi <rongbo.x.chi@sonymobile.com> Merge "Deal with unknown signal strength level comes from Telephony"
am: 2327cfc525

Change-Id: Ib8d0db50ecfd8507e66a7eb8c239da5eaae05c0e
2327cfc525050c03787bcedcab48b9368541a3aa 07-Jul-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Deal with unknown signal strength level comes from Telephony"
029e8f9b005b40a695255a2787e9bae40507565c 07-Jul-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Extract metadata info from MediaPlayer.Queue added by Google Play Music" into oc-dr1-dev
cb0d2145b07212fdf953ca02a9e9cf60d9aedf93 07-Jul-2017 Jack He <siyuanh@google.com> Merge "OPP: Fix support for vCal 1.0 and iCal 2.0" am: d072aecef9 am: 0cb1ceceb0
am: 62c7e9d633

Change-Id: I6fa0ca759649201716a06aba77519ca0680bf439
0cb1ceceb0dffddc6539e99ea5dd86aa1f9ec06a 07-Jul-2017 Jack He <siyuanh@google.com> Merge "OPP: Fix support for vCal 1.0 and iCal 2.0"
am: d072aecef9

Change-Id: I8a0942bd5fe70cd26ef81a8f005c380a33fe3a0f
a7c269cbeab5fb8d4997bfc404e7ac9713b6fb28 09-Mar-2016 rongbo.x.chi <rongbo.x.chi@sonymobile.com> Deal with unknown signal strength level comes from Telephony

According to TS27.007 8.5, GSM level 99 represents
not known or not detectable. Bluetooth doesn't take it into
consideration, so HF unit cannot display correct signal level.

Add judgement for this special case so that HF unit can match
with status bar of phone.

Bug: 28992746

Change-Id: I951c808472dff11af5584ac66c06386d8c601bbb
fp/HeadsetPhoneState.java
141eb4655cd1341641326d89bc16d87626baee84 30-Jun-2017 Ajay Panicker <apanicke@google.com> Extract metadata info from MediaPlayer.Queue added by Google Play Music

Bug: 63117921
Test: Test with BMW carkit which grabs next song info and see full metadata
TestTracker: 95441
Change-Id: I78f54e7dd4f9f46c6c5dfc7fbb9400d7214d23cc
vrcp/AddressedMediaPlayer.java
bcad71fe152ffc073359b8b4f2e2ba58d4118810 06-Jul-2017 Jack He <siyuanh@google.com> OPP: Fix support for vCal 1.0 and iCal 2.0

* Add corresponding MIME types in AndroidManifests
text/x-vcalendar
text/calendar
* Add corresponding support flags in SDP record
* Remove one time use constants and add comments to SDP
record array
* Remove text/x-vcalendar from black list
* Removed some dead code

Bug: 63259707
Test: make, PTS test IOPT/SDAS/BV-03-I, send/receive .ics
and .vcs files over Bluetooth
Change-Id: I06d67da09050a7f5e244568e57c9685bfdf6cdd6
pp/BluetoothOppService.java
pp/Constants.java
059439747af53021d105ede7e0c6734c6ffc8efd 06-Jul-2017 greg_huang <greg_huang@htc.com> PBAP: Check for null in isNameMatchTarget
am: 741a627118

Change-Id: I6bfb94508fd4655532c27e304dbf5f0671593c66
194f58af49eaee976fea5a1797924f741aa7044f 06-Jul-2017 greg_huang <greg_huang@htc.com> Merge "PBAP: Check for null in isNameMatchTarget"
am: 4c75faae10

Change-Id: I3d790c94b2f9db4ed5d86a147a5ef42095b1a898
741a62711866e8c5571ce20a30257a122ac95dd6 12-Jun-2017 greg_huang <greg_huang@htc.com> PBAP: Check for null in isNameMatchTarget

Bug: 62361842
Test: make, PTS test by vendor
Change-Id: Ie9861931c93cb0ff26f86a2fdfa5aa1e3083d81a
(cherry picked from commit 544344635a4a10084710ea5cf3aebbcd491dd42c)
bap/BluetoothPbapObexServer.java
544344635a4a10084710ea5cf3aebbcd491dd42c 12-Jun-2017 greg_huang <greg_huang@htc.com> PBAP: Check for null in isNameMatchTarget

Bug: 62361842
Test: make, PTS test by vendor
Change-Id: Ie9861931c93cb0ff26f86a2fdfa5aa1e3083d81a
bap/BluetoothPbapObexServer.java
820361b168031643eb29db460e923f8a0c9bef7e 21-Jun-2017 Jack He <siyuanh@google.com> Support battery level reporting via Apple VSC (2/2)

* Add parsing methods for Apple AT+XAPL and AT+IPHONEACCEV AT commands
* Record the received battery level information through DeviceProperties
* Add unit tests for getBatteryLevelFromAppleBatteryVsc() and intent
handler

Bug: 35874078
Test: make, test with supporting headsets, unit tests
runtest -c com.android.bluetooth.btservice.RemoteDevicesTest bluetooth
Change-Id: I16de640a53f333f54b5609cbb482d1735a9e5de2
Merged-In: I16de640a53f333f54b5609cbb482d1735a9e5de2

(cherry picked from commit f27d360b7ec35eaddee66cac173c51c18c238b03)
tservice/RemoteDevices.java
fp/HeadsetStateMachine.java
07fcaf47d68f9df6fd07c2f9aa24ff6d46751ce5 21-Jun-2017 Jack He <siyuanh@google.com> Support battery level reporting via Plantronics XEVENT (2/2)

* Add parser for Plantronics AT+XEVENT=BATTERY* AT command
* Record the received battery level information through DeviceProperties
* Add unit test for getBatteryLevelFromXEventVsc() and intent handler

Bug: 35874078
Test: make, test with supporting headsets, unit tests
runtest -c com.android.bluetooth.btservice.RemoteDevicesTest bluetooth
Change-Id: I2972c525a43ff0dc415b63fcbf0f08e7bc0b21a8
Merged-In: I2972c525a43ff0dc415b63fcbf0f08e7bc0b21a8

(cherry picked from commit 8536d97c0196cdbf1ee288ffe4edc377f3833019)
tservice/RemoteDevices.java
fp/HeadsetStateMachine.java
15cd8b09b70121d11f82756e2692e023e8f6bb99 21-Jun-2017 Jack He <siyuanh@google.com> Add intent handler for HF battery indicator (2/2)

* Modify HeadsetStateMachine to send integer indicator id and value
* Add handler for BluetoothHeadset.ACTION_HF_INDICATORS_VALUE_CHANGED
* Process indicator #2, Battery Level indicator
* Only works with HFP 1.7+ device
* Add unit test for onHfIndicatorValueChanged()
* Change RemoteDevices.mDevices to final as it should never be
re-assigned
* Move construction of RemoteDevices in AdapterService onCreate() to
guarantee that mReceiver in RemoteDevices is registered when
mRemoteDevices is not null in AdapterService

Bug: 35874078
Test: make, PTS test, unit tests
runtest -c com.android.bluetooth.btservice.RemoteDevicesTest bluetooth
Change-Id: I9c37f92a9071a5f3ee288612daa0ec8d7f2fde8c
Merged-In: I9c37f92a9071a5f3ee288612daa0ec8d7f2fde8c

(cherry picked from commit 0b319f1df5ba13d6bec5a431cc4f329b43dd37fb)
tservice/AdapterService.java
tservice/RemoteDevices.java
fp/HeadsetHalConstants.java
fp/HeadsetStateMachine.java
e97b1205614094fca632a9ceb1695d862a70dbda 20-Jun-2017 Jack He <siyuanh@google.com> Add APIs to get remote device's battery level (2/2)

* Add backend service methods for BluetoothDevice.getBatteryLevel()
* Add battery level field in DeviceProperties with getters and setters
* Add updateBatteryLevel() method in RemoteDevices
* Add resetBatteryLevel() method in RemoteDevices
* Reset battery level for device when device is disconnected in
aclStateChangeCallback() to ensure a BATTERY_LEVEL_CHANGED intent
when device first report battery level information after connection
* Add tests for updateBatteryLevel() and resetBatteryLevel()

Bug: 35874078
Test: make, pair with devices and use them, unit tests
runtest -c com.android.bluetooth.btservice.RemoteDevicesTest bluetooth
Change-Id: Id770ee08b3cd295563660557b9a1bf0e643b32b8
Merged-In: Id770ee08b3cd295563660557b9a1bf0e643b32b8

(cherry picked from commit 3686813d56c7ed82952ea7640b7aeee964948208)
tservice/AdapterService.java
tservice/RemoteDevices.java
5b65fac7e1d4251adc8f8b36990828b9b0be56b5 29-Jun-2017 Vinay Kalia <vinaykalia@google.com> Revert "Revert "Improve BLE scan attribution to facilitate debugging power issues""
am: ff0aaa12c3

Change-Id: I75f51146a8c604fed5997f7ad4a77fc89b5b5c44
811f6ef9aa51ddfeb0bf82b40cb7417b91c46c8e 29-Jun-2017 Jack He <siyuanh@google.com> Merge "Support battery level reporting via Apple VSC (2/2)" am: 4cafef3a64 am: ac7afd6fa9
am: 071193334b

Change-Id: I7bd920c5e67b01af9b53b86adada4ca3c40ba34b
ac7afd6fa9626682b0c6ca593b8b8c01d6efef9c 29-Jun-2017 Jack He <siyuanh@google.com> Merge "Support battery level reporting via Apple VSC (2/2)"
am: 4cafef3a64

Change-Id: I4cbc4786326572bb36df4faab5d3f3b87ff3f953
f27d360b7ec35eaddee66cac173c51c18c238b03 21-Jun-2017 Jack He <siyuanh@google.com> Support battery level reporting via Apple VSC (2/2)

* Add parsing methods for Apple AT+XAPL and AT+IPHONEACCEV AT commands
* Record the received battery level information through DeviceProperties
* Add unit tests for getBatteryLevelFromAppleBatteryVsc() and intent
handler

Bug: 35874078
Test: make, test with supporting headsets, unit tests
runtest -c com.android.bluetooth.btservice.RemoteDevicesTest bluetooth
Change-Id: I16de640a53f333f54b5609cbb482d1735a9e5de2
tservice/RemoteDevices.java
fp/HeadsetStateMachine.java
10b19e4f9875d302fe2364caab2a8f8707025dc1 29-Jun-2017 Jack He <siyuanh@google.com> Merge "Support battery level reporting via Plantronics XEVENT (2/2)" am: da5cf60a0d am: b031dfb5a1
am: 93bae45d1b

Change-Id: If3b52884ac501579719d82acae3538734b3d11c8
b031dfb5a1072869afea5aead8995a09165631d0 29-Jun-2017 Jack He <siyuanh@google.com> Merge "Support battery level reporting via Plantronics XEVENT (2/2)"
am: da5cf60a0d

Change-Id: I4650f1e039496b6ffdf44e92cd8c5f0940d26100
ff0aaa12c3204523136cc75886add779e4727d00 29-Jun-2017 Vinay Kalia <vinaykalia@google.com> Revert "Revert "Improve BLE scan attribution to facilitate debugging power issues""

This reverts commit 2e20779b97be2073942b1fc8093414ae08e03136.

BUG: 62389939
Test: Tested a few BLE scanning applications which included misbehaving
Change-Id: I5e0884159e8e95ae15b591d16eb85ce150ce86bb
att/AppScanStats.java
att/GattService.java
att/ScanManager.java
1529fd45d15b1a18a70012289e42856ae518e310 29-Jun-2017 Vinay Kalia <vinaykalia@google.com> Revert "Improve BLE scan attribution to facilitate debugging power issues" am: 2e20779b97
am: ad9ac95d3d

Change-Id: Ia52a863b57e0e45298c27bb3890924335a7e78f6
ad9ac95d3dec9680be8ee46377e8b419595a8f5d 29-Jun-2017 Vinay Kalia <vinaykalia@google.com> Revert "Improve BLE scan attribution to facilitate debugging power issues"
am: 2e20779b97

Change-Id: I4165ae5a023c57a3ac46d71afeffa26be1fd3f94
a0710bde568eca07d4e3ab934471e3e0449cd65a 29-Jun-2017 Andre Eisenbach <eisenbach@google.com> Merge "Add intent handler for HF battery indicator (2/2)" am: 190b58cad1 am: 759fbe576a
am: e21a582296

Change-Id: Id349be915340c71d1424c4001554fa9faeb16d24
e21a58229662d21ef1a6e4fa8e34758d8abd4f35 29-Jun-2017 Andre Eisenbach <eisenbach@google.com> Merge "Add intent handler for HF battery indicator (2/2)" am: 190b58cad1
am: 759fbe576a

Change-Id: Idd91ff352f572a413551a557edae54861d0fb1b2
759fbe576a8211866e6eb4ab3a0a9d36f470f785 29-Jun-2017 Andre Eisenbach <eisenbach@google.com> Merge "Add intent handler for HF battery indicator (2/2)"
am: 190b58cad1

Change-Id: I8a322befa498de1a5621baa512eddb1cfd450e62
8536d97c0196cdbf1ee288ffe4edc377f3833019 21-Jun-2017 Jack He <siyuanh@google.com> Support battery level reporting via Plantronics XEVENT (2/2)

* Add parser for Plantronics AT+XEVENT=BATTERY* AT command
* Record the received battery level information through DeviceProperties
* Add unit test for getBatteryLevelFromXEventVsc() and intent handler

Bug: 35874078
Test: make, test with supporting headsets, unit tests
runtest -c com.android.bluetooth.btservice.RemoteDevicesTest bluetooth
Change-Id: I2972c525a43ff0dc415b63fcbf0f08e7bc0b21a8
tservice/RemoteDevices.java
fp/HeadsetStateMachine.java
0b319f1df5ba13d6bec5a431cc4f329b43dd37fb 21-Jun-2017 Jack He <siyuanh@google.com> Add intent handler for HF battery indicator (2/2)

* Modify HeadsetStateMachine to send integer indicator id and value
* Add handler for BluetoothHeadset.ACTION_HF_INDICATORS_VALUE_CHANGED
* Process indicator #2, Battery Level indicator
* Only works with HFP 1.7+ device
* Add unit test for onHfIndicatorValueChanged()
* Change RemoteDevices.mDevices to final as it should never be
re-assigned
* Move construction of RemoteDevices in AdapterService onCreate() to
guarantee that mReceiver in RemoteDevices is registered when
mRemoteDevices is not null in AdapterService

Bug: 35874078
Test: make, PTS test, unit tests
runtest -c com.android.bluetooth.btservice.RemoteDevicesTest bluetooth
Change-Id: I9c37f92a9071a5f3ee288612daa0ec8d7f2fde8c
tservice/AdapterService.java
tservice/RemoteDevices.java
fp/HeadsetHalConstants.java
fp/HeadsetStateMachine.java
20329d5ab161fa580870a24251eb0a10f40f6eed 28-Jun-2017 Hall Liu <hallliu@google.com> Defer sendDeviceStateChanged until SIM config loaded
am: 487fb02a65

Change-Id: I9f0301a4f95731f1cf2a8f81e93a9870d011ea3c
4b49e683ecf9de181a8c2edcd10b142332ea8389 28-Jun-2017 Jack He <siyuanh@google.com> Merge "Add APIs to get remote device's battery level (2/2)" am: f0207f0d1d
am: 2b8a4a3ac8

Change-Id: Iaa3ce4aa616618f62a051405e9dfa0944dede6fb
2b8a4a3ac89006845c02bc6e5b7bc61bb129bddc 28-Jun-2017 Jack He <siyuanh@google.com> Merge "Add APIs to get remote device's battery level (2/2)"
am: f0207f0d1d

Change-Id: I90004419c90cad630df4c3661b0eb07fb9f64c01
2e20779b97be2073942b1fc8093414ae08e03136 28-Jun-2017 Vinay Kalia <vinaykalia@google.com> Revert "Improve BLE scan attribution to facilitate debugging power issues"

This reverts commit 81efe3aa81785d7e25a1b9dbeb9f35dc1aacb524.

Change-Id: I9f08c85f7c140b2075ded97764e4ff3eb9ec6fa4
att/AppScanStats.java
att/GattService.java
att/ScanManager.java
3686813d56c7ed82952ea7640b7aeee964948208 20-Jun-2017 Jack He <siyuanh@google.com> Add APIs to get remote device's battery level (2/2)

* Add backend service methods for BluetoothDevice.getBatteryLevel()
* Add battery level field in DeviceProperties with getters and setters
* Add updateBatteryLevel() method in RemoteDevices
* Add resetBatteryLevel() method in RemoteDevices
* Reset battery level for device when device is disconnected in
aclStateChangeCallback() to ensure a BATTERY_LEVEL_CHANGED intent
when device first report battery level information after connection
* Add tests for updateBatteryLevel() and resetBatteryLevel()

Bug: 35874078
Test: make, pair with devices and use them, unit tests
runtest -c com.android.bluetooth.btservice.RemoteDevicesTest bluetooth
Change-Id: Id770ee08b3cd295563660557b9a1bf0e643b32b8
tservice/AdapterService.java
tservice/RemoteDevices.java
487fb02a65fafa5689a037460875470ae1b4e209 27-Jun-2017 Hall Liu <hallliu@google.com> Defer sendDeviceStateChanged until SIM config loaded

When a sim is inserted, the service state will change before all the
data is fully available. To prevent the headset from seeing bad data,
wait until the sim config is fully loaded before calling
sendDeviceStateChanged.

Change-Id: I49831b8b1e494b2263cbc543c187b170faaaaca0
Fixes: 37301718
Test: manual
fp/HeadsetPhoneState.java
f3ae1d65ce60a4b8c55e0a43cfb61a444a8e0a61 28-Jun-2017 Vinay Kalia <vinaykalia@google.com> Improve BLE scan attribution to facilitate debugging power issues
am: 81efe3aa81

Change-Id: I13ab5a8c3de65f7d593e04927776c484be12f6e5
50cc0de07bc7679c1ee85a0f513d2a41c59ea6dd 28-Jun-2017 Vinay Kalia <vinaykalia@google.com> Improve BLE scan attribution to facilitate debugging power issues
am: 81efe3aa81

Change-Id: Ic00922f7848153f7863fe30d2f98f5308ce4762f
81efe3aa81785d7e25a1b9dbeb9f35dc1aacb524 23-Jun-2017 Vinay Kalia <vinaykalia@google.com> Improve BLE scan attribution to facilitate debugging power issues

Following changes are made to improve BLE scan dumpsys:
1. All stats in AppScanStats assumed one scan per application.
This is not true for many applications. Fix scanning stats
to support multiple scans per application:
a. Fix number of scans started/stopped counters.
b. Fix scan min/max/avg/total time.
c. Fix scan start/stop indication to batterystats.

2. Show ongoing scans as a separate list of scans.

Example:
<app-name> (Registered)
LE scans (started/stopped) : 13 / 11
Scan time in ms (min/max/avg/total): 1098 / 227509 / 19805 / 257469
Total number of results : 2623
Last 5 scans :
2017/06/26 14:55:02 - 6659ms 59 results (7)
2017/06/26 14:55:13 - 1113ms 6 results (8)
2017/06/26 14:55:14 - 10012ms Filter 0 results (8)
2017/06/26 14:55:24 - 1106ms 7 results (8)
2017/06/26 14:57:56 - 10007ms 100 results (9)
Ongoing scans:
2017/06/26 14:55:09 - 227509ms 2232 results (7)
2017/06/26 14:58:06 - 50463ms Filter 0 results (9)

Application ID : 5
UUID : xxxx

BUG: 62389939
Test: Tested a few BLE scanning applications which included misbehaving
applications.

Change-Id: Iaade4ce4bf06533415b49bc3635866b1bf0db937
att/AppScanStats.java
att/GattService.java
att/ScanManager.java
c960943641d79069f2f8177c0a3c378d8337b9c2 23-Jun-2017 Ajay Panicker <apanicke@google.com> AVRCP: Fix NowPlayingList looping

When a controller requested GetFolderItems, we would sometimes send a
NowPlayingListChanged before responding to GetFolderItems, prompting a
new GetFolderItems request. This put us in an infinite loop.

Test: connect to BMW and note it actually works
Bug: 62775732

Change-Id: Idc669a03f71ed9ec6b211bb5c33fc98548cc9f85
(cherry picked from commit d65422f9b47bff59b12162fc51032eb633f0722f)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpMediaRspInterface.java
4170b0f1c76ac450b4d299543ccd732589fc3476 24-Jun-2017 Ajay Panicker <apanicke@google.com> AVRCP: Fix NowPlayingList looping
am: d65422f9b4

Change-Id: I46f1f42d6a04ace62e16fb1f607e7280f7d3eb11
f34e489f567c2ae8ac2383acc2f16a536c146183 24-Jun-2017 Ajay Panicker <apanicke@google.com> AVRCP: Fix NowPlayingList looping
am: d65422f9b4

Change-Id: I7a3355c0371e40a5e529f5098216d594a008a5df
d65422f9b47bff59b12162fc51032eb633f0722f 23-Jun-2017 Ajay Panicker <apanicke@google.com> AVRCP: Fix NowPlayingList looping

When a controller requested GetFolderItems, we would sometimes send a
NowPlayingListChanged before responding to GetFolderItems, prompting a
new GetFolderItems request. This put us in an infinite loop.

Test: connect to BMW and note it actually works
Bug: 62775732

Change-Id: Idc669a03f71ed9ec6b211bb5c33fc98548cc9f85
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpMediaRspInterface.java
292adb6539162a1ae77f8f1adeba50f0343fb42b 23-Jun-2017 Marie Janssen <jamuraa@google.com> Avrcp: Limit available players changed
am: 85ff690324

Change-Id: Iedc3d249ea37e10133ea93f28523e68f54ac03f7
d60fe2491aee641d30203420a5edd2ad3d4789b2 23-Jun-2017 Marie Janssen <jamuraa@google.com> Avrcp: refactor addressed player notifications
am: b631457c5c

Change-Id: Idd8c6cb44c72652972a1baf841ae01978896cc3b
85ff6903243d244d4342f390bb40aa99097a9a7c 22-Jun-2017 Marie Janssen <jamuraa@google.com> Avrcp: Limit available players changed

According to the spec, we should only send an Available Players Changed
update when a player is added or removed. (AVRCP 1.6.1 Sec 6.9.4 p74)

Only send an update when a player is added or removed. If a player
would change feature bits, display name, major or minor type, present it
as a new player instead and remove the old player.

Sync available players notifications with other notifications.

Bug: 34471252
Test: switch players, note that Available Players Changed is not sent
all the time
Change-Id: Icd3730afa6e182810920f28fa7db17b98e53ceea
(cherry picked from commit f2f6a4ea02e9456f71ea0490112845110ca5d975)
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
12b10db2eb7e370a05f25410beaee98bb6db9d65 23-Jun-2017 Marie Janssen <jamuraa@google.com> Merge "Avrcp: Limit available players changed" am: e3e952d0e9
am: 377f379737

Change-Id: Ib0abba7f0f779284890513e0049aff7c62272ce3
b631457c5ccc472a499334f65b88848bbaf3c605 21-Jun-2017 Marie Janssen <jamuraa@google.com> Avrcp: refactor addressed player notifications

The time when audio players change is a time of great changes in the Media
Framework. Many things are updated at the same time, and controllers
are updating three or four times before Metadata is stable for sending
to the controller.

Accordingly, when media updates happen, we can wait a little bit to
update media info when it changes to let it settle.

Refactor sending addressed player changes, resetting notifications when
we are supposed to, and check for an update whenever we update media.

Only update media at max every second.

Test: connect to carkit, change apps, notice media appears
Bug: 34471252
Change-Id: I6f0a5e169bece69894d1139a2b6615fac6b08a48
(cherry picked from commit 59b1c77f883bd97816332046a3a98be4431ccedd)
vrcp/Avrcp.java
f2f6a4ea02e9456f71ea0490112845110ca5d975 22-Jun-2017 Marie Janssen <jamuraa@google.com> Avrcp: Limit available players changed

According to the spec, we should only send an Available Players Changed
update when a player is added or removed. (AVRCP 1.6.1 Sec 6.9.4 p74)

Only send an update when a player is added or removed. If a player
would change feature bits, display name, major or minor type, present it
as a new player instead and remove the old player.

Sync available players notifications with other notifications.

Test: switch players, note that Available Players Changed is not sent
all the time
Change-Id: Icd3730afa6e182810920f28fa7db17b98e53ceea
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
ca33435490d1f79bff8d5face2e67de13efeb71d 22-Jun-2017 Marie Janssen <jamuraa@google.com> Merge "Avrcp: refactor addressed player notifications" am: 6ba02a984f
am: 93d354956f

Change-Id: Ifcb9a9ce73467ade34dc4ee62ef7c7e97022ffda
f91bac85648c9e339f53cab2581f331092a284b7 22-Jun-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Add a missing check for null pointer during closing of PBAP Service" into oc-dev
am: 90cad4dd0e

Change-Id: I9ac185faf00cbc0e6485323e7ceaab707d956462
12e7aa2b07335cf57c5dad00b82a5d6a4e7bfe78 22-Jun-2017 Marie Janssen <jamuraa@google.com> Avrcp: redact media info
am: 029b34a866

Change-Id: Icd9f9cc24c1f040c20ce6a892251a804cad7f3d2
90cad4dd0ef3a0a2e8e50c65ba6b62e6e3f95690 22-Jun-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add a missing check for null pointer during closing of PBAP Service" into oc-dev
59b1c77f883bd97816332046a3a98be4431ccedd 21-Jun-2017 Marie Janssen <jamuraa@google.com> Avrcp: refactor addressed player notifications

The time when audio players change is a time of great changes in the Media
Framework. Many things are updated at the same time, and controllers
are updating three or four times before Metadata is stable for sending
to the controller.

Accordingly, when media updates happen, we can wait a little bit to
update media info when it changes to let it settle.

Refactor sending addressed player changes, resetting notifications when
we are supposed to, and check for an update whenever we update media.

Only update media at max every second.

Test: connect to carkit, change apps, notice media appears
Bug: 34471252
Change-Id: I6f0a5e169bece69894d1139a2b6615fac6b08a48
vrcp/Avrcp.java
804b9b6f148d151b95d406e9645cbcdea577513a 22-Jun-2017 Hans MÃ¥nsson <hans.mansson@sony.com> Merge "AdapterProperties: Guard unregisterReceiver" am: 614a8b889f
am: 6bef18b573

Change-Id: I4b7a3dceb28d2421c7a9e6b89b7ce6331277ee4e
614a8b889fe7364ce179a53044bf2fe9f10d283d 22-Jun-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "AdapterProperties: Guard unregisterReceiver"
060b6d09487e40bd5592a97cadc5eb48c21d5e23 22-Jun-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Add a missing check for null pointer during closing of PBAP Service" am: e061ac9dcb
am: 90225e0ab2

Change-Id: I500f85e91c0aa6eaadcc3f3e30bece3ae0b135da
e061ac9dcb858af09426cdce4a9d33a8c76cce56 22-Jun-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Add a missing check for null pointer during closing of PBAP Service"
029b34a866c2f4ab132412ec2814fd500813c565 21-Jun-2017 Marie Janssen <jamuraa@google.com> Avrcp: redact media info

Let's redact some of that media info when we're not on debug/eng builds.

Test: play some music, adb logcat and observe
Bug: 62826797
Change-Id: Icf7e926508215eae70cd75bef3cddcc001218c50
(cherry picked from commit cc07ee436d00418ecc69ae3aace986f7fbf0823a)
tils.java
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
741b86afd1c01e8fb66d5b167c1200fe761d63e9 22-Jun-2017 Marie Janssen <jamuraa@google.com> Merge "Avrcp: redact media info" am: 0ca22b7adc
am: 4d0c3bea83

Change-Id: I7b92051c27a2a44cb2f4da1b84d97ff852278fcb
75911dfffcd36542b340cd11729edc8553456646 21-Jun-2017 Pavlin Radoslavov <pavlin@google.com> Add a missing check for null pointer during closing of PBAP Service

This fixes NullPointerException when processing MSG_SERVERSESSION_CLOSE
from the Obex Server if Bluetooth itself is shutting down.

BluetoothPbapService.closeService() ->
BluetoothPbapObexServer.onClose() -> msg(MSG_SERVERSESSION_CLOSE) -> ...
-> BluetoothPbapService.stopObexServerSession()
-> mAdapter.isEnabled() -> NPE (mAdapter is null)

Bug: 62073087
Test: Code compilation
Change-Id: Ica98e1b784b3a51456c7709062074ea122eb8bdd
(cherry picked from commit d5a30661a5c51e5f02320868ec870709c1c0ecac)
bap/BluetoothPbapService.java
d5a30661a5c51e5f02320868ec870709c1c0ecac 21-Jun-2017 Pavlin Radoslavov <pavlin@google.com> Add a missing check for null pointer during closing of PBAP Service

This fixes NullPointerException when processing MSG_SERVERSESSION_CLOSE
from the Obex Server if Bluetooth itself is shutting down.

BluetoothPbapService.closeService() ->
BluetoothPbapObexServer.onClose() -> msg(MSG_SERVERSESSION_CLOSE) -> ...
-> BluetoothPbapService.stopObexServerSession()
-> mAdapter.isEnabled() -> NPE (mAdapter is null)

Bug: 62073087
Test: Code compilation
Change-Id: Ica98e1b784b3a51456c7709062074ea122eb8bdd
bap/BluetoothPbapService.java
cc07ee436d00418ecc69ae3aace986f7fbf0823a 21-Jun-2017 Marie Janssen <jamuraa@google.com> Avrcp: redact media info

Let's redact some of that media info when we're not on debug/eng builds.

Test: play some music, adb logcat and observe
Bug: 62826797
Change-Id: Icf7e926508215eae70cd75bef3cddcc001218c50
tils.java
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
12d9d6b10991fef925f3fd673e39dd2ef0f9ee87 21-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: Prevent multithread issues in cleanup
am: 676768272f

Change-Id: Id41a1e2ca136bb253e749088be00ea97657e03b9
481d75623ce421158ab898bbe6980f7bfcedf686 05-May-2017 Hans MÃ¥nsson <hans.mansson@sony.com> AdapterProperties: Guard unregisterReceiver

At first boot if Bluetooth is not enabled by default the Bluetooth app
will crash due to a poorly guarded cleanup method.

The root cause is that BluetoothMangerService.handleOnBootPhase() issues
a MESSAGE_GET_NAME_AND_ADDRESS, which inturn will try get device address
and name. When done it will call unbindAndFinish() if Bluetooth is not
enabled. The Bluetooth app then cleans up in preparation for shutdown
and the crash occurs.

Test: def_bluetooth_on => false in SettingsProvider defaults. Build/boot
Change-Id: Idc6817eacd75fcc22d284ca0e54933914b587e49
tservice/AdapterProperties.java
5c893299df473e6c87d1fc8899f4f7ea5c4b4b43 21-Jun-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Prevent multithread issues in cleanup" am: aee6c7fb68
am: 3a7b9eac6c

Change-Id: If564458360ac347db078d390d6c7c7e66b44f00e
676768272f84bc3fef9068b6286b6f38cb1e8962 16-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: Prevent multithread issues in cleanup

When cleaning up the object in doQuit it was possible to have multiple
threads updating at once, causing NullPointerExceptions in some cases.

Synchronize the startup and shutdown of the Avrcp object to prevent
this.

Test: toggle bluetooth rapidly
Bug: 62676895
Change-Id: I2618c7d7b21acb1f95cb67366d469da2fa88d4a4
(cherry picked from commit 9a5f80a6528d76153a7e97821f114f3370df89a5)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
9a5f80a6528d76153a7e97821f114f3370df89a5 16-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: Prevent multithread issues in cleanup

When cleaning up the object in doQuit it was possible to have multiple
threads updating at once, causing NullPointerExceptions in some cases.

Synchronize the startup and shutdown of the Avrcp object to prevent
this.

Test: toggle bluetooth rapidly
Bug: 62676895
Change-Id: I2618c7d7b21acb1f95cb67366d469da2fa88d4a4
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
67d591b7445329d2282730fd73a701bb62ce51b3 15-Jun-2017 Avish Shah <avshah@broadcom.com> Merge "Bluetooth 5: Update LE2M implementation through DM (1/3)" am: 0733dd54f0
am: 306b532ebb

Change-Id: I1ae0fd8f4d7c6d7ecd6af79283370c5744860b0b
78776aada90a70a875b00d3796798752652c3b86 17-May-2017 Avish Shah <avshah@broadcom.com> Bluetooth 5: Update LE2M implementation through DM (1/3)

This patch moves LE2M implementation to the DM instead of tied to GATT.

Below are the reasons to make this change:
1) Per link setting usually be done under DM, such as link policy etc.
2) In the future, if LECOC is coming to use in more profile/apps,
we can not rely on GATT API for these. Separate API should be required.
3) we could have multiple logical GATT user on top of the same link.
4) Also this will avoid duplicating all the APIs on GATTC and GATTS.

Bug: 37586939
Test: manual
Change-Id: I9e84b7b4aac1ccb7d3d1c4932d5da40784acf0d7
att/GattService.java
8cf85dc4b5ee53db49b31d1b82457049977ec200 14-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: Workaround Queue ID & metadata updates
am: d5b2445ec7

Change-Id: I30a811ffa1371809e923cf2e384fcdee622db90d
33463255fe8c3d0f1929d55739a600aaad1bc5bc 14-Jun-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Workaround Queue ID & metadata updates" am: d183cb255f
am: 6facec1edb

Change-Id: Ic34d2faebe75a7690d0b518ff6a5fab80b11b19f
d5b2445ec7ff3809c1c90a9b20784a6a861a037c 13-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: Workaround Queue ID & metadata updates

When a player with a queue updates their track, it comes in two separate
parts from MediaController.Callback:
- Queue ID is in onPlaybackStateChanged
- Metadata is in onMetadataChanged

Because the ordering of these two is not specific, both must change
before we have a consistent data state to present the carkit if the
Media client has a queue.

Even though the only thing sent in the Track Changed notification is the
Queue ID, the request for metadata often comes before the Metadata has
been updated after that notification.

Refactor Track Changed notification to keep track of the last data we
sent to the controller, and send new tracks when both Queue ID and
Metadata have changed.

Test: various carkit testing with track skipping
Bug: 37707672
Change-Id: Ibf9f725f6912955a65421786068921489dbf8e45
(cherry picked from commit 5aca05c1d79f3412b6964b3b6335ad6f2d558756)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
5aca05c1d79f3412b6964b3b6335ad6f2d558756 13-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: Workaround Queue ID & metadata updates

When a player with a queue updates their track, it comes in two separate
parts from MediaController.Callback:
- Queue ID is in onPlaybackStateChanged
- Metadata is in onMetadataChanged

Because the ordering of these two is not specific, both must change
before we have a consistent data state to present the carkit if the
Media client has a queue.

Even though the only thing sent in the Track Changed notification is the
Queue ID, the request for metadata often comes before the Metadata has
been updated after that notification.

Refactor Track Changed notification to keep track of the last data we
sent to the controller, and send new tracks when both Queue ID and
Metadata have changed.

Test: various carkit testing with track skipping
Bug: 37707672
Change-Id: Ibf9f725f6912955a65421786068921489dbf8e45
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
25979a8a7b21b8bc4e8ab13fa718a2a15a2554c5 13-Jun-2017 Calvin On <con@google.com> Work around/prevent NPE in aclStateChangedCallback.
am: 0ce2c58515

Change-Id: I21751c40fc3e332e350f00309458c4c92004dcf6
514aec1bc54b72edbf755fb77f0bb435e402401c 13-Jun-2017 Calvin On <con@google.com> Work around/prevent NPE in aclStateChangedCallback.
am: 0ce2c58515

Change-Id: Ifc2aaa9f2d8eb2eebd10ab341f4c80c66b99b052
0ce2c585150e29d4d8fa7157d9243d4760c77c7f 09-Jun-2017 Calvin On <con@google.com> Work around/prevent NPE in aclStateChangedCallback.

Bug: 62440980
Change-Id: I0fd02d80a9cb656a253e537a4ce2dd538df4c48d
tservice/RemoteDevices.java
f6329ee803b2171cd258cd983c77bf1b2a6e4404 13-Jun-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: reduce PLAY_INTERVAL_TIMEOUT logspam" into oc-dev
am: b716d637ed

Change-Id: I3ba504256104ca2f53fc9e6f0299884f4b144973
47c8a4f765440530788a8182829dd14ba6896d51 13-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: fix single item queue Now Playing issues
am: 4ffc876674

Change-Id: I2d8abc6235792c0dcb746d308d96ff49d7e7d959
b716d637edded2ee0872aed5fb1259d2acded221 13-Jun-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AVRCP: reduce PLAY_INTERVAL_TIMEOUT logspam" into oc-dev
6ead7a617a7a5faac21b1da2a777d15d7c8e7144 13-Jun-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: reduce PLAY_INTERVAL_TIMEOUT logspam" am: a654b98eea
am: 641629f114

Change-Id: Idb6b75b619845a7039def1f430642861b67cfbc1
a06a7e90bac455c4bc440a1e03117dd6ae41a653 12-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: reduce PLAY_INTERVAL_TIMEOUT logspam

Before:
06-10 20:38:36.926 1002 1520 2053 V Avrcp : MSG_NATIVE_REQ_REGISTER_NOTIFICATION:event=5 param=1
06-10 20:38:36.926 1002 1520 2053 D Avrcp : sendPlayPosNotificationRsp: (true) 193004 <=? 194015 <=? 195004
06-10 20:38:36.926 1002 1520 2053 D Avrcp : sendPlayPosNotificationRsp: currentPlayState PlaybackState {state=3, position=698, buffered position=0, speed=1.0, updated=76557851, actions=794551, custom actions=[Action:mName='Thumbs up, mIcon=2130838014, mExtras=Bundle[mParcelledData.dataSize=40], Action:mName='Thumbs down, mIcon=2130838013, mExtras=Bundle[mParcelledData.dataSize=44], Action:mName='Start radio, mIcon=2130837971, mExtras=Bundle[mParcelledData.dataSize=648], Action:mName='Shuffle, mIcon=2130837998, mExtras=null], active item id=27596, error=null}
06-10 20:38:36.926 1002 1520 2053 D Avrcp : PLAY_INTERVAL_TIMEOUT set for 1000ms from now
06-10 20:38:37.928 1002 1520 2053 V Avrcp : MSG_PLAY_INTERVAL_TIMEOUT
06-10 20:38:37.928 1002 1520 2053 D Avrcp : sendPlayPosNotificationRsp: (false) 193015 <=? 195017 <=? 195015
06-10 20:38:37.928 1002 1520 2053 D Avrcp : sendPlayPosNotificationRsp: currentPlayState PlaybackState {state=3, position=698, buffered position=0, speed=1.0, updated=76557851, actions=794551, custom actions=[Action:mName='Thumbs up, mIcon=2130838014, mExtras=Bundle[mParcelledData.dataSize=40], Action:mName='Thumbs down, mIcon=2130838013, mExtras=Bundle[mParcelledData.dataSize=44], Action:mName='Start radio, mIcon=2130837971, mExtras=Bundle[mParcelledData.dataSize=648], Action:mName='Shuffle, mIcon=2130837998, mExtras=null], active item id=27596, error=null}

After:
06-12 14:27:38.217 1217 1807 V Avrcp : MSG_NATIVE_REQ_REGISTER_NOTIFICATION:event=5 param=5
06-12 14:27:38.218 1217 1807 D Avrcp : sendPlayPosNotificationRsp: (true) 56305 <=? 61489 <=? 66305 Playing State: 3 Timeout 5000ms
06-12 14:27:43.225 1217 1807 D Avrcp : sendPlayPosNotificationRsp: (false) 56489 <=? 66495 <=? 66489 Playing State: 3

Test: adb logcat when playing music and connected to a device
Bug: 36802046
Change-Id: Icb3623c51ceaf0e70f3da9beb1f0a2896b4cfd65
(cherry picked from commit 0ace2d5941549e466ada4258c6c6fbb1debdf48d)
vrcp/Avrcp.java
fffae32cac3d028d64a659264133b78f4821423a 13-Jun-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: fix single item queue Now Playing issues" am: e1c6f9b2d8
am: 9cb2225301

Change-Id: If0d401ac5fbbd96a97b30ada97aa5dc5d242fc9f
0ace2d5941549e466ada4258c6c6fbb1debdf48d 12-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: reduce PLAY_INTERVAL_TIMEOUT logspam

Before:
06-10 20:38:36.926 1002 1520 2053 V Avrcp : MSG_NATIVE_REQ_REGISTER_NOTIFICATION:event=5 param=1
06-10 20:38:36.926 1002 1520 2053 D Avrcp : sendPlayPosNotificationRsp: (true) 193004 <=? 194015 <=? 195004
06-10 20:38:36.926 1002 1520 2053 D Avrcp : sendPlayPosNotificationRsp: currentPlayState PlaybackState {state=3, position=698, buffered position=0, speed=1.0, updated=76557851, actions=794551, custom actions=[Action:mName='Thumbs up, mIcon=2130838014, mExtras=Bundle[mParcelledData.dataSize=40], Action:mName='Thumbs down, mIcon=2130838013, mExtras=Bundle[mParcelledData.dataSize=44], Action:mName='Start radio, mIcon=2130837971, mExtras=Bundle[mParcelledData.dataSize=648], Action:mName='Shuffle, mIcon=2130837998, mExtras=null], active item id=27596, error=null}
06-10 20:38:36.926 1002 1520 2053 D Avrcp : PLAY_INTERVAL_TIMEOUT set for 1000ms from now
06-10 20:38:37.928 1002 1520 2053 V Avrcp : MSG_PLAY_INTERVAL_TIMEOUT
06-10 20:38:37.928 1002 1520 2053 D Avrcp : sendPlayPosNotificationRsp: (false) 193015 <=? 195017 <=? 195015
06-10 20:38:37.928 1002 1520 2053 D Avrcp : sendPlayPosNotificationRsp: currentPlayState PlaybackState {state=3, position=698, buffered position=0, speed=1.0, updated=76557851, actions=794551, custom actions=[Action:mName='Thumbs up, mIcon=2130838014, mExtras=Bundle[mParcelledData.dataSize=40], Action:mName='Thumbs down, mIcon=2130838013, mExtras=Bundle[mParcelledData.dataSize=44], Action:mName='Start radio, mIcon=2130837971, mExtras=Bundle[mParcelledData.dataSize=648], Action:mName='Shuffle, mIcon=2130837998, mExtras=null], active item id=27596, error=null}

After:
06-12 14:27:38.217 1217 1807 V Avrcp : MSG_NATIVE_REQ_REGISTER_NOTIFICATION:event=5 param=5
06-12 14:27:38.218 1217 1807 D Avrcp : sendPlayPosNotificationRsp: (true) 56305 <=? 61489 <=? 66305 Playing State: 3 Timeout 5000ms
06-12 14:27:43.225 1217 1807 D Avrcp : sendPlayPosNotificationRsp: (false) 56489 <=? 66495 <=? 66489 Playing State: 3

Test: adb logcat when playing music and connected to a device
Bug: 36802046
Change-Id: Icb3623c51ceaf0e70f3da9beb1f0a2896b4cfd65
vrcp/Avrcp.java
4ffc87667492e40e448efa2ef5b11ae3de2f449b 06-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: fix single item queue Now Playing issues

When queried (and in track change notifications) we previously returned
an item ID not allowed by the spec (0xFFFFFFFFFFFFFFFF) to a controller
when presenting a "single item queue" because the player doesn't provide
one.

Refactor the code so that the single item queue is persisted and send
NOW_PLAYING_CONTENT_CHANGED when the single item queue updates.

Tweak debugging of mediacontrollers for easier player debugging.

Test: check media info on honda carkit w/fm.player app
Bug: 62288178
Change-Id: Ic37d0c4c837436e102e9642e1f8e36e17e0dc254
(cherry picked from commit 3a80469f095e51f9be3965d67fff595eabc00293)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/mockable/MediaController.java
3a80469f095e51f9be3965d67fff595eabc00293 06-Jun-2017 Marie Janssen <jamuraa@google.com> AVRCP: fix single item queue Now Playing issues

When queried (and in track change notifications) we previously returned
an item ID not allowed by the spec (0xFFFFFFFFFFFFFFFF) to a controller
when presenting a "single item queue" because the player doesn't provide
one.

Refactor the code so that the single item queue is persisted and send
NOW_PLAYING_CONTENT_CHANGED when the single item queue updates.

Tweak debugging of mediacontrollers for easier player debugging.

Test: check media info on honda carkit w/fm.player app
Bug: 62288178
Change-Id: Ic37d0c4c837436e102e9642e1f8e36e17e0dc254
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/mockable/MediaController.java
91e595b5bef1b092975992e529b2c581eb1be08b 09-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> PBAP: Implement Folder Version Counter(s)

Primary version counter should be updated on any change to
contact. Secondary version counter should not update when
there is change to fields other than F, FN, TEL, EMAIL or
ADDRESS. There is no default API available in android to determine
which field is updated as required for updating secondary
version counter. Implemented logic to increment the secondary
version counter by comparing updated contacts with old cached
contacts of the contact database.

Test: Verified that folder version counter gets incremented for
change(s) in fields of Contacts as per PBAP specification.
TestTracker: 89053
Bug: 33011817
Change-Id: I90a1ced3713c369bcde0edd627bbde57a9676708
(cherry picked from commit cf92c2759b709461acf7c36c08f4eef9c8004c85)
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
bap/BluetoothPbapVcardManager.java
cecda8201dad0b6d2007f6c7e31b1113729d7850 17-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> PBAP: Add support for PBAP 1.2

Add changes required to do the SDP registration as
supported by 1.2, L2CAP related functionality and counter
related changes to support PBAP 1.2.

Test: Connected with Remote PBAP Client supporting PBAP 1.2 and
verified that connection and transfer happens over L2CAP.
Connected with Remote PBAP Client supporting PBAP 1.1 and
and verified that connection and transfer happens over RFCOMM.
TestTracker: 89053

Bug: 33011817
Change-Id: Iddace24f43a7618ccbe6a9b49bcab88dbaae0e06
(cherry picked from commit 5a37bc407ab1b8844c3541ff4e6653635b108bed)
bexServerSockets.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
e7e55e685ee70f0132b11c46724e5972e19be501 09-Jun-2017 Pavlin Radoslavov <pavlin@google.com> Initialize the RemoteDevice Class Of Device to UNCATEGORIZED
am: 75d921ee3b

Change-Id: I598a2ce3e37c2884be5ea2c6708d14c5e9d5f6c6
27b25fdda25eb3847b1f9c9650980ff2fc263b42 09-Jun-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Initialize the RemoteDevice Class Of Device to UNCATEGORIZED" am: 675a21200c
am: a54c805a5a

Change-Id: I85f739e4bef790ac915f229c0b3eb3836dbb1307
75d921ee3bba53093facb1d8bc772ddd6483a0db 09-Jun-2017 Pavlin Radoslavov <pavlin@google.com> Initialize the RemoteDevice Class Of Device to UNCATEGORIZED

Bug: 37615863
Test: Manual with LG HBS1100 headset
Change-Id: I0420cd517f77a4c8965c6651a24f97c29ae99f7f
(cherry picked from commit 2c5969fcd9beac52e4218d66f7f47d8ea901647a)
tservice/RemoteDevices.java
2c5969fcd9beac52e4218d66f7f47d8ea901647a 09-Jun-2017 Pavlin Radoslavov <pavlin@google.com> Initialize the RemoteDevice Class Of Device to UNCATEGORIZED

Bug: 37615863
Test: Manual with LG HBS1100 headset
Change-Id: I0420cd517f77a4c8965c6651a24f97c29ae99f7f
tservice/RemoteDevices.java
03d7afd12bb620a1c1343368da40f8eaf7ea5b5c 07-Jun-2017 Ajay Panicker <apanicke@google.com> Prevent opportunistic scans from changing the hardware filter

Before this patch opportunistic scans could set the hardware filter
to be an all pass filter. This would result large amounts of scan
results as short filtered scans would act as if they were unfiltered.
Now if an app is scanning opportunistically, its filter doesn't
get added to the hardware filter.

Bug: 62280037
Test: Do a filtered scan while another app is scanning opportunistically
and see that the scan results only increase marginally.

Change-Id: I6214a2dd14d2c5ee4c21faa440c48ce7bab0b3fe
att/ScanManager.java
0126c56a6af77a69fffa31915a9df53bba77134f 08-Jun-2017 Zach Johnson <zachoverflow@google.com> Merge "Publish AG audio route policy to native layers" am: a8af79d79b
am: 8f17ca8468

Change-Id: Ice12e3f5afa82c35c270b3ac26aa3c6f23164d07
a86dc0fbdd99227e8ed07af1e3a9c11c1eb39e6f 19-Apr-2017 Zach Johnson <zachoverflow@google.com> Publish AG audio route policy to native layers

Bug: 32958838
Test: manual
Change-Id: I97ec6e38b4f3243548732d2af644d6f0ad894e97
fp/HeadsetStateMachine.java
4b25156563d9e5a28c35b948ce6ef534ca933027 08-Jun-2017 Ajay Panicker <apanicke@google.com> Prevent opportunistic scans from changing the hardware filter
am: 8239c5c797

Change-Id: I08ba544a97b34e79eaf87acc65b6af44c640b6e9
f205e6d0634989cd763534a1ce4cafd539ac96e7 08-Jun-2017 Ajay Panicker <apanicke@google.com> Prevent opportunistic scans from changing the hardware filter
am: 8239c5c797

Change-Id: Ib4992d480475a0ffd3e7fb92a5d518530f00da23
8239c5c797b26376ddef46aaae43ae72019873bc 07-Jun-2017 Ajay Panicker <apanicke@google.com> Prevent opportunistic scans from changing the hardware filter

Before this patch opportunistic scans could set the hardware filter
to be an all pass filter. This would result large amounts of scan
results as short filtered scans would act as if they were unfiltered.
Now if an app is scanning opportunistically, its filter doesn't
get added to the hardware filter.

Fixes: 62280037
Test: Do a filtered scan while another app is scanning opportunistically
and see that the scan results only increase marginally.

Change-Id: I6214a2dd14d2c5ee4c21faa440c48ce7bab0b3fe
(cherry picked from commit b5d5a9563793d32bdafacfe93e303a13d5afd364)
att/ScanManager.java
39652bd0ad5daacf917299a2b2843649cea212aa 03-Jun-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AVRCP: Fix issues around trackChanged notification" into oc-dev
89466c14f70f336e253cc055484e3ca22fbd6fad 03-Jun-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Fix issues around trackChanged notification" am: fac62fd8cb am: 4c04778c2d
am: d70e87127a

Change-Id: If4bdd4b07cb7442f245681bb1badb705b9128e2a
8ac88214fdbf5e5197033b89ba82a6bf728706a4 31-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix issues around trackChanged notification

When the track changes, sometimes the Queue ID changes before the
Metadata, and vice versa. Indicate that the track info has changed in
either case.

Guard against unsolicited responses since we are triggering more often.

Use the MediaController info for GetItemAttributes when the requested
id matches the current id.

Test: connect to Chrysler CK, switch to next track a few times, look for
good data.
Bug: 37707672
Change-Id: I6bffd419e22e1a029e11f9340afde54be00d3efc
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
cab802a9688cba8dfb8faceab820d1320370722b 02-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix OnAdvertisingSetStopped callback not being called" am: f9d9bf4199 am: d57765298d
am: fe8465217c

Change-Id: Ie797e01689155a65a49e7a66e7a4c8409f3db3a8
aa977ceda593239b1948570ccac6f5460cc0fb8c 02-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Fix OnAdvertisingSetStopped callback not being called

Bug: 62031687
Test: sl4a AdvertisingSetTest
Change-Id: I6de84bb68d8c54d8c9685e701ca5ee4967a7b6f0
att/AdvertiseManager.java
1642b48f9d3b00ca80d43830f9bfd6c15fa5ba66 02-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Fix OnAdvertisingSetStopped callback not being called

Bug: 62031687
Test: sl4a AdvertisingSetTest
Change-Id: I6de84bb68d8c54d8c9685e701ca5ee4967a7b6f0
att/AdvertiseManager.java
827c417f70082918b965a5213c38395398389811 31-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix issues around trackChanged notification

When the track changes, sometimes the Queue ID changes before the
Metadata, and vice versa. Indicate that the track info has changed in
either case.

Guard against unsolicited responses since we are triggering more often.

Use the MediaController info for GetItemAttributes when the requested
id matches the current id.

Test: connect to Chrysler CK, switch to next track a few times, look for
good data.
Bug: 37707672
Change-Id: I6bffd419e22e1a029e11f9340afde54be00d3efc
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
1ed348039a1ecbf7ad480bfe41b80578c6eed0b1 02-Jun-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AVRCP: synchronize around mMediaController" into oc-dev
32a0d84101196f40620a535e7a563df7681042f3 01-Jun-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: synchronize around mMediaController" am: d7e7b38cd3 am: fec0498dbe
am: 53554269aa

Change-Id: If76a0d9e4d1ad4b96fdc8f403f320d8784d4768c
d7e7b38cd342c3f896a31ded4fcbec96271d3f5f 01-Jun-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: synchronize around mMediaController"
469e9bc6e1aa0cd5dacf51659e32bda38ddb7ab4 01-Jun-2017 Pavlin Radoslavov <pavlin@google.com> Improve internal state synchronization of the A2dpStateMachine

* Don't block entering Disconnected state
If the mCurrentDevice or mTargetDevice or mIncomingDevice
is not null, print an error message and reset the state
* Add consistency checks when entering each state: Disconnected,
Pending, Connected
* Add a missing "synchronized" statement

Bug: 62164051
Test: Manual
Change-Id: I5856a88e58b42aa55d9075aa507bfa706ea52512
(cherry picked from commit 459978de76c5d152208538f61180e4a790c6e8d9)
2dp/A2dpStateMachine.java
2c2aec2ef9436eb6d7c8ab5628a5dc86e511b52d 01-Jun-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Improve internal state synchronization of the A2dpStateMachine" am: 1de504036f am: 2e5ab36e0d
am: 017346d9d7

Change-Id: I501deaba8e5ec202c9f24acfd52f4c608ab61bc0
2640251bf5123d3855154360d6bc27daedaf5e66 01-Jun-2017 Stanley Tng <stng@google.com> Merge "Clear caller identity while checking Tether Change permission" am: fdc619e544 am: 6724df4905
am: c78d3e2c6c

Change-Id: Id9e1fc35b76ed82eb24558cfe994145dd5af72b2
1de504036f4a12f227d7b3ca6c4e429917bd9ddc 01-Jun-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Improve internal state synchronization of the A2dpStateMachine"
fdc619e54464a3b4124887193a000f0a604d269a 01-Jun-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Clear caller identity while checking Tether Change permission"
1fa21505ce53d436be23d479780c5cb9403bfea7 01-Jun-2017 Jack He <siyuanh@google.com> Merge "HFP: Allow SCO audio to be forcibly connected" am: 24593a9fc6 am: fc7e56a925
am: c956b195e7

Change-Id: I6dd2f056b4d552b427873da49a6ecd3394d77cb4
459978de76c5d152208538f61180e4a790c6e8d9 01-Jun-2017 Pavlin Radoslavov <pavlin@google.com> Improve internal state synchronization of the A2dpStateMachine

* Don't block entering Disconnected state
If the mCurrentDevice or mTargetDevice or mIncomingDevice
is not null, print an error message and reset the state
* Add consistency checks when entering each state: Disconnected,
Pending, Connected
* Add a missing "synchronized" statement

Bug: 62164051
Test: Manual
Change-Id: I5856a88e58b42aa55d9075aa507bfa706ea52512
2dp/A2dpStateMachine.java
da8d8ebe1a6a92d1b3c39f9fda36e7c7ab522663 31-May-2017 Stanley Tng <stng@google.com> Clear caller identity while checking Tether Change permission

When changing the Bluetooth tether settings, the call comes from the
system UID but the app op package name of the Bluetooth app is used
and this causes a mismatch between UID and package. This commit
temporarily clear the caller identity while doing the Tether Change
permission check.

Bug: b/37746850
Test: Manual through the Settings app on device
Change-Id: I4835f940dea28f183fbddcc467723a9e03e759fd
an/PanService.java
41689d7ece8db1cbac33f9613040fa08237b79b4 06-May-2017 Jack He <siyuanh@google.com> HFP: Allow SCO audio to be forcibly connected

* Normally, Android only allows SCO audio to be connected in several
allowed cases (e.g. in call, in ringing, in virtual call state, etc)
* Sometimes, it is necessary to force a SCO audio connection (e.g.
during PTS test)
* This change adds setForceScoAudio(boolean) hidden, system only method
to allow such behaviour

Bug: 38040125
Test: PTS HFP tests
Change-Id: Iab6bca8ec437d04804d61c169f570c1966d164c1
fp/HeadsetService.java
fp/HeadsetStateMachine.java
996875a59e4d2b9a1dae98422835d5781514b26d 31-May-2017 Joe Onorato <joeo@google.com> Merge "Send ble scan type to Batterystats" into oc-dev
am: b4650c79c6

Change-Id: Ie6935d39d89ca7a61e3031f74a4998add71928ec
b4650c79c67ba13773724ef4af9a82c1bb7c808c 31-May-2017 Joe Onorato <joeo@google.com> Merge "Send ble scan type to Batterystats" into oc-dev
47b42d03beb13e55f1789e58c9b8cbf8ddd75d2d 31-May-2017 Joe Onorato <joeo@google.com> Merge "Turn off logspam (Bluetooth)" into oc-dev
am: 4a33b1ae72

Change-Id: I05fca9da411b4d190f02c5562bea2986fa238673
4a33b1ae722da6fba769e36808f75405c7685de8 31-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Turn off logspam (Bluetooth)" into oc-dev
86582543b9cd70a617e84c049c03b466653e9641 25-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: synchronize around mMediaController

There were small windows where mMediaController could be used and
modified by separate threads causing NullPointerExceptions. Synchronize
around mMediaController to avoid these issues.

Test: none
Bug: 62068020
Change-Id: I68acadefe793c4c0f7ffed108ec2e943ade138b8
(cherry picked from commit ad7a50ece55752b9b7e47cd86dc45de368c8c6d5)
vrcp/Avrcp.java
792b3b63ea8109fb0d30135e9249256f3d891d9e 26-Apr-2017 Joe Onorato <joeo@google.com> Turn off logspam (Bluetooth)

For more information, see https://source.android.com/source/code-style#log-sparingly

Bug: 37252687
Test: development/tools/logblame/medium_idle_test
Change-Id: I8c839eff19fa0b00d1b6a04fbb554b39010884d9
att/AdvertiseManager.java
att/GattService.java
att/GattServiceConfig.java
att/PeriodicScanManager.java
att/ScanManager.java
ad7a50ece55752b9b7e47cd86dc45de368c8c6d5 25-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: synchronize around mMediaController

There were small windows where mMediaController could be used and
modified by separate threads causing NullPointerExceptions. Synchronize
around mMediaController to avoid these issues.

Test: none
Bug: 62068020
Change-Id: I68acadefe793c4c0f7ffed108ec2e943ade138b8
vrcp/Avrcp.java
ca4e714ae37050265379fc6604a4e01db9ecae15 24-May-2017 Ajay Panicker <apanicke@google.com> Switch GATT scan timekeeping to use a different clock

System.currentTimeMillis() could cause a scan to have a negative scan
time if the system time changed during a scan. Switch to
SystemClock.elapsedRealtime which is guaranteed to be monotonic.

Test: Start a scan and change system time
Bug: 62057540
Change-Id: Ie4d88df96c0a133955f46c355660756e587d29c5
(cherry picked from commit 4e58faa3aa59332e4d2394e6e54d8d1579e5cc73)
att/AppScanStats.java
a9b127180797191035cec0a38f8c6d30018f3a47 30-May-2017 Ajay Panicker <apanicke@google.com> Merge "Switch GATT scan timekeeping to use a different clock" am: fd12816a6e am: beb868d127
am: ef3763a9cb

Change-Id: Id5e1030853d62ac095da7afc3968bd16ca9aa6c4
318a93083dcbcc0d70c5a4dd6e95cf8bf2f01461 24-May-2017 Ajay Panicker <apanicke@google.com> Switch GATT scan timekeeping to use a different clock

System.currentTimeMillis() could cause a scan to have a negative scan
time if the system time changed during a scan. Switch to
SystemClock.elapsedRealtime which is guaranteed to be monotonic.

Test: Start a scan and change system time
Bug: 62057540
Change-Id: Ie4d88df96c0a133955f46c355660756e587d29c5
att/AppScanStats.java
978986041010d3d2d72e1057743415e76c6f2ce9 11-May-2017 Hemant Gupta <hemantg@codeaurora.org> AVRCP: Fix GetItemAttributesCommand

Usecase:
1) Connect DUT with remote device supporting AVRCP 1.4
2) Connect browsing channel (if not already connected).
3) Send request to retrieve player list and select browsed player.
3) Send get item attribute commands to retrieve attributes of particular uid.

Expected Result:
Item attributes of particular UID are retrieved successfully.

Observation:
Get Item Attribute command does not return any response.

Root cause:
Media id passed as argument to MediaBrowse.subscribe is of children instead of
parent as required by the API

Fix:
Refactor to encapsulate requested ID in the subscribe callback, call the
MediaBrowser.subscribe with the correct id.

Test: connect to carkit and check if DUT responds correctly to GetItemAttribute
Bug: 37265436
Change-Id: Ifd7e17c600c0142cd29514eedf4ff8150f632570
(cherry picked from commit 3cd52581b21ef8c35382650170c9046119213f28)
vrcp/AddressedMediaPlayer.java
vrcp/AvrcpHelperClasses.java
vrcp/BrowsedMediaPlayer.java
5e89980042b5c92485274d6a9665d6f5f2387d2b 26-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Fix GetItemAttributesCommand" am: 2df98dca91 am: 4a6eeb7592
am: 27b97b4983

Change-Id: Ib811110c0db67bf53cfe848864b9cae0a184b69e
3cd52581b21ef8c35382650170c9046119213f28 11-May-2017 Hemant Gupta <hemantg@codeaurora.org> AVRCP: Fix GetItemAttributesCommand

Usecase:
1) Connect DUT with remote device supporting AVRCP 1.4
2) Connect browsing channel (if not already connected).
3) Send request to retrieve player list and select browsed player.
3) Send get item attribute commands to retrieve attributes of particular uid.

Expected Result:
Item attributes of particular UID are retrieved successfully.

Observation:
Get Item Attribute command does not return any response.

Root cause:
Media id passed as argument to MediaBrowse.subscribe is of children instead of
parent as required by the API

Fix:
Refactor to encapsulate requested ID in the subscribe callback, call the
MediaBrowser.subscribe with the correct id.

Test: connect to carkit and check if DUT responds correctly to GetItemAttribute
Bug: 37265436
Change-Id: Ifd7e17c600c0142cd29514eedf4ff8150f632570
vrcp/AddressedMediaPlayer.java
vrcp/AvrcpHelperClasses.java
vrcp/BrowsedMediaPlayer.java
1b4eebcff6f188f48c8a4b1835f080ea03fbe523 25-May-2017 Marie Janssen <jamuraa@google.com> Merge "Fix setFlags/addFlags typo" am: 9a530c3704 am: 4d25ef04a2
am: 00e67f1c97

Change-Id: I79fde69c2599fcd0740520320f6404147515fe0a
b7350e83ebac9e86321791cb62b3e71fa3c54562 24-May-2017 Marie Janssen <jamuraa@google.com> Fix setFlags/addFlags typo

In aosp/352873 setFlags was used instead of addFlags which means wrong
semantics are used.

Test: sanity pairing tests with devices
Bug: 35853357
Change-Id: If27a870d880036aea60e8a07714a76af6de75081
(cherry picked from commit 117ee66c2a482df8ae99d4edbc1be1d03765d54a)
tservice/BondStateMachine.java
117ee66c2a482df8ae99d4edbc1be1d03765d54a 24-May-2017 Marie Janssen <jamuraa@google.com> Fix setFlags/addFlags typo

In aosp/352873 setFlags was used instead of addFlags which means wrong
semantics are used.

Test: sanity pairing tests with devices
Bug: 35853357
Change-Id: If27a870d880036aea60e8a07714a76af6de75081
tservice/BondStateMachine.java
90dcb467d4964f65bde4f847a2e8fe0fe048c3a7 24-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: don't remove inactive media controllers

Some players change their controllers to inactive when they are
buffering, paused, or changing songs which causes us to lose track of
the controller in these states when it makes sense to keep track still.

In the case where we actually have no controller, simplify the logic
around tracking play state using A2DP feedback.

Test: Pause / Play with troublesome headphones
Bug: 38497029
Change-Id: I8e1258b85007c070fc083d9522f9fa8caa13e6f2
(cherry picked from commit c9f4e0d24e39b372452fa809b12f9c588b29abd9)
vrcp/Avrcp.java
643a286b2616bd5fac1117eaa2a574bb96541b85 24-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: don't remove inactive media controllers" am: 65c71f4025 am: b2e17d6b13
am: ec867ed03b

Change-Id: Icdb07f043bf52286c74492623b44a1dbf441464d
c9f4e0d24e39b372452fa809b12f9c588b29abd9 24-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: don't remove inactive media controllers

Some players change their controllers to inactive when they are
buffering, paused, or changing songs which causes us to lose track of
the controller in these states when it makes sense to keep track still.

In the case where we actually have no controller, simplify the logic
around tracking play state using A2DP feedback.

Test: Pause / Play with troublesome headphones
Bug: 38497029
Change-Id: I8e1258b85007c070fc083d9522f9fa8caa13e6f2
vrcp/Avrcp.java
ffec5afaea207f22ceeab0eeb73a4ec5000f91fc 23-May-2017 Bookatz <bookatz@google.com> Send ble scan type to Batterystats

Batterystats is now informed whether the ble scan is unoptimized or not.
In this context, unoptimized means that it is none of filtered, background,
or opportunistic.

Bug: 38461344
Test: run cts-dev -m CtsIncidentHostTestCases -t com.android.server.cts.BatteryStatsValidationTest#testUnoptimizedBleScans
Change-Id: Idb199666830db24b2ef92797cdcc59e8eab16be3
att/AppScanStats.java
99be05cc9c25d4d9f541b0c3bc5f4e28996a06b4 18-May-2017 Dave Rim <davidrim@google.com> Enable bluetooth a2dpsink to request audio focus from source

- Allow source to initiate play on IoT devices without having audiofocus
first
- Added mockPackageManager and testSrcPlayIot to A2dpSinkStreamHandler
unit test

Test: Bluetooth a2dp sink works using the sample-audio-bluetooth
sample app
Bug: 38098044
Change-Id: I98472c857afa4922ae9ce118c1bcf0f801ffd304
2dpsink/A2dpSinkStreamHandler.java
5910c61af4aba20e00c660a6a59116000565fe63 23-May-2017 Ajay Panicker <apanicke@google.com> Merge "Remove logspam in service state changes" into oc-dev
am: 85d0a3893b

Change-Id: I03ef1eb46fdafe1db72309cd17fee5013bb1c00d
85d0a3893b2aff55f0c57e319570d5e38e7b9cbd 23-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Remove logspam in service state changes" into oc-dev
bac02931f0f9e42ae130fa46c9092d8961bd2b4e 23-May-2017 Ajay Panicker <apanicke@google.com> Merge "Remove logspam for empty remote device properties" am: 7c358a3c47 am: 8df88eda5d
am: 3b786576e2

Change-Id: If0a6d218ea12b2c70c2099fbf31b709d62c933ab
7c358a3c47d3ba2ecd9ed3f3ce5d9930c3003cd6 23-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Remove logspam for empty remote device properties"
e7de65e09358a285073944499230b755ab29591b 17-May-2017 Ajay Panicker <apanicke@google.com> Remove logspam in service state changes

Bug: 37803501
Test: Code still compiles
Change-Id: I9b2055476f74486a3d57957d2c9e6cf7946a139e
(cherry picked from commit edbf12256878f7d1a01c12f44342ec4ffe3405ba)
tservice/AdapterService.java
566ab625deaccd0db8ae964bf07dd6db01a55c70 17-May-2017 Ajay Panicker <apanicke@google.com> Remove logspam for empty remote device properties

Some properties can have a length of zero, so don't display an error
message when this happens.

Bug: 37803501
Test: Code still compiles
Change-Id: If6a2f32505c61f31075b2fc87d0521020c3720ac
(cherry picked from commit 6ad1b92100edacaa55560c3df5179bafb49539c2)
tservice/RemoteDevices.java
6ad1b92100edacaa55560c3df5179bafb49539c2 17-May-2017 Ajay Panicker <apanicke@google.com> Remove logspam for empty remote device properties

Some properties can have a length of zero, so don't display an error
message when this happens.

Bug: 37803501
Test: Code still compiles
Change-Id: If6a2f32505c61f31075b2fc87d0521020c3720ac
tservice/RemoteDevices.java
7c7890afafc95b1da5301cd3e7e1b46e3b4b4afe 20-May-2017 Hemant Gupta <hemantg@codeaurora.org> Settings: Convert notifications to use NotificationChannel (1/2)
am: 83955a5b05

Change-Id: I7b79402f8f079d14004f8a1fc7a73d6794f38f40
706513c6b97b076a1c04f6590d81d233e671df6e 20-May-2017 Andre Eisenbach <eisenbach@google.com> Merge changes from topic 'PBAP-1.2' am: 2d2af9a9e6 am: 0428d6217b
am: e791bcaf47

Change-Id: I62508220038fef2920e25560582c8d54c8a37beb
cf92c2759b709461acf7c36c08f4eef9c8004c85 09-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> PBAP: Implement Folder Version Counter(s)

Primary version counter should be updated on any change to
contact. Secondary version counter should not update when
there is change to fields other than F, FN, TEL, EMAIL or
ADDRESS. There is no default API available in android to determine
which field is updated as required for updating secondary
version counter. Implemented logic to increment the secondary
version counter by comparing updated contacts with old cached
contacts of the contact database.

Test: Verified that folder version counter gets incremented for
change(s) in fields of Contacts as per PBAP specification.

Bug: 33011817
Change-Id: I90a1ced3713c369bcde0edd627bbde57a9676708
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
bap/BluetoothPbapVcardManager.java
5a37bc407ab1b8844c3541ff4e6653635b108bed 17-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> PBAP: Add support for PBAP 1.2

Add changes required to do the SDP registration as
supported by 1.2, L2CAP related functionality and counter
related changes to support PBAP 1.2.

Test: Connected with Remote PBAP Client supporting PBAP 1.2 and
verified that connection and transfer happens over L2CAP.
Connected with Remote PBAP Client supporting PBAP 1.1 and
and verified that connection and transfer happens over RFCOMM.

Bug: 33011817
Change-Id: Iddace24f43a7618ccbe6a9b49bcab88dbaae0e06
bexServerSockets.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
83955a5b052c70a080dac6b185170b3ba65d82e1 16-May-2017 Hemant Gupta <hemantg@codeaurora.org> Settings: Convert notifications to use NotificationChannel (1/2)

Test Setup:
===========
HW DUT: Pixel O
Remote: MecApp (SAP Client)

Usecase:
1) Connect from MecApp.
2) Accept SAP connection on DUT.

Expected Behaviour:
Notification popup for SAP connected should be displayed on UI
which provide option for user to disconnect SAP connection.

Observed Behaviour:
Notification popup for SAP connected is not displayed on UI so user
is not able to initiate disconnection from SAP server.

Root cause:
In Android O, notifications are hidden by default.
This must be changed to use notification channels so that the
priority of the notifications can be updated.

Fix:
Add notification channel before building notification from SAP.

Test: Checked if now notification for SAP connect can be seen in
notification bar when SAP is connected allowing user to disconnect.

Bug: 38331825
Change-Id: I67b0a3fd7f1df857c6288150edbef80d4a953490
(cherry picked from commit c5c434b205948c7bf6bea50fc55521904c896ce6)
ap/SapServer.java
303c1c67dbc142822bc37e7c5a89fba82faf2ac0 16-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: increase log info density

AVRCP has a lot of log messages that have little to no info.
Particularly with carkits that poll for data all the time, this makes it hard
to debug anything.

Remove logs where there's no info, add info where it's available with the goal
of making every log message useful.

Remove variables that we don't use anymore.

Print Now Playing Queue data on the dumpsys and when we report it
back to the controller.

Test: connect to a carkit and grab a bugreport
Bug: 37707672
Bug: 36802046
Bug: 38264897
Change-Id: I4fcb5a1c625c2d212685b4df04a0ac42df3d7841
(cherry picked from commit e5384f02ec837a8f274ed59548cb6879849239f5)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
3217a9509440f3ccd1fa935f01d0a5b275e764fa 19-May-2017 Ajay Panicker <apanicke@google.com> Merge "Track BLE Scanning statistics by UID instead of by package name" into oc-dev
am: 5bdc2bfcdf

Change-Id: I6b3ccd12a644b4c830cee6feba2dfca1c2f3f99c
5bdc2bfcdf1dfd0a76c242468fc78f48d0c79771 19-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Track BLE Scanning statistics by UID instead of by package name" into oc-dev
78f2de0dee3204fef83a710d01cfde608cf5d197 19-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: increase log info density" am: 1688255f05 am: 32c7b9d874
am: 3da8cd0161

Change-Id: I74b549dc7e545705287da06795c9a0db5984fe5a
0533d66ae0a334789c197cde425d3ad87a84dd7d 17-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: send track changed if queue id is the same

Since metadata lags behind queue id changes, we need to send another
track changed to present the correct media metadata to the controller.

Test: connect to carkit and next track a few times
Bug: 37707672
Change-Id: Ifc6f3219dbffb078e4de247c67083bdbc29c52bc
(cherry picked from commit 89cbf5bfe48e75aee016ffbc7824353ff9ce242e)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
e5384f02ec837a8f274ed59548cb6879849239f5 16-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: increase log info density

AVRCP has a lot of log messages that have little to no info.
Particularly with carkits that poll for data all the time, this makes it hard
to debug anything.

Remove logs where there's no info, add info where it's available with the goal
of making every log message useful.

Remove variables that we don't use anymore.

Print Now Playing Queue data on the dumpsys and when we report it
back to the controller.

Test: connect to a carkit and grab a bugreport
Bug: 37707672
Bug: 36802046
Bug: 38264897
Change-Id: I4fcb5a1c625c2d212685b4df04a0ac42df3d7841
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
51d1c495c84be47b53db4d6b0b76b9e1cf1c7c31 19-May-2017 Andre Eisenbach <eisenbach@google.com> Merge "AVRCP: send track changed if queue id is the same" am: cba622c859 am: dd7912ba7a
am: f798424a9b

Change-Id: I668941829ad3e83b5c3d6ade68c29718980b6886
c1267074b7df0d6e42cefea0ac40b584fdb1430f 17-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: send track changed if queue id is the same

Since metadata lags behind queue id changes, we need to send another
track changed to present the correct media metadata to the controller.

Test: connect to carkit and next track a few times
Bug: 37707672
Change-Id: Ifc6f3219dbffb078e4de247c67083bdbc29c52bc
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
076da58dd34f33ea27edf905216493fa69c34cf7 18-May-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "AVRCP: Fix returned attributes for Genre/Play Time" am: beaec3e8a5 am: 25cc80d517
am: bfb007cd17

Change-Id: Iffa7a60ec055dcb46035c6795b22fb30b96bd787
d4f3f444bc09eaa0b447557900f2d9d82ef44e1c 15-May-2017 Ajay Panicker <apanicke@google.com> Track BLE Scanning statistics by UID instead of by package name

Bug: 38315257
Test: cts-tradefed run cts-dev -m CtsIncidentHostTestCases -t com.android.server.cts.BatteryStatsValidationTest
Change-Id: I8a705f6f8169bf074a0eacc39c015bb1af04207d
att/ContextMap.java
cb13e7c56b13582e976e396e69ec5a7a203d7c9c 17-May-2017 Hemant Gupta <hemantg@codeaurora.org> AVRCP: Fix returned attributes for Genre/Play Time

Usecase:

1) Connect DUT with remote device supporting AVRCP 1.4
2) Send request to retrieve genre or play time attributes.

Observation:
DUT returns incorrect attribute id

Root cause:
Missing break in code leading to corruption of values of attributes returned.

Fix:
Add break statement missing in code.

Test: Checked that genre and play time attributes are returned correctly by DUT.

Bug: 38372332
Change-Id: I0ec2f3b8bfc6668819a207046ceb65659037b368
vrcp/BrowsedMediaPlayer.java
1c642dde8f18beeebbeacaf663fb9d70aa7dc7b8 16-May-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Discover primary service by UUID for PTS tests (3/4)" am: 77bb5f0924 am: 543193e1bd
am: f816a4d8bd

Change-Id: Ia543419909e3fac09df6c08bcdb9f28acf79678d
55995e8f4bc667358f3106a18f0722f137c734bc 16-May-2017 Jakub Pawlowski <jpawlowski@google.com> Discover primary service by UUID for PTS tests (3/4)

Bug: 38123054
Test: manual
Change-Id: I1547f1dbd46e2d5e9a4e2b953b9973fb3f52a7d7
(cherry picked from commit 84685c0e90fc8ad9453157d6f2b6454974d594e8)
att/GattService.java
77bb5f0924034f9124e11e0d074ec731293b48c4 16-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Discover primary service by UUID for PTS tests (3/4)"
84685c0e90fc8ad9453157d6f2b6454974d594e8 16-May-2017 Jakub Pawlowski <jpawlowski@google.com> Discover primary service by UUID for PTS tests (3/4)

Bug: 38123054
Test: manual
Change-Id: I1547f1dbd46e2d5e9a4e2b953b9973fb3f52a7d7
att/GattService.java
214b7f0b959e2fb3474d43f99136c83e4e11c843 12-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix concurrency issues with MediaController

Some callbacks could null the MediaController when we are updating it -
only update in one place and synchronize.

Test: change players while player removes
Bug: 38228028
Change-Id: I4c5f7e9d51cddabeb7f3e48da58f89202f7362e4
(cherry picked from commit f6521ba818df22d8a853d25f7c6adc1e724875e6)
vrcp/Avrcp.java
e2f3f7e9c19c3ec600608e06920c1a0d1936bc09 13-May-2017 Ajay Panicker <apanicke@google.com> Add scan result tracking to battery stats
am: 8dc1ac7b01

Change-Id: I6215430d5821e22de8f04ebbc7a3a69c3890e91c
67fdfe890ead88e584eb9beae5c84926893867b0 12-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Fix concurrency issues with MediaController" am: fa3d29eb23 am: 5f6f8329b3
am: 5288f0db9f

Change-Id: I9adc349141ff0068ca5ae280333a3b4e2f900e6b
8dc1ac7b011ff262830a0a28f66ae53fe5f63f74 09-May-2017 Ajay Panicker <apanicke@google.com> Add scan result tracking to battery stats

Bug: 37720787
Test: View volta stats and check for results
Change-Id: I92f116686fe394b4205fc684fd4872bbc88766a5
att/AppScanStats.java
f6521ba818df22d8a853d25f7c6adc1e724875e6 12-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix concurrency issues with MediaController

Some callbacks could null the MediaController when we are updating it -
only update in one place and synchronize.

Test: change players while player removes
Bug: 38228028
Change-Id: I4c5f7e9d51cddabeb7f3e48da58f89202f7362e4
vrcp/Avrcp.java
b53db85ac64743580dee8bf31bf0ba3c4eab0c67 08-May-2017 Ajay Panicker <apanicke@google.com> Remove delay received from audio layer for A2DP state changes

Due to changes in the audio layer, the
setBluetoothA2dpDeviceConnectionState() function now returns a
delay of 0 on a state change from disconnecting to disconnected.
After a discussion with the audio team, the delay returned by
this function isn't actually relevant to the A2DP state machine
so instead remove the dependency on the delay returned.

Bug: 37906688
Test: Disconnect from headset multiple times and see that it is
not stuck disconnecting.

Change-Id: I108cc5230a571edbd26fcb1f985a0b14cb7123b6
(cherry picked from commit 895d2fc990ef39441731af44b3603355ddb05a46)
2dp/A2dpStateMachine.java
de5340b6cbe5e8bd62658131e87c551d0fc7a182 05-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Add PlaybackState for Track Changed

MediaController.getMetadata() updates out of sync with
MediaController.getPlaybackState(), causing issues because we use
PlaybackState.getCurrentQueueId() to sent track IDs to AVRCP CT.

Add getCurrentQueueId() as an indicator of track changes.

Remove counting how many tracks have played since it's inaccurate.

Test: connect to carkit, skip tracks, metadata is updating correctly
Bug: 37707672
Change-Id: I5d190933b847622ec858eab38828902cf798f8e1
(cherry picked from commit 29174eb9ad6e255d7ec216ab9a2ce8d20e2fe13c)
vrcp/Avrcp.java
ff987e8b9bf6639a922eb94d6d27a760c854c640 11-May-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "PBAP: Convert notifications to use NotificationChannel" into oc-dev
am: a7beda7b5c

Change-Id: I682737aafb20701087aca05b09693a206e863abf
7fb58ed02d290cf9f9919500378daceb62c1b3e9 11-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Add PlaybackState for Track Changed" am: 5d52214c70 am: 64242edd98
am: 6de3f98f7a

Change-Id: I143e5d7fff3939c70200ab2b4a16579bf2e06427
5d52214c702637c6a50b39f3c0c6c92c67c9d250 11-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "AVRCP: Add PlaybackState for Track Changed"
75ddeb7d0efdaac8407af59d1df1d79ac653c895 11-May-2017 Ajay Panicker <apanicke@google.com> Merge "Remove delay received from audio layer for A2DP state changes" am: fa31e9b594 am: 2959cd2704
am: 3ec66a3406

Change-Id: I9fed9792bab69879e9969bce7e88897094491dcc
a7beda7b5cb38e757c4daf42996119b7c790cc35 11-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Convert notifications to use NotificationChannel" into oc-dev
fa31e9b594829778ba928aaee8b84c7b65941305 11-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Remove delay received from audio layer for A2DP state changes"
66bddc8b8127d543aaa45841a16c427f3bce2515 11-May-2017 Andre Eisenbach <eisenbach@google.com> Merge "HID: Add support for Set Idle and Get Idle commands (4/4)" am: 8c4a05db3d am: a1f35eb0ed
am: ca7577e7c4

Change-Id: I650858c02bbe4ec84a02a49267d6fc3f065108aa
29174eb9ad6e255d7ec216ab9a2ce8d20e2fe13c 05-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Add PlaybackState for Track Changed

MediaController.getMetadata() updates out of sync with
MediaController.getPlaybackState(), causing issues because we use
PlaybackState.getCurrentQueueId() to sent track IDs to AVRCP CT.

Add getCurrentQueueId() as an indicator of track changes.

Remove counting how many tracks have played since it's inaccurate.

Test: connect to carkit, skip tracks, metadata is updating correctly
Bug: 37707672
Change-Id: I5d190933b847622ec858eab38828902cf798f8e1
vrcp/Avrcp.java
7bef8bee875ed0b3af41d868ef560a24f6866d6d 14-Jul-2014 Hemant Gupta <hemantg@codeaurora.org> HID: Add support for Set Idle and Get Idle commands (4/4)

Provides an interface for application to send Set Idle
and Get Idle commands to remote HID Device. Support for these
two commands was missing from existing code, so existing code
design is reused to add support for these two commands.

Without this support following mandatory PTS test cases for HID 1.0
cannot be passed, TC_HOS_HID_BV_05/06

Test: Executed PTS tests TC_HOS_HID_BV_05/06 and confirmed if they can
pass

Bug: 34344715
Change-Id: I066d47c022905a39c11d365a9d26d128f94fe2f6
id/HidService.java
895d2fc990ef39441731af44b3603355ddb05a46 08-May-2017 Ajay Panicker <apanicke@google.com> Remove delay received from audio layer for A2DP state changes

Due to changes in the audio layer, the
setBluetoothA2dpDeviceConnectionState() function now returns a
delay of 0 on a state change from disconnecting to disconnected.
After a discussion with the audio team, the delay returned by
this function isn't actually relevant to the A2DP state machine
so instead remove the dependency on the delay returned.

Bug: 37906688
Test: Disconnect from headset multiple times and see that it is
not stuck disconnecting.

Change-Id: I108cc5230a571edbd26fcb1f985a0b14cb7123b6
2dp/A2dpStateMachine.java
557b7d5218c907beaac2d7e28807dd4752db5f18 08-May-2017 Hemant Gupta <hemantg@codeaurora.org> PBAP: Convert notifications to use NotificationChannel

Test Setup:
===========
HW DUT: Pixel O
Remote1: MecApp PBAP Client

Steps:
=====
1. Enable BT on DUT and bond with Remote.
2. Connect from MecApp PBAP Client Tab and observe.(Request
Authentication checkbox enabled in MecApp).

Expected Result:
================
Device should connect successfully.

Actual Result:
===========
In Step2, "The remote PBAP server did not accept the connect request error
popup is displayed."

Reproducibility:
===========
5/5

Log trace:
Line 6855: 05-08 14:04:23.453 10051 11015 D BluetoothPbapService:
Pbap state 0 -> 2, result = 1
Line 6868: 05-08 14:04:23.465 1615 1751 E NotificationService:
Cannot post notification
without channel ID when targeting O - notification=Notification
(pri=0 contentView=null vibrate=null
sound=default tick defaults=0x1 flags=0x18 color=0xff607d8b vis=PRIVATE)
Line 6947: 05-08 14:04:33.471 10051 10051 W BluetoothPbapService:
Release Wake Lock
Line 7155: 05-08 14:04:53.491 10051 11492 D BluetoothPbapObexServer:
onClose(): msg MSG_SERVERSESSION_CLOSE sent out.
Line 7172: 05-08 14:04:53.509 10051 10051 D BluetoothPbapService:
Pbap state 2 -> 0, result = 1

Root Cause:
In Android O, Bluetooth notifications are hidden by default.
This must be changed to use notification channels so that the
priority of the notifications can be updated.

Test: PBAP connection works fine when remote sends authentication
challenge.

Bug: 38149308
Change-Id: Ifff0a81912f1bf11edc73279a9a127b791188d02
bap/BluetoothPbapService.java
8f9506100817b3fda7a4c4fc250deefc96a1c084 10-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Prevent concurrent access of Browser List" am: 00eda682e1 am: 02094d6ec1
am: c55521b79c

Change-Id: Ifa74ee2cffbcfc6a9a455a754f962aad100189ea
241af80129d66d60eea6e77e8962b7123e1c61c5 02-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Prevent concurrent access of Browser List

Concurrent access to mBrowsePlayerInfoList could happen still.

Test: none - concurrently change sessions and add a player?
Change-Id: Ibb2e1010eb1326387c04dae4ab2413d6aa3b2034
Bug: 37896665
(cherry picked from commit 5146bd27869df5473aa53e6271266f51733971ef)
vrcp/Avrcp.java
5146bd27869df5473aa53e6271266f51733971ef 02-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Prevent concurrent access of Browser List

Concurrent access to mBrowsePlayerInfoList could happen still.

Test: none - concurrently change sessions and add a player?
Change-Id: Ibb2e1010eb1326387c04dae4ab2413d6aa3b2034
Bug: 37896665
vrcp/Avrcp.java
d088653f84737b2216dda32384486430881662a2 28-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Stop MediaBrowser attempts on shutdown

Once we start our atttempts to connect to MediaBrowsers, we can get a
signal to shut down which means we could connect to a MediaBrowser and
then never disconnect, leaking a service connection.

Test: rapid on-off of the Bluetooth in settings
Change-Id: I0364b387f9b2e4ca1f65d122060ed4c153b9d70d
Fixes: 37634554
(cherry picked from commit be66a1bf5584a2a7985666ab20c5e9b54053e17d)
vrcp/Avrcp.java
e4daa593dd24459fe4aab92c7c5400a694a9b121 09-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Stop MediaBrowser attempts on shutdown" am: d7b3a52a92 am: bb136f2814
am: 423ad3d7d4

Change-Id: I4257483c6c2a41bfab228b4c9e9d1f6daac0d3fe
78387a7039c973ed7b19809f6f7fa01361a9d6c4 09-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Move Bluetooth battery stats tracking (2/2)"
d7b3a52a922104eae11d6f8d0154b6b527388b87 09-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Stop MediaBrowser attempts on shutdown"
dc0ce7e118f2ea8e7e9cf8c461a25bf4df1ceb15 09-May-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "PBAP: Update intent parameters for connection." am: 75b7ef2a0b am: 59160d0b7a
am: 73b74563c0

Change-Id: Ic2eddbe4f8844a97af912bf1dc7be6080604a71d
94e5a24c73e66e3dafd073c7a97904b1c071a787 04-Nov-2015 Hemant Gupta <hemantg@codeaurora.org> PBAP: Update intent parameters for connection.

Update the intent parameters to use generic profile flags
so that same can be retrieved by Application like all other profiles
connection change with same handler.

Test: PBAP connection state change intent successfully received by upper
layers.

Bug: 35020479
Change-Id: I1ccb291c13b7f033c8cf8b86482391673775efbf
bap/BluetoothPbapService.java
be66a1bf5584a2a7985666ab20c5e9b54053e17d 28-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Stop MediaBrowser attempts on shutdown

Once we start our atttempts to connect to MediaBrowsers, we can get a
signal to shut down which means we could connect to a MediaBrowser and
then never disconnect, leaking a service connection.

Test: rapid on-off of the Bluetooth in settings
Change-Id: I0364b387f9b2e4ca1f65d122060ed4c153b9d70d
Fixes: 37634554
vrcp/Avrcp.java
579be982d9d3ffa93c38fe27589db8eae80d1d34 04-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix crash when app change during shutdown

If you turned off Bluetooth and then immediately changed the app that
media keys went to, a NPE could be generated.

Test: shutdown bt then quick-switch to telecom immediately
Change-Id: Ifbca7446d94aa411b642b42131f603c8f9d1c31e
Bug: 37865933
(cherry picked from commit 7c7cc128e93e7e1db8a5ed7f69583ddc6d99493e)
vrcp/Avrcp.java
8e68fb0428b6c4e6ad3aa5aadbb9815e05f723ce 03-May-2017 Ajay Panicker <apanicke@google.com> Move Bluetooth battery stats tracking (2/2)

Move Bluetooth battery stats tracking to AppScanStats for a more
unified tracking system.

Bug: 37720787
Test: cts-tradefed run cts-dev -m CtsIncidentHostTestCases -t com.android.server.cts.BatteryStatsValidationTest#testBleScans
Perform BLE scan and check battery stats
Change-Id: I6129a83d275c7d72edc6abfc5cc72641adde8767
att/AppScanStats.java
att/ContextMap.java
att/GattService.java
att/ScanClient.java
att/ScanManager.java
553a7fbb8a15d007138ffc82385f3f3474bc51bd 06-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Fix crash when app change during shutdown" am: abc3d7eb7e am: 80160a9af0
am: 251ba13f57

Change-Id: I6104c0a219fbf60c760f2128844b18669a42e2dd
7c7cc128e93e7e1db8a5ed7f69583ddc6d99493e 04-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix crash when app change during shutdown

If you turned off Bluetooth and then immediately changed the app that
media keys went to, a NPE could be generated.

Test: shutdown bt then quick-switch to telecom immediately
Change-Id: Ifbca7446d94aa411b642b42131f603c8f9d1c31e
Bug: 37865933
vrcp/Avrcp.java
072dc4dab1a04d0ed21af1f576cd7f1606d83d09 05-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: set addressed player on key dispatch" am: ec6957edd2 am: 68591cf8ba
am: 129586577c

Change-Id: I22cc073e82ff9326aad123070911b55d9680c372
0c3b4f4f77175b72061b356a54e2febaf1f19a6a 05-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: set addressed player on key dispatch

MediaSessionManager.Callback.onAddressedPlayerChanged isn't being called
consistently when the package that receives media keys changes.

This affects media metadata showing up because the addressed player
controls the mMediaController.

Update the addressed player for every media key press as a workaround.

Adjust logging to reduce logspam.

Test: connect to carkit, play from GPM then switch to Youtube.
Bug: 37789858
Bug: 34471252
Bug: 37998705
Bug: 37865298
Change-Id: Ic94bb97d51f48f9799edfca0d5f9a9b2872b0132
(cherry picked from commit 78d53f7d7133cb5a32e1160e1c1a23f2e8174978)
vrcp/Avrcp.java
78d53f7d7133cb5a32e1160e1c1a23f2e8174978 05-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: set addressed player on key dispatch

MediaSessionManager.Callback.onAddressedPlayerChanged isn't being called
consistently when the package that receives media keys changes.

This affects media metadata showing up because the addressed player
controls the mMediaController.

Update the addressed player for every media key press as a workaround.

Adjust logging to reduce logspam.

Test: connect to carkit, play from GPM then switch to Youtube.
Bug: 37789858
Bug: 34471252
Bug: 37998705
Bug: 37865298
Change-Id: Ic94bb97d51f48f9799edfca0d5f9a9b2872b0132
vrcp/Avrcp.java
25ecc977c0ff464fd9643c29967e6011383e8e47 05-May-2017 Ajay Panicker <apanicke@google.com> Move Bluetooth battery stats tracking (2/2)
am: edbc90eb91

Change-Id: I9276e0ca1e20eb429a7e7f8433b47cb6d0a062ec
edbc90eb917a8a509d2d03fb304763b768ec5517 03-May-2017 Ajay Panicker <apanicke@google.com> Move Bluetooth battery stats tracking (2/2)

Move Bluetooth battery stats tracking to AppScanStats for a more
unified tracking system.

Bug: 37720787
Test: cts-tradefed run cts-dev -m CtsIncidentHostTestCases -t com.android.server.cts.BatteryStatsValidationTest#testBleScans
Perform BLE scan and check battery stats
Change-Id: I6129a83d275c7d72edc6abfc5cc72641adde8767
att/AppScanStats.java
att/ContextMap.java
att/GattService.java
att/ScanClient.java
att/ScanManager.java
37b87504071b66b874d503d930f456149570f21a 05-May-2017 Ajay Panicker <apanicke@google.com> Merge "Limit btsnoop file size (2/9)" into oc-dev
9c2305404ac5caf31dbb6303b3dc44419efdb222 04-May-2017 Jakub Pawlowski <jpawlowski@google.com> Increase device name limit in the LE advertisement

The advertise data refactor:
https://android-review.git.corp.google.com/#/q/topic:btif-ad-data-refactor
introduced a change in behaviour. Previously, the device name was
included in full, or truncated if the device name was longer than the
advertisement. After the patch, name longer than 18 chars are truncated.

Increase the allowed device name length to 26 - the maximum size it can
get for legacy connectable advertisement.

Bug: 37870615
Test: none
Change-Id: I3464ffae32e73cefa10142c2f0509d9139475ddd
(cherry picked from commit c36b2ae522ab9bf7827cfca8f6cbb8efeaf2b8fa)
att/AdvertiseHelper.java
2f71318cb054f98241ebeda6714a4d8d810d7603 04-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Fix NPE in removeMediaController" into oc-dev
eff4e3489b837460eab0acd091ced6c898b3fd71 04-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Fix NPE in removeMediaController" am: f99ae558de am: 33840f6177
am: bb851967ca

Change-Id: I8bee5eba9dc3687c8dd62f0a1f65aad780a4adce
2633df43195c9c45bbf3576ab659a0f62196ea4d 04-May-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Increase device name limit in the LE advertisement" am: 44e69a5061 am: 3d09368e1a
am: 9881523e5c

Change-Id: If12456e895ff87c01c00c975340e7c17a57f596e
f99ae558dea2c4debbbe9ed13c906139120b451d 04-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "AVRCP: Fix NPE in removeMediaController"
07331cbd302f65c1cc72be3f7f20004127cdd1fb 03-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Launch player when selected and not running

When a carkit selects a player, start it if we don't have a session
running, instead of trying to start it's browsing service instead.

Test: select browsable player as active player from carkit
Change-Id: I50a5817daf9e9a666871f01c22ffbe7fedb15ec1
Bug: 37919422
(cherry picked from commit eb3c55797d3ba16916327effa6b36acec5f1de36)
vrcp/Avrcp.java
c721162e8198dbc1b4b3ec9d87beb083ba704307 04-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix NPE in removeMediaController

Test: make a SIP call, hang up.
Bug: 37976254
Change-Id: I975163aa85dc77f108d89064bbe6eadf682d3123
(cherry picked from commit a1e42e29b15323e1a4d0559235a0987200663b2f)
vrcp/Avrcp.java
a1e42e29b15323e1a4d0559235a0987200663b2f 04-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix NPE in removeMediaController

Test: make a SIP call, hang up.
Bug: 37976254
Change-Id: I975163aa85dc77f108d89064bbe6eadf682d3123
vrcp/Avrcp.java
c36b2ae522ab9bf7827cfca8f6cbb8efeaf2b8fa 04-May-2017 Jakub Pawlowski <jpawlowski@google.com> Increase device name limit in the LE advertisement

The advertise data refactor:
https://android-review.git.corp.google.com/#/q/topic:btif-ad-data-refactor
introduced a change in behaviour. Previously, the device name was
included in full, or truncated if the device name was longer than the
advertisement. After the patch, name longer than 18 chars are truncated.

Increase the allowed device name length to 26 - the maximum size it can
get for legacy connectable advertisement.

Bug: 37870615
Test: none
Change-Id: I3464ffae32e73cefa10142c2f0509d9139475ddd
att/AdvertiseHelper.java
9a023a5393be6839282317d421e6186b1c3501e3 04-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Launch player when selected and not running" am: 0ef20e70da am: 050ea8c49c
am: f516f01d6e

Change-Id: Ibade3efb0f95755f6939effc56dc8f8b3d437533
b5abf887db7cd7492899eb53058ab1bbbb7918c0 04-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AVRCP: Track players without active media sessions" into oc-dev
55f755e7ae3c33ee294035e62f144ba5f75ff2dd 04-May-2017 Antony Sargent <asargent@google.com> Merge "Add persistent state for Bluetooth high quality audio support" into oc-dev
am: bdb553b836

Change-Id: Iadeb5942225414405b1aea5a4269b876935c7af6
eb3c55797d3ba16916327effa6b36acec5f1de36 03-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Launch player when selected and not running

When a carkit selects a player, start it if we don't have a session
running, instead of trying to start it's browsing service instead.

Test: select browsable player as active player from carkit
Change-Id: I50a5817daf9e9a666871f01c22ffbe7fedb15ec1
Bug: 37919422
vrcp/Avrcp.java
bdb553b83619e54dec3e386403cfb50293f6eb22 04-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add persistent state for Bluetooth high quality audio support" into oc-dev
95b4cb48392010386c63b943cbdb814679ed0b0a 04-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Track players without active media sessions" am: a7fe0f9887 am: 11efff99f8
am: b0b80abbbf

Change-Id: I888ef21fa9c0c5225bdd4b6bd041ee18732ce342
d89304c6be6e1c332008dcbeab08889881064454 03-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Track players without active media sessions

Players can be selected as addressed by MediaSessionService, then
destroy and renew their MediaSession. We want them to continue to
be addressed.

Don't remove players that destroy their MediaSession, and just forget
the controller instead.

Remove players when their package is removed though.

Report "(unknown)" when we are asked for media info for an addressed
player that has no controller.

Fix a bug where we didn't send updated metadata when it changed.
Fix an ordering bug updating the media session.

Make logging more clear when we're adding / updating / removing players.
Add dumpsys log to confirm current mMediaController is correct.

Use @Nullable and @NonNull to help with distinguishing when
MediaController can be null in AddressedMediaPlayer.

Test: send pause / play from headset, look at bugreport to confirm
Change-Id: I083745f8988e67776716db2bec5e67b697e8ee67
Bug: 36357185
Fixes: 37865298
(cherry picked from commit 384011244f5a62ed34f198b8ba91341b4efb4fb6)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/mockable/MediaController.java
384011244f5a62ed34f198b8ba91341b4efb4fb6 03-May-2017 Marie Janssen <jamuraa@google.com> AVRCP: Track players without active media sessions

Players can be selected as addressed by MediaSessionService, then
destroy and renew their MediaSession. We want them to continue to
be addressed.

Don't remove players that destroy their MediaSession, and just forget
the controller instead.

Remove players when their package is removed though.

Report "(unknown)" when we are asked for media info for an addressed
player that has no controller.

Fix a bug where we didn't send updated metadata when it changed.
Fix an ordering bug updating the media session.

Make logging more clear when we're adding / updating / removing players.
Add dumpsys log to confirm current mMediaController is correct.

Use @Nullable and @NonNull to help with distinguishing when
MediaController can be null in AddressedMediaPlayer.

Test: send pause / play from headset, look at bugreport to confirm
Change-Id: I083745f8988e67776716db2bec5e67b697e8ee67
Bug: 36357185
Fixes: 37865298
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/mockable/MediaController.java
20155af8008337cb70ea0556472854abf46ca1eb 27-Apr-2017 Antony Sargent <asargent@google.com> Add persistent state for Bluetooth high quality audio support

This CL implements the storage/retrieval of flags for whether Bluetooth
A2DP sink devices support optional codecs and if they should be turned
on when that device is connected. It also contains code to listen for
device connections and do two things: (1) save whether that device
supports optional codecs, and (2) either enable or disable those codecs
for playback if we had a stored preference for the device.

Bug=37441685
Test: manually

Change-Id: I5f3113342d53aeeb9ede68602da8c7ff8c853457
2dp/A2dpService.java
ecb3f00c5c34c3517a3caad75f051f9e0ff0cf28 02-May-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: fix crash on callback with no player" am: 01cffb24be am: 89d577726c
am: 201ef8d9db

Change-Id: I23b72ce5c888835e2c99d7cd9921178fcf835598
1107f9516bf8866640247044deb9f780bb89e55c 28-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: fix crash on callback with no player

If MediaSessionService tells us there's no place for keys to go, then we
have no player.

Test: disable com.google.music, reboot
Change-Id: I2adf884f9db991975cd0ae72abf2238ce323c517
Fixes: 37681487
(cherry picked from commit 41527b2493a4ea59933c7cd4f8d1c761598509d8)
vrcp/Avrcp.java
41527b2493a4ea59933c7cd4f8d1c761598509d8 28-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: fix crash on callback with no player

If MediaSessionService tells us there's no place for keys to go, then we
have no player.

Test: disable com.google.music, reboot
Change-Id: I2adf884f9db991975cd0ae72abf2238ce323c517
Fixes: 37681487
vrcp/Avrcp.java
ee0e5e79e0ed6bd4a4b7dac33ac8aad90296d8b8 28-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Merge changes from topic 'bt5-cherry-pickerry-3' into oc-dev

* changes:
Expose LE advertiser address for easier PTS tests (2/6)
Read by UUID for PTS tests (2/5)
b97ba18524d97ebaef86773384d79f0e9ef7f0fb 27-Apr-2017 Andre Eisenbach <eisenbach@google.com> Merge "AVRCP: update metadata and state more consistently" am: fd8536160d am: a7e610b924
am: 6aa1c9faf1

Change-Id: I308978fa90cf0023349f54cc6ced6d760c18b65f
90d55ae85dc19e33fffe1e51787df2b8dd40c230 18-Apr-2017 Ajay Panicker <apanicke@google.com> Limit btsnoop file size (2/9)

Limit btsnoop file size by rotating between snoop files. The rotation occurrs
when a fixed number of packets have been logged and will start overwriting
the older file.

Bug: 35998031
Test: Enable snoop logs from developer options and let logs get large
Merged-In: Idf4dd2ee10d8b8aecf1066115fbb6a53ce8ea04a
Change-Id: Idf4dd2ee10d8b8aecf1066115fbb6a53ce8ea04a
tservice/AdapterService.java
404085904278dc4085f19e25db8324e9b7beaef5 27-Apr-2017 Andre Eisenbach <eisenbach@google.com> Merge "AVRCP: Gracefully handle missing item attributes" am: b69828dfc9 am: 8de45bd357
am: 8b0620404e

Change-Id: Ia7bb4433bf11bf56a523c97472b7572c97738656
93f177151f5b96ce3e06888884da3cd7f7858ecf 25-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: update metadata and state more consistently

When we get onMetadata it's not updated quite right, and the
PlaybackState gives the wrong answer for getActiveQueueItemId, which
means that we don't send the correct updated data. Update the metadata
when we get a onPlaybackStateChanged as well, so we refresh the
metadata and notify correctly for EVENT_TRACK_CHANGED.

Keep track of the last queue item we sent and don't send an update if
the queue item has not changed.

Use A2DP streaming state only when we don't have strong signals from
Media framework.

Use PlaybackState.getLastPositionUpdateTime() instead of trying to
figure it out on our own.

Trust MediaAttributes with the track length instead of duplicating it.

Test: connect to BMW kit and skip some tracks, new data will show up
correctly
Bug: 37209435
Bug: 36016671
Bug: 36357185
Bug: 36055995
Change-Id: I332aaadeabcfe8284084a34c964e5f0d07bfeef4

(cherry picked from commit 0a429916782c20980e7f0893c503c633b8341f88)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
0a429916782c20980e7f0893c503c633b8341f88 25-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: update metadata and state more consistently

When we get onMetadata it's not updated quite right, and the
PlaybackState gives the wrong answer for getActiveQueueItemId, which
means that we don't send the correct updated data. Update the metadata
when we get a onPlaybackStateChanged as well, so we refresh the
metadata and notify correctly for EVENT_TRACK_CHANGED.

Keep track of the last queue item we sent and don't send an update if
the queue item has not changed.

Use A2DP streaming state only when we don't have strong signals from
Media framework.

Use PlaybackState.getLastPositionUpdateTime() instead of trying to
figure it out on our own.

Trust MediaAttributes with the track length instead of duplicating it.

Test: connect to BMW kit and skip some tracks, new data will show up
correctly
Bug: 37209435
Bug: 36016671
Bug: 36357185
Bug: 36055995
Change-Id: I332aaadeabcfe8284084a34c964e5f0d07bfeef4
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
0f9c79e8afa3e575dfd8c80c2c58b9321e18898d 26-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Gracefully handle missing item attributes

The source of our metadata sometimes doesn't even give us basic title
information, which causes a NullPointerException when we try to fill the
Displayable Name.

Fill it with "<unknown>" when we don't know the data.

Add more useful debugging for GetFolderItems and GetItemAttributes.

Test: Tested with Audi and Porche car kit
Bug: 37657532
Bug: 37718715
Change-Id: I183f2b9c5714ebacabc8093de1c2bc166e323fae
(cherry picked from commit 89728a4d50001ac76d05efa1c916711ef9f9c2b4)
tils.java
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcp/BrowsedMediaPlayer.java
89728a4d50001ac76d05efa1c916711ef9f9c2b4 26-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Gracefully handle missing item attributes

The source of our metadata sometimes doesn't even give us basic title
information, which causes a NullPointerException when we try to fill the
Displayable Name.

Fill it with "<unknown>" when we don't know the data.

Add more useful debugging for GetFolderItems and GetItemAttributes.

Test: Tested with Audi and Porche car kit
Bug: 37657532
Bug: 37718715
Change-Id: I183f2b9c5714ebacabc8093de1c2bc166e323fae
tils.java
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcp/BrowsedMediaPlayer.java
00129680f9863701255425567f408e66ec84caf1 19-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Expose LE advertiser address for easier PTS tests (2/6)

This patchset adds a hidden method getOwnAddress, that lets app with
BLUETOOTH_PRIVILEGED permission to lear their own addreess. This is done
exclusively for PTS tests.

Bug: 35147497
Test: manual
Change-Id: I8da0128c1dac2995e488f1e0c48aa7d5fd399b4c
(cherry picked from commit f10e5516ed308be0493173fcd7982fb4f0a8cd0e)
att/AdvertiseManager.java
att/GattService.java
f2b309cfa9c602760e88f3dca60f813438a9726b 14-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Read by UUID for PTS tests (2/5)

Add a hidden api for reading characteristic by UUID for PTS.

Bug: 35150313
Test: sl4a GattReadTest.byUuid
Change-Id: I6ec848eac1ecfbd1a4ec2bc968faff8a082d9c79
(cherry picked from commit 5fc203008497b071dc583450a53c93e11dd561ff)
att/GattService.java
810d960162d74ba291a085ee2b11a37e7cbdace7 25-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: fix PlayItem NPE with no Addressed Player

Test: connect to audi, note no crashes
Change-Id: I584244c98b5afbc697b491886e4205f3af9083ca
Fixes: 37657913
(cherry picked from commit db2d487ba559f0e4de02bc2ad4cc7e275878b2fc)
vrcp/Avrcp.java
c6699acd010ddaf046dae92bec61707bd77fb667 27-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "A2DP sink audio focus" into oc-dev
25a60cf9d1fc17379e6c1ca91639c88fe4322059 27-Apr-2017 Ajay Panicker <apanicke@google.com> Merge "Limit btsnoop file size (2/8)" am: 68592ced64 am: d679d463b2
am: e2ee86f710

Change-Id: I9cf4121969526625d54545ca8f6a0eeb3a449097
68592ced642140c1c3bd6c681dd2b2cb26539a26 27-Apr-2017 Ajay Panicker <apanicke@google.com> Merge "Limit btsnoop file size (2/8)"
7b35d90800e16ce78186c30bb37d4bddcc071e00 18-Apr-2017 Ajay Panicker <apanicke@google.com> Limit btsnoop file size (2/8)

Limit btsnoop file size by rotating between snoop files. The rotation occurrs
when a fixed number of packets have been logged and will start overwriting
the older file.

Bug: 35998031
Test: Enable snoop logs from developer options and let logs get large
Merged-In: Idf4dd2ee10d8b8aecf1066115fbb6a53ce8ea04a
Change-Id: Idf4dd2ee10d8b8aecf1066115fbb6a53ce8ea04a
tservice/AdapterService.java
2cf50c3c52daa9ada22711dccc847596c191dbf6 26-Apr-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: fix PlayItem NPE with no Addressed Player" am: c862d25559 am: 59d6c6afda
am: 09ddd1c203

Change-Id: Ie59e8e28ceb06f4912cf32734cf4a8ba155524cb
bf4ba692de57c0e7dd1c87474231135fbce9eb3e 26-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: synchronize with better granularity
am: 8cd453176a

Change-Id: Ic34af87aaf307aa1accecd14e1cb60cf33645c3b
db2d487ba559f0e4de02bc2ad4cc7e275878b2fc 25-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: fix PlayItem NPE with no Addressed Player

Test: connect to audi, note no crashes
Change-Id: I584244c98b5afbc697b491886e4205f3af9083ca
Fixes: 37657913
vrcp/Avrcp.java
511ebf9e8dfa9f39315de93ad9a5dcf72556676e 25-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: synchronize with better granularity

Make synchronization more granular by synchronizing on the objects
actually being used.

Fix missing synchronization on mMediaPlayerInfoList.

Test: basic smoke test with multiple players
Change-Id: Iec451dca2c51ec6f6f35a1d0a28f2c4dd52db722
Fixes: 37651901
vrcp/Avrcp.java
8cd453176a070f0627d64fc2f3e34b8258d2e9a7 25-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: synchronize with better granularity

Make synchronization more granular by synchronizing on the objects
actually being used.

Fix missing synchronization on mMediaPlayerInfoList.

Test: basic smoke test with multiple players
Change-Id: Iec451dca2c51ec6f6f35a1d0a28f2c4dd52db722
Fixes: 37651901
(cherry picked from commit a303cd6e430b887aa2c74fe585a323617d1837ab)
vrcp/Avrcp.java
b8bd002d207c8025cd298521d1ecd7515ac33b44 19-Apr-2017 Joseph Pirozzo <pirozzoj@google.com> A2DP sink audio focus

Resolved a bug where BT media fails to pause and subsequently resume during
a transient audio focus loss as is seen during voice recognition.
Resolved a bug where BT media may not resume after a phone call due to an
audio focus race condition.
Resolved a bug where BT phone notifications could interrupt and disrupt
an ongoing media session such as radio or local media player.

Bug: 34853256
Bug: 36529639
Bug: 37288772
Test: runtest bluetooth -c
com.android.bluetooth.a2dpsink.A2dpSinkStreamHandlerTest
Change-Id: I5261d24fd7bbe49bf61c48fdf2c9ae86934dcd3d

(cherry picked from commit 2938b62a0f172680d726a351b609e83c4b2e81f7)
2dpsink/A2dpSinkStateMachine.java
2dpsink/A2dpSinkStreamHandler.java
189938f036ebfcc479187c15c6be3cc670a3437a 25-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AVRCP: Fix getFolderItems with all items request" into oc-dev
145a9120ab84d2f51704802947371fd56a0ddf8a 25-Apr-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "A2DP sink audio focus" am: 61a64df261 am: e24f8ec09a
am: 4478cf6be8

Change-Id: Ib51afbc43d080768245f79ba5299c86fe296e042
61a64df2616e5e98cf9da1b9d5123a8ebfe1ba58 25-Apr-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "A2DP sink audio focus"
df73c0b1b3d100ce1be8c5132736347aaef27e32 25-Apr-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Pick a media player ASAP" am: e748bdd0bd am: fcfef12f47
am: 0694d81326

Change-Id: I61fcd783477fe0c238772a33694306f5d8e5cedb
a9d0c9d2d8120b38ce1e79245a1dcb3f753dde6b 25-Apr-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Fix getFolderItems with all items request" am: 4d3b060a93 am: 629f0ce645
am: b39e8f5069

Change-Id: Ided80d9770d91c7a709b42a782aed2a2b3a6bb2d
3fd48c3ffbb61bd971ce016b3b4caeef4d980cf5 22-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Pick a media player ASAP

Fix things to pick a "default media player" as soon as we can so that
connected devices have something to send media commands to. This is
also in line with the spec.

Previously we were not detecting when we didn't have a media player
selected and selecting one.

Test: boot with com.android.music and connect to carkit, check logs
Bug: 36016671
Change-Id: I89175a3d513635d7cf8b75f5010967b99d5490aa
vrcp/Avrcp.java
025568aec7a1e4bc32f00080d937f9b891d357b6 22-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Pick a media player ASAP

Fix things to pick a "default media player" as soon as we can so that
connected devices have something to send media commands to. This is
also in line with the spec.

Previously we were not detecting when we didn't have a media player
selected and selecting one.

Test: boot with com.android.music and connect to carkit, check logs
Bug: 36016671
Change-Id: I89175a3d513635d7cf8b75f5010967b99d5490aa
(cherry picked from commit 793470cef61d887cc26ce793e21e411733af8b38)
vrcp/Avrcp.java
19a05f008446506069b34265d57bcf421447e7e3 15-Feb-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix getFolderItems with all items request

start item and end item are uint32_t
0xFFFFFFFF is commonly used as an indicator for "all items" end value.

Using a jint (int32_t) doesn't work, use jlong instead.

Test: browse with audi kit
Bug: 35385700
Bug: 36645066
Change-Id: I364f70a8b985796a6bcc83148a4ecc368a0c0493
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcp/BrowsedMediaPlayer.java
2938b62a0f172680d726a351b609e83c4b2e81f7 19-Apr-2017 Joseph Pirozzo <pirozzoj@google.com> A2DP sink audio focus

Resolved a bug where BT media fails to pause and subsequently resume during
a transient audio focus loss as is seen during voice recognition.
Resolved a bug where BT media may not resume after a phone call due to an
audio focus race condition.
Resolved a bug where BT phone notifications could interrupt and disrupt
an ongoing media session such as radio or local media player.

Bug: 34853256
Bug: 36529639
Bug: 37288772
Test: runtest bluetooth -c
com.android.bluetooth.a2dpsink.A2dpSinkStreamHandlerTest
Change-Id: I5261d24fd7bbe49bf61c48fdf2c9ae86934dcd3d
2dpsink/A2dpSinkStateMachine.java
2dpsink/A2dpSinkStreamHandler.java
ce0f15c8598a1e570faf80bbc60e0568d2d20d45 15-Feb-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix getFolderItems with all items request

start item and end item are uint32_t
0xFFFFFFFF is commonly used as an indicator for "all items" end value.

Using a jint (int32_t) doesn't work, use jlong instead.

Test: browse with audi kit
Bug: 35385700
Bug: 36645066
Change-Id: I364f70a8b985796a6bcc83148a4ecc368a0c0493
(cherry picked from commit aabff2d74224e1d122a2ae767330a69b9324779e)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcp/BrowsedMediaPlayer.java
90005b32854f4ffd9d4f352aef91112702294a7e 22-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AdapterProperties: Track connection state change from more profiles" into oc-dev
8f8a60a3e49ebe15b170bac127d0d6a437bd3a8b 22-Apr-2017 Jack He <siyuanh@google.com> Merge "AdapterProperties: Track connection state change from more profiles" am: f309029bb1 am: bce7ad9ce1
am: f578d97efb

Change-Id: I738e5fe329f09028e61c1706632995ce36392759
122aff50aec1a1eb6cef8c94c84e33dae7194e31 21-Apr-2017 Jack He <siyuanh@google.com> AdapterProperties: Track connection state change from more profiles

* AdapterProperties should handle ACTION_CONNECTION_STATE_CHANGED intent
from more profiles
* AdapterProperties sends BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED
with STATE_CONNECTING and STATE_CONNECTED when first profile send out
the same intent, and with STATE_DISCONNECTING and STATE_DISCONNECTED
when last profile send out the same intent.
* At the same moment, AdapterProperties also update the return value for
BluetoothAdapter.getConnectionState()
* Currently, we are only tracking HEADSET (HFP), HEADSET_CLIENT (HFP), A2DP,
A2DP_SINK profiles, other profiles such as PAN, PBAP, HID profiles are
not tracked properly and their state change could be missed by
both intent users and BluetoothAdapter.getConnectionState()
* After this CL, the following profiles will be tracked:
AVRCP_CONTROLLER, A2DP, A2DP_SINK, HEADSET, HEADSET_CLIENT,
INPUT_HOST, INPUT_DEVICE, MAP, MAP_CLIENT, PAN, PBAP_CLIENT, SAP

Bug: 37546066
Test: make, test connect and disconnect each profiles
Change-Id: I2ef0e55f58e6f7891823137e2e4534e97a126c25
(cherry picked from commit cbdcb7e4fc76661793877f142f628864797cb970)
tservice/AdapterProperties.java
30ab34382e41956c87be2f1632249b2f8a4da577 18-Apr-2017 Stanley Tng <stng@google.com> Allow the Bluetooth MAC address to be updated asynchronously (1/3)

There are intermittent issues where either the returned Bluetooth
MAC address to Java framework is uninitialized or this address update
arrives too late. This fix will do 2 things:
(1) Returns error when MAC address is unavailable in the native code.
(2) Updates the MAC address later by adding a new broadcast event.

Test: Check address for these cases: factory reset, system reboot, and
Bluetooth re-enable.
Bug: 36709382

Change-Id: I6b71100c2c03c6f365f0dbc27d4e37c734145e30
(cherry picked from commit 6d5da5e7ffb69614706ca030bfe194a493b24e99)
tservice/AdapterProperties.java
cbdcb7e4fc76661793877f142f628864797cb970 21-Apr-2017 Jack He <siyuanh@google.com> AdapterProperties: Track connection state change from more profiles

* AdapterProperties should handle ACTION_CONNECTION_STATE_CHANGED intent
from more profiles
* AdapterProperties sends BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED
with STATE_CONNECTING and STATE_CONNECTED when first profile send out
the same intent, and with STATE_DISCONNECTING and STATE_DISCONNECTED
when last profile send out the same intent.
* At the same moment, AdapterProperties also update the return value for
BluetoothAdapter.getConnectionState()
* Currently, we are only tracking HEADSET (HFP), HEADSET_CLIENT (HFP), A2DP,
A2DP_SINK profiles, other profiles such as PAN, PBAP, HID profiles are
not tracked properly and their state change could be missed by
both intent users and BluetoothAdapter.getConnectionState()
* After this CL, the following profiles will be tracked:
AVRCP_CONTROLLER, A2DP, A2DP_SINK, HEADSET, HEADSET_CLIENT,
INPUT_HOST, INPUT_DEVICE, MAP, MAP_CLIENT, PAN, PBAP_CLIENT, SAP

Bug: 37546066
Test: make, test connect and disconnect each profiles
Change-Id: I2ef0e55f58e6f7891823137e2e4534e97a126c25
tservice/AdapterProperties.java
306810af645cd2e2964a5ecea6c14cf1e86affd1 21-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Log battery stats before ScanClient gets removed" into oc-dev
061700ec0ab744c5c909a00b7aabcdf768d04bd7 21-Apr-2017 Stanley Tng <stng@google.com> Merge "Allow the Bluetooth MAC address to be updated asynchronously (1/3)" am: c17a4d5e3f am: f21ec2c76b
am: e6234485b5

Change-Id: Ida1e34b7f856498c076584e5cbbe474b1898a57b
6d5da5e7ffb69614706ca030bfe194a493b24e99 18-Apr-2017 Stanley Tng <stng@google.com> Allow the Bluetooth MAC address to be updated asynchronously (1/3)

There are intermittent issues where either the returned Bluetooth
MAC address to Java framework is uninitialized or this address update
arrives too late. This fix will do 2 things:
(1) Returns error when MAC address is unavailable in the native code.
(2) Updates the MAC address later by adding a new broadcast event.

Test: Check address for these cases: factory reset, system reboot, and
Bluetooth re-enable.
Bug: 36709382

Change-Id: I6b71100c2c03c6f365f0dbc27d4e37c734145e30
tservice/AdapterProperties.java
909aec933813d1b064adea5c141f156850ef4a6e 20-Apr-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "AVRCP: Fix EvictingQueue"
fea084fbcde5e3880ae467e855c02a196587ecff 20-Apr-2017 Ajay Panicker <apanicke@google.com> Merge "Log battery stats before ScanClient gets removed" am: af7eb05b95 am: 8b2dd38acb
am: a1e18139cb

Change-Id: I7fc13ee86b114e868569c27c7dfc64cd8b8da682
94e2acc28e8a6a2e6b2efdae1449f1a942e40f9d 20-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix EvictingQueue
am: a6d4a79398

Change-Id: Iac8c08032c77c6e7f454ee71e08b8d547b6ae4e4
ba90319146ccf629f6909ae8511511f7331e87bd 20-Apr-2017 Ajay Panicker <apanicke@google.com> Log battery stats before ScanClient gets removed

Bug: 36977250
Change-Id: I8b926b7eeb9bdd8b54c7655a4951d21e8dffddfc
att/ScanManager.java
a6d4a7939896c36c0448b2bb058d2c8c0397aa95 20-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix EvictingQueue

Fixes EvictingQueue to not overflow the stack when a thing is added.

Test: runtest bluetooth -c com.android.bluetooth.avrcp.EvictingQueueTest
Bug: 33828042
Change-Id: I35f7f89152ff45edfacfe2c7e673adc1f31e1b3e
(cherry picked from commit 5e65f55d906687a682b4c7bbc9372084e4df3e53)
vrcp/AvrcpHelperClasses.java
5e65f55d906687a682b4c7bbc9372084e4df3e53 20-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix EvictingQueue

Fixes EvictingQueue to not overflow the stack when a thing is added.

Test: runtest bluetooth -c com.android.bluetooth.avrcp.EvictingQueueTest
Bug: 33828042
Change-Id: I35f7f89152ff45edfacfe2c7e673adc1f31e1b3e
vrcp/AvrcpHelperClasses.java
3f33bbb6164a0b42eee2d9d469e9325c5395d680 20-Apr-2017 Ajay Panicker <apanicke@google.com> Log battery stats before ScanClient gets removed

Bug: 36977250
Test: run cts-dev -m CtsIncidentHostTestCases -t com.android.server.cts.BatteryStatsValidationTest
Change-Id: I8b926b7eeb9bdd8b54c7655a4951d21e8dffddfc
att/ScanManager.java
a759c30d30ded4547ad5d2c624a4047e195dba2e 20-Apr-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Passthrough through MediaSessionService" am: 197a97644b am: 3ebd1cd512
am: 3ef68104be

Change-Id: Ib0fb06594b9ac45916a439bee4354151a184d2f1
197a97644bf59efa1ea949239cb59792a2230815 20-Apr-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "AVRCP: Passthrough through MediaSessionService"
bdcf510515b5b251b0b88ba3c05937661ca5da3f 24-Mar-2017 Marie Janssen <jamuraa@google.com> AVRCP: Passthrough through MediaSessionService

Send passthrough keys through MediaSessionService instead of trying to
interpret them ourselves, and log who they get dispatched to.

Remove the hack around down fast-forward / rewind.

This should result in a lot less confusion about which app is addressed
when the user is sending a command (such as at car connection time).

Test: play / skip, switch app on phone, reboot, start from carkit, dumpsys logs
Bug: 33828042
Bug: 37476911

Change-Id: I8c8c40cb3792254a3720f64707e67fdcc940edaa
(cherry picked from commit 44a4da788f878d1946301dbf297dd7b938dfd730)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcp/AvrcpMediaRspInterface.java
b3436e976055f684050be9afdadc73645316806a 07-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Report current playing item for now playing

According to the Bluetooth AVRCP 1.6.1 (p79):
In the case where the media player does not natively support a Now
Playing folder, it may present a folder containing one item, the
currently playing media element, as would be returned by a
GetElementAttributes command with the now playing UID.

Send this one-item list back when we don't have a queue, and try to
refresh the queue from the current player when we need to.

When a browsable player is selected, it's illegal for us to send a
response to EVT_TRACK_CHANGED with the now playing UID, so make up a
fake qid for this one item list in this case, since ids are only valid
within the current folder for database-unaware players anyway.

Respond with "no players available" when we actually don't have a
player.

Also fixes a bug where we would try to send the current queue back twice,
and reduces logspam in the main message handler by half.

Test: connect to carkit, test basic playback
Bug: 32800406
Bug: 36645066
Bug: 36055995
Bug: 36645066
Change-Id: Ia16c05bfc849359ca857b03edd5a75e21f13d6fb
(cherry picked from commit 5cbc96dc8da6b455c0d0a142d27274708ac1f208)
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
910620c28dcf7674b61b4f1c27a8c9a2de4626a5 20-Apr-2017 Erik Kline <ek@google.com> Merge "Make tetherChangePermission to be secured for AppOps permission" am: 5584fba25d am: 6a7e43e46e
am: be34ba0cee

Change-Id: I2718753d47e9845bcea47eb1d09a54adfdfa95ff
5584fba25df20743fbab9a821fc1a10e32c8a57e 20-Apr-2017 Erik Kline <ek@google.com> Merge "Make tetherChangePermission to be secured for AppOps permission"
319adb1ca2c31b4e4f40d236aeceaacb545d6a92 20-Apr-2017 Amith Yamasani <yamasani@google.com> Merge "Handle PendingIntent-based callback for scan results" into oc-dev
am: 180c9367c9

Change-Id: Ida9ccba0bf8322ee65f9ec246ac93274f07e174e
180c9367c92b4dc1e0ba854e5cafe4641d756ab0 20-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Handle PendingIntent-based callback for scan results" into oc-dev
e3ab5f06e99daaffa16c62f991be6c322b7da07f 20-Apr-2017 Ajay Panicker <apanicke@google.com> Merge "Convert OPP notifications to use NotificationChannel" into oc-dev
am: 4c9e91aa0d

Change-Id: I1d13e544bc8a05a554a6df3a7e383088e62545f7
4c9e91aa0d4e92197311fd1496e7251101aa0b3d 20-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Convert OPP notifications to use NotificationChannel" into oc-dev
4f16f3ae1984b27b75f2a4e1090c37fce2e53e2b 20-Apr-2017 Andre Eisenbach <eisenbach@google.com> Merge "AVRCP: Report current playing item for now playing" am: 4a242c87db am: c095cf05c3
am: 825b15691d

Change-Id: I68caf84ec064f0bd79407ba29cfc0fc7bab45f6a
05df242b454cbe62dab2bfaa07ab2b236ed00f67 24-Mar-2017 Marie Janssen <jamuraa@google.com> AVRCP: Passthrough through MediaSessionService

Send passthrough keys through MediaSessionService instead of trying to
interpret them ourselves, and log who they get dispatched to.

Remove the hack around down fast-forward / rewind.

This should result in a lot less confusion about which app is addressed
when the user is sending a command (such as at car connection time).

Test: play / skip, switch app on phone, reboot, start from carkit, dumpsys logs
Bug: 33828042
Bug: 37476911

Change-Id: I8c8c40cb3792254a3720f64707e67fdcc940edaa
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcp/AvrcpMediaRspInterface.java
294ff299ca4837fd7f56861941b274fadee97ec4 07-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Report current playing item for now playing

According to the Bluetooth AVRCP 1.6.1 (p79):
In the case where the media player does not natively support a Now
Playing folder, it may present a folder containing one item, the
currently playing media element, as would be returned by a
GetElementAttributes command with the now playing UID.

Send this one-item list back when we don't have a queue, and try to
refresh the queue from the current player when we need to.

When a browsable player is selected, it's illegal for us to send a
response to EVT_TRACK_CHANGED with the now playing UID, so make up a
fake qid for this one item list in this case, since ids are only valid
within the current folder for database-unaware players anyway.

Respond with "no players available" when we actually don't have a
player.

Also fixes a bug where we would try to send the current queue back twice,
and reduces logspam in the main message handler by half.

Test: connect to carkit, test basic playback
Bug: 32800406
Bug: 36645066
Bug: 36055995
Bug: 36645066
Change-Id: Ia16c05bfc849359ca857b03edd5a75e21f13d6fb
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
d03408c87f740be8d87e706d8f43db6870b2733a 14-Apr-2017 Amith Yamasani <yamasani@google.com> Handle PendingIntent-based callback for scan results

This allows scan results to be returned to an app that is
potentially not running at the moment.

Bug: 37254611
Test: WIP for new tests. Existing cts bluetooth tests pass.
Change-Id: Iaa24333605ebd06636bfd765cec4551692d0f4d4
att/ContextMap.java
att/GattService.java
4bea238bc51250d2967d50e99f582efa65a20f8d 19-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Expose LE advertiser address for easier PTS tests (2/6)" am: b30a2ec969 am: 858143e209
am: 8109daa990

Change-Id: I07df42fd30f1805e13b96fd0d2e8b54d24ec2589
d2f6bd176055ed6c707f3e27ff130318afd231b1 18-Apr-2017 Ajay Panicker <apanicke@google.com> Convert OPP notifications to use NotificationChannel

In O, Bluetooth notifications are hidden by default. This must be
changed to use notification channels so that the priority of the
notifications can be updated.

Bug: 36974285
Test: Send files/batches over OPP
Testtracker: 84338
Change-Id: Ie34123bbb559cc760c83a6bdc7094a3a72382c33
pp/BluetoothOppNotification.java
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppReceiver.java
dd8f86f29f37b8ea0a230d854757513ccf1b1bce 19-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Read by UUID for PTS tests (2/5)" am: b524c7ed10 am: 691a2b3f40
am: 374cc1b6d5

Change-Id: Ie58a6cdc55f7537ff0bcd604a01ebfd234d2db6d
f10e5516ed308be0493173fcd7982fb4f0a8cd0e 19-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Expose LE advertiser address for easier PTS tests (2/6)

This patchset adds a hidden method getOwnAddress, that lets app with
BLUETOOTH_PRIVILEGED permission to lear their own addreess. This is done
exclusively for PTS tests.

Bug: 35147497
Test: manual
Change-Id: I8da0128c1dac2995e488f1e0c48aa7d5fd399b4c
att/AdvertiseManager.java
att/GattService.java
02c656642c1e3c90703fcd0a3c559fd1c1b4c3f9 18-Apr-2017 Shunta Sato <shunta.sato@sonymobile.com> Make tetherChangePermission to be secured for AppOps permission

Symptom:
AppOps verified the incorrect package of calling tether state
changing API.
It threw SecurityException by mistake.

Solution:
Pass the correct package name to enforceTetherChangePermission.

Bug: 32931147
Change-Id: I46fd0c8128d00a12fd693e08000aca85849baf33
an/PanService.java
5fc203008497b071dc583450a53c93e11dd561ff 14-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Read by UUID for PTS tests (2/5)

Add a hidden api for reading characteristic by UUID for PTS.

Bug: 35150313
Test: sl4a GattReadTest.byUuid
Change-Id: I6ec848eac1ecfbd1a4ec2bc968faff8a082d9c79
att/GattService.java
df2c7df9eb3df62cf13e9d2e82fc1c156c71f280 15-Apr-2017 Jack He <siyuanh@google.com> OPP: Initialize OPP FileProvider after user unlock

* The FileProvider used by Bluetooth OPP profile used to be initialized
before user unlock, resulting in file system access errors since
credential encrypted volumes are not mounted and unlocked yet
* Incomplete initialization also leads to NPE when getUriForFile is
called
* This change adds BluetoothOppProvider that only initializes after user
unlocks the device

Bug: 36274847
Test: make, Opp regression test
Change-Id: I323b9084de1ff72922c4dd9866c36dd172696a8f
(cherry picked from commit a19f73959d7e054b206633aa1592a874d0d623f2)
pp/BluetoothOppFileProvider.java
pp/BluetoothOppUtility.java
119fced54e5c091239407ede0ff1172102d3ffce 18-Apr-2017 Jack He <siyuanh@google.com> Merge "OPP: Initialize OPP FileProvider after user unlock" am: cc7b936289 am: 4320d1f811
am: e47d33e556

Change-Id: Ie0a8de6bed994bf6de10d31bffcc35428d61725d
9408636a7db7ad35359b3c80d77dce0ae92459fa 15-Apr-2017 Jack He <siyuanh@google.com> OPP: Initialize OPP FileProvider after user unlock

* The FileProvider used by Bluetooth OPP profile used to be initialized
before user unlock, resulting in file system access errors since
credential encrypted volumes are not mounted and unlocked yet
* Incomplete initialization also leads to NPE when getUriForFile is
called
* This change adds BluetoothOppProvider that only initializes after user
unlocks the device

Bug: 36274847
Test: make, Opp regression test
Change-Id: I323b9084de1ff72922c4dd9866c36dd172696a8f
pp/BluetoothOppFileProvider.java
pp/BluetoothOppUtility.java
8165f54abe920fe688ffb14644a8c65cd342aa6a 06-Apr-2017 Joseph Pirozzo <pirozzoj@google.com> PBAP Client Account Authenticator

Update PBAP client account authenticator have the correct package
namespace and the Bluetooth icon.

Bug: 27724937
Test: With the PBAP client profile enabled visit Settings->Users &
accounts->Add account observe icon and name for bluetooth pbap account.

Change-Id: If197ac22733be5a54f4f76b399f37949b7cc4915
(cherry picked from commit 741218f261f751c55564a60b581d9b7151fc235e)
bapclient/AuthenticationService.java
bapclient/Authenticator.java
fe53cbf450c60ff0cadb5220d51403ceff27043b 05-Apr-2017 Joseph Pirozzo <pirozzoj@google.com> PBAP Client Call Log

Update PBAP Client to correctly handle cases where a call log has either
an unknown phone number or missing timestamp. Included are test cases
to verify proper parsing.

Bug: 26760364
Bug: 29230296

Test: runtest bluetooth -c com.android.bluetooth.pbapclient.PbapParserTest
Change-Id: Ibdabd0320f3bdd6dee0d7bd7b5ddd9400219f3d4
(cherry picked from commit e1ee0dace9e715e3d94339dc642b8767db83b89e)
bapclient/CallLogPullRequest.java
50c47cd5713bb8c2ca292782a298a11389430a2a 15-Apr-2017 Ajay Panicker <apanicke@google.com> Merge "Prevent OPP from opening files that aren't sent over Bluetooth" into oc-dev
am: 69e512126b

Change-Id: I454a805e3914e333739b2a4138443d8dcf4a987d
69e512126b50c5297710638ef4347103972a86e3 15-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Prevent OPP from opening files that aren't sent over Bluetooth" into oc-dev
69cc0f9ea6a62198148ca8cb2d4c6474f84d7e44 15-Apr-2017 Amith Yamasani <yamasani@google.com> Dummy implementation for BLE scan via PendingIntent
am: 97995b8ccb

Change-Id: I95f39d146300fcaebc6a95e2e41b2b6aa9c4dd38
24bc6f18757cec2d0e71829164c8616e697d442f 11-Apr-2017 Ajay Panicker <apanicke@google.com> Prevent OPP from opening files that aren't sent over Bluetooth

Before this patch an app could send an open intent to
BluetoothOppTransferService using a fake content provider to gain external
read and write access. We fix this by checking the Uri of the file before
opening it to see if it originated from the Bluetooth Share content provider.
We also stop graning write access to apps that we use to view the file.

Bug: 35385327
Test: PoC found in bug
Change-Id: Iad85490a0306b3e70767285393b204be22b11511
pp/BluetoothOppUtility.java
97995b8ccbadc3d868adc70684b13bc0d199edc2 15-Apr-2017 Amith Yamasani <yamasani@google.com> Dummy implementation for BLE scan via PendingIntent

Actual implementation under construction. This is a placeholder
for the new APIs.

Bug: 37254611
Test: N/A
Change-Id: Id2226bb919b944268ff6e4bf53d609d5808419e4
att/GattService.java
cd379e8f26d2335799c07144ae8d5965884d0652 09-Nov-2016 Jack He <siyuanh@google.com> Check support for in-band ringing during HFP init

* Check in-band ringing support for this platform during HFP init

Bug: 19171297
Test: mm -j 40, HFP regression testing, testplans/82144
Change-Id: I5a90b2218b0dc15eb92f32bf9b4ed3ff3b01980b
(cherry picked from commit 6eac09b725ed509b26e8f49d8442426f7816953a)
fp/HeadsetStateMachine.java
67766698d6cf7bbc51b52e174dfe1cfdb5cfd492 12-Apr-2017 Jack He <siyuanh@google.com> Merge "OPP: Restrict file based URI access to external storage" into oc-dev
am: 376a8d4bed

Change-Id: I3db3ba9507b459eccd9b97bf8c916b905a895561
376a8d4bed6bfe20532acf2f4af58f49e06080b9 12-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "OPP: Restrict file based URI access to external storage" into oc-dev
fe1c54e3fcbb75af7e49aecbd27ab7327a631c64 13-Mar-2017 Jack He <siyuanh@google.com> OPP: Restrict file based URI access to external storage

* Allow only external storage paths in file based URI in
BluetoothOppSendFileInfo when the file send request comes from an
external source
* Fix a potential NPE when using Uri.getPath()

Bug: 35310991
Test: Make, test various cases of Bluetooth file share
Change-Id: I8ff00d63d3c880667302f8d7ff8eaa0c0b533921
(cherry picked from commit 3edd7f0a8aadf2f44bc62ea5b567c74d39a534c8)
pp/BluetoothOppHandoverReceiver.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppManager.java
pp/BluetoothOppSendFileInfo.java
pp/BluetoothOppUtility.java
8917adeb3c2e1832188cb13f05d26c6075916a8b 11-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix NPE on adding non-browsable player
am: 9ab3d68415

Change-Id: I71fa1f3a79d1e1a53e941fe269198d6243cc7209
9ab3d6841511bc7d58677f13a1f9862b6daa0c01 11-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix NPE on adding non-browsable player

Test: boot phone with unbrowsable app installed
Change-Id: I7131d49b4c3c5bb86f9206b4214b80de06ec025c
Fixes: 37224369
Bug: 37197672
(cherry picked from commit eb48cddfe0630c165baae581c65c1fe0c42a4842)
vrcp/AvrcpHelperClasses.java
eb48cddfe0630c165baae581c65c1fe0c42a4842 11-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Fix NPE on adding non-browsable player

Test: boot phone with unbrowsable app installed
Change-Id: I7131d49b4c3c5bb86f9206b4214b80de06ec025c
Fixes: 37224369
Bug: 37197672
vrcp/AvrcpHelperClasses.java
464bd35cdd9358a99b8c7d939d3a3a173d60505a 11-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Prevent NPEs with browsing-only players
am: 0b6cad4a9f

Change-Id: I87b12a1b1f2d27b3128b605a0b3e678c269bd11b
269172b70a57435f3774b28afd4d33787999865c 11-Apr-2017 Andre Eisenbach <eisenbach@google.com> Merge "AVRCP: Prevent NPEs with browsing-only players"
471c4aba471dfdaf04de913d62a0a76cf9ecf5d7 11-Apr-2017 Jack He <siyuanh@google.com> Merge "Check support for in-band ringing during HFP init" am: f9a93e287b am: e6bcfa3f7d
am: 27506e36b5

Change-Id: I68350feea763621a3e4446062ac31aa16f05b2db
0b6cad4a9f1ab18f6b3627ce7cf6316466cdb95a 10-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Prevent NPEs with browsing-only players

When a player doesn't have an active controller, the MediaPlayerInfo
is identified by package name instead.

Add the list of media players to the dumpsys.

Test: connect with browsing player that has no active session
i.e. GPM right after reboot with no paired devices
Bug: 37197672
Change-Id: I064b1dcce33172ceb7bcad2af4b214ea4fc4198c

(cherry picked from commit b8faaf4863cfae62c32af644765a9190512925c9)
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
b8faaf4863cfae62c32af644765a9190512925c9 10-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Prevent NPEs with browsing-only players

When a player doesn't have an active controller, the MediaPlayerInfo
is identified by package name instead.

Add the list of media players to the dumpsys.

Test: connect with browsing player that has no active session
i.e. GPM right after reboot with no paired devices
Bug: 37197672
Change-Id: I064b1dcce33172ceb7bcad2af4b214ea4fc4198c
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
6eac09b725ed509b26e8f49d8442426f7816953a 09-Nov-2016 Jack He <siyuanh@google.com> Check support for in-band ringing during HFP init

* Check in-band ringing support for this platform during HFP init

Bug: 19171297
Test: mm -j 40, HFP regression testing, testplans/82144
Change-Id: I5a90b2218b0dc15eb92f32bf9b4ed3ff3b01980b
fp/HeadsetStateMachine.java
351ffc02e8c395d0eabe108e5b4909e7f41ffae6 28-Mar-2017 Marie Janssen <jamuraa@google.com> AVRCP: Rework available media player handling

Instead of rebuilding the available player list every time a player
changes, only add and remove the players that have changed.

Add browsable players that don't have an active media session to the
available players.

Update browsable players as they are connected to and refresh the list
(and notify clients) when we are done.

This has an effect of removing a lot of log lines, and reduces churn
of the MediaController callback registration.

Update logging that remains to be much less verbose.

Test: connect to various carkits, verify browsing, updated logs
Bug: 34249902
Bug: 36497125
Bug: 36802046
Change-Id: I9783c682a3f8c22b8b79cfd9023fac6078b21b9f
(cherry picked from commit eef486e7e3145cc7b302ee1b00bbd317481cdabd)
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
820598758392679717c5540cf41ee2e15adfc33b 07-Apr-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Rework available media player handling" am: 555b5c0282 am: 08ecd82a18
am: 81d55ee429

Change-Id: I2b64b33ec4e55e8d2059dfbb27a46d359105f4bb
eef486e7e3145cc7b302ee1b00bbd317481cdabd 28-Mar-2017 Marie Janssen <jamuraa@google.com> AVRCP: Rework available media player handling

Instead of rebuilding the available player list every time a player
changes, only add and remove the players that have changed.

Add browsable players that don't have an active media session to the
available players.

Update browsable players as they are connected to and refresh the list
(and notify clients) when we are done.

This has an effect of removing a lot of log lines, and reduces churn
of the MediaController callback registration.

Update logging that remains to be much less verbose.

Test: connect to various carkits, verify browsing, updated logs
Bug: 34249902
Bug: 36497125
Bug: 36802046
Change-Id: I9783c682a3f8c22b8b79cfd9023fac6078b21b9f
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
cf5074df561bdd7e5e14e6ba1f65b0bd7c415ca2 07-Apr-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP Client Account Authenticator" am: 61927b5b7a am: 5e7cb38723
am: f83a85bcbf

Change-Id: I2d764f7031a3d41fa6ff9ab1451c54666d2c7e97
a3c991e7e457557228b180165c6374413eabefe1 07-Apr-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP Client Call Log" am: b600ebe9c7 am: 5f8c922872
am: 669abc5908

Change-Id: Ia4bf8ea186525055b693f3e8316c87d78f9e7085
741218f261f751c55564a60b581d9b7151fc235e 06-Apr-2017 Joseph Pirozzo <pirozzoj@google.com> PBAP Client Account Authenticator

Update PBAP client account authenticator have the correct package
namespace and the Bluetooth icon.

Bug: 27724937
Test: With the PBAP client profile enabled visit Settings->Users &
accounts->Add account observe icon and name for bluetooth pbap account.

Change-Id: If197ac22733be5a54f4f76b399f37949b7cc4915
bapclient/AuthenticationService.java
bapclient/Authenticator.java
e1ee0dace9e715e3d94339dc642b8767db83b89e 05-Apr-2017 Joseph Pirozzo <pirozzoj@google.com> PBAP Client Call Log

Update PBAP Client to correctly handle cases where a call log has either
an unknown phone number or missing timestamp. Included are test cases
to verify proper parsing.

Bug: 26760364
Bug: 29230296

Test: runtest bluetooth -c com.android.bluetooth.pbapclient.PbapParserTest
Change-Id: Ibdabd0320f3bdd6dee0d7bd7b5ddd9400219f3d4
bapclient/CallLogPullRequest.java
1beade1e45f1f82b411eac62cf13b60bb2ed1969 05-Apr-2017 Jack He <siyuanh@google.com> HFP: Check for service level connection when connecting SCO

* A service level connection (SLC) should be established before a SCO
connection could be created
* This CL creates a flag within HeadsetStateMachine to track the status
of service level connections
* BluetoothHeadset.connectAudio() will return false when an SLC is not
established

Bug: 36100309
Test: make, HFP regression, testplans/82424
Change-Id: Ibb52674ef6be75eeac66eb228e8b75d9bba1ddc6
(cherry picked from commit 7a895040f9654546a3ea6f5aca904a533a112dbd)
fp/HeadsetService.java
fp/HeadsetStateMachine.java
fac4bd88b552a8e3f5c6814c04144493371ae655 06-Apr-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Don't send notifications in callbacks" am: 6f34f6f1b9 am: e2152c80e1
am: f7955423bf

Change-Id: Ia510de2773f53f676303feada9f74657914bc9f0
a7cf67c3e381792a7648b02d61b0fce75c4cc210 05-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Don't send notifications in callbacks

Since native code can have unbounded wait (for thread safety), only call
it on the main thread.

Some notifications are also idempotent so also eliminate duplicate
notifications if we might send multiple in a short time period.

Test: connect to tesla, observe no crashing
Change-Id: I4ca1ab6d8657ce4f02983101c68e95ebf9026753
Fixes: 36794139
(cherry picked from commit e2619781c799435cf0273d381069c754c5f89a20)
vrcp/Avrcp.java
6f34f6f1b9d770cb57ed9db60286653d4c0b790b 06-Apr-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Don't send notifications in callbacks"
d48e721c95fbefc328caf56507757d5d5b87cc92 06-Apr-2017 Jack He <siyuanh@google.com> Merge "HFP: Check for service level connection when connecting SCO" am: f428943817 am: 96a4b1a9ed
am: 12786a86d8

Change-Id: Ib1d030f060a37675752ae143c2b1cf74c691db24
7a895040f9654546a3ea6f5aca904a533a112dbd 05-Apr-2017 Jack He <siyuanh@google.com> HFP: Check for service level connection when connecting SCO

* A service level connection (SLC) should be established before a SCO
connection could be created
* This CL creates a flag within HeadsetStateMachine to track the status
of service level connections
* BluetoothHeadset.connectAudio() will return false when an SLC is not
established

Bug: 36100309
Test: make, HFP regression, testplans/82424
Change-Id: Ibb52674ef6be75eeac66eb228e8b75d9bba1ddc6
fp/HeadsetService.java
fp/HeadsetStateMachine.java
e2619781c799435cf0273d381069c754c5f89a20 05-Apr-2017 Marie Janssen <jamuraa@google.com> AVRCP: Don't send notifications in callbacks

Since native code can have unbounded wait (for thread safety), only call
it on the main thread.

Some notifications are also idempotent so also eliminate duplicate
notifications if we might send multiple in a short time period.

Test: connect to tesla, observe no crashing
Change-Id: I4ca1ab6d8657ce4f02983101c68e95ebf9026753
Fixes: 36794139
vrcp/Avrcp.java
be74f02a2ff91427d331440b8b843aacfacc5852 05-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Change radio related service names to slot1, slot2, slot3..." into oc-dev
160a5d973567ea4466f5be906cae350082b75174 31-Mar-2017 Jack He <siyuanh@google.com> Consolidate log messages in RemoteDevices.java

Test: make, no user visible effect
Change-Id: I8725b2d97cdc45e8751b45fc08e6943d48ce9ece
(cherry picked from commit ae62adac760fd5236fa1e8c3b7a18f3635333ae2)
tservice/RemoteDevices.java
13c7f938a8586fa7e06746aacfc26785c39c3397 05-Apr-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Reset connection accepted flag" am: c7eadc8970 am: 27c53c3dea
am: 47afa9a09d

Change-Id: Ib5459b174d7ad3a146bb437e1622a0a7cf902428
25d80d9ee0782f9b602499eb456b585bb8e9dea0 30-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Reset connection accepted flag

Usecase:
1) Transfer file to remote (10-15 MB)
2) While transfer is ongoing, send file to DUT from another
remote device. File transfer fails as expected.
3) After Tx completes try to receive file on DUT from any remote.

Observation:
DUT is not accepting the obex connection and all Incoming files are
rejected.

Rootcause:
During Tx ongoing if DUT receives Rx request, DUT waits
upto 20 seconds for Tx to complete and after that rejects
incoming file since OPP service is still busy (with Tx).

Fix:
Reset connection accepted flag to accept new incoming connection
after rejecting incoming connection so that new connection can be
accepted in future.

Test: Checked the above scenario and file could be received
in future iterations when we have incoming Rx during ongoing Tx.

Bug: 36800414
Change-Id: I004ef6ff994bc7c3b3a607053d7bfc9c9b773989
pp/BluetoothOppService.java
0e68b031093ca4776111da8babaf6ea1142b4755 28-Mar-2017 Amit Mahajan <amitmahajan@google.com> Change radio related service names to slot1, slot2, slot3...

Test: Basic telephony sanity
Bug: 36570718
Merged-in: I054a5e7cc396a78df95752218e52e92dd7616d88
Change-Id: I054a5e7cc396a78df95752218e52e92dd7616d88
ap/SapRilReceiver.java
26990a00672892e666f3e46e6e6dd6b065d2b10c 28-Mar-2017 Amit Mahajan <amitmahajan@google.com> Change radio related service names to slot1, slot2, slot3...

Test: Basic telephony sanity
Bug: 36570718
Merged-in: I054a5e7cc396a78df95752218e52e92dd7616d88
Change-Id: I054a5e7cc396a78df95752218e52e92dd7616d88
ap/SapRilReceiver.java
67313c9b643282d9b8c0f3baa22a6b003bd97869 05-Apr-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Change radio related service names to slot1, slot2, slot3..."
6a48ea52aa7cb627614382192ab375c76e5da7ba 28-Mar-2017 Amit Mahajan <amitmahajan@google.com> Change radio related service names to slot1, slot2, slot3...

Test: Basic telephony sanity
Bug: 36570718
Merged-in: I054a5e7cc396a78df95752218e52e92dd7616d88
Change-Id: I054a5e7cc396a78df95752218e52e92dd7616d88
ap/SapRilReceiver.java
b65d878b89a592796f33fef516da2ca0d95c6e35 04-Apr-2017 Jack He <siyuanh@google.com> OPP: Check target device when receiving SDP search result
am: 0f7c253837

Change-Id: Id2059ec0f7595c6f7f63dc8240644523cc62bb7e
13eae94de911103615abbd4b5c04eb173d63f14f 04-Apr-2017 Bill Yi <byi@google.com> Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD
0f7c253837f9eff47557990fd1053f62b9600222 04-Apr-2017 Jack He <siyuanh@google.com> OPP: Check target device when receiving SDP search result

* Return and print warning message when target is null while
handling ACTION_SDP_RECORD
* Without this check, a NullPointerException could be triggered
when a previously successful SDP search result landed on a
BluetoothOppTransfer object will recently failed SDP search that would
render mDevice null

Bug: 36260940
Test: make, test sending file through Bluetooth Opp
Change-Id: I861e7e64a7c9b316d4540fd5134892c247753f74
(cherry picked from commit 8e94b07aeccfa09db9add50b116b04393e3d8f1a)
pp/BluetoothOppTransfer.java
68e9d781ca43a7403e2f637ff4987f5c1441fc8e 04-Apr-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Check target device when receiving SDP search result"
8e94b07aeccfa09db9add50b116b04393e3d8f1a 04-Apr-2017 Jack He <siyuanh@google.com> OPP: Check target device when receiving SDP search result

* Return and print warning message when target is null while
handling ACTION_SDP_RECORD
* Without this check, a NullPointerException could be triggered
when a previously successful SDP search result landed on a
BluetoothOppTransfer object will recently failed SDP search that would
render mDevice null

Bug: 36260940
Test: make, test sending file through Bluetooth Opp
Change-Id: I861e7e64a7c9b316d4540fd5134892c247753f74
pp/BluetoothOppTransfer.java
32ea3206d2d10d4fc82ca8e894abb72b5859e262 03-Apr-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Fix Resource Leak in OPP (2/2)" am: a0445f8d72 am: 27e40e3e8d
am: 9ebbf507f6

Change-Id: Ic94fba968f0a47d4dd95e53ee511867b0e9b7eeb
27e40e3e8d19548c516a7bfe5e670443260441b6 03-Apr-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Fix Resource Leak in OPP (2/2)"
am: a0445f8d72

Change-Id: I98005a8294225b9eb7ca991bfb5e9d31de258256
1c87133a411302f275440bad23aa04b720dcd753 01-May-2014 Hemant Gupta <hemantg@codeaurora.org> OPP: Fix Resource Leak in OPP (2/2)

[Test Procedure]
1) Select File -> Press share via BT -> Press back key
2) Repeat step 1 in loop (1024 times)

Expected Result
No BT crash observed

Observed Result
-------------------------------------------------------------------------------------------------
issueTag : SYSTEM_TOMBSTONE
PackageName : N/A
PackageVersion : N/A
ExceptionType : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
ExceptionMessage : #00 pc 0004ea14 /system/lib/libdvm.so #01 pc 00004a49 /system/lib/libbluetooth_jni.so
Process : com.android.bluetooth
Build : FarEastone/Smart503_03TW/MC2:4.4.2/KVT49L/03TW_0_160:user/release-keys

StackTrace :

issueCount : 3
issueLogPath :
... TEM_TOMBSTONE/SYSTEM_TOMBSTONE@1397693648904.txt – 2014-04-17 08:14:08 (GMT+8)
... TEM_TOMBSTONE/SYSTEM_TOMBSTONE@1397693649571.txt – 2014-04-17 08:14:09 (GMT+8)
... TEM_TOMBSTONE/SYSTEM_TOMBSTONE@1397693650035.txt – 2014-04-17 08:14:10 (GMT+8)

and then we can see:
-------------------------------------------------------------------------------------------------
issueTag : system_app_crash
PackageName : com.android.bluetooth
PackageVersion : 4.4.2-00WW_0_160
ExceptionType : java.lang.RuntimeException
ExceptionMessage : Could not read input channel file descriptors from parcel.
Process : com.android.bluetooth
Flag : 0x88be45
Build : FarEastone/Smart503_03TW/MC2:4.4.2/KVT49L/03TW_0_160:user/release-keys
throwClassName : android.view.InputChannel.nativeReadFromParcel
throwMethodName : Native Method

StackTrace :
java.lang.RuntimeException: Could not read input channel file descriptors from parcel.
at android.view.InputChannel.nativeReadFromParcel(Native Method)
at android.view.InputChannel.readFromParcel(InputChannel.java:148)
at android.view.IWindowSession$Stub$Proxy.addToDisplay(IWindowSession.java:690)
at android.view.ViewRootImpl.setView(ViewRootImpl.java:502)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:259)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2860)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1204)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5055)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:658)
at dalvik.system.NativeStart.main(Native Method)

Root Cause:
Input stream was never closed resulting in leak with each iteration and system crash after 1024 iterations.

Fix:
Handle closing of input stream and Remove hashmap share if no device is selected by user when trying to send
file via BT. Without this, input stream was never closed resulting in leak with each iteration and system crash
after 1024 iterations.

Test: Performed the usecase overnight and see if no crash is observed.

Bug: 35626275
Change-Id: I92aa0d8e81977fde0446f565f1de95e2d91e1e9c
pp/BluetoothOppBtEnableActivity.java
pp/BluetoothOppManager.java
pp/BluetoothOppReceiver.java
00afbc90278b80415c9e847a3e97f05abe7fe313 03-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Fix unregAll throwing Concurrent exception

unregAll does iterate over ContextMap.mApps without synchronization,
and then call unregisterClient, which also iterate over same variable,
and remove element. This cause ConcurrentModificationException. To fix
that, make sure mApps access is always guarded by synchronized block.
Also make mApps into private variable, to make sure no one would make
similar errors in the future.

Bug: 34805290
Test: manual
Change-Id: I6254c809423ecc3901b64f1a2d60324efd1c4834
(cherry-picked from commit 98ca87dd893a7a3d1545e00a2a9a2419d83e22ef)
att/ContextMap.java
att/GattService.java
97c35afe9ad91372333a95d300974be2cce27055 03-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix unregAll throwing Concurrent exception" am: 824d9c61dd am: b5b4aa5d87
am: ec378f8739

Change-Id: I109fa02ad545a22ac4b0ed1c264408d3498e537b
b5b4aa5d872f769d1cc6c6558cd75e9f1891c073 03-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix unregAll throwing Concurrent exception"
am: 824d9c61dd

Change-Id: Ie12f52b261a305f9320ec7583099932505ce2d20
4bc8b429262badc21e1ace5a7d00bca6b6726f0c 03-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Fix unregAll throwing Concurrent exception

unregAll does iterate over ContextMap.mApps without synchronization,
and then call unregisterClient, which also iterate over same variable,
and remove element. This cause ConcurrentModificationException. To fix
that, make sure mApps access is always guarded by synchronized block.
Also make mApps into private variable, to make sure no one would make
similar errors in the future.

Bug: 34805290
Test: manual
Change-Id: I6254c809423ecc3901b64f1a2d60324efd1c4834
att/ContextMap.java
att/GattService.java
7f4a31f44f61bf765dad1d3b570e314fa1a98f85 31-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 advertising duration refactoring (3/4)

Expose both duration and maximum extended advertising events to limit
advertising time.

Test: manual
Bug: 30622771
Change-Id: I81ee59086f40b64d07eb43b32f1a59a6856ab886
(cherry picked from commit de068ddbc7bc4de68b178c5e32a44180ddf257a0)
att/AdvertiseManager.java
att/GattService.java
att/PeriodicScanManager.java
7efb7c69c45e71e96a035cdd0b2f9e57064aa0fe 31-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Add missing mApps synchronization

Test: manual
Bug: 33227052
Change-Id: I29d50f706c64b3a46f4bcb868dee6e86484ebed7
(cherry picked from commit 9b093393eead74eb3f1a8c19418d3d3a6e86761c)
att/ContextMap.java
c9cdb6c47f5b318291a0a321b22a2c830adf7ab0 28-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 periodic scan (1/3)

This patch wires calls/callbacks through stack to prepare for actual
implementation.

Test: manual
Bug: 30622771
Change-Id: I9e6d81ccbbe1626de96f766813b048909e9ef452
(cherry picked from commit 2feca0e43c7309a47275b643e499b590190463a7)
att/GattService.java
att/PeriodicScanManager.java
6f10c24c984a10fef0b48c0b7f9d0651f043d44c 01-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 advertising duration refactoring (3/4)" am: 9974e867a7 am: 36aaa958ea
am: c079b60229

Change-Id: Ic2ca767ed0b1bb84dabfa49c99dc819edfecb4f8
36aaa958ea1ff8517d10a4cf98f33ff570d37c65 01-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 advertising duration refactoring (3/4)"
am: 9974e867a7

Change-Id: I1faff665b808eec646285ba462a3b92391f8c27a
de068ddbc7bc4de68b178c5e32a44180ddf257a0 31-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 advertising duration refactoring (3/4)

Expose both duration and maximum extended advertising events to limit
advertising time.

Test: manual
Bug: 30622771
Change-Id: I81ee59086f40b64d07eb43b32f1a59a6856ab886
att/AdvertiseManager.java
att/GattService.java
att/PeriodicScanManager.java
eb47a693272e23886c2434ff3c2b07b13d951328 01-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Add missing mApps synchronization" am: e0c491dd44 am: 219e81c062
am: 07e3c1c378

Change-Id: I68c37f81da57e61676680fef0838bd3984c80c4d
219e81c06224ffe106b9f5bc7693b39ee5b6aaed 01-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Add missing mApps synchronization"
am: e0c491dd44

Change-Id: Ic6f1c7f7828bb6ea9a0448f600b927974ec10925
e0c491dd44a2364a1dd9a2ddedce7e53a1c8c4dd 01-Apr-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Add missing mApps synchronization"
3a3c3dda7894df4b9aea23f06df0826c26136d6d 01-Apr-2017 Jack He <siyuanh@google.com> Merge "Consolidate log messages in RemoteDevices.java" am: 750677bb34 am: 0162ee6079
am: cc9fa74e67

Change-Id: If1582d3ecfb202f57ce74405ca131ad2a16b0c0b
0162ee6079c4738e6c8a250bfe4805959e943094 01-Apr-2017 Jack He <siyuanh@google.com> Merge "Consolidate log messages in RemoteDevices.java"
am: 750677bb34

Change-Id: Idb50cce5c58ea9fd70eefdfd2fcee8da50dd684f
750677bb34a6196a4268e2b6dc576d0084515dd6 31-Mar-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Consolidate log messages in RemoteDevices.java"
ae62adac760fd5236fa1e8c3b7a18f3635333ae2 31-Mar-2017 Jack He <siyuanh@google.com> Consolidate log messages in RemoteDevices.java

Test: make, no user visible effect
Change-Id: I8725b2d97cdc45e8751b45fc08e6943d48ce9ece
tservice/RemoteDevices.java
9b093393eead74eb3f1a8c19418d3d3a6e86761c 31-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Add missing mApps synchronization

Test: manual
Bug: 33227052
Change-Id: I29d50f706c64b3a46f4bcb868dee6e86484ebed7
att/ContextMap.java
e82a8fd11578344f0fbdfe7e9480e2aefab09fb7 30-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 periodic scan (1/3)" am: 4336d7a6a4 am: 80e864cbff
am: 65c8332f17

Change-Id: Ie7c0c567b4f93d9753b13f59060f92ea86e1f197
80e864cbff01e0cbc7ac4b4527f7ba07dd101731 30-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 periodic scan (1/3)"
am: 4336d7a6a4

Change-Id: Iecd35d2b725c71f963d2dc7b5c2a8a95c00e58c7
2feca0e43c7309a47275b643e499b590190463a7 28-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 periodic scan (1/3)

This patch wires calls/callbacks through stack to prepare for actual
implementation.

Test: manual
Bug: 30622771
Change-Id: I9e6d81ccbbe1626de96f766813b048909e9ef452
att/GattService.java
att/PeriodicScanManager.java
0e1abf2276c4bc7e940624da89113b23e526be7a 24-Feb-2017 Pavlin Radoslavov <pavlin@google.com> Add new internal API: enableOptionalCodecs()/disableOptionalCodecs()

This API can be used to enable the optional codecs, or disable them
and use only the mandatory SBC.
Internally, it is implemented by raising the SBC priority to
highest (so SBC will be used/selected), or reducing the SBC priority
to its default value (lowest).

Test: A2DP streaming and enabling/disabling/selecting optional codecs
Bug: 35873828
Change-Id: I3f0dfc2e965e89647c03d032089dcccbd5fb8ffc
(cherry picked from commit 7aec8406176f8cef0b608c22b6e631df71ccd363)
2dp/A2dpService.java
2dp/A2dpStateMachine.java
4981ddba0b7d0b1fb95fab66d9f38f9bc92b1bc0 30-Mar-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Add new internal API: enableOptionalCodecs()/disableOptionalCodecs()" am: 5d6dc68180 am: 7024a64f0d
am: 02de9e25ca

Change-Id: I5d07416b1014d7bba42c3f58c2672977a4804011
7024a64f0d6c25aad6f997473180f05aaa45c5bd 30-Mar-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Add new internal API: enableOptionalCodecs()/disableOptionalCodecs()"
am: 5d6dc68180

Change-Id: I0a79742625360b7e31609a8b10bd2c01ed44dfbc
7aec8406176f8cef0b608c22b6e631df71ccd363 24-Feb-2017 Pavlin Radoslavov <pavlin@google.com> Add new internal API: enableOptionalCodecs()/disableOptionalCodecs()

This API can be used to enable the optional codecs, or disable them
and use only the mandatory SBC.
Internally, it is implemented by raising the SBC priority to
highest (so SBC will be used/selected), or reducing the SBC priority
to its default value (lowest).

Test: A2DP streaming and enabling/disabling/selecting optional codecs
Bug: 35873828
Change-Id: I3f0dfc2e965e89647c03d032089dcccbd5fb8ffc
2dp/A2dpService.java
2dp/A2dpStateMachine.java
4dfcb27efcb199dcb5dd83e466ce017fea99d2e5 28-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Remove unused API from OPP code." am: 9d87793523 am: 44ce7700f3
am: 5117133d2c

Change-Id: Ic2bbcde646f312fdc3bc0ff19aa323bc207a54c8
44ce7700f330d0878dd1f899492bee94499c484d 28-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Remove unused API from OPP code."
am: 9d87793523

Change-Id: I7e0e12119c505e1a5fe1df1fca8c6c376fa76b22
3085911905df7e3440b1f22008ca6571b511190f 24-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Remove unused API from OPP code.

Remove unused API getConnectionSocket() from OPP code.

Test: builds
Bug: 36581558
Change-Id: I6864a526de6fcb49cd7d6f5e36c35ba92ac83176
pp/BluetoothOppService.java
3d3cb18aa0c4e5894b1f6f1ef9c707f34db8d754 28-Mar-2017 Amit Mahajan <amitmahajan@google.com> Merge "Remove SAP socket"
am: 8246015c81

Change-Id: I943a4be7d4f85d396bb65fe3e4a2c11253e38055
8246015c8129fe057db9a40e269464438d72bd28 28-Mar-2017 Amit Mahajan <amitmahajan@google.com> Merge "Remove SAP socket"
3b002f0f096244f5ee91455ab2de70f7076a5f1d 22-Mar-2017 Amit Mahajan <amitmahajan@google.com> Remove SAP socket

Test: Basic SAP sanity
Bug: 32020264
Merged-in: I57d34f1cb36e4a63848ebf0dda9795fc75352a37
Change-Id: I57d34f1cb36e4a63848ebf0dda9795fc75352a37
ap/SapRilReceiver.java
ap/SapServer.java
7d26735cb7aefc4d6f30b28aa74c16d64d25b7d9 28-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Remove SAP socket"
0d06e0d707c80e339d3b5ba4fbfa3b37af6a3de2 27-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth GATT callback naming fix "Ext" -> "" (2/2)" am: 0d76e0b3c1 am: 2d30263860
am: a10df55a65

Change-Id: I1d47dc2975b1408daa2f30435f2db24257ad2c97
2d302638609b4b02f28b3b77b90ede83e41df895 27-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth GATT callback naming fix "Ext" -> "" (2/2)"
am: 0d76e0b3c1

Change-Id: I37d5414b3dc58b7eb10cbf2523578fd6044b3ad7
4d8cedbd24f654206090466a334482cc7334b3ee 27-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Add option to specify initial LE connection PHY (3/3)" am: 8ef68115ff am: 0327911138
am: 0d63782a13

Change-Id: Iece2baeb669c514779230be001b03cc18dd8c097
032791113821d8fd5cd18076772d5db4f9808007 27-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Add option to specify initial LE connection PHY (3/3)"
am: 8ef68115ff

Change-Id: I6823a2ce47ed40fd377c5400026ae36dd63ebf4c
02056166f907639f6088b78b6754bd55af8aa083 27-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth GATT callback naming fix "Ext" -> "" (2/2)

Gatt callback don't need the "Ext" postfix, as it was removed from new
API.

Test: manual
Bug: 30622771
Change-Id: Ie7f764062662277b8c82b9a9e4628ce9411a924f
att/GattService.java
73a32dfbd2f283341b86385b58ac4f3761c83f7b 22-Mar-2017 Amit Mahajan <amitmahajan@google.com> Remove SAP socket

Test: Basic SAP sanity
Bug: 32020264
Change-Id: I57d34f1cb36e4a63848ebf0dda9795fc75352a37
ap/SapRilReceiver.java
ap/SapServer.java
95d31b5b2a12528114ec63f55cc06161a11e7cf4 25-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Add option to specify initial LE connection PHY (3/3)

For whitelist connections we always use all possible PHYs, for direct
connection use PHY specified by client.

Test: manual
Bug: 30622771
Change-Id: I6e4de425ab3f367eb6c00ce36dee1d59869c0061
att/GattService.java
0c4eb6793749599bc3c7c4b8d7b9ad09e52a5c85 27-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix (again) bad scan record data length" am: 02634fce73 am: 4361ddf27e
am: 23dc8bb47f

Change-Id: I485d752aa5939212279481287ca78b0d73b15a42
4361ddf27ed2afcbc2c54981afcd91c75113e5a3 27-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix (again) bad scan record data length"
am: 02634fce73

Change-Id: I0b76cc39e4832cc6fed278a39ee03780be2de887
150d57466e21f2802d588ff6e8fab974fb91bfbf 25-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Fix (again) bad scan record data length

Bug: 36530831
Test: sl4a Bt5ScanTest:test_legacy_scan_result_raw_length
Change-Id: Ie7b04c40947f6419a665a8f6c1244effa63d8a7e
att/GattService.java
ae151449126a546f9e53e352e4f67c42cad8c424 24-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Expose connection update callback (3/4)" am: ffca06958c am: 7b12bc9c49
am: e1c53baafb

Change-Id: I52413e8cf101ff2220c81dc279ed23fe6614ec8e
7b12bc9c49eed7412236ee32aef959349756fc72 24-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Expose connection update callback (3/4)"
am: ffca06958c

Change-Id: I53e75df168f3f907bd0849913cad6b4565520384
4982e11647f30b47e9e352013d561bed272cb7fc 24-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Expose connection update callback (3/4)

Test: manual
Bug: 30622771
Change-Id: Ie731cf45bbb0ef01c5c6c13d149d75fea82e38d8
att/GattService.java
17f511eef41ab445e448708fd694737979fb7db1 24-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Set preferred PHY and read PHY implementation (1/3)" am: d84a18a54e am: a54ea98fcc
am: 4e4ff25e90

Change-Id: I87445175c2e418badf89844834db725f802698fc
a54ea98fcc43e02d515f2b9a7f18f88edfc9e812 24-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Set preferred PHY and read PHY implementation (1/3)"
am: d84a18a54e

Change-Id: I2a785efa6a06e8b694a58d01670d60cfde69c781
1878bcf7b85d6f6e88fe60b582c576f5bfb78e88 23-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Set preferred PHY and read PHY implementation (1/3)

Test: manual
Bug: 30622771
Change-Id: I43b7b036e50188f76d8ed0609f5142b2a4ad07ee
att/GattService.java
8cd0a17a7d64e34178807f178be63b12f5cd4688 23-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 Enable->Enabled (2/2)" am: f5505ac184 am: fe39467aad
am: a46f78b758

Change-Id: I7aefa97a6dfc01eb8a0ad26ecf7a82cbbf55725d
fe39467aade71425d41162d24789178abe20ff51 23-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 Enable->Enabled (2/2)"
am: f5505ac184

Change-Id: I4d102d76670253d72c719b1ca99457ea05a45e32
f5505ac184173807652a1e9c7045a3d0099fe5e2 23-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 Enable->Enabled (2/2)"
8afb5229a27e775f16f920c43db30061a7a96593 22-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 Enable->Enabled (2/2)

Test: manual
Bug: 30622771
Change-Id: Ifce2fc20fde2c55f26cb54012c9ee4eb44b1c91e
att/AdvertiseManager.java
5269dfe71bfefe287db723de5563dd7be77d065f 22-Mar-2017 Ajay Panicker <apanicke@google.com> Merge "Add rejected calls to Incomming Call History" am: 048d5aaff9 am: fce8d2a965
am: d76888650e

Change-Id: I3d05e3afad1e3b838c9134261f1d930d9486ffb2
fce8d2a965a2b23afcd6c1387b8a473051e405dd 22-Mar-2017 Ajay Panicker <apanicke@google.com> Merge "Add rejected calls to Incomming Call History"
am: 048d5aaff9

Change-Id: I3351863c632270fac223726a624ae0fe2d8e0bf7
048d5aaff9f9b545c09dd22042ae6d96137c5f7c 22-Mar-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Add rejected calls to Incomming Call History"
4ad109a53e99b559909b3239a99cb0d4bf0744c6 22-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Remove un-supported formats from SDP" am: 65f0a7ea2c am: a3014f0f18
am: 462b2a5ec5

Change-Id: I3df17257fcc3f0e896772b8c7a239c0cdaeddf22
a3014f0f1855e329b4e5e40bf549ae08e62cdf95 22-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Remove un-supported formats from SDP"
am: 65f0a7ea2c

Change-Id: I8976455db62ecffc8df8b70eb8248191321c5c6d
52f2f2a6dc254ce5d715a9533f0e6faae3b5c2a1 22-Mar-2017 Ajay Panicker <apanicke@google.com> Add rejected calls to Incomming Call History

Bug: 36490575
Test: Connect to carkit after rejecting a call on test device
Change-Id: Ifa3593b5b26e13a3bd6d2b94f744254e3eb353fb
bap/BluetoothPbapObexServer.java
45d51acb639adebef03c9e6a0591586de649a4a6 22-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Replace deprecated API(s) with new API." am: a2f7b90981 am: 3b6dac5898
am: 32af253a3f

Change-Id: Ice9ba86ccc496ac8c0f2e03b6891a31af035f497
3b6dac58981802734418de741075549a25fbccfd 22-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Replace deprecated API(s) with new API."
am: a2f7b90981

Change-Id: Id018ab5d51c3f53f4fd208fbd82abf9b320cdbe5
560fb676a64f888d31e672a4b66e52a05abb5f26 21-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Remove un-supported formats from SDP

Use case:
1. Send a vcalendar file to DUT
2. Verify file is received on DUT

Result:
DUT rejects vCalendar put request with reason unsupported media type
although DUT SDP records claim support for vcalendar format. Same is valid
for vNote and vMessage formats as well.

Rootcause:
ACCEPTABLE_SHARE_INBOUND_TYPES does not have support for above MIME formats.

Fix:
Remove vCal, vNote and vMessage from OPP Server supported format list.

Reproducibiltiy:
5/5

Test: All PTS tests that were enabled because of support for different OPP MIME
formats got disabled as by default OPP Rx will not support these MIME formats
leading to no OPP failures in PTS.

Bug: 36467777
Change-Id: I2503f5c61dd28fd3cf73d10939c6d931dbe0d6ea
pp/BluetoothOppService.java
dp/SdpManager.java
9c11dad35ee454d303b4f56a87042fc094bb61d8 06-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Replace deprecated API(s) with new API.

Remove unnecessary variable/functions and avoid using
deprecated API(s).

Test: OPP functionality (Tx/Rx) works fine without issues.

Bug: 35013632
Change-Id: Ice9314d599d0c0f4d7cc0e1ed70c7e87fa41e937
pp/BluetoothOppBatch.java
pp/BluetoothOppHandoverReceiver.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppNotification.java
pp/BluetoothOppProvider.java
pp/BluetoothOppReceiveFileInfo.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppSendFileInfo.java
pp/BluetoothOppTransfer.java
35a1b2d3448c9449b7461c5828ee5149d97f5467 22-Mar-2017 Jack He <siyuanh@google.com> Merge "Call System.exit(0) in onDestroy" am: 0214c82fd5 am: 30d0df8a3e
am: 219d962f1b

Change-Id: I9dbe6edba105476b2b4c423e019168c3d92948e4
30d0df8a3ed2b1dec01b2c6dc28ec048911d7912 22-Mar-2017 Jack He <siyuanh@google.com> Merge "Call System.exit(0) in onDestroy"
am: 0214c82fd5

Change-Id: I6c742028f19ca69badf29ef2268e064fec1fd085
33e325b5c50001d9eb6c9d53cc0a258aa93c9dd1 22-Mar-2017 Jack He <siyuanh@google.com> Call System.exit(0) in onDestroy

Call System.exit(0) in onDestroy() to make sure state is cleared in
the Bluetooth stack when Bluetooth is disabled

Bug: 27859763
Bug: 36487153
Test: Build, run unit tests, Bluetooth enable/disable
Change-Id: I34917ca3302b01c4da74b969da08860d6fbf8274
tservice/AdapterService.java
d8861915771e841bfb3a2d8d1ad7668e52cb64f1 20-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 AdvertisingSet implementation (2/4)" am: b9954db54b am: b8a0a458e2
am: 8899aaeb8d

Change-Id: I5e1dce7724a8d27b1f80c23cf8cd3a8f1a6aa706
b8a0a458e2fc3f47fe677bc1919c345222c264b8 20-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 AdvertisingSet implementation (2/4)"
am: b9954db54b

Change-Id: I718747628310e4a9af5b580e0a9752c0194fbb28
8cc4343c3b71c7a4d57c0b8c669b0a6188185f6b 17-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 AdvertisingSet implementation (2/4)

Test: manual
Bug: 30622771
Change-Id: I69e1ce6be3b776f783d2b2d18aee63a494b8cfd1
att/AdvertiseManager.java
att/GattService.java
7e687a79280f60135dacd4723e45ed905d5bfb19 18-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 move timeout parameter (2/2)" am: 91aa86124b am: 0cff63044b
am: 26abda20bf

Change-Id: I9eeacd23ccd9155fc26fee45a897adbbda33b345
0cff63044ba6f05d7d6e64b1e37d647f1779d896 17-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 move timeout parameter (2/2)"
am: 91aa86124b

Change-Id: I9cdefa60cc696cb727a24f0d3a29969deeffc860
b3246f3a27d269b4c0ef19cb2c8772d039eb26cc 17-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 move timeout parameter (2/2)

Timeout is not a parameter, it is a property of enabling the
advertising. Move it into more proper place.

Test: manual
Bug: 30622771
Change-Id: Ib688f183bf71fe429da6b9c3c8eb3591e9c6ec1d
att/AdvertiseManager.java
att/GattService.java
d9251e30cd3caf7b15fcce49c259e73aefeb9b51 17-Mar-2017 Jack He <siyuanh@google.com> Merge "Fix formatting issue on Headset State Machine"
am: 61345026a7

Change-Id: I7058f53b20e94b75042ae1127e0a3b6f099d50b9
61345026a788c4226a375adedbc3ef53db30818c 17-Mar-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Fix formatting issue on Headset State Machine"
c303b43b314abb34284182eee839217469ac51cd 09-Mar-2017 Jack He <siyuanh@google.com> Fix formatting issue on Headset State Machine

Test: build, no user visible effect
Merged-In: I482661d95ac6e30a6f55afa9970627e889907125
Change-Id: I482661d95ac6e30a6f55afa9970627e889907125
fp/HeadsetService.java
fp/HeadsetStateMachine.java
dbc1c61208e493caa17888848e7290717bcb32ec 17-Mar-2017 TreeHugger Robot <android-build-prod@system.gserviceaccount.com> Merge "Fix formatting issue on Headset State Machine"
3659dee2b21c7f269a2bef051483093fe07e5682 09-Mar-2017 Jack He <siyuanh@google.com> Fix formatting issue on Headset State Machine

Test: build, no user visible effect
Change-Id: I482661d95ac6e30a6f55afa9970627e889907125
(cherry picked from commit 79ea359530515b27f608e52cc53f33d3797f7d4c)
fp/HeadsetService.java
fp/HeadsetStateMachine.java
c17583b8c79588cce0611c5e40900065fa0c982a 17-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "LE Maximum Advertising Data Length (2/4)" am: 4cee47de11 am: 9a6a474ca6
am: d45acd0053

Change-Id: Ie13b1b78b9b21349f6490d5256ae5597f220cd62
9a6a474ca6d2415b8b53ca24444a5c89945319b6 17-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "LE Maximum Advertising Data Length (2/4)"
am: 4cee47de11

Change-Id: I2a26d6eb8a9b8372dc2a171e798aec5f122794b0
1f205202cbab0dd9edd2654bfbc60edd77b5ab58 17-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> LE Maximum Advertising Data Length (2/4)

Add ability to check maximum advertising data length.

Bug: 30622771
Test: manual
Change-Id: Ia912f9d738ec8dbf56205a1c22a21f687d9cb6cd
tservice/AdapterProperties.java
tservice/AdapterService.java
752c435ef8ea48a2a0b97d313c6183f52c942672 17-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 AdvertisingSet implementation (2/4)" am: 92b2f24308 am: b0cefb9617
am: a1c00d1c01

Change-Id: I021d704fb92c155a5520a39a8d174dbb897d3982
b0cefb9617e3e5911b78b82924672e65319f6821 17-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 AdvertisingSet implementation (2/4)"
am: 92b2f24308

Change-Id: I5d070edb82d2b1d51339bb68e9dc1fdb46e035e0
917f34e18aa235e68ac0663e24f52100e95970b7 13-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 AdvertisingSet implementation (2/4)

This patch wires up fist methods of AdvertisingSet, making it possible
to start advertising and stop advertising. It also replaces legacy
implemementation with calls to new implementation.

Bug: 30622771
Test: sl4a ConcurrentBleAdvertisingTest
Change-Id: I35e7db5df1945d101402299f78dd541e346d548c
att/AdvertiseClient.java
att/AdvertiseHelper.java
att/AdvertiseManager.java
att/GattService.java
8bf42fb4386aecb590a96e4055889c4c6e2bba54 16-Mar-2017 Jack He <siyuanh@google.com> Merge "AdapterService: Do not call System.exit() on onUnbind" am: 5cc1112d65 am: 97669e3cf2
am: d1bd91c832

Change-Id: I646ae82b85c5573a52e526aeb9c2892ca5c7a8f1
97669e3cf2e6b46545096d249b759fb44ce3e138 16-Mar-2017 Jack He <siyuanh@google.com> Merge "AdapterService: Do not call System.exit() on onUnbind"
am: 5cc1112d65

Change-Id: I6893a7be8a7676092efdb5bf49921616aff041f8
e169577e19d174dffe93970e08059aeb1e2ec894 16-Mar-2017 Jack He <siyuanh@google.com> AdapterService: Do not call System.exit() on onUnbind

* Process termination should be handled by the OS
* System.exit() in onUnbind also prevents onDestroy() to be called
* Removed isMock() since its only use case is to check if System.exit()
should be called

Bug: 35366908
Test: make, run java test, turning Bluetooth ON/OFF
Change-Id: Ieba927ce86d5dd27269f10188c74308fa76e66d9
tservice/AdapterService.java
2c7e241ae35137020d00f686692e4f90883f8074 16-Mar-2017 Marie Janssen <jamuraa@google.com> Merge "Broadcast ACTION_PAIRING_REQUEST to everyone again" am: 71da1cf06b am: a670256bf7
am: 2c85a2fb29

Change-Id: Iff29d77430a3133aa7de135e20fc8f3afbce1e6c
a670256bf7dd5623d17b1b3bb2afd2806ebdcb5c 16-Mar-2017 Marie Janssen <jamuraa@google.com> Merge "Broadcast ACTION_PAIRING_REQUEST to everyone again"
am: 71da1cf06b

Change-Id: I57f8a7673d28fcbe1e60d51e192564bf13189682
ed7769f8ae926290325cc81aca25da5923d9870c 15-Mar-2017 Marie Janssen <jamuraa@google.com> Broadcast ACTION_PAIRING_REQUEST to everyone again

ACTION_PAIRING_REQUEST to be sent to all packages while new methods for
handling automated pairing are developed.

Test: AAP pairing && SL4A connection tests
Bug: 36024655
Bug: 35853357
Change-Id: Ib07adf5253c1e051ab2abc6e2ed711d8bbf107c9
tservice/BondStateMachine.java
21ac25fb3b89c761fb2617f89554482337c57331 15-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix advertise data length parsing" am: 91dca83714 am: cb43fe1b20
am: 3f2cfb78bc

Change-Id: I27ba5edef65a75802455435d9355ca3c04b9ee9b
cb43fe1b20064cbe38518129656d89e35a056f85 15-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix advertise data length parsing"
am: 91dca83714

Change-Id: I8328e4b789189d7f3320418553d9a5f5957e35c2
a8c9c053dfe53df74934e1210b4c0cee521bf036 15-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Fix advertise data length parsing

Bluetooth 5 advertise data can be longer than 128bytes. The length bit
must be properly converted to unsigned value for such long data.

Bug: 36086416
Test: manual
Change-Id: I7449ea99be2e78dd60dd90ec607b74f2bb02d213
att/GattService.java
1c4f03e514ec8ca79bce9a9041a5d82540561b91 14-Mar-2017 Andre Eisenbach <eisenbach@google.com> Merge "Initialize the Media Player list at start" am: af66394a61 am: 4120a36bb1
am: 139f67c496

Change-Id: I45eaadd89b962b2d9d1fd0339d61dc44490ce2f5
4120a36bb10879f6d3221ad161ca29e8bb8e2745 14-Mar-2017 Andre Eisenbach <eisenbach@google.com> Merge "Initialize the Media Player list at start"
am: af66394a61

Change-Id: I50bf13adf13e46737b6bc5ecc4bef1d5b01b446c
11bf73ff614f48a41dc379763bc007f271197b26 14-Mar-2017 Ajay Panicker <apanicke@google.com> Initialize the Media Player list at start

If the browsable list builder fails to receive any connect callbacks when
connecting to media services, we could be left in a state where the media
player list is uninitialized. This is fixed by always initializing the
media player list at the start of AVRCP.

Change-Id: I15088c1f4e8ffa2ac8a101339c9b47989fc17a5e
Fixes: 36151636
Test: Manually tested connecting AVRCP with AVIC-8100NEX
vrcp/Avrcp.java
3b1061a2d6ffe13f84e3d813e4955c31d4c593fa 11-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 feature check implementation (3/3)" am: af78536ab5 am: 9163d2b20c
am: 52f852db81

Change-Id: If1646c29d60d3fe083f3dfbc8a79f65b9654a1ed
9163d2b20c0293b7f34bf91a9e8a57e08336680d 11-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 feature check implementation (3/3)"
am: af78536ab5

Change-Id: Ie3d08bc680f1e3a93fda7cf90d0d693f379104fb
551de252cd8661c9f65a16211386e354e3f0d063 10-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 feature check implementation (3/3)

Wire the new feature check API to actual values received from the
controller.

Test: manual
Bug: 30622771
Change-Id: I0812ed3ed8e28b8be34090ffb09c27d7a6405b8b
tservice/AdapterProperties.java
tservice/AdapterService.java
a8511da7a301d94b85c7ea07ba13c5b5c3e55f7b 10-Mar-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP PropertySelector" am: e0f2564001 am: f6bfa2ab47
am: c7cf507694

Change-Id: I093436dd9bcc306362ba0f25dbfd90e92cb78144
f6bfa2ab474f9cef46919a1db7119c0402372c6a 10-Mar-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP PropertySelector"
am: e0f2564001

Change-Id: Ic85da3fffa537ec1651ea517ff7c8a0c41470009
ea6f5c72ed023255dd2350b4727c1c02dc33c04c 09-Mar-2017 Srinivas Visvanathan <sriniv@google.com> Updating contact extras in Unread-msg broadcast

- Contact uri/name are sent as string instead of string-array.

Bug: 33280056
Test: Manually
Change-Id: I4221c2a529009d02135dcfb8d15262bd5129a08b
apclient/MceStateMachine.java
33e2ea9f0756c2dc4f8dccd712e38b860a694922 01-Mar-2017 Joseph Pirozzo <pirozzoj@google.com> PBAP PropertySelector

Fill out and transmit the PropertySelector when requesting to download
the phonebook. Although the PropertySelector field is an optional field
and the default behavior is well specified when it is absent, some
phones do not adhere to the specification. By sending the
PropertySelector field we can improve interoperability and eliminate
unneeded data.

Bug: 35322439
Change-Id: I25bcfce8bf4c7648c7cc07387bf02ebef600cf44
Test: Verification of filter bits set in wireshark and successfull
transfer of contact images, names, and numbers.
bapclient/PbapClientConnectionHandler.java
bapclient/PhonebookPullRequest.java
fc7baa33a7590237fe8cbea234fe3d0c8c7dc502 08-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Use fixed size scan response data" am: cc295bbfee am: ece2d59522
am: 42466fc833

Change-Id: Ib3fc7e69c7e218623f05274100657f38284013ab
ece2d59522de439feb5d959d6deefa49a6d7323f 08-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Use fixed size scan response data"
am: cc295bbfee

Change-Id: I83c212284fe05204ed25bf02c2a2a73221487c71
3ae219d81403f905ed4efc3b6071acae075e7660 08-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Use fixed size scan response data

We used to return fixed size scan response data before commit ed3417a6,
and some applications rely on this behaviour. For now make sure that all
apps get fixed data.

Bug: 36003118
Test: manual
Change-Id: Ieff1a933c01e7fcb0ae36f740048ccba2b3481b9
att/GattService.java
c38bf613d601a6b95eeaa91f22c4adf7d04bf9b0 08-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 Advertising API"
am: dcffb67e16

Change-Id: I28998dc9ff77349eb219d0511ca8af797fd10c4f
86508a4a5b0abd7e074eccfb36f69b6799a206ab 08-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 PHY change API"
am: d3e9d9f8b1

Change-Id: Ia9e2375ba0138e78077f4b4b7f9fac6ef8b65e9f
5bb6c3f0e8efaeaf92082e8414859eda1bf513a6 08-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 periodc scan API (2/2)"
am: d84aac6a34

Change-Id: I322c05d22c1cbfeff33f9fa7238b001071c58269
b8d9dd85f20a08631e1a4366f86bb18815dd4c68 08-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Propagate Bluetooth 5 scan result properties"
am: 30241a4d72

Change-Id: I4fbbec83552071bd756b8aabd43d3e62b94874bd
d5a798f579fdc89f39849c6843abfa4237192ac9 08-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 feature check API (2/2)"
am: b52e56f18b

Change-Id: I481dc74b86858e185798e65a48393470fc4d1496
ba699eadbd14de6561e65950adf6f4ad02546c52 10-Jan-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 Advertising API

Bug: 30622771
Test: manual
Change-Id: I3a670756e26345833ce595c9b22b8b39ae0ba41f
att/GattService.java
21013566d951befa7a129f3e8e2f62c5ba401ebd 07-Feb-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 PHY change API

Bug: 30622771
Test: manual
Change-Id: I859d23e7db95585551675d09c0b009222a475dd2
att/GattService.java
04feee00681f5ca88480a6700e1d6e4baf69293e 01-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 periodc scan API (2/2)

Bug: 30622771
Test: manual
Change-Id: I2bde2072f55949b195b64e0ce333a40b4f6d6673
att/GattService.java
f37eca417f424c4900a48b8d95d10178cab5c543 07-Feb-2017 Jakub Pawlowski <jpawlowski@google.com> Propagate Bluetooth 5 scan result properties

Bug: 30622771
Test: manual tests
Change-Id: Icbb353aa3435a97035c81384fc9031175a934239
att/GattService.java
c9456d3d91fc683a41354e16d1d4259323c8f032 08-Mar-2017 Srinivas Visvanathan <sriniv@google.com> Merge "Including Handle in Unread-message broadcast"
412c7264674341300bc1cb2bfbd8bcda92d468ee 08-Feb-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 feature check API (2/2)

Bug: 30622771
Test: manual
Change-Id: I90e2efe989745c07c2f2fb8f4ea5bc3b718382f6
tservice/AdapterService.java
b1ad50fe30850472d91c86ec6c36763c243e4975 10-Jan-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 Advertising API

Bug: 30622771
Test: manual
Change-Id: I3a670756e26345833ce595c9b22b8b39ae0ba41f
att/GattService.java
42cb5bfd06eacca873c2afc921738c5af8fd77f2 07-Feb-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 PHY change API

Bug: 30622771
Test: manual
Change-Id: I859d23e7db95585551675d09c0b009222a475dd2
att/GattService.java
38a94db541f5eb50982d51d93fc594dd2b07b40e 01-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 periodc scan API (2/2)

Bug: 30622771
Test: manual
Change-Id: I2bde2072f55949b195b64e0ce333a40b4f6d6673
att/GattService.java
f1a86cbf7b3268ba61851559b8869adca56999e6 07-Feb-2017 Jakub Pawlowski <jpawlowski@google.com> Propagate Bluetooth 5 scan result properties

Bug: 30622771
Test: manual tests
Change-Id: Icbb353aa3435a97035c81384fc9031175a934239
att/GattService.java
ff9923489b7fb87b4fbd9a5ffb9b9a8e9079a0cf 08-Mar-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth 5 feature check API (2/2)"
97e134ff5c6add04c454e052f817e2e155d1e5a0 08-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Add OPP 1.2 feature." am: 3361ec466c am: d92e77006e
am: 30c1788597

Change-Id: I33a72bf2526a869f90fd213d52622fa4373859ae
d92e77006e7f60ff4580a65eceeaa22b5e0d751b 08-Mar-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Add OPP 1.2 feature."
am: 3361ec466c

Change-Id: I861f5aecb8721baa8cc7a8ffd4e215f0d9de1ddd
20a83dc11d22f3de0accaa0957c94c5b14496f88 08-Feb-2017 Jakub Pawlowski <jpawlowski@google.com> Bluetooth 5 feature check API (2/2)

Bug: 30622771
Test: manual
Change-Id: I90e2efe989745c07c2f2fb8f4ea5bc3b718382f6
tservice/AdapterService.java
926eccc4833e86ba491efa651c5072fe3226b00c 07-Mar-2017 Srinivas Visvanathan <sriniv@google.com> Including Handle in Unread-message broadcast

- Including Handle in Unread-message broadcast. Clients can use this to
identify messages within a session.

Bug: 33280056
Test: Manually
Change-Id: I7b1d6f6e4016c4c8ecfe60345df052f3732d45f5
apclient/MceStateMachine.java
apclient/obex/RequestGetMessage.java
4aa5e4e2fe52c06d97481db0bf180349053dae48 16-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Add OPP 1.2 feature.

Add changes to support OPP 1.2 which uses OBEX over L2CAP.

Test: Connect with Remote OPP Client supporting OPP 1.2 and verify
that connection and transfer happens over L2CAP. Connect with Remote
OPP Client supporting OPP 1.1 and verify that connection and transfer
happens over RFCOMM.

Bug: 33010988
Change-Id: I44c2f2f01fb04f4306d0eb121d66dc08954966c0
bexServerSockets.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
dp/SdpManager.java
564b35e8f2ef5dd0015a49f1e52ea94dc0a42068 02-Mar-2017 Srinivas Visvanathan <sriniv@google.com> Updating fields in New Unread-message broadcast

- Including BT device that new message notification is for. This will be
helpful for messaging apps that need to handle incoming messages for
different possible devices. When a device disconnects, all messages
persisted from that device can be wiped.
- Switching extra used for sender fields. Using *RECIPIENT* fields was
confusing and hence switching to new *SENDER* fields defined in
BluetoothMapClient.

Bug: 33280056
Change-Id: I6bf410315801eeb7e869e86b807c8261e4ffae3f
Test: Manually
apclient/MceStateMachine.java
7e0bfa88762d8bb080705dc00c503ce25e1a8b98 23-Feb-2017 Amit Mahajan <amitmahajan@google.com> Merge "Exception and death notification handling for ISap." am: f2f1ecd69e am: f598dcd6b5
am: a909908155

Change-Id: Ia7487f95c4dda08c28b1ddb8e22baa5c32750f13
f598dcd6b545383732b3784f24fc4a0960d96d09 23-Feb-2017 Amit Mahajan <amitmahajan@google.com> Merge "Exception and death notification handling for ISap."
am: f2f1ecd69e

Change-Id: I83c55cc4d32d812415b164f89bffdbe58bb562ea
f2f1ecd69e42b9abf05a9b46779e29cda643c946 23-Feb-2017 Amit Mahajan <amitmahajan@google.com> Merge "Exception and death notification handling for ISap."
c33526f6999a5a8f74f40e2cbc9b480e8e3a9303 21-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "HID: Send connection state change broadcast during cleanup" am: 71f903cb3d am: 99c2b9f8fc
am: 959b195532

Change-Id: Ic89efbc6ffdc506a2c1bc322cec200a688f2da0e
99c2b9f8fcf1d7344edf3d800dd513bc1e5e5cae 21-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "HID: Send connection state change broadcast during cleanup"
am: 71f903cb3d

Change-Id: I35985711ac5708e021826a18a77ea3048d7bf829
c074ef3847cc28679509edd550c5d2a7f93268aa 02-Nov-2016 Hemant Gupta <hemantg@codeaurora.org> HID: Send connection state change broadcast during cleanup

Usecase:
1) Connect HID device with DUT
2) Turn Off BT

Observation:
HID state change is not received by application leading to
application showing connected even when BT is turned off and
HID was connected.

Rootcause:
HidService does not send state change to application if BT is turned off
while connected

Fix:
Send broadcast for HID connection state change during cleanup.

Test: Verified that connection state change intent is received by upper layers
during BT off if HID was connected.

Bug: 35013637
Change-Id: I5d7989887f9089876c78e43d97d066f384cc237e
id/HidService.java
a8e818c943d9b2046de1b61aaaeac877d87697ea 18-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Send ACL connect/disconnect broadcasts to manifest receivers"
512617997d76560cfcac1069495dff0c5d675654 18-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "PBAP: Fix Functionality failure for PBAP" am: fe641c1e38 am: 8e2b8940f1
am: c7b31065a5

Change-Id: I141ddc56865b9ee8ba204643278a86a935df1793
8e2b8940f1cff90d9cbd3d28decd2dd5d94f8963 18-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "PBAP: Fix Functionality failure for PBAP"
am: fe641c1e38

Change-Id: Ide835f7a3eb1dab26b7c9adff0a0b1710c9cff22
fe641c1e3817918c6673ad6fe1d88c21447edd77 18-Feb-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP: Fix Functionality failure for PBAP"
e7f838d89352ad39b3840311b4a40d4d7ef48e2f 17-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Fix Functionality failure for OPP Rx" am: 2cc49b962d am: 8977c829a4
am: 1fd8408561

Change-Id: I1d76f76332969ee5a17850b38a40faaa0f7f19eb
8977c829a481ec1d4d1dcd7f6dd7405445bb7a66 17-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Fix Functionality failure for OPP Rx"
am: 2cc49b962d

Change-Id: I6c139e1ca1e94dc8eeaaaf95912f56aed35474dc
b6bab63f4f973cfeda914f1fd3ee58fe0d922926 17-Feb-2017 Christopher Tate <ctate@google.com> Send ACL connect/disconnect broadcasts to manifest receivers

Bug 35403302

Change-Id: Ib2a9c177ec86f1a19ff26537da84f587c1d5270c
tservice/RemoteDevices.java
8711aafd89ae152e9c8f228a21e52ba4fbdafd59 17-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> OPP: Fix Functionality failure for OPP Rx

Usecase:
Send file from Remote BT device to DUT

Expectation:
File should be received properly

Observation:
File reception popup does not occur on DUT

Root Cause:
Socket listener not started for OPP

Fix:
Add changes to properly start listeners for OPP

Test:
1) Verified that SDP records for OPP are exposed and can be browsed
by remote OPP Client.
2) File can be received without issues from OPP Client.

Bug: 35416619
Change-Id: I5b4f343f3fd7b957ce423ce2cb76cd0683e10c3a
pp/BluetoothOppService.java
44c14217776ec48dc02fd8f25a60b7fcd193d92d 17-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> PBAP: Fix Functionality failure for PBAP

Usecase:
Connect to DUT from PBAP Client (Carkit)

Expectation:
Carkit is able to browse PBAP SDP and connect to PBAP Profile
with DUT

Observation:
PBAP Connection is successful

Root Cause:
Socket listener not started for PBAP

Fix:
Add changes to properly start listeners for PBAP

Test:
1) Verified that SDP records for PBAP are exposed and can be browsed
by remote PBAP Client.
2) Connection happens fine and phonebook can eb downloaded properly.

Bug: 35416619
Change-Id: I52acb1c10b91dd5ffecc44badcfd60f0e27b0a55
bap/BluetoothPbapService.java
a176898857c96029d1d0838babb8db287ad70523 17-Feb-2017 Marie Janssen <jamuraa@google.com> Merge "Broadcast BOND_STATE_CHANGED to foreground." am: 6d3498fba2 am: 0864a05422 am: 90e812968b
am: cd875f04a9

Change-Id: I970eac7670f0600d76579a16f813398d3f54ad25
90e812968baead0adca392486afd2143bc84df98 17-Feb-2017 Marie Janssen <jamuraa@google.com> Merge "Broadcast BOND_STATE_CHANGED to foreground." am: 6d3498fba2
am: 0864a05422

Change-Id: Ia9999e7976b1b931637af472178df20ccf9ad489
6d3498fba2d74950cf4961c8d841c92a205e8165 16-Feb-2017 Marie Janssen <jamuraa@google.com> Merge "Broadcast BOND_STATE_CHANGED to foreground."
fc8677faf32ae6a2a6d132c9754c28aab6a9148f 15-Feb-2017 Marie Janssen <jamuraa@google.com> Broadcast BOND_STATE_CHANGED to foreground.

Limiting BOND_STATE_CHANGED to settings app meant accessories apps can't
determine when a device completes pairing.

Test: pairing tests with various devices
Bug: 35234069
Bug: 35325574
Change-Id: If9fffb3410ec051b96e65b867571e93ae56ca706
tservice/BondStateMachine.java
73b643d20a5c20f370845569ccffd1fa6b634413 15-Feb-2017 Ajay Panicker <apanicke@google.com> Merge "Prevent getting Session Token if media browser isn't connected" am: cda194ce36 am: 5dd802d8d7 am: a0c275a817
am: 1c5ad86437

Change-Id: Ieafc0e19e7c019d54e5de67ecfd5ac8aac4270a1
a0c275a8179073cc9e00c50eed06187795638d9e 15-Feb-2017 Ajay Panicker <apanicke@google.com> Merge "Prevent getting Session Token if media browser isn't connected" am: cda194ce36
am: 5dd802d8d7

Change-Id: I2872bfbd6e7dcc64aa9a22629c4ef2125a1a968a
e03b71ad9c4c89ab36f836145d90120c6457479e 14-Feb-2017 Ajay Panicker <apanicke@google.com> Prevent getting Session Token if media browser isn't connected

Bug: 35348574
Test: Sanity test browsing with VW Carkit
Change-Id: I795a19f4bd0a95d36f64bc767fdeda108c20f5ed
vrcp/BrowsedMediaPlayer.java
a11b41371f21dbf4865863e5d8dbc4b9fa8f8c5c 14-Feb-2017 Marie Janssen <jamuraa@google.com> Merge "Services: start PBAP and OPP like other services" am: 14280ec46c am: 6686a52270 am: 4701d38aa1
am: a5e304fc5d

Change-Id: Ied6cd2949a4853e1a1bf8c8f5692d2742c12b872
4701d38aa14da59bfa48d588826be716e5e5f0c0 14-Feb-2017 Marie Janssen <jamuraa@google.com> Merge "Services: start PBAP and OPP like other services" am: 14280ec46c
am: 6686a52270

Change-Id: If279435e68c4f8bd65487ab3cbd7f1a73a94bc21
72d0629dfc5db8ae48a512b47aa384f42b9ed71d 07-Feb-2017 Marie Janssen <jamuraa@google.com> Services: start PBAP and OPP like other services

PBAP and OPP are currently normal services that are started and stopped
by the system. Have AdapterService start them just like all of the
other profile services instead.

Bug: 34395439
Fix: 35216901
Test: connect to a carkit that does PBAP
Test: use beam to receive a file
Change-Id: I84e769886f6aa4e698bd07fb9900f124111b50b3
tservice/Config.java
tservice/ProfileService.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppService.java
bap/BluetoothPbapActivity.java
bap/BluetoothPbapReceiver.java
bap/BluetoothPbapService.java
5c01e8796f5ff6f9dfed215160612ac91493c9f1 13-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "Remove use of Contacts.IN_VISIBLE_GROUP" am: c8a531ab45 am: 2a5a9bee6e am: 29621d90da
am: 341400874e

Change-Id: I7fa86fa7fe95fda46228269a8ed3ea2fb3e3cdac
29621d90da6724c3a0c948a5bc616f288f9b1ebb 13-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "Remove use of Contacts.IN_VISIBLE_GROUP" am: c8a531ab45
am: 2a5a9bee6e

Change-Id: Ia59221960abf72d4fb231b9b44c36773ec740081
e93237d7f3ef9d50a6791708d3ad903e66aa7248 13-Feb-2017 Marie Janssen <jamuraa@google.com> Merge "Use resources for pairing ui package" am: 5c72d9a85a am: aa6795b9c9 am: 13cf7aa3d9
am: 028d19f5ad

Change-Id: I73c03f386f1626bf5463060fc3af8b6f8c666cb7
af64b66d0705f8e1f5b7d20a56f8f6997b60093a 13-Feb-2017 Amit Mahajan <amitmahajan@google.com> Exception and death notification handling for ISap.

Test: Basic telephony sanity
Bug: 32020264
Change-Id: I3d710fc59a397fe0054b286d422066f9ff149262
ap/SapMessage.java
ap/SapRilReceiver.java
ap/SapServer.java
4f259e9aa3a3dbcef758902fe0769f584001f50b 11-Feb-2017 Hemant Gupta <hemantg@codeaurora.org> Remove use of Contacts.IN_VISIBLE_GROUP

IN_VISIBLE_GROUP is a column that should not be used by Bluetooth
and is only relevant for the Contacts App.

Change-Id: I05866ccdfd565643564bf4217a4dfaf196e26d16
Bug: 35013623
fp/AtPhonebook.java
13cf7aa3d997f333a82791b172f078e04d0c4743 13-Feb-2017 Marie Janssen <jamuraa@google.com> Merge "Use resources for pairing ui package" am: 5c72d9a85a
am: aa6795b9c9

Change-Id: I4e6c039d0e7bd3f3090f333bc83e64ffdbd644c6
5c72d9a85ab99f254cedfcd9a29a6686d121ea38 13-Feb-2017 Marie Janssen <jamuraa@google.com> Merge "Use resources for pairing ui package"
e38e481a756b0eeb50f72f6f9f3252046c65087b 11-Feb-2017 Ajay Panicker <apanicke@google.com> Merge "Use END:MSG to determine bMessage body end" am: cdc1edbe64 am: 883b0a1086 am: c68cf9dd22
am: 1a3401df72

Change-Id: I0685a8d0f8cc8890293b94556cf913590fff3763
c68cf9dd2271a7142e6bd69d83dd54f3c7fd7a7f 11-Feb-2017 Ajay Panicker <apanicke@google.com> Merge "Use END:MSG to determine bMessage body end" am: cdc1edbe64
am: 883b0a1086

Change-Id: I126162e0954c6be7cd4d60dc7e79a77fc901e36f
da6bccfffb75e8452faafa8906082dc192cd7ce9 07-Feb-2017 Ajay Panicker <apanicke@google.com> Use END:MSG to determine bMessage body end

Use END:MSG to determine the end of a message body instead of using
an incorrect length that was sent by the carkit,

Change-Id: Idf93a6fec50755ad5e9433e237ebca242e2d83aa
Fixes: 35102373
Test: Send multiple messages from Chrysler carkit and TestTracker:75287
ap/BluetoothMapbMessage.java
aed51b5e1151240567d990bacff01b66572fd45b 10-Feb-2017 Marie Janssen <jamuraa@google.com> Use resources for pairing ui package

The pairing package is set to "com.android.settings" which means
overlays can't change the package that's responsible for UI interaction
when pairing and access request events happen. Move it to a resource.

Test: pair a device, initiate pair from remote
Change-Id: I5731bcdcfed58b72b4e15e3e60035c7e8144b7d4
Bug: 35163738
Fix: 35219650
tservice/BondStateMachine.java
tservice/RemoteDevices.java
fp/AtPhonebook.java
ap/BluetoothMapService.java
bap/BluetoothPbapService.java
ap/SapService.java
c38b6da77ffb536de6135f7c15eac07fa88c37f3 10-Feb-2017 Sanket Agarwal <sanketa@google.com> Merge "Conference calling crash on null call object"
90ecb737f15de886ec646e66f5099d608b87d418 09-Feb-2017 Christopher Tate <ctate@google.com> Send Bt connection-state-changed broadcasts to manifest receivers

Connection-state notifications are intentionally allowed to launch apps
that have subscribed to them.

Bug 35207510

Change-Id: I8d2c9ff53f7338e3f7f43cdde9419cc29aaaab22
2dp/A2dpStateMachine.java
fp/HeadsetStateMachine.java
906b7250b6f57f2dbfb5daca8915db81f584725b 09-Feb-2017 Sanket Agarwal <sanketa@google.com> Conference calling crash on null call object

After conference call ends there are some NPE happening because the call
is being accessed after getting destroyed. Check that underlying call
object is not NULL

Bug: b/34983172
Test: Hangup conference call from CarKitt
Change-Id: I08bfc5478a4dce4e608d7dc5cf9688b65fbc6637
fpclient/connserv/HfpClientConnection.java
30b9b7738f1096cd85417c7d784947763e03c7b3 09-Feb-2017 Sanket Agarwal <sanketa@google.com> Merge "Abort fetching items if remote sends us an error" am: 60a720c650 am: bc391cebd1 am: bb76e31813
am: 8e7219fff3

Change-Id: I492cc3585f9d60152a5a1055627ce8285dd3dc40
5674ca7041c11d2f9ca6a5b390600e932e2c8cba 09-Feb-2017 Marie Janssen <jamuraa@google.com> Merge "Broadcast pairing intents to settings package" am: d5cedd37c6 am: edbc3ed61e am: 43a12fbba6
am: 0acca779d4

Change-Id: Id46f737de88db91087e5df037728a252dd05f8bf
bb76e31813184f2dc1c36b89810d41485176d33a 09-Feb-2017 Sanket Agarwal <sanketa@google.com> Merge "Abort fetching items if remote sends us an error" am: 60a720c650
am: bc391cebd1

Change-Id: Ib00e7a6023a9cde72bd17f115b11c022835bda67
43a12fbba67007f9d4b97c4c7eeca0f7ac542bf3 09-Feb-2017 Marie Janssen <jamuraa@google.com> Merge "Broadcast pairing intents to settings package" am: d5cedd37c6
am: edbc3ed61e

Change-Id: Ifa6c734384fe2d64cf9f4d9c08992a07daca4a5f
60a720c6507ed8ef5daea6a87e095b74caf494f1 09-Feb-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Abort fetching items if remote sends us an error"
d5cedd37c6a294bec25bc986233aaf3de0c52692 09-Feb-2017 Marie Janssen <jamuraa@google.com> Merge "Broadcast pairing intents to settings package"
3f360ed6148acc534ca6d790ed1b0486c6b3d65a 08-Feb-2017 Sanket Agarwal <sanketa@google.com> Merge "Handle conference calling w/ multi device" am: f5c91a8e85 am: bec8c58b4d am: c4fcf42203
am: 354ec8b76f

Change-Id: I113fd5c9eb3c992595af17ae6a712c142f18575a
eaf14d30927109da6029700ce25303fde844ca9b 08-Feb-2017 Sanket Agarwal <sanketa@google.com> Merge "Handle volume changes for multiple devices" am: 527cd9597f am: 6a4ab73f09 am: 8027fbac9f
am: cc7e54690b

Change-Id: I44a3a79ca188f61f10381d50ec2692ed5674eab3
c4fcf4220380d1cb0ee95cd85f68cb02270777a2 08-Feb-2017 Sanket Agarwal <sanketa@google.com> Merge "Handle conference calling w/ multi device" am: f5c91a8e85
am: bec8c58b4d

Change-Id: I34d7c4240998f18ad1c6fe1727f98f2e423e9c3d
e5df60ac54d1d5d868f6fb674bc493fec144305f 08-Feb-2017 Sanket Agarwal <sanketa@google.com> Abort fetching items if remote sends us an error

Currently most of errors from stack for GetFolderItems response come
back in form of a empty response list. Since we keep looping to get more
items, we often get stuck in a loop. Aborting is the right thing to do
here

Bug: b/35152188
Test: Try browsing over a folder which returns an error (not Out of
range) when trying to browse

Change-Id: I69bb90da71c55d46c04eaeab5a78026f22be9e02
vrcpcontroller/AvrcpControllerStateMachine.java
f5c91a8e850b4b214a855113a3f5a3692780d05e 08-Feb-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Handle conference calling w/ multi device"
8027fbac9f23e0c88cec7d0bf2af5766db30d0f8 08-Feb-2017 Sanket Agarwal <sanketa@google.com> Merge "Handle volume changes for multiple devices" am: 527cd9597f
am: 6a4ab73f09

Change-Id: I5de70bdc9d51e9bfd91eaa2bc30fe3ad3c853125
527cd9597fa9cbdbf6d62d597a9cc90f485b7748 08-Feb-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Handle volume changes for multiple devices"
e0466c0155cfd92f195786e21e197bc7c6ba9497 08-Feb-2017 Ajay Panicker <apanicke@google.com> Merge "Remove use of Contacts.IN_VISIBLE_GROUP" am: bdb6f925a4 am: ffbc02aaea am: fa24aecf0d
am: c7917c831e

Change-Id: Ic56625974ff55751aae596232e0d3a29f2315899
fa24aecf0d8d40f708197cf61ab552ab5da5171f 08-Feb-2017 Ajay Panicker <apanicke@google.com> Merge "Remove use of Contacts.IN_VISIBLE_GROUP" am: bdb6f925a4
am: ffbc02aaea

Change-Id: I02e6c568320f8274ac37981b8acea57ea21fa428
515626a94a01807a5a9d49af9a8cdb1be6251808 08-Feb-2017 Sanket Agarwal <sanketa@google.com> Handle conference calling w/ multi device

Bug: b/34983172
Test: Make a conference call and hangup (hangup should not crash the
stack)

Change-Id: I5b9707e227071acfe13ebad1575fc12d22087f81
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientConnectionService.java
93d129a2679021c3275ba940405ba2609853b9ee 07-Feb-2017 Sanket Agarwal <sanketa@google.com> Handle volume changes for multiple devices

Since synchronizing volume of multiple HFP connected devices is rather
cumbersome as a UX, we will make the car control the volume of the call
and the phone's volume will remain unchanged. The only scenario that
this breaks is when the user is trying to change the phone volume while
being in a call and connected over Bluetooth. This scenario should
anyways not happen for dirving safety

Bug: b/34518638
Test: Volume change w/ multiple AG connected to HF
Change-Id: Ic4345a71bfb677f94cf6543b1b2c64fb99676ed3
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/NativeInterface.java
4ca05d6f02264b0eb2983e43d34ca4051434a4d4 07-Feb-2017 Ajay Panicker <apanicke@google.com> Remove use of Contacts.IN_VISIBLE_GROUP

IN_VISIBLE_GROUP is a column that should not be used by Bluetooth
and is only relevant for the Contacts App.

Change-Id: If7dc10a899ce820f61758dea8346b780319ed994
Fixes: 35064907
Test: PBAP sanity test with Ford Carkit and TestTracker:75170
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapVcardManager.java
9cdf0e2181334e8afd949b7060ca89172844437c 07-Feb-2017 Sanket Agarwal <sanketa@google.com> Merge "HF Client: SCO routing for multiple devices" am: 2e3cd65d5e am: ff0687091b am: c183f468c3
am: aa744e0385

Change-Id: I493080a250035388c1ad2018acfc71d3f16ea8ae
c183f468c3fa092caa481275fb27e55f05ab25fc 07-Feb-2017 Sanket Agarwal <sanketa@google.com> Merge "HF Client: SCO routing for multiple devices" am: 2e3cd65d5e
am: ff0687091b

Change-Id: Ic3db4e2173abd6e6078c34c3a870eecb081a32e5
fb7703a90e8a408f9032fb1ea86888087f8df52e 07-Feb-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Propagate BT5 specific scan result properties up the stack (3/3)" am: f609494e26 am: 08595859ac am: a0d24f8f39
am: 7391ff6219

Change-Id: I31704d8fd1d733497b6adee52cf29a68a9324992
434c2f1a75997c28e898eebf417fc7454a7d881f 07-Feb-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Add a mechanism to configure the default A2DP codec priorities" am: db5851f52a am: b96199f74f am: 435317f88a
am: 414bdc649c

Change-Id: I2f62260dc8ad98ddc19a2fe6f44a260e9bf09203
2d9c62894634e9c4aa947ddf2cc50f4482163cf1 07-Feb-2017 Sanket Agarwal <sanketa@google.com> HF Client: SCO routing for multiple devices

Bug: b/34518638
Test: Manual testing w/ multiple active calls and SCO switching

Change-Id: Ic5e2dc8da69ee6c0e93a8b57a5f41a26b7b09513
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
a0d24f8f393903050cccd1a7bee948c223db7772 07-Feb-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Propagate BT5 specific scan result properties up the stack (3/3)" am: f609494e26
am: 08595859ac

Change-Id: If20fb31e69b76da17ca638a1c021a1bebaca664e
f609494e26f09a0e0a537768f4a41220c46916e0 07-Feb-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Propagate BT5 specific scan result properties up the stack (3/3)"
435317f88a44a82da299d7949fd54607683deef0 07-Feb-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Add a mechanism to configure the default A2DP codec priorities" am: db5851f52a
am: b96199f74f

Change-Id: Icbcefe85e3f0e28ad9b4015547204c836f307e10
ad71e23e009fc9a808db3547bcb3e1923f87aeaa 30-Jan-2017 Jakub Pawlowski <jpawlowski@google.com> Propagate BT5 specific scan result properties up the stack (3/3)

Bug: 30622771
Test: sl4a FilteringTest
Change-Id: I0afb900871cbc2f556ad506e21515e4ca8c49142
att/GattService.java
8a9f762c80d436719375de5d5f83c1c11e9f5723 02-Feb-2017 Pavlin Radoslavov <pavlin@google.com> Add a mechanism to configure the default A2DP codec priorities

Previously, the relative codec priorities were hard-codec internally.
The new mechanism uses the following configurable resources in
packages/apps/Bluetooth/res/values/config.xml to re-assign the
default codec priorities per device, or to explicitly disable a codec.

- a2dp_source_codec_priority_sbc
- a2dp_source_codec_priority_aac
- a2dp_source_codec_priority_aptx
- a2dp_source_codec_priority_aptx_hd
- a2dp_source_codec_priority_ldac

Those values are assigned on startup.
Also, they can be changed per device by using an overlay:
device/<VENDOR>/<DEVICE>/overlay/packages/apps/Bluetooth/res/values/config.xml

Test: Manually streaming to a headset
Change-Id: Ic3cf8549b46547dbeba93632c3178c6b7f2b810d
2dp/A2dpStateMachine.java
fbdf4f223574f48f8f3db83ea88e063a7551f799 20-Jan-2017 Marie Janssen <jamuraa@google.com> Broadcast pairing intents to settings package

Intent broadcasts intended directly for pairing dialogs should only be
specifically targetted to those packages.

Bug: 34395439
Test: pair a device, pair a device remotely, and connect devices
Change-Id: Ieb1354d534d4dc0457279aa3f1d3020b3a3ee37b
tservice/BondStateMachine.java
tservice/RemoteDevices.java
ap/BluetoothMapService.java
bap/BluetoothPbapService.java
ap/SapService.java
ff6c27d74172b1b9bb81bdc4658e5a710a1e6446 02-Feb-2017 Amit Mahajan <amitmahajan@google.com> Merge "Client changes for BT SAP hidl." am: f856d7942f
am: ff6120a8bc

Change-Id: Iad9703807e0f11e400ccfa74e815aeea4b10cdff
549c5a7e95c7934d8d3ab10a8653564e42b0c937 11-Dec-2016 Amit Mahajan <amitmahajan@google.com> Client changes for BT SAP hidl.

Test: Basic SAP sanity.

Bug: 32020264
Change-Id: If001ff221e3240a31cfbb08df11cbf6188ebd07e
ap/SapMessage.java
ap/SapRilReceiver.java
ap/SapServer.java
28ad49c7ebc69a0a3568d76d4514249b1d516008 31-Jan-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Update the A2DP Codec Config API" am: 0c5e1e15fa am: a50737f724 am: 526bb3ca92
am: 5afbb6aef7

Change-Id: I43ea78a15ce526364406c8f15a6d8a8dd4532896
526bb3ca925269f50d507521f4b05f79d7294506 31-Jan-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Update the A2DP Codec Config API" am: 0c5e1e15fa
am: a50737f724

Change-Id: I3e22d30a3c8057358ffc493239b6d1a156b0ef68
08d3925d3d72837e6f86c9e0beaed5f7b813ea37 26-Jan-2017 Pavlin Radoslavov <pavlin@google.com> Update the A2DP Codec Config API

Previously, the JNI upcall would contain only the current codec config.
In the new API, the upcall contains:
1. The current codec config
2. The list of codecs containing the local codecs capabilities
3. The list of codecs containing the selectable codecs capabilities.
This list is the intersection of the local codecs capabilities
and the capabilities of the paired device.

Also, refactored the Java internals to accomodate the extra information:
* Added new class BluetoothCodecStatus that contains the extra info:
current codec config, local codecs capabilities and selectable
codecs capabilities
* Renamed method getCodecConfig() to getCodecStatus() and return the
corresponding BluetoothCodecStatus object.
* Updates to class BluetoothCodecConfig:
new methods isValid(), getCodecName(), and updated toString()
so it is more user friendly
* Removed BluetoothCodecConfig.EXTRA_CODEC_CONFIG and
EXTRA_PREVIOUS_CODEC_CONFIG.
The former is superseded by BluetoothCodecStatus.EXTRA_CODEC_STATUS;
the latter is not really used.

Test: A2DP streaming with headsets and switching the codecs
Change-Id: I18536cffc5c73abc31c3d6afa54f9d3c3b1d577e
2dp/A2dpService.java
2dp/A2dpStateMachine.java
30e7dcff41df9f65e736e3a7bb26e52c0fc130bc 30-Jan-2017 Marie Janssen <jamuraa@google.com> Merge "AdapterService: track last discovering timestamp" am: 9f230a5591 am: 42ecb419fd am: db09bdd069
am: b026115e97

Change-Id: If4575310e6e57b21c64cb2ffab287f51f1cabfe3
db09bdd06948235287800799d620a131a176f2fe 30-Jan-2017 Marie Janssen <jamuraa@google.com> Merge "AdapterService: track last discovering timestamp" am: 9f230a5591
am: 42ecb419fd

Change-Id: I191c55e041ace98b88313d05d0e1b298751c31fb
2aad9ef373bb7c4d0415ba2869a72869d22673f4 24-Jan-2017 Marie Janssen <jamuraa@google.com> AdapterService: track last discovering timestamp

getDiscoveryEndMillis() is an alternative to the DISCOVERY_FINSHED
intent and provides a way to avoid restarting discovery if we've
just been discovering.

Test: compiles and discovery still works
Bug: 34395439
Change-Id: I4334e99ae8665fc0a0d5d11229897505fae8510b
tservice/AdapterProperties.java
tservice/AdapterService.java
70cc1e8d1a2386eb465bdb2cdfa1414defea4b21 27-Jan-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "A2DP Audio Focus" am: 705f8de019 am: 02af7401ff am: 0ecc58866d
am: f77a5f8d19

Change-Id: I30fb3699c53f89983337c6541393b052fb74bfa9
0ecc58866d2ba81586742b769bb69648ae26b6e8 27-Jan-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "A2DP Audio Focus" am: 705f8de019
am: 02af7401ff

Change-Id: I32089ea4180d5feccbd3b1e2caa3096911ea7600
b591f3801c7de7a12e52f47483e8c2a714c7c131 25-Jan-2017 Joseph Pirozzo <pirozzoj@google.com> A2DP Audio Focus

Update A2dpSinkStateMachine to handle audio focus for notifications and
navigation. Simplified state machine to boolean flags to track user
intent and availability of audio stream and audio focus.

Bug: 31215324
Test: Manual music streaming, navigation, and assistant. Tested
navigation, assistant and music streaming with phones from several major
manufacturers. Tests were to verify proper transitions in both audio
and playback state while music was playing locally and streamed via
Bluetooth. Additionally b/34722788 was written to capture unit tests.

Change-Id: If8e89588ca24bdedf2c57c989f8a960353ccbe9a
2dpsink/A2dpSinkStateMachine.java
2dpsink/A2dpSinkStreamHandler.java
2dpsink/A2dpSinkStreamingStateMachine.java
69ba6ad9dd4b8855692493eacd96ce10a789db3f 25-Jan-2017 Sanket Agarwal <sanketa@google.com> Merge "Init JNI in Bluetooth Service not the Bluetooth State machine" am: 08cd928d03 am: 233b926489 am: 91ad5d6d1d
am: e95a72a1d9

Change-Id: Ic9ff54a8f308d8abba539f85b0848b2b9848eab7
91ad5d6d1dd5a0fc830f2cb003c57c8845940350 25-Jan-2017 Sanket Agarwal <sanketa@google.com> Merge "Init JNI in Bluetooth Service not the Bluetooth State machine" am: 08cd928d03
am: 233b926489

Change-Id: I817e4c9a5e148af07aba764c3a480d0d5b190d64
727dc7918318d01b5f2308e55038b7fcba7765f8 24-Jan-2017 Sanket Agarwal <sanketa@google.com> Init JNI in Bluetooth Service not the Bluetooth State machine

Since we can have multiple state machines the right lifecycle management
should be done in the Bluetooth service with start and stop operations.
Otherwise, there could be JNI crashes, due to JNI callbacks before the
JNI is setup.

Bug: b/34681827
Test: Connect device over HFP and make a call
Change-Id: I3ebe9d035511ca830f131d5b09461ecccfcc4672
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
053981b483699c79ef40d1e3e74eaa8a04e5df7c 24-Jan-2017 Andre Eisenbach <eisenbach@google.com> Merge "Ignore ACTION_UUID intent when no uuids present" am: 613fe46161 am: 45cb6a47fe am: e36b3e406d
am: 1ad91a1311

Change-Id: Ia827ca53cc8331a53328effa430d4cb6db055265
4b4ab34efa3e4b576fd463beaf88ec8903f4ecc7 24-Jan-2017 Sanket Agarwal <sanketa@google.com> Merge "Multi HFP connection handling"
e36b3e406dd0bd00b557c3b5b0b00163d387630e 24-Jan-2017 Andre Eisenbach <eisenbach@google.com> Merge "Ignore ACTION_UUID intent when no uuids present" am: 613fe46161
am: 45cb6a47fe

Change-Id: Ife45600307828c8e4bae766c437b6ed4dcc12ffc
0068bdad22ffd70c90de67b6e85c8a0dfa838d90 24-Jan-2017 Sanket Agarwal <sanketa@google.com> Ignore ACTION_UUID intent when no uuids present

When no uuids are present, parsing UUIDs throws NPE in PhonePolicy

Bug: b/34640345
Test: Manual test by trying various devices. Follow up unit tests
required

Change-Id: Ibe54ea7b62b644ba1d92ef4f1d850c09113875af
tservice/PhonePolicy.java
63b19b09500efc4301f5d69b85e0e3e60b484c03 14-Dec-2016 Sanket Agarwal <sanketa@google.com> Multi HFP connection handling

The basic handling mechanism is to create multiple state machines for
each connection. We route the upper layer (application) and lower layer
(callbacks) appropriately depending on the BluetoothDevice.

The following are implemented:
-- StateMachine creation (garbage collection/deletion still needs work)
-- Device awareness in service to route the messages
-- Cleanup of code and creating a new class for handling native messages

You can do the following with this change:
-- Create multiple connections (simultaneously)
-- Tear down connections

Bug: b/33554547
Bug: b/30984220

Change-Id: If08f24f744b046a393e836c99fcf2288fd698cc2
(cherry picked from commit 98c5bfdf980d573042bec06588b7e6ddfc48d054)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/HeadsetClientStateMachineFactory.java
fpclient/NativeInterface.java
fpclient/StackEvent.java
fpclient/connserv/HfpClientConnectionService.java
fpclient/connserv/HfpClientDeviceBlock.java
5c9abb266ba99df3b89e93ca66fa448eef5bae81 23-Jan-2017 Ajay Panicker <apanicke@google.com> Merge "Change scan downgrading to be app independent" am: 7efcba6e5f am: 14c7ff2ce1 am: 07047bea5a
am: b6a414e295

Change-Id: I296f39faa0a7e87330277a1b81d59888bff49a82
07047bea5ab703bd0b875777b5cfefdd2bdb8628 23-Jan-2017 Ajay Panicker <apanicke@google.com> Merge "Change scan downgrading to be app independent" am: 7efcba6e5f
am: 14c7ff2ce1

Change-Id: If0b67882e5ff89cb4514a76afbfd3db64bf4805a
2d6cacb618941cc75179fe71c0a7ba659363dcf4 23-Jan-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Truncating receiving filename" am: 89e68b36bd am: 2fc97c9e15 am: 1bd73b96bc
am: 25f46fc2a0

Change-Id: Ia7997c989a53293ea8c548a7d025a42f3ba3b10e
7efcba6e5f566e84005216d1260682bd56e8846b 23-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Change scan downgrading to be app independent"
1bd73b96bc1a19bf224ebdfcd1b7f882c27e3d4e 23-Jan-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Truncating receiving filename" am: 89e68b36bd
am: 2fc97c9e15

Change-Id: Ib3085434f876e78fbc5bb34084c69ec5b5ca6e4b
89e68b36bdd39c637f5317889820e9b4d1b18a59 23-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Truncating receiving filename"
e7b1bd3f752006a06b50d5b0372b9bbe6ff680e9 23-Jan-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Send proper share status of file once transfer is complete" am: a862c84069 am: 7c771f04ea am: 0d9ac0ea18
am: a69c2e8b62

Change-Id: If8648a8ab76d0bbcce501215dc9b59c97895bae7
0d9ac0ea18b6237275b49d2d0a25854c8431f309 23-Jan-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Send proper share status of file once transfer is complete" am: a862c84069
am: 7c771f04ea

Change-Id: I375fea157e975b357e36c4f80ecf10639945fc7b
65e839fa45222955a605f6270a240edc68b21617 20-Jan-2017 Ajay Panicker <apanicke@google.com> Change scan downgrading to be app independent

Before this patch, every time an app started a new scan it would reset the
timer to downgrade apps down to opportunistic. Now each app is kept track
of individually so that another app doing frequent short scans doesn't cause
a long scanning app to avoid downgrading.

Bug: 34224062
Test: Tested scanning multiple times with multiple apps / TestTracker:73279
Change-Id: Ibcae9115dcd0fb5325f7bc9fc5d6e0fe4bf6e062
att/AppScanStats.java
att/ScanManager.java
17109c836b13f1b3cf08f37db70fb8634d96f911 28-Apr-2016 Hemant Gupta <hemantg@codeaurora.org> OPP: Send proper share status of file once transfer is complete

Use Case:
1. Select >15 files from DUT and try to transfer it to
already paired device. Some file are of very small size.
2. Check whether all files received or not

Failure:
File transfer fails in between.

Fix:
Share status of the file will be sent with MSG_SHARE_COMPLETE to
avoid sending the file again during batch transfer. Otherwise, if
DUT is sending batch containing small files transfer will be completed
immediately and status may not be updated to correct state. This will
lead to sending of same file again and transfer will fail because file
info is already removed from the hashmap of pending shares.

Change-Id: Ibbb0d44b72796af4844ae6289ba8182b4bbd4445
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppService.java
9a7bfaca5eee899cabe435cb73d4858ebf7435f2 12-Dec-2013 Hemant Gupta <hemantg@codeaurora.org> OPP: Truncating receiving filename

Truncating receiving filename if name exceeds MAX_LENGTH. Otherwise,
files having non-ascii characters as filename are failed to receive.

Change-Id: I0df7f81fe2d772ddeea54597231c1741d8918661
pp/BluetoothOppReceiveFileInfo.java
84f977c60b8d7feea9c9b20d60a7eb8e3e4869a9 14-Dec-2016 Sanket Agarwal <sanketa@google.com> Multi HFP connection handling

The basic handling mechanism is to create multiple state machines for
each connection. We route the upper layer (application) and lower layer
(callbacks) appropriately depending on the BluetoothDevice.

The following are implemented:
-- StateMachine creation (garbage collection/deletion still needs work)
-- Device awareness in service to route the messages
-- Cleanup of code and creating a new class for handling native messages

You can do the following with this change:
-- Create multiple connections (simultaneously)
-- Tear down connections

Bug: b/33554547
Bug: b/30984220

Change-Id: If08f24f744b046a393e836c99fcf2288fd698cc2
(cherry picked from commit 98c5bfdf980d573042bec06588b7e6ddfc48d054)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/HeadsetClientStateMachineFactory.java
fpclient/NativeInterface.java
fpclient/StackEvent.java
fpclient/connserv/HfpClientConnectionService.java
fpclient/connserv/HfpClientDeviceBlock.java
795cce60d2afec1771f70c2eb32d884669a86cc3 21-Jan-2017 Sanket Agarwal <sanketa@google.com> Merge "Multi HFP connection handling"
8b07c23fa3dcf7cb2f703d1eac796f110ede58b5 21-Jan-2017 Sanket Agarwal <sanketa@google.com> Merge "Add flag to disable phone policy" am: d3c7d49769 am: 0d9fe557eb am: a59bab99b7
am: 9d42626010

Change-Id: I4ecf36d72c8110173ffeab8f746839acd357b7b5
a59bab99b7c5a746acfce6dea885d479926fe267 21-Jan-2017 Sanket Agarwal <sanketa@google.com> Merge "Add flag to disable phone policy" am: d3c7d49769
am: 0d9fe557eb

Change-Id: Ib403679f92ea62ae76052045caa3dded9bcd5127
98c5bfdf980d573042bec06588b7e6ddfc48d054 14-Dec-2016 Sanket Agarwal <sanketa@google.com> Multi HFP connection handling

The basic handling mechanism is to create multiple state machines for
each connection. We route the upper layer (application) and lower layer
(callbacks) appropriately depending on the BluetoothDevice.

The following are implemented:
-- StateMachine creation (garbage collection/deletion still needs work)
-- Device awareness in service to route the messages
-- Cleanup of code and creating a new class for handling native messages

You can do the following with this change:
-- Create multiple connections (simultaneously)
-- Tear down connections

Bug: b/33554547
Bug: b/30984220

Change-Id: If08f24f744b046a393e836c99fcf2288fd698cc2
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/HeadsetClientStateMachineFactory.java
fpclient/NativeInterface.java
fpclient/StackEvent.java
fpclient/connserv/HfpClientConnectionService.java
fpclient/connserv/HfpClientDeviceBlock.java
3a6e55686e88d16666e7f253d634531a033b8c61 20-Jan-2017 Sanket Agarwal <sanketa@google.com> Add flag to disable phone policy

After the separation of policy and mechanism this change completes the
loop whereby a non-phone device could simply disable the phone policy
and implement its own version

Test: Check by flashing flag vs no flag for verification
Bug: b/33079907
Change-Id: I9476f0dc16a5257a6fc8c198ff419fbdad3e8795
tservice/AdapterService.java
d371c46039f28bf00e17f0edaea93d9a5661952b 20-Jan-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Remove advertiser during unregistration" am: 10f36a1d60 am: 750a0a4354 am: 18bd46fbb7
am: 951d5c84f3

Change-Id: I6365f5cafdec01b6c54b593324cc13de5f033231
18bd46fbb7dddca45b80e3fd048e6b1ebcb0c9bf 20-Jan-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Remove advertiser during unregistration" am: 10f36a1d60
am: 750a0a4354

Change-Id: Ia1c7bddd61c9d6ea0f32bb97fc5937185e5723cc
7bdbdb9c5c81e08957c442f91d70fb34d8b34dde 20-Jan-2017 Jakub Pawlowski <jpawlowski@google.com> Remove advertiser during unregistration

When advertiser is being unregistered in non-regular flow, i.e. due to
failure to start advertising, or when started with timeout, remove
client instance from map.

Bug: 34440704
Test: sl4a ConcurrentBleAdvertising:test_timeout
Change-Id: Id7b2079bf7936b344afada80f079666dc0ea6440
att/AdvertiseManager.java
9151f1d76335e751c0ee23272b00dfaa2f3fd62a 20-Jan-2017 Sanket Agarwal <sanketa@google.com> Merge "Separate Phone Policy from mechanism" am: ab9c1344b6 am: d45695faef am: 9d738dc281
am: f12307c33f

Change-Id: I24979d2312918559081634904def891f4215b5ae
9d738dc281192e4601efcef0a3d98766ce9bf4e8 20-Jan-2017 Sanket Agarwal <sanketa@google.com> Merge "Separate Phone Policy from mechanism" am: ab9c1344b6
am: d45695faef

Change-Id: I131a0c23824041576942cffcee6e05ee1f80ff49
ab9c1344b617d77eb20bc4bd32231833f0932b4e 20-Jan-2017 Sanket Agarwal <sanketa@google.com> Merge "Separate Phone Policy from mechanism"
83df1b46c066c5d1d8a7e0fa9bd98c2a39c20890 20-Jan-2017 Jack He <siyuanh@google.com> Merge "Add counters for true number of events being logged" am: 35940f3f94 am: fe5bd2a008 am: 9e94f943e8
am: e2d039beb5

Change-Id: Ib77b6a33770498597693b2d9da87f2a9beb8d414
9e94f943e8c174100ec6dbd37f7e68b565bf0010 20-Jan-2017 Jack He <siyuanh@google.com> Merge "Add counters for true number of events being logged" am: 35940f3f94
am: fe5bd2a008

Change-Id: Ic855294c115a442689d6f70ecdaa9ebb2bf18569
d0021fed4912dbf4bfa492bdf7a9c10a6405cc6c 18-Jan-2017 Jack He <siyuanh@google.com> Add counters for true number of events being logged

* The metrics module drops oldest event when event size goes beyond its
logging capacity
* The understand whether events were dropped, we want to log the true
number of events.

Bug: 33694310
Test: Code compilation
Change-Id: I381e1cbdf6d08ec2d6e98a53cd27593b700b3d2a
(cherry picked from commit b5633d92c0debaf5b07dc3973a880c31a940421c)
tservice/bluetooth.proto
17a6280084abb18f05b77e3ccefbe15bd54051f6 19-Jan-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Don't reopen finished transfer list." am: d259049966 am: 7b9c523e75 am: 93f42487ab
am: 767aac95d5

Change-Id: Id0b173b4130cac6c38c70a0f84b171b5bca6e304
93f42487ab09f62fccc56a66f1c881edaff68fa1 19-Jan-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Don't reopen finished transfer list." am: d259049966
am: 7b9c523e75

Change-Id: If5226cc706095de9d25cf6d73128407d860c763d
d808638cd1715e39c4dcd5a12ed4371a8eb709d0 10-Aug-2015 Hemant Gupta <hemantg@codeaurora.org> OPP: Don't reopen finished transfer list.

Prevent opening selected file from transfer history
list after it's cleared from notification to avoid crash.

Step by Step procedure:
=======================
1. Pair remote phone with DUT.
2. Receive a file to DUT and accept.
3. Now Drag the notification bar and select history.
4. Long press any file to select.
5. Again drag notification bar and press clear to clear notifications.
6. Press clear file on popup which observed in step 3.

Expected Result:
================
Should not crash Bluetooth.

Actual Result:
===========
Bluetooth crashing by selecting clear list

Change-Id: Ib5f4d3edbd32af298cfe439389b8e77864cb5462
pp/BluetoothOppTransferHistory.java
e1c2e4c2476f48cba66db2e2a9e891b87964999d 18-Jan-2017 Ajay Panicker <apanicke@google.com> Merge "Add additional logging to root cause IOExceptions for OPP" am: 75c9708271 am: 05f8b02d70 am: c3d2c50ca1
am: 8ab5bdede2

Change-Id: I40d66e4851bc9492651f68644459e6eece213b61
c3d2c50ca15ea4c7613cbf93fe5152d6fffc8ba4 18-Jan-2017 Ajay Panicker <apanicke@google.com> Merge "Add additional logging to root cause IOExceptions for OPP" am: 75c9708271
am: 05f8b02d70

Change-Id: I13e1438b45753efd925d2c16c9a9c85d568c2b49
86c29fe88456bdcfbd4334647b04ef81ff384a06 22-Dec-2016 Sanket Agarwal <sanketa@google.com> Separate Phone Policy from mechanism

Create a new policy file which interacts using either public APIs (such
as Intents) or uses equivalent functions which are exposed by the
binder. This is an attempt to be able to separate policy such that
different devices can have different policies.

Bug: b/33079907
Test: JUnit tests
Change-Id: I6c5a7ee9eb4e10f5f649794546acde5ec4b297aa
2dp/A2dpService.java
2dp/A2dpStateMachine.java
2dpsink/A2dpSinkStateMachine.java
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/PhonePolicy.java
tservice/ProfileService.java
tservice/RemoteDevices.java
tservice/ServiceFactory.java
dp/HealthService.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
fpclient/HeadsetClientStateMachine.java
id/HidDevService.java
id/HidService.java
ap/BluetoothMapService.java
apclient/MceStateMachine.java
an/PanService.java
bap/BluetoothPbapService.java
bapclient/PbapClientStateMachine.java
ap/SapService.java
cc284c80ef076eb33b99521cbb1cf3d6982fa341 18-Jan-2017 Ajay Panicker <apanicke@google.com> Add additional logging to root cause IOExceptions for OPP

Bug: 34007014
Test: Code still compiles
Change-Id: I74e33a124dc1792541e464eeb1150d8e10fc4fd6
pp/BluetoothOppObexServerSession.java
e41e8b1060d6ed73ea5e0daa838bfe2843b352f7 18-Jan-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP Multi Connection" am: b25160eb6f am: d21e0cd458 am: 47ad22dbfc
am: 512939001f

Change-Id: I15a32ddb3b86e6012598356e23d7583be6f800ab
47ad22dbfcc419657c08db5a1f41e9cb7cc2495d 18-Jan-2017 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP Multi Connection" am: b25160eb6f
am: d21e0cd458

Change-Id: I6b8c79b3412ff53205a566653482a9c6f2641621
b25160eb6f0c9c65f51072242cb11aabfddf10b0 18-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP Multi Connection"
3a197b3259b8906c60534bc8a533f2d38c0d6b52 13-Jan-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Fix file sending error by calculating size of file properly." am: 7e97344391 am: 5a3d5db5b9 am: 8bac873a08
am: b37f867330

Change-Id: Idd3bf188e5f95c01c3c93ea4d773d3c7946b6089
8bac873a082bed6d77b07560765fbb456c31b456 13-Jan-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Fix file sending error by calculating size of file properly." am: 7e97344391
am: 5a3d5db5b9

Change-Id: I5fb521a9d95ca7f35f95d2b6f4ec7c0c7c35cd4f
7e9734439152ce8405ddae72ef104d90fb1843f5 13-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Fix file sending error by calculating size of file properly."
b96340e8cef5df637d3d28906f31a6a5ff853d6f 09-Dec-2016 Joseph Pirozzo <pirozzoj@google.com> PBAP Multi Connection

Add support for multiple state machine instances such that PBAP can
download contacts from multiple connected phones at once.

Bug: 33075066
Test: SL4A BtCarPbapTest:test_multiple_phones
Change-Id: I8364df622395eb15d43183190a9895246091750e
bapclient/PbapClientService.java
bapclient/PbapClientStateMachine.java
b80576437611cfe2bbc1a0088dd7cf3077af8a13 13-Jan-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Report no track playing correctly." am: cd801c800d am: 372eae966b am: 9e979bebfc
am: 283fd8aa7f

Change-Id: I7411ace66381a75ad91e4f8b3c0e0d865ff8bb16
9e979bebfc45c6b407d2a5d6e541d96a2ecfc693 13-Jan-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Report no track playing correctly." am: cd801c800d
am: 372eae966b

Change-Id: Ie683d89d7bca22b8e47857cd463ef780dade294e
e23a886e79f60a3f7f5b8e87f8c5ffc26134bd32 04-Jan-2017 Marie Janssen <jamuraa@google.com> AVRCP: Report no track playing correctly.

If browsing is supported, we cannot use 0x0 (Track selected) as a
generic response per the AVRCP 1.6.1 spec p64.

Rename mTrackNumber => mTracksPlayed to be more accurate, and use media
info to determine if a track is selected instead of whether we've played any.

Test: check with Carkit && PTS: TC_TG_NFY_BV_04_C
Bug: 33414166
Change-Id: I004aa5596ff9aef001ce74c463da0e1ed77b9ff4
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpConstants.java
f4e8a77a42e791c4cbb8ab85106c81086688cb9f 14-Nov-2016 Hemant Gupta <hemantg@codeaurora.org> OPP: Fix file sending error by calculating size of file properly.

Use case:
Send and receive vcard file through OBEX multiple times (above 30 times)

Result:
Sometimes DUT is unable to begin the vcard sharing and a message is displayed
saying "File unknown file could not be sent".

Root cause:
In Some race conditions InputStream.available() returns zero which causing error.
According to java documentation InputStream.available() method provides a weak
guarantee so it isn't guaranteed to return the total number of bytes in the stream.

Fix:
Read the InputStream by read() API to calculate the actual length of data.

Change-Id: I3448d6d3c410ae9dc8213c1c1d5f23dba4a56982
pp/BluetoothOppSendFileInfo.java
4d272c8a2763c2fd36e819422236ea69df7bc24b 11-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Client changes for BT SAP hidl."
3b8e3a168e5851dc5a1414f9e5d82e51018af3e5 11-Dec-2016 Amit Mahajan <amitmahajan@google.com> Client changes for BT SAP hidl.

Test: Basic SAP sanity.

Bug: 32020264
Change-Id: If001ff221e3240a31cfbb08df11cbf6188ebd07e
ap/SapMessage.java
ap/SapRilReceiver.java
ap/SapServer.java
8f0396f8153e14e8f550e5078f3c1c1e91b8acbc 10-Jan-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "SAP: Close RFCOMM connection immediately if access is denied." am: b02ffbde21 am: 5b852e0b7a am: 4eacbdb6ea
am: 34a3faf9ed

Change-Id: I2f1271d08ab9fe243a6dae9f91a6d41752c7d160
f1254d40e07eae44424fdb25666aa292a8de3f65 10-Jan-2017 Sravan Kumar V <sravankumar@codeaurora.org> Merge "OPP: Check file size before send to prevent crash" am: 8e6ece2ad4 am: 5f12709a2d am: b497d8e620
am: 45d46dac5a

Change-Id: I8b8bde7a87ca15e0a37e5634bbad5e23d11d90c3
4eacbdb6ea1e86c7741e6e80a054e8331eca5560 10-Jan-2017 Hemant Gupta <hemantg@codeaurora.org> Merge "SAP: Close RFCOMM connection immediately if access is denied." am: b02ffbde21
am: 5b852e0b7a

Change-Id: I152ef414c08da47ae4415b124cc0fd39166e6262
b497d8e62029e784fc1efda3335405a7a2d410c1 10-Jan-2017 Sravan Kumar V <sravankumar@codeaurora.org> Merge "OPP: Check file size before send to prevent crash" am: 8e6ece2ad4
am: 5f12709a2d

Change-Id: Ic5e5128e9da74f5cfe50196904733d28ac50cb2e
b02ffbde217d679c00e0963cba552f49407199bd 10-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "SAP: Close RFCOMM connection immediately if access is denied."
95ba9eb75fe596dd231bf142fd3535ea489469ce 08-Sep-2016 Hemant Gupta <hemantg@codeaurora.org> SAP: Close RFCOMM connection immediately if access is denied.

Usecase
1) Pair with carkit and connect HF and A2DP/AVRCP.
2) Carkit sends SAP connect request. Reject this request from DUT.
3) Power off/on carkit.
4) Carkit sends SAP connection request to DUT.

Expectation:
SAP connection is rejected, but carkit can reconnect HF and A2DP/AVRCP

Observation:
Unable to connect any profiles after power cycling carkit.

Root Cause:
Even thought DUT rejects incoming SAP RFCOMM connection request whose access
was previously rejected by DUT, RFCOMM connection is not closed from DUT until
time out of 30 seconds. This prevents carkit from sending new connect request
for previously connected profiles like HFP, A2DP/AVRCP.

Fix:
Close RFCOMM connection in case request is from remote device whose access is
already denied by DUT in previous attempt.

Change-Id: I31bd2dfd862f7f69e46b8012924942e08e850c95
ap/SapService.java
a4e626056b2d8dff1b624b5d79664ba27ae2777f 09-Jan-2017 Sravan Kumar V <sravankumar@codeaurora.org> OPP: Check file size before send to prevent crash

Use case :
1. Send large file to dut (Above 4 GB)
Failure:
Crash in com.android.bluetooth.
Process: com.android.bluetooth
java.lang.IllegalArgumentException: Length must be
between 0 and 0xFFFFFFFF
at javax.obex.HeaderSet.setHeader(HeaderSet.java:333)
at com.android.bluetooth.opp.BluetoothOppObexClientSession$ClientThread
.sendFile(BluetoothOppObexClientSession.java:411)
at com.android.bluetooth.opp.BluetoothOppObexClientSession$ClientThread
.doSend(BluetoothOppObexClientSession.java:337)

Root cause :
Largest length in OBEX message header is unsigned 4 bytes, so actual
file length (4 GB) cannot be written into Obex header which leads
to exception in OBEX code.

Fix :
Add length check before push file and skip sendfile if length is above
4GB to prevent crash.

Change-Id: I9066fb7456d85fdc197fe21fed26fb2bb89ff09e
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppManager.java
pp/BluetoothOppSendFileInfo.java
d56590e2df3256fbbb1d92b9187b5e62318e63c0 10-Jan-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix improper unregistration of scanner for app that died" am: b171d8b460 am: 5d32f22364 am: 2fe8a775d2
am: 9f7d1d9ac6

Change-Id: I020b3318c45f4c2706d791a31538e32d4c590cbc
2fe8a775d219615f09e91c73a0c9359855ed484d 10-Jan-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix improper unregistration of scanner for app that died" am: b171d8b460
am: 5d32f22364

Change-Id: I9ab26db919a4d061a9db2c6de5c79ddd7cd4674b
b171d8b4605061f3e32b01090850df8228d0b688 10-Jan-2017 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix improper unregistration of scanner for app that died"
9d3c43d748cc17e3c19ac8134cc3fc93e60304e2 10-Jan-2017 Jakub Pawlowski <jpawlowski@google.com> Fix improper unregistration of scanner for app that died

When scanner died, it should be unregistered as scanner, not as GATT
client. Otherwise app will not be able to start scan when it's
restarted.

This bug was introduced when separating GATT client from LE scan
clients.

Bug: 33556286
Test: start scanning, kill app, restart the app
Change-Id: If8da5512081e1986bbee7362984091f298500f4e
att/ScanManager.java
537e9e177646a577eddfe08d34c09bdfbe3063e6 05-Jan-2017 Ajay Panicker <apanicke@google.com> Merge "Add the Filter statistic to scan statistics" am: 640eeeafa7 am: 675b533c53 am: bcd906d64c
am: 8bc3ccdb52

Change-Id: Ic899680aed521516512210e10396543b4fe8f3c4
bcd906d64c5da98dcb963f9696c0f6688f4cf945 05-Jan-2017 Ajay Panicker <apanicke@google.com> Merge "Add the Filter statistic to scan statistics" am: 640eeeafa7
am: 675b533c53

Change-Id: Ia80c7c4d33d816563240b9814cf744cbdbf13c85
bd11ad34482a898a53bbd9f55bf3607c40c648ec 04-Jan-2017 Ajay Panicker <apanicke@google.com> Add the Filter statistic to scan statistics

Test: sl4a FilterTest
Change-Id: Ic16e523524022803107b5e0653a35e3f2cbc5186
att/AppScanStats.java
att/GattService.java
4d466218ef15e80c6841d9635cacd4b056305e76 05-Jan-2017 Ivan Podogov <ginkage@google.com> Merge "Remove debug logging from report sending in HID Device mode." am: 94c5334109 am: e7845653d7 am: 3436052813
am: b24f416030

Change-Id: I8f99d0520149f9d5611ad8825333ac2faab231e2
3436052813342e9fe64aa8fcf83dd15a08cde4f7 05-Jan-2017 Ivan Podogov <ginkage@google.com> Merge "Remove debug logging from report sending in HID Device mode." am: 94c5334109
am: e7845653d7

Change-Id: I0660ce1d657833f0a21822a118c1fe8444e8fcc7
94c5334109c8c53c5c3b502fc26c757ed6884711 05-Jan-2017 Ivan Podogov <ginkage@google.com> Merge "Remove debug logging from report sending in HID Device mode."
3ecc45db86e05c3ebd098ea7b0d9bfc9072648b6 05-Jan-2017 Jack He <siyuanh@google.com> Merge "Fix A2DP metrics session duration" am: fdd72a76aa am: f2ede323d3 am: c4c874ad73
am: 989a3d9dd4

Change-Id: I8e9a0811fc136749f216212166bfc761b34eaf61
c4c874ad73d150ed27afc59b489b7c5b1775eefb 05-Jan-2017 Jack He <siyuanh@google.com> Merge "Fix A2DP metrics session duration" am: fdd72a76aa
am: f2ede323d3

Change-Id: I209ad9066e000cb60200416abcef4345f8802b4a
4308e8f5f34b668f48cb50fbbdac77e45d04e432 22-Dec-2016 Jack He <siyuanh@google.com> Fix A2DP metrics session duration

* Add one extra item in the A2DPSession message to keep track of audio
playback time for A2DP source

Bug: 33694310
Test: code compilation
Change-Id: Iee1e47997bf9cf9ba3f7f812c965eab36f19c0f4
tservice/bluetooth.proto
989c69f6f315e1decd44b30c1c1d8d7092cbecbe 05-Jan-2017 Ivan Podogov <ginkage@google.com> Remove debug logging from report sending in HID Device mode.

When the app acts as a pointing device, it (according to the
specification) generates ~80 reports per second.
Removing 5 log lines per report makes logs shorter by 400 lines
per second.

Test: build, run, logcat
Change-Id: Ief2300294b7c7ed56cb67bcf1b77f70187291b8e
id/HidDevService.java
23013c7a8ca277fb39281a812f93cb3cfe7a851d 04-Jan-2017 Marie Janssen <jamuraa@google.com> Merge "Don't print dumpsys info twice in bugreport" am: 61df78ee30 am: bc7c356839 am: ac69240b1c
am: 07a263d593

Change-Id: I854751cbc6347e521ee523e1462183201cdfe07f
ac69240b1cab532dd125ef7029560f72f80e81a2 04-Jan-2017 Marie Janssen <jamuraa@google.com> Merge "Don't print dumpsys info twice in bugreport" am: 61df78ee30
am: bc7c356839

Change-Id: I328d0ee2d17d67074b9ecc56bf6ebd14bfbe0134
ff428bdad1e1e1b3e8927c9ba7f783ff8f248c81 03-Jan-2017 Marie Janssen <jamuraa@google.com> Don't print dumpsys info twice in bugreport

Test: run a bugreport, check in "APP SERVICES" section
Bug: 29356402
Change-Id: I51a2ab0ec51d4607d39eaca225584d3d539fbfd6
tservice/AdapterService.java
913de42d7bb6c6c7b2f277a6367f4509f1226483 04-Jan-2017 Ivan Podogov <ginkage@google.com> Merge "Allow HID Device to connect to a specific device" am: 9ab658fda6 am: 6057300665 am: aee2411af0
am: 72723ecdc4

Change-Id: Ibad0400e86a70a96e4fd6ca824771e0574e6e8df
aee2411af079c4a5a3721b2890b408b13773eae1 04-Jan-2017 Ivan Podogov <ginkage@google.com> Merge "Allow HID Device to connect to a specific device" am: 9ab658fda6
am: 6057300665

Change-Id: If5606f3e7087dd90412996c562e17272fb8273ee
9ab658fda62275301722af7b36b4068f61041d34 04-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Allow HID Device to connect to a specific device"
0a5a0e715e320ac2f0d8e8fb92719331ad00dc17 04-Jan-2017 Ivan Podogov <ginkage@google.com> Merge "HID Device role API fixes" am: 641928be18 am: a72a0b6958 am: 570d850055
am: 772f5096d6

Change-Id: I1ca0c3f477012b068aaa3bbb7dfa2f12f4af24fc
570d8500557fca6b467bc4ff15bb457b56940a03 04-Jan-2017 Ivan Podogov <ginkage@google.com> Merge "HID Device role API fixes" am: 641928be18
am: a72a0b6958

Change-Id: Icbe765ac505f118553b36203ee8899572423c144
641928be18e670aa53ab3861c2ead87b9ffb2ea0 04-Jan-2017 Ivan Podogov <ginkage@google.com> Merge "HID Device role API fixes"
58456617296aa39cde978dfe63a3aa1b3f1ecb44 04-Jan-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Add a mechanism for configuring the A2DP Source codecs" am: ae635ea9e4 am: 69f120140d am: 6ffec16e86
am: 2e25db8449

Change-Id: I03f666f37a975a1361174877bb4979ed0b69216c
6ffec16e868658defc51eb4ac26ab0f3874071b4 04-Jan-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Add a mechanism for configuring the A2DP Source codecs" am: ae635ea9e4
am: 69f120140d

Change-Id: I2f8b2cd61fa44f727fb87defb4082b08e22f49d1
33b6b7d2b08dcd7ced1809e2ac653c5e8c2514af 21-Dec-2016 Pavlin Radoslavov <pavlin@google.com> Add a mechanism for configuring the A2DP Source codecs

* Extended the Bluetooth A2DP AIDL interface to get/set the current
codec configuration

* If the current codec config is changed such that the audio feeding
parameters have changed, then inform the Audio Manager so it can
reset accordingly the audio feeding parameters in the Audio HAL to
the Bluetooth stack.

Also, fix the BT_BOND_STATE_* values (unused) in the
AbstractionLayer.java class so they match the corresponding
BT_BOND_STATE_* values in
hardware/libhardware/include/hardware/bluetooth.h

Test: A2DP streaming to headsets, TestPlans/71390
Bug: 30958229
Change-Id: Ic3e35154d9dbc32b66522322cd5d2a96bc5a977c
2dp/A2dpService.java
2dp/A2dpStateMachine.java
tservice/AbstractionLayer.java
82973b036b68cf2a0a0c105e7666afa58c1a38d8 03-Jan-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Test MediaBrowsers before trying to use" am: 8ca327ce49 am: 5d0fdd60a5 am: e83357f042
am: b66c15cc54

Change-Id: Idc658be423d256d2b78dbe4314d49954df6290a0
e83357f042b27fb222be863f9f6b0ef4e8dbf63a 03-Jan-2017 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Test MediaBrowsers before trying to use" am: 8ca327ce49
am: 5d0fdd60a5

Change-Id: Ie6d159cdf484e5f6086a036312e6f0ec2eea5b9b
3843256f294cfd3e9b1d883e71ed7306738b6ca1 10-Dec-2016 Marie Janssen <jamuraa@google.com> AVRCP: Test MediaBrowsers before trying to use

MediaBrowserService can reject the connection from a MediaBrowser.

Test packages beforehand so we don't advertise browsing for a player we
can't browse to.

Refactor and cleanup some code around building media player lists and
remove some dead code.

Bug: 33390650
Bug: 32382082
Test: use carkit to browse to different players
Change-Id: I5a4c18ab77a24f3cf2aa34d1c15e3213edfed61d
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcp/BrowsedMediaPlayer.java
b6aa20542f9e6d42ae840e19ce7e85b20087cfb3 30-Dec-2016 Ivan Podogov <ginkage@google.com> Allow HID Device to connect to a specific device

Test: make
Change-Id: I1322eb7fb5d253c0968a8bbe11a19cca8f1834f9
id/HidDevService.java
2769ac313a195a805bb2189ca5b8ba8797300fb6 30-Dec-2016 Ivan Podogov <ginkage@google.com> HID Device role API fixes

This change reflects the API update, and also fixes a couple
issues with the code (non-initialized, wrongly compared and
otherwise unused mHidDevice field).

It keeps the current logic of using a single device at a time,
yet introduces checks that the application is actually
addressing the right device.

Test: make
Change-Id: I088417046907c8310692cf9205075d6da0cd81e6
id/HidDevService.java
a3b737b82ffd21d350cef9f706209b70d7e0efba 29-Dec-2016 Marie Janssen <jamuraa@google.com> Merge "Move state dumpsys (to BluetoothManagerService)" am: 320a508c59 am: 998638650c am: 5254b2274a
am: 0298dd0391

Change-Id: I83e19aa1f8727e6bc0d2788e5519cf0ff1e821a4
5254b2274a1e7ba0815b202c195675b490509759 29-Dec-2016 Marie Janssen <jamuraa@google.com> Merge "Move state dumpsys (to BluetoothManagerService)" am: 320a508c59
am: 998638650c

Change-Id: I51b866545ea2aa5be8e2cac04e3a08a9f7cba497
a04407b49c89c9f2c3119126e23e302907eca768 29-Dec-2016 Ivan Podogov <ginkage@google.com> Rename the Bluetooth profile classes for HID Device role. am: b7aaa47ba5 am: a1e61f62e1 am: 282f0da4fa
am: 7ff30fc747

Change-Id: Ia11a98d13f5d461e0be7756e3241af8ee3b161c2
1f56ca1de54bbfeaf5bede0af4d95d1ed9585e4e 29-Dec-2016 Hemant Gupta <hemantg@codeaurora.org> HIDD: Add support for HID Device Role am: cf27f0ddf9 am: d7188b8a90 am: 190456f980
am: 0e88017618

Change-Id: I4725a418db9a1b42248b7305c9a8d7e53d872cb7
282f0da4fad80ae90a7ed2b77717b17f8043ca43 29-Dec-2016 Ivan Podogov <ginkage@google.com> Rename the Bluetooth profile classes for HID Device role. am: b7aaa47ba5
am: a1e61f62e1

Change-Id: Ib6cd4abc149293cf773ae020706d7e8ac0da7af7
190456f9800e87aa905191112a455bfa80fc1f0a 29-Dec-2016 Hemant Gupta <hemantg@codeaurora.org> HIDD: Add support for HID Device Role am: cf27f0ddf9
am: d7188b8a90

Change-Id: Ic892bd2dec0897bb5539328873bd8d2bbf8dc40f
320a508c59c2a940ec70096019c9e56ab71fbd97 29-Dec-2016 Marie Janssen <jamuraa@google.com> Merge "Move state dumpsys (to BluetoothManagerService)"
4f768f68b35a237052bbbb8570ff1896828c1e05 28-Dec-2016 Marie Janssen <jamuraa@google.com> Move state dumpsys (to BluetoothManagerService)

BluetoothManagerService will dump basic state about Bluetooth now for
standard dumpsys arguments. Move it from here and track which apps enable /
disable Bluetooth.

Test: enable/disable a few times, check that apps are recorded correctly
Bug: 33692282
Change-Id: I7505ba25a5cafda061fa23774cc31a6b83909d34
tservice/AdapterService.java
b7aaa47ba556ba2e09e07d04c09c0cbd8d836d87 23-Dec-2016 Ivan Podogov <ginkage@google.com> Rename the Bluetooth profile classes for HID Device role.

This CL reflects the changes from frameworks/base.

Test: make
Change-Id: I0e3a3335572f6ab4683e8a3b5335f3b51afba2f5
tservice/Config.java
id/HidDevService.java
cf27f0ddf906a8f76a22b8a30ff4262526e33477 18-Apr-2014 Hemant Gupta <hemantg@codeaurora.org> HIDD: Add support for HID Device Role

This patch adds support for HID Device Role which enables phone being
used as a Bluetooth keyboad or mouse.

Change-Id: I931867442111ad997a34a166c7b2ec1daf317ddd
tservice/Config.java
id/HidDevService.java
5b16ef0e5fd3576eedc5d10e926a5d4fce0f9062 20-Dec-2016 Andre Eisenbach <eisenbach@google.com> Merge "Fix cleanup of dead GATT clients" am: 6621044f48 am: 14c316072c am: 61cd4c83b4
am: fd4e46b156

Change-Id: Id19bb6720e237d006c80ac35120f62273d21fa78
61cd4c83b4f8fb3b6366332cb837688de4490832 20-Dec-2016 Andre Eisenbach <eisenbach@google.com> Merge "Fix cleanup of dead GATT clients" am: 6621044f48
am: 14c316072c

Change-Id: I0200299e9a99a54fabfd0cbe75779784e3d88625
6621044f48ea355da914cfd64d29cf696ac91327 20-Dec-2016 Andre Eisenbach <eisenbach@google.com> Merge "Fix cleanup of dead GATT clients"
7286c32288222252f6b1d232befb21d6f4f8a8db 20-Dec-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Expose Bluetooth 5.0 properties to JNI" am: 944da24342 am: a3a4ca722a am: a88290c072
am: 5e1f5cab14

Change-Id: I00c786bbc2a3d41e95543fa95816ac1dab362052
a88290c072c21c70d3b1396211dfcda7aadfa450 20-Dec-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Expose Bluetooth 5.0 properties to JNI" am: 944da24342
am: a3a4ca722a

Change-Id: I12609287a5fd5d681f1b2684bd516e87113d1224
c8ffb102474da9834e70ab72641fea143f5f3a3d 05-Dec-2016 Jakub Pawlowski <jpawlowski@google.com> Expose Bluetooth 5.0 properties to JNI

Bug: 30622771
Test: sl4a ConcurrentBleAdvertisingTest
Change-Id: I1cfdd29075a41057ae99b5b458876a4a9916e845
att/AdvertiseHelper.java
att/AdvertiseManager.java
d4f5965598faf465e21f8254bcee0cef4b365840 15-Dec-2016 Emil Lenngren <emil.lenngren@gmail.com> Fix cleanup of dead GATT clients

A bug was introduced in commit
d828b42ed91213bd6115b84bc16809f13fc7afe6 which causes normal
GATT clients (neither scanners nor advertisers) not being freed
properly when remote process terminates, leading to out of space
of available GATT clients after some time.

This patch adds back a ClientDeathRecipient to handle this.

Test: kill an app that has gatt client, restart it and create new
gatt client, verify the client id is same as before in logcat

Change-Id: I318cb1693984444a172cb81be2023a064dbc02a4
att/GattService.java
dedd8b0b057c2d777d5c873e73318fd7a90a01a2 16-Dec-2016 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP performance" am: c0ea41ba0e am: 3bfa299328 am: 970a2d254d
am: daf0c903ad

Change-Id: I14c354bd168a41d30c76ced5ae1aadf8b821fc2d
970a2d254d9a5d25891d3434b0ff90e9b3f82f4e 16-Dec-2016 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP performance" am: c0ea41ba0e
am: 3bfa299328

Change-Id: I26a0db18286e8d9c687f2e4d1b476ca07a6d1ea9
ce13981723f7e227ac5e51478cded5741f788796 16-Dec-2016 Ajay Panicker <apanicke@google.com> Merge "Prevent SQL query from having a bad where clause" am: 6c58f22c09
am: 47f23e1d25

Change-Id: I7bb275568ea5a8c5d8fc12f356005331320a79f9
458e7b842a2cb5d04ed7dd92be1d2de4dc70cdcf 15-Dec-2016 Ajay Panicker <apanicke@google.com> Prevent SQL query from having a bad where clause am: 046debbf87
am: 427341d580

Change-Id: I8a3b8ac03a729c5400a65ddf1eaf9030b561d098
427341d5804c9f71c91204ca8339e82545b30005 15-Dec-2016 Ajay Panicker <apanicke@google.com> Prevent SQL query from having a bad where clause
am: 046debbf87

Change-Id: I3abeab386e5047faaa66d3863bbfdd7dd8f7496c
c0ea41ba0e71ad595f4f0b445480077c9ae639a7 15-Dec-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "PBAP performance"
046debbf8704ce4a0e0e318567cddcba76b026e6 15-Dec-2016 Ajay Panicker <apanicke@google.com> Prevent SQL query from having a bad where clause

Bug: 33092708
Test: Sanity test MAP on carkit
Change-Id: I6c7f54f60877cf2c57df9b3521604660321214ff
(cherry picked from commit 0552994436e2afdec3d35fed5aac0f87e8e3e0bb)
ap/BluetoothMapContent.java
0552994436e2afdec3d35fed5aac0f87e8e3e0bb 15-Dec-2016 Ajay Panicker <apanicke@google.com> Prevent SQL query from having a bad where clause

Bug: 33092708
Test: Sanity test MAP on carkit
Change-Id: I6c7f54f60877cf2c57df9b3521604660321214ff
ap/BluetoothMapContent.java
b44a18cd53b3dadf4a81d0822c091b8fdca82305 06-Dec-2016 Joseph Pirozzo <pirozzoj@google.com> PBAP performance

Change behavior of onPullComplete to group insert operations for
contacts and apply together. This batching of operations reduces cross
process communications and improves performace about 3x from 100 seconds
for 1000 contacts to 34.

Bug: 27343808
Test: SL4A test BtCarPbapTest:test_contact_download.
Change-Id: I56bc23c69bc93cf44f2a8e132dea8dce8de109dc
bapclient/PhonebookPullRequest.java
89aaa72b21e05161ba1e86f3742367b7c9a01b7d 15-Dec-2016 Ajay Panicker <apanicke@google.com> Merge "Prevent Null Pointer Exception caused by empty remote device properties" am: 4b4f533766 am: 249bbe4611 am: 9ef833f81f
am: 58d8f60c45

Change-Id: Ib48ff63c7b8a4508a45e5b2c5d3abed29a6a7aca
9ef833f81f464ce95b2d848a76f6957777d4b2e7 15-Dec-2016 Ajay Panicker <apanicke@google.com> Merge "Prevent Null Pointer Exception caused by empty remote device properties" am: 4b4f533766
am: 249bbe4611

Change-Id: I1acad92fea490fd2c81b092f505d4f26c2574e18
9f2682b75aab6ac9eff1d4ac5956df402d98d1c1 15-Dec-2016 Ajay Panicker <apanicke@google.com> Prevent Null Pointer Exception caused by empty remote device properties

Bug: 33092708
Test: runtest bluetooth
Change-Id: I6d7bfd9baaa428692183a64cc7ae87438862d518
tservice/RemoteDevices.java
818acdd7951f1dde8a7909fcb4afafb3d184b0a1 14-Dec-2016 Jack He <siyuanh@google.com> Merge "Remove disk IO read/write blocks in AdapterService for main thread" am: 8723086a83 am: 287e7ea1bf am: 0bd2c74ba5
am: d62d5804cf

Change-Id: Id6a14cebea9de76a09ac7ca16b39f7154029eb13
0bd2c74ba53623f657e9ba24cfe9ea2b615685b8 14-Dec-2016 Jack He <siyuanh@google.com> Merge "Remove disk IO read/write blocks in AdapterService for main thread" am: 8723086a83
am: 287e7ea1bf

Change-Id: Icaa7098686be6658f33eb35bd0babe6780d3d439
7eeb95b6f29a6f55e117e329468168d4bcbec0c8 07-Dec-2016 Jack He <siyuanh@google.com> Remove disk IO read/write blocks in AdapterService for main thread

* Call getSharedPreferences() asynchronously during onCreate() to cache
preferences in memory as early as possible to prevent ANR
* Change editor.commit() to editor.apply() in AdapterService for:
setPhonebookAccessPermission
setMessageAccessPermission
setSimAccessPermission
so that these methods will return true when editor.apply() is called.
After that call, the preference will be updated in memory so that
following calls that use such preferences will see the change.
However, there is a possibility that write to persistent storage will
fail in the background which reset the preference after reboot or service
restart. In this case, we need to call these method again.
* Same changes in Avrcp for:
blackListCurrentDevice
resetBlackList
In these methods, the return values for editor.commit() are already
ignored and therefore no user-visible effect.

Bug: 33382877
Test: mannual test, connect to carkit and browse phone book
Change-Id: I605dc00db4647f06c9fa797f272188a44f0e5724
vrcp/Avrcp.java
tservice/AdapterService.java
52e8773c5c27257aad4602fb0f4539645f7d7b74 12-Dec-2016 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Catch Intent.startService SecurityException" am: 1b559e9463 am: ad08eafd60 am: 61d0dafd3f
am: a9065f3b38

Change-Id: I0bfa99b8b082aff3da9e5a0e7798da432b8c8858
61d0dafd3fcd9905f9933e6e8929b686b0c01eb5 12-Dec-2016 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Catch Intent.startService SecurityException" am: 1b559e9463
am: ad08eafd60

Change-Id: I62d317443299707348faf67ed98d23f25b1d8503
f65765e71b2a6552c319eb5199914045a1ecdb04 24-Nov-2016 Marie Janssen <jamuraa@google.com> AVRCP: Catch Intent.startService SecurityException

If a package is being upgraded it is frozen and we can't start the
MediaBrowseService on it.

Test: runtest bluetooth

Bug: 32977865
Change-Id: Ie0c47f6db370be70259c5e7cde67b2e89c07ab75
vrcp/Avrcp.java
6cda653b577ed785a11b476bbe6d59409e12fb94 08-Dec-2016 Ajay Panicker <apanicke@google.com> Merge "Use the correct ContextMap for scan statistics" am: 2e7125a257 am: 319bece190 am: 5acbd2f421
am: 324e57e3d0

Change-Id: If4a35488c49416d7ac5516bdc71d96d595356a94
5acbd2f4211477d865466d483181051da7ae1efa 08-Dec-2016 Ajay Panicker <apanicke@google.com> Merge "Use the correct ContextMap for scan statistics" am: 2e7125a257
am: 319bece190

Change-Id: I51f1ed40be28bb7f10a78f72d0bac523e0db0727
f3863dec6d1ac2f83a5b0ab4df379ca1e87d5df3 07-Dec-2016 Ajay Panicker <apanicke@google.com> Use the correct ContextMap for scan statistics

Test: "adb shell dumpsys bluetooth_manager" after scanning with an LE app
Change-Id: Id8c16aa171d9ceee9b3ce83ae5afbefa0d6fd9ed
att/GattService.java
609c916ecf0c68dd6c9becaee88c870615a094ee 06-Dec-2016 ltrochtova <ltrochtova@google.com> Merge "AdapterService: enforce new user restriction for disallowing Bluetooth." am: 80343eba78 am: f87e5650c9 am: 1c072190bc
am: 738a98cf2d

Change-Id: If8f9ad05cd24b488cbe030d8032a9b5de71ee47e
1c072190bc14127c36fee2ae61a25b34f61d5217 06-Dec-2016 ltrochtova <ltrochtova@google.com> Merge "AdapterService: enforce new user restriction for disallowing Bluetooth." am: 80343eba78
am: f87e5650c9

Change-Id: I38d759c37e00e4e266cad5de3e8f3be5ffc6c26a
f87e5650c9e9b5b02ae4f345bae0d37cc201541e 06-Dec-2016 ltrochtova <ltrochtova@google.com> Merge "AdapterService: enforce new user restriction for disallowing Bluetooth."
am: 80343eba78

Change-Id: I26a9af5750833ba8d9202c3b9159ad9ffa060bc2
183084b53e0bae164497667117ca6cd8e334eddc 02-Dec-2016 Lenka Trochtova <ltrochtova@google.com> AdapterService: enforce new user restriction for disallowing Bluetooth.

Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.UserRestrictionsTest
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.DeviceOwnerTest#testBluetoothRestriction

Bug: 32895300

Change-Id: I832b9c7d6427dfd977a6f0ee73c860234c1e2347
tservice/AdapterService.java
cfb8afd0a26603585fe6f05241bd0ac2d4d43026 01-Dec-2016 ltrochtova <ltrochtova@google.com> Merge "Revert "AdapterService: enforce new user restriction for disallowing Bluetooth."" am: 490b7a3bbe am: a7da3b78f1 am: 56c36936a7
am: 35b4deede9

Change-Id: I624aa134d9551382ffc4dccaffc12dce6a15d31a
b4558e8b9ef47f968c1eca2d73e9ed2824b2fc8a 01-Dec-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix null settings in AdvertiseCallback.onStartSuccess" am: 67969eff13 am: 2e230c6a96 am: bf8a7f12e4
am: 6c86b7c38b

Change-Id: Ie1f658cf77f0dd98c6c41229e5bb9432b7b11b66
a4d4bcb7bcfe49880991dca9a15ebd07bb6c19c4 01-Dec-2016 ltrochtova <ltrochtova@google.com> Merge "AdapterService: enforce new user restriction for disallowing Bluetooth." am: 6add0e7b31 am: aca88a2c5d am: 0a3fa3c7ab
am: e39ac56d74

Change-Id: I6967aa39b877722f250ed645a1bbe5905de27c9b
56c36936a70e29e339bbbd99803b31e4e73a7734 01-Dec-2016 ltrochtova <ltrochtova@google.com> Merge "Revert "AdapterService: enforce new user restriction for disallowing Bluetooth."" am: 490b7a3bbe
am: a7da3b78f1

Change-Id: I15af93485e71244435c0524746546f524cd08cba
bf8a7f12e4ad73abfb3357f1803099d9f2f5ae66 01-Dec-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix null settings in AdvertiseCallback.onStartSuccess" am: 67969eff13
am: 2e230c6a96

Change-Id: I911246bd9be13ed919a68920fa4ed138b7833341
a7da3b78f135e774feb542d6e67442e45fea809d 01-Dec-2016 ltrochtova <ltrochtova@google.com> Merge "Revert "AdapterService: enforce new user restriction for disallowing Bluetooth.""
am: 490b7a3bbe

Change-Id: I8cb18c89f011e1117876ef4d044ad30e744e2f57
0a3fa3c7abf98d0a374c78d37fc935b72c2efeef 01-Dec-2016 ltrochtova <ltrochtova@google.com> Merge "AdapterService: enforce new user restriction for disallowing Bluetooth." am: 6add0e7b31
am: aca88a2c5d

Change-Id: If3aaceacd0b330b10ce7d87c686997a1ef0f5f96
2e230c6a96deda76acd46fe8539d7cb6f32f1480 01-Dec-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix null settings in AdvertiseCallback.onStartSuccess"
am: 67969eff13

Change-Id: I1368389902709d0a9b6745f8c88d2f154db772dc
aca88a2c5d57c3a1e85e2764e09d5932da703619 01-Dec-2016 ltrochtova <ltrochtova@google.com> Merge "AdapterService: enforce new user restriction for disallowing Bluetooth."
am: 6add0e7b31

Change-Id: I2651d74350dea46faed29a82847634b035e9a15a
490b7a3bbeff693b0ec1529ad33125c9d67d98e6 01-Dec-2016 ltrochtova <ltrochtova@google.com> Merge "Revert "AdapterService: enforce new user restriction for disallowing Bluetooth.""
7fb204fb20d80b78013fbb1826c80fa3f4c33527 01-Dec-2016 ltrochtova <ltrochtova@google.com> Revert "AdapterService: enforce new user restriction for disallowing Bluetooth."

This reverts commit 1f802f2473b5f8b8a401bcd9c7273d21b27d4bc2.

Change-Id: Ic5ffcf4e1ad9d024646363fa83094997058dd05b
tservice/AdapterService.java
4d6c42f3481f1ef7657b10f1ba5198216b67c498 01-Dec-2016 Jakub Pawlowski <jpawlowski@google.com> Fix null settings in AdvertiseCallback.onStartSuccess

Test: acts FilteringTest
Bug: 33171815
Bug: 30622771
Change-Id: Ib3df1d13535999ede0e820651fc6d69daeb8ef17
att/AdvertiseManager.java
att/GattService.java
1f802f2473b5f8b8a401bcd9c7273d21b27d4bc2 24-Nov-2016 Lenka Trochtova <ltrochtova@google.com> AdapterService: enforce new user restriction for disallowing Bluetooth.

Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.UserRestrictionsTest
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.DeviceOwnerTest#testBluetoothRestriction

Bug: 32895300

Change-Id: I9bc69b4f4886e9d61574ed1a717371d035eb9776
tservice/AdapterService.java
a7bac2a6dc381423a8d76f2c70d327bca01ff661 30-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Add Bluetooth device address parameter to HF Client APIs" am: f7d1e331cb am: e3f300d6f2 am: 8d610eeb2d
am: 2d715e5cc4

Change-Id: I6964a60d4afda99d478aa7b6e9977ca1ac146cee
8d610eeb2d290106464a4371e7da5c7d30f42e0e 30-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Add Bluetooth device address parameter to HF Client APIs" am: f7d1e331cb
am: e3f300d6f2

Change-Id: I8c339d3341e55fd9ed1e5ad6519ea4fdd77f09d9
e3f300d6f226c75032503857e12ce7979dc8cf81 30-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Add Bluetooth device address parameter to HF Client APIs"
am: f7d1e331cb

Change-Id: Ifdb0b617841ea38e4afe2d9ea8faeb65a4c3e1a1
9b923688bf84c08df2a1c569540ddefaff7964a1 29-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Disable HFP audio path when HFP call goes on hold/resume when goes off hold"
am: d13d573c0a

Change-Id: I358a75c0b793d81c56107094f46cea37c07185a4
ef3a3b50a70aea2b4583395198aa7572553d2846 29-Nov-2016 Sanket Agarwal <sanketa@google.com> Add Bluetooth device address parameter to HF Client APIs

Bug: 30984220
Test: SL4A tests for HFP

Change-Id: Ic03dd8fab87c3ed7ea83a617fc18426427020182
fpclient/HeadsetClientStateMachine.java
849169b3530d0da7fddd1e6884ab713aa4554f94 27-Oct-2016 Christine Hallstrom <hallstrom@google.com> Disable HFP audio path when HFP call goes on hold/resume when goes off hold

This fixes the issue where a cellular call made to a watch when an
HFP call is in progress causes the cellular audio to go through the
HFP path.

Bug: 32164561
Change-Id: I179ba4e1f1a1e76496f3062cc29bc20014fe5661
(cherry picked from commit 3ee63fdfb7fa5896bff7e172be60c763919c9f63)
fpclient/HeadsetClientStateMachine.java
e35958ff5f53addb1d74094559a897926bb1374f 28-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Cleanup startAdvertising call" am: 676347ddce am: 2fb1b4a04a am: 80e09bb7c7
am: c380dd5088

Change-Id: If65c2f46c87c9246d2af3eccc25634027b95ea6b
80e09bb7c7b73c1fb53ecd681aa12c7bb500548e 28-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Cleanup startAdvertising call" am: 676347ddce
am: 2fb1b4a04a

Change-Id: Ia074d895655d2b6ddae5f72378f65eb7c49dacd9
2fb1b4a04acbdf1dce86b7569458aeb33e10b075 28-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Cleanup startAdvertising call"
am: 676347ddce

Change-Id: Icc388d93446ddd689af2d4e040e5d44565fcd379
52ec4e757eff12405d0d074d58822b061cd77d84 23-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Cleanup startAdvertising call

AdvertiseManager.startAdvertising no longer sends multiple commands.
Its native counterpart, BleAdvertisingManagerImpl.RegisterAdvertiser,
thanks to better tests, guarantees that it either sends a success or
error callback. Therefore, no additional synchronization is required.

The only cases when the native code can get executed without a callback
are when the controller sends no response, or the bta thread is stuck.
Both of those cases should result in a crash and restart of bluetooth.

This patch also fixes an error, where if a timeout happens, the error
callback gets called twice.

Bug: 30622771
Test: sl4a ConcurrentBleAdvertising
Change-Id: I72a729f4da2bd8d5d62a81a6f93dbadab088a036
att/AdvertiseManager.java
att/GattService.java
2235686b8aef18cab3eb6760939df76c5f4984cb 24-Nov-2016 Christine Hallstrom <hallstrom@google.com> Disable HFP audio path when HFP call goes on hold/resume when goes off hold
am: 3ee63fdfb7

Change-Id: I0f35f2a743cbd963686e6ba41c632e52234f53de
59d4f0e9d674721b2f539436ce2efed0bb644604 23-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Remove unnecessary advertiser count check" am: 8fc01bd0eb am: 7eaee06a7c am: 91bc804f98
am: b820be3f76

Change-Id: Idf38b6c3cc429884aea36785b6cec3def548c62c
b820be3f76d0a5039cd5d41216d74cac3594f69f 23-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Remove unnecessary advertiser count check" am: 8fc01bd0eb am: 7eaee06a7c
am: 91bc804f98

Change-Id: Ie91a259cfee5ee6e6302e4e1568e1f1f91a75cd2
91bc804f98f1ed01732352e717eb055d4520faa5 23-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Remove unnecessary advertiser count check" am: 8fc01bd0eb
am: 7eaee06a7c

Change-Id: I59464159b27222784ad054e74c945af5c6f8d143
7eaee06a7c90a437f4096f4ba103b031a69e8371 23-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Remove unnecessary advertiser count check"
am: 8fc01bd0eb

Change-Id: Ie5e41217486cbe2558f28c8d82d4aeef02c1a486
7770f07e7444ff63d56df3ff48a335296c11fcf4 23-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Remove unnecessary advertiser count check

Bluetooth stack won't allow to register more advertisers that it can
handle, so checking count of registered advertisers make no sense when
calling startAdvertising.

Bug: 30622771
Test: sl4a ConcurrentBleAdvertisingTest
Change-Id: Ifbaf583871cf59ce8e345d7bca8e9a9ea1540734
att/AdvertiseManager.java
22c68791d27a9c4e4317dd96d87bec26cb746664 19-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Move some AdvertiseManager methods into separate helper am: 335fb7b425 am: f9b212f2f4 am: 12ca1af305
am: 1798f56e66

Change-Id: I4a645ce039db7a0165f424796334048c1d808580
1798f56e660932c464e0115f8f471d6b5d290770 19-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Move some AdvertiseManager methods into separate helper am: 335fb7b425 am: f9b212f2f4
am: 12ca1af305

Change-Id: I6ab096f32fc0b683a90c9ee0cf5382b874f62160
12ca1af305b32d4a2a645eeda0dd518ae30433c8 19-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Move some AdvertiseManager methods into separate helper am: 335fb7b425
am: f9b212f2f4

Change-Id: I46d6490e38a4bf2d4b562d6b150eb6da9694b2d7
f9b212f2f4cd804a16d5f7950045019215cc3400 19-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Move some AdvertiseManager methods into separate helper
am: 335fb7b425

Change-Id: I9336088e214841f6f7530f2b54209891ff4302bd
335fb7b425b0a585c271ae34901ea443ec88be38 19-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Move some AdvertiseManager methods into separate helper

This patch is moving some methods from AdvertiseManager into a
AdvertiseHelper. This is a preparation to add tests to
advertiseDataToBytes and others.

Bug: 30622771
Test: sl4a ConcurrentBleAdvertisingTest BleAdvertiseApiTest
Change-Id: I41f857379c892f76a5cec807879722764ef3cfa7
att/AdvertiseHelper.java
att/AdvertiseManager.java
6eac7f5c5614bedb580d6cade16708031466b4c9 18-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Move startAdvertising() logic into native code (1/3) am: e82cce565b am: 9ecd25b8ef am: 350497f07d
am: 9973ce87c7

Change-Id: Id2915cae0f2ff1b6b6800a08013d0c884fc9b201
9973ce87c7a130924731ba4471d17b11be904f86 18-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Move startAdvertising() logic into native code (1/3) am: e82cce565b am: 9ecd25b8ef
am: 350497f07d

Change-Id: If9c8a0ceea9970f3d8d9aca95e431fdcb7bbefb1
350497f07dff2ac487c2da9ce268cd7318959d6b 18-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Move startAdvertising() logic into native code (1/3) am: e82cce565b
am: 9ecd25b8ef

Change-Id: I2e278f6d46572c325a4ff8021196fb1e8282a078
9ecd25b8ef9a2168d8a5b14e9f2188518c94d13a 18-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Move startAdvertising() logic into native code (1/3)
am: e82cce565b

Change-Id: I6e9cf2db1974c893bfed648cffae627e2b53b9c5
e82cce565b1549001f5a70526239c2d92106f85a 17-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Move startAdvertising() logic into native code (1/3)

AdvertiseManager.startAdvertising() was implemented in Java layer for
historical reasons. Now that we have nice native callbacks and tests,
it can be moved into native code, where it will be shared between
Android daemon and bluetoothtbd.

Bug: 30622771
Test: native tests added to cover startAdvertising
Change-Id: Ifee1fc74ad3e749ffc0c6a734e450c540b5b59bb
att/AdvertiseManager.java
att/GattService.java
576d9f67a261275a87d338e65cf128a1cdf51ae9 16-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix NPE in createBond" am: 2beef8d589 am: f17f8cf739 am: 8c9d2e36bc
am: ce288efcc9

Change-Id: I1bb90c79850e4e9bff7b385236f2930a869b4d95
ce288efcc911672d13715f8cda8b8842ea7de019 16-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix NPE in createBond" am: 2beef8d589 am: f17f8cf739
am: 8c9d2e36bc

Change-Id: Iae3a23967f90bcf3b29f19c421f36f33394a458d
8c9d2e36bc77879cfe7c2c610e74bb908a7417cb 16-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix NPE in createBond" am: 2beef8d589
am: f17f8cf739

Change-Id: I6e92eb2a114a3da0febad730faaf30edee28be50
f17f8cf7392727c18ee1b2c5ac75699d926ba05c 16-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix NPE in createBond"
am: 2beef8d589

Change-Id: I97256a6d98bfcd694e2abd55e8892228615c09e8
2beef8d58967ba6ed33d5da97fff13ca729e64a7 16-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix NPE in createBond"
7d2fcd0564e9f9037879c31e149011aa1280bc59 16-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Fix NPE in createBond

Bug: 32925925
Test: initiate bonding locally using NFC OOB
Change-Id: I9aadea84e9e2e57cf75c02affa618eb37a33a767
tservice/AdapterService.java
tservice/RemoteDevices.java
07154c1614247067a5dd718d8779e7f952598e3c 15-Nov-2016 Ajay Panicker <apanicke@google.com> Merge "Protect against SQLiteException crash in MAP init" am: a0753c2c96 am: bf077b3e5d am: 50288fdadd
am: 32eeb9a589

Change-Id: Ib5b77aecf3ce5a267d5fb49a72c29205c6fc2def
32eeb9a5898d1472f8af6402c7ac2088af5ab5cf 15-Nov-2016 Ajay Panicker <apanicke@google.com> Merge "Protect against SQLiteException crash in MAP init" am: a0753c2c96 am: bf077b3e5d
am: 50288fdadd

Change-Id: I2043501cfae4f56f3dd34c31a9988ae1ade2f35d
50288fdadd4f2c6719ba5100a5b7984353cc215d 15-Nov-2016 Ajay Panicker <apanicke@google.com> Merge "Protect against SQLiteException crash in MAP init" am: a0753c2c96
am: bf077b3e5d

Change-Id: I5ec78e3d5f58ffc294f5d866d70f532c46369795
bf077b3e5d54df12bfb9e3150cb96045a9d68a6a 15-Nov-2016 Ajay Panicker <apanicke@google.com> Merge "Protect against SQLiteException crash in MAP init"
am: a0753c2c96

Change-Id: I0ac00f14ee5c1a95472d14ac036f845df86f7d60
a0753c2c964957aac18b3a7b4690e0268147c481 15-Nov-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Protect against SQLiteException crash in MAP init"
0905a86a66d6754469c00b5d154ffafe35f630b7 10-Nov-2016 Ajay Panicker <apanicke@google.com> Protect against SQLiteException crash in MAP init

Bug: 32717472
Test: runtest bluetooth
Change-Id: I533d7ca0b281291f931f4aca271ea9ff3214bdf2
ap/BluetoothMapContentObserver.java
9f70e8d5cf5075198e669497ba8df1ce43a85a4d 15-Nov-2016 Yoshiharu Kurita <yoshiharu.x.kurita@sonymobile.com> Merge "Use ENTERPRISE_CONTENT_FILTER_URI for phone lookup URI" am: 5b71cc4c23 am: 226ac8d582 am: dc4d95a2e5
am: 3116c5ba44

Change-Id: Iff6162284500e62352c20e08e6ae57a61d313682
3116c5ba44bd983a7ec83294e8219dcb32688ac5 15-Nov-2016 Yoshiharu Kurita <yoshiharu.x.kurita@sonymobile.com> Merge "Use ENTERPRISE_CONTENT_FILTER_URI for phone lookup URI" am: 5b71cc4c23 am: 226ac8d582
am: dc4d95a2e5

Change-Id: I5d4a3f96100c4e3bb1b4dd2d0543f6924b53831b
dc4d95a2e57a78c95167b8a97158d6e45c585ca9 15-Nov-2016 Yoshiharu Kurita <yoshiharu.x.kurita@sonymobile.com> Merge "Use ENTERPRISE_CONTENT_FILTER_URI for phone lookup URI" am: 5b71cc4c23
am: 226ac8d582

Change-Id: I839f15f50e8d9cfe7819e3f4e94c67bf607fe4ad
226ac8d5828e83a2e1f73155f8ebb93d70ffe709 15-Nov-2016 Yoshiharu Kurita <yoshiharu.x.kurita@sonymobile.com> Merge "Use ENTERPRISE_CONTENT_FILTER_URI for phone lookup URI"
am: 5b71cc4c23

Change-Id: Ie838a43f90e7f167ffe290bccf97f400718b4e23
ff27bef23cb3dc1a6b0fbb4fef71e52948f4849b 07-Dec-2015 Yoshiharu Kurita <yoshiharu.x.kurita@sonymobile.com> Use ENTERPRISE_CONTENT_FILTER_URI for phone lookup URI

To retrieve not only personal caller-id but also corporate caller-id,
we need to use ENTERPRISE_CONTENT_FILTER_URI for phone lookup URI
instead of CONTENT_FILTER_URI.
This modification is required by Android for Work.

Bug: 28947490
Change-Id: Iee51c1bebf8ee41668bec305cf37d2cdfdda5e2e
ap/SmsMmsContacts.java
04ce6ce3e742f54e6de651e887358713c0e0c98e 04-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Unify advertising API (3/3)

This patch unifies advertising API. On startup, if VSC multi advertising
is avaliable, it will be used, otherwise
BleAdvertiserLegacyHciInterfaceImpl will be used, which provides one
advertising instance.

Test: sl4a tests are passing, all proper tests updated accordingly
Change-Id: I899ed51bf4e747e1e3ff1a472a55f060249cbb75
tservice/AdapterService.java
att/AdvertiseManager.java
att/GattService.java
9efbac114fcfa9ac60d4f952033d6201b61a7b6f 12-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Unify advertising API (3/3)" am: e19d38fd41 am: 728915cdfd
am: 346ae998f7

Change-Id: I072b494a9009befb06ebbb5ac1685016cd404411
346ae998f72cf6752f5469e1879b0043e61db498 12-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Unify advertising API (3/3)" am: e19d38fd41
am: 728915cdfd

Change-Id: Ia0a11cf04ad8527752b7d196014298773de422ba
728915cdfd2dd01edd9f44be53ce815a31c0da9e 12-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Unify advertising API (3/3)"
am: e19d38fd41

Change-Id: I9770b855ffa0f9cab36c06f499ec60a51bd54a63
6d5a03f00fc00a4fe9d9e2bd1e6a2abc8ffc5284 04-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Unify advertising API (3/3)

This patch unifies advertising API. On startup, if VSC multi advertising
is avaliable, it will be used, otherwise
BleAdvertiserLegacyHciInterfaceImpl will be used, which provides one
advertising instance.

Test: sl4a tests are passing, all proper tests updated accordingly
Change-Id: I899ed51bf4e747e1e3ff1a472a55f060249cbb75
tservice/AdapterService.java
att/AdvertiseManager.java
att/GattService.java
7b929a5f67433636ac7651e6160abf8122705cfc 03-Nov-2016 Chris Manton <cmanton@google.com> Merge "BLE Check and send scan response data" am: 97f86114a4
am: 1794060bb6

Change-Id: Ic6b73fc114c56e0698c4f688ee21c5b861176611
1794060bb69d54f3bd027d9b41a6feaa21b1b88e 03-Nov-2016 Chris Manton <cmanton@google.com> Merge "BLE Check and send scan response data"
am: 97f86114a4

Change-Id: I34d73f42bd2403aea99621838ab55b8c0f1c2d56
97f86114a40281176c8feb81874427ee79c78745 03-Nov-2016 Chris Manton <cmanton@google.com> Merge "BLE Check and send scan response data"
e5b2af01a39c819f8bf20ca1ef46d6b05d84d20c 03-Nov-2016 Chris Manton <cmanton@google.com> DO NOT MERGE BLE Check and send scan response data am: 6bb2114adf
am: f48e98fe54

Change-Id: I5a00c0fcd551fcb4b351f27e18d8866901b724e6
f48e98fe5426fff27cc43c1f62117d506295f003 03-Nov-2016 Chris Manton <cmanton@google.com> DO NOT MERGE BLE Check and send scan response data
am: 6bb2114adf

Change-Id: I97ebca38b9a8d5e05decaa1b8a79d6ed789fb078
6bb2114adfde5e3dcd78860e6ea0a2271e0335b4 01-Nov-2016 Chris Manton <cmanton@google.com> DO NOT MERGE 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
att/AdvertiseManager.java
1bc4b2cc785b95ce3c702379a619fc77ece5b240 02-Nov-2016 Ram Periathiruvadi <ramperry@google.com> Fixing A2dpSinkStreamingStateMachine thread leak. am: f00c68aeda am: 2d98ead211 am: 7b55f9616c
am: 53a6d69c61

Change-Id: I223212657d8b0e0a792e8d8daaa683d2d3be2d2b
336f3def7331fd6d16df1c2d9d16f3209103cf34 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Now Playing List gets stuck in a loop am: 609f94bb87 am: 90c909d063 am: 982e9fd60e
am: b8e6858277

Change-Id: I663adb690e805023cb66377ed67b0569286ec872
0af860d51aa3a3580a951ce974ef3ba63fd2c570 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP Client connect after PBAP Client am: 2ad555291d am: fb4eaf84e9 am: 171b6d19a3
am: 99ba123635

Change-Id: I3c6ce84fa0c8c7aff005ffc6d6a218ac0f1750b7
7e1e3e26a4ac4cb07fee3c1917a330463f1f72e9 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP MCE iPhone connectivity am: c1c6d1d504 am: da21d7195c am: db2f50804e
am: 3925b745ec

Change-Id: Ie1e0e60c70d13c05110f96ac61532e3c62b2838c
dc463e06926036ed5e4c52bf725619a2f00f4acb 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP MCE disconnecting automatically am: 7adf1f5877 am: 4be2ecfc28 am: 625b226af2
am: e85218701b

Change-Id: I7272d21aebee2d163914b3879f7c02dba5607581
a73b3040f8c8ebceb3c03007f50c0054382fc8a1 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP MCE message filtering am: 12ae7442e5 am: 152e8de4cb am: f90514e44e
am: 2aca3035ad

Change-Id: I0defc5c3540c18dbd6418b2406f285d09c2b81e2
0cbf31862c9cce5e56923bf77e7f22666c7493f5 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Set debug flags to false am: 763f0e3db6 am: 753ae396ef am: 8c01c5bc54
am: fba9311f1c

Change-Id: Id1de13d2dc7644e264499a6fdeafced9b0f6376b
53a6d69c61a058241c55f966357ca9a3d3e4b725 02-Nov-2016 Ram Periathiruvadi <ramperry@google.com> Fixing A2dpSinkStreamingStateMachine thread leak. am: f00c68aeda am: 2d98ead211
am: 7b55f9616c

Change-Id: I60d3b45f2ff681d40155e9c0add3dcf1d47e9b25
b8e685827790658dff9c83593ad1ae9b04e6f65c 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Now Playing List gets stuck in a loop am: 609f94bb87 am: 90c909d063
am: 982e9fd60e

Change-Id: I8b61b2ff996d3b81009467b7819223e6f0ef9eb3
99ba1236351b1d57d042947ae9e92fb9019ce8d1 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP Client connect after PBAP Client am: 2ad555291d am: fb4eaf84e9
am: 171b6d19a3

Change-Id: If1dad59318eba70512a4fa05663f2e07a1638dae
3925b745ec2c9fddad3d21333a72c1aafe1e71f6 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP MCE iPhone connectivity am: c1c6d1d504 am: da21d7195c
am: db2f50804e

Change-Id: I95f1b452f4616e8c323259241b15cce14e287bcb
e85218701bf2e6ea3da1d0a978103befc366d61d 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP MCE disconnecting automatically am: 7adf1f5877 am: 4be2ecfc28
am: 625b226af2

Change-Id: Ieb742b71d4e68814e07fd8f3aaed62fb05f064f3
2aca3035add86522e7c8d65f20f64d36130030f2 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP MCE message filtering am: 12ae7442e5 am: 152e8de4cb
am: f90514e44e

Change-Id: I32d875a0e1b3572e387cbd298c20a3b320cd3e60
fba9311f1cc2b9f31ae558aed4b1ea529dbb2817 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Set debug flags to false am: 763f0e3db6 am: 753ae396ef
am: 8c01c5bc54

Change-Id: Ie158417007f1e43aa0bd249865eb5101f94350df
7b55f9616c783ba1c5092060e233461fa725e48c 02-Nov-2016 Ram Periathiruvadi <ramperry@google.com> Fixing A2dpSinkStreamingStateMachine thread leak. am: f00c68aeda
am: 2d98ead211

Change-Id: I3cf3a90a044ae57c740c13e19f702b7e5bd98667
982e9fd60ede5f32b2fe91229983e8ce4dd0a4bb 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Now Playing List gets stuck in a loop am: 609f94bb87
am: 90c909d063

Change-Id: I107c5c574cea56889cab5e48bc17c9e7c97011f3
171b6d19a3a2a792ed37edef7cf6da1063fe1ed1 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP Client connect after PBAP Client am: 2ad555291d
am: fb4eaf84e9

Change-Id: I6e46eb2dec6d71146ec34ddc2a0091273ba303e0
db2f50804e2dc6d2fb625aaaa38df5689af38791 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP MCE iPhone connectivity am: c1c6d1d504
am: da21d7195c

Change-Id: Icccc1b7ab6272b06943de09a4c2e79f96aef8b90
625b226af276d847bb719a318352b17bc77e2c43 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP MCE disconnecting automatically am: 7adf1f5877
am: 4be2ecfc28

Change-Id: I2a8567ab486539e08ca1c618d27b3d0cf652b8fe
f90514e44e52d06f864c1134f4d1f8c4e9e27f36 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP MCE message filtering am: 12ae7442e5
am: 152e8de4cb

Change-Id: I6c4f1cac46410ad6b79f1d1eb37a734db314d3ab
8c01c5bc548dfdc7a62acd55af13408d9babf3d0 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Set debug flags to false am: 763f0e3db6
am: 753ae396ef

Change-Id: I1dcc8f3c051bb251769c3c20b2a8a94acf6ea0fb
2d98ead211b35b4d1203a6eb95bfee25c198bf89 02-Nov-2016 Ram Periathiruvadi <ramperry@google.com> Fixing A2dpSinkStreamingStateMachine thread leak.
am: f00c68aeda

Change-Id: I1119f2ec7a050a0f76633f842e51b3aef778ec69
90c909d063314da3b91772e2e146d4d02baa4d0e 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Now Playing List gets stuck in a loop
am: 609f94bb87

Change-Id: Icd7d8a87b3d1840e37dbe80097a1c638e4923d45
fb4eaf84e9435cb77b9b579a1eee7de169038226 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP Client connect after PBAP Client
am: 2ad555291d

Change-Id: I1d54810f796fbad50b95a5f3552001826cd5d9c8
da21d7195c04275bebed22a9f9b75fc21595bd98 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP MCE iPhone connectivity
am: c1c6d1d504

Change-Id: Ic40593a9bd0682ae099153995340b58e5008c1cb
4be2ecfc28aca6f70bbffbf8ff2ca943a1bfdd3d 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP MCE disconnecting automatically
am: 7adf1f5877

Change-Id: I7dc26938faa42847a6de2c30bf0617b1dd8a5820
152e8de4cb8ce4a7e5c4893798d966c07f10676f 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> MAP MCE message filtering
am: 12ae7442e5

Change-Id: I16d85f63df0c390c4f437e9bda143725f3ae5f4c
753ae396ef16c5cfe386e7e86156300d2d4deb20 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Set debug flags to false
am: 763f0e3db6

Change-Id: I2732c0f72d32d6b3cdc9fb1596bc4a00b5135a9a
f00c68aeda2ec97a4382677754a1eab4429a235d 14-Oct-2016 Ram Periathiruvadi <ramperry@google.com> 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)
2dpsink/A2dpSinkStateMachine.java
2dpsink/A2dpSinkStreamingStateMachine.java
609f94bb870727471a8c571ede2aa8cbbaf70f76 12-Oct-2016 Sanket Agarwal <sanketa@google.com> 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)
vrcpcontroller/AvrcpControllerStateMachine.java
vrcpcontroller/BrowseTree.java
2ad555291d7cd3b670ed7673bbaabdc898f3c172 13-Oct-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
tservice/AdapterService.java
c1c6d1d504fbf0344631b4416e51c8b0f61958a7 13-Oct-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
apclient/MceStateMachine.java
7adf1f5877056e639044a0620355e87888fdc799 11-Oct-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
apclient/MceStateMachine.java
12ae7442e59511a9e9d85eb5f76bc3bc5f3bec4c 07-Oct-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
apclient/MceStateMachine.java
763f0e3db67879294d045fbca0f55b3b0244b266 06-Oct-2016 Sanket Agarwal <sanketa@google.com> 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)
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientConnectionService.java
661793b4503cf3e7f723053cc77942a3be411184 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP Logging" am: 1826359356 am: d5a4e1d6b3 am: 15acc96fd7
am: 011b36f286

Change-Id: I0d6f77868b99ec44fa1813dd6b9f48e4233424b3
011b36f286ad9e7638227034214988159fdffd2a 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP Logging" am: 1826359356 am: d5a4e1d6b3
am: 15acc96fd7

Change-Id: I4cfdaeb5937113f1d731ea0d2e4121988658162b
15acc96fd7288a35402fce6896032408d8d8e335 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP Logging" am: 1826359356
am: d5a4e1d6b3

Change-Id: I11a712fb891fce0da8ba612c263a7e97d2bbdf20
d5a4e1d6b330953d950c88ad3b4862d8c1b7caf9 02-Nov-2016 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP Logging"
am: 1826359356

Change-Id: I3416940523563faaefe112564fb01344f0f579af
18ef7045b04916a7b29b50371de6b1b3efb0cbe9 06-Oct-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
bapclient/BluetoothPbapRequestPullPhoneBook.java
bapclient/CallLogPullRequest.java
bapclient/PhonebookPullRequest.java
e4c14b7af0360e86e6057662324a06d7f9f609c3 02-Nov-2016 Ajay Panicker <apanicke@google.com> Merge "Protect against adding a null config for the BT health profile" am: f8727080ea am: 868c01a6ba am: 5d09395a63
am: aa1e49fc9d

Change-Id: I53c58fba39966fe0c5580c947e8a05ca347c38a3
8811955e1d1f2f05a0b1061ac87e8a20d9a55d18 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "MAP MCE" am: db95af257e am: 577700754e am: ad6c649a1a
am: aea3aa12dd

Change-Id: I903844453d5289dec23f94a9d9b4fea233835f07
aa1e49fc9d82b4a71c9d421007f7724d2cc127ae 02-Nov-2016 Ajay Panicker <apanicke@google.com> Merge "Protect against adding a null config for the BT health profile" am: f8727080ea am: 868c01a6ba
am: 5d09395a63

Change-Id: I57cd03674d71cf16e0382ed7f35be9e6e9c7c2ed
5d09395a632d3dd3579bebc821f48a541a45a236 02-Nov-2016 Ajay Panicker <apanicke@google.com> Merge "Protect against adding a null config for the BT health profile" am: f8727080ea
am: 868c01a6ba

Change-Id: Id317a63729be7bebcdda167fe3d4f417252ed9e6
aea3aa12ddf8d247dce29536fc5e3cb6b9a99e40 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "MAP MCE" am: db95af257e am: 577700754e
am: ad6c649a1a

Change-Id: I8df7b50fe04c707824f396f6e07f296ce97f1961
868c01a6baa7a6a6703dc16695a53cfa2a5e914a 02-Nov-2016 Ajay Panicker <apanicke@google.com> Merge "Protect against adding a null config for the BT health profile"
am: f8727080ea

Change-Id: I96dc9eb3b033518474700ef05942d1e8a18d645b
f8727080ea27c6669095a0c942165508a05dfb80 02-Nov-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Protect against adding a null config for the BT health profile"
ad6c649a1a2d728337f8e7012e7b409e533500c7 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "MAP MCE" am: db95af257e
am: 577700754e

Change-Id: Ibe8375c60af53335f2c32fe6960bb0b9ba29c3bb
577700754e7bda8dda5bc15c56df395f1f882d8a 02-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "MAP MCE"
am: db95af257e

Change-Id: Ib8635558016c225d8b00b6ed83464d01ba839cf8
b68b83c0463161ce65922ec606f12244446efab1 19-Aug-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
bexServerSockets.java
tservice/AdapterService.java
tservice/Config.java
apclient/MapClientService.java
apclient/MasClient.java
apclient/MceStateMachine.java
apclient/MnsObexServer.java
apclient/MnsService.java
apclient/obex/Bmessage.java
apclient/obex/BmessageBuilder.java
apclient/obex/BmessageParser.java
apclient/obex/BmsgTokenizer.java
apclient/obex/EventReport.java
apclient/obex/FolderListing.java
apclient/obex/Message.java
apclient/obex/MessagesFilter.java
apclient/obex/MessagesListing.java
apclient/obex/ObexAppParameters.java
apclient/obex/ObexTime.java
apclient/obex/Request.java
apclient/obex/RequestGetFolderListing.java
apclient/obex/RequestGetMessage.java
apclient/obex/RequestGetMessagesListing.java
apclient/obex/RequestPushMessage.java
apclient/obex/RequestSetNotificationRegistration.java
apclient/obex/RequestSetPath.java
abc538d128b495c2c05ba0a69f7c502354a06d40 01-Nov-2016 Ajay Panicker <apanicke@google.com> Protect against adding a null config for the BT health profile

Bug: 25340134
Test: Manual and UnitTest
Change-Id: I595a61050c88787d79db2527aa4387966680e166
dp/HealthService.java
094664ac823f9e00ae0ad7d0d1bf24fce25ff4bb 02-Nov-2016 Bryce Lee <brycelee@google.com> Merge "Implement new API for retrieving supported Bluetooth profiles."
am: fe33cb11e0

Change-Id: I2e50ad4fb53ac80e49e4ee72197beea3251e2216
fe33cb11e0dd1239a7503e069d1c1a099fa5e1b9 02-Nov-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Implement new API for retrieving supported Bluetooth profiles."
52fe544610fc30974fec62c5d79aad632c90d4fe 01-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Move start advertise method to advertising interface (1/3)" am: 108f20709b am: ec6d280be0 am: cb1300acc1
am: ad34482594

Change-Id: I0c8993eab1c8e7f41199120d973f05a864b9397f
ad344825946e8dea33c1c79a9472751f2741e51e 01-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Move start advertise method to advertising interface (1/3)" am: 108f20709b am: ec6d280be0
am: cb1300acc1

Change-Id: I2ead6cc74cdc7847a29a2ab18ebde28483f9a372
cb1300acc1126393f2ba8e816b541566a4ca5f9d 01-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Move start advertise method to advertising interface (1/3)" am: 108f20709b
am: ec6d280be0

Change-Id: Ia3d9d38ecac7f7868a7f36b464a7ab31841b7fd6
ec6d280be0abd084df14ee4c711bbba2aab47b7d 01-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Move start advertise method to advertising interface (1/3)"
am: 108f20709b

Change-Id: I9cfd2d12f5064ab5764db4c7cf600f22cb349a5a
108f20709b11dbdbaf0adcd47d2e123423dcce1c 01-Nov-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Move start advertise method to advertising interface (1/3)"
4ded021f96d858848e68b0a901848211694bbe92 01-Nov-2016 Chris Manton <cmanton@google.com> 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
att/AdvertiseManager.java
013408c9c16e4c1b5b7f285d68bb2f36bca4f654 09-Oct-2016 Bryce Lee <brycelee@google.com> Implement new API for retrieving supported Bluetooth profiles.

Bug: 26451648
Change-Id: I552882034e0289b643377d14bac4fb01c9018046
(cherry picked from commit b7e2f972a0633b4d8c8843d025819d61e71053e7)
tservice/AdapterService.java
tservice/Config.java
55e02560b3399399052d465525eef98fbb1a5fee 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Fix connection state broadcasts" am: be63faf318 am: 45b8871b4e am: ec6a16ba8d
am: 9e5fdf9598

Change-Id: I05ce6b132936bc28d89fd9d2602f79ec7ac32dec
fe9a889d171cda7f66b4d1f5a1e777884246ff2e 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Return bool in AVRCP Controller API" am: 9dc8695a42 am: 10615a1e31 am: 4b1b1e6262
am: 836b6115ea

Change-Id: I85056c7d1775a593e3361084e755cf696c3ecf32
f9fa4736b4032fdd206a5102d54e75f66787d6d0 01-Nov-2016 Christine Hallstrom <hallstrom@google.com> Disable HFP audio path when HFP call goes on hold/resume when goes off hold am: 3ee63fdfb7 am: a76d5985c4
am: 2f712df63a

Change-Id: I87c54a3e38f0276ac7eecfb00574f788b18fc9dd
9e5fdf95986053306d07f644b9095d42c3cd90eb 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Fix connection state broadcasts" am: be63faf318 am: 45b8871b4e
am: ec6a16ba8d

Change-Id: I2a76816796c3767aa46002352372501d4268eec8
836b6115eafbacb53e8adb062750e01544bcbf1b 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Return bool in AVRCP Controller API" am: 9dc8695a42 am: 10615a1e31
am: 4b1b1e6262

Change-Id: I53aa1758f78c57925dd7bbe9705d46b6053d88dc
ec6a16ba8d71f44913041c01c5f64162169984b0 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Fix connection state broadcasts" am: be63faf318
am: 45b8871b4e

Change-Id: I6094c6e9e6774cbd342cc97bfc36969acbe16821
2f712df63a7861d0bca1e1fbac5411d0db05e2dd 01-Nov-2016 Christine Hallstrom <hallstrom@google.com> Disable HFP audio path when HFP call goes on hold/resume when goes off hold am: 3ee63fdfb7
am: a76d5985c4

Change-Id: Id074b069efa559420bf6f6bf0e1601e9605da2be
4b1b1e6262597330b110c349528c8e05e1c9c6d1 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Return bool in AVRCP Controller API" am: 9dc8695a42
am: 10615a1e31

Change-Id: Ifac5edcb1847bcbe0f8b5035e09a7286d3874e04
45b8871b4ecfd74f945c8ae38ac9699a5721ff70 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Fix connection state broadcasts"
am: be63faf318

Change-Id: I6d8a1b8771a7f20eaba6fc17092522fbdba7a87b
10615a1e3145c3e40aec56608e1c8af032f2a2df 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Return bool in AVRCP Controller API"
am: 9dc8695a42

Change-Id: I7eb500eb40baf8cefdb56c208be28021852c4ccc
1aa7d25cdc80a4653d5e9465f58008398ac03d96 04-Oct-2016 Sanket Agarwal <sanketa@google.com> 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)
2dpsink/A2dpSinkStateMachine.java
fpclient/HeadsetClientStateMachine.java
4aad8ce02068598e90dd2cdcb8165dba9d152e22 31-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> 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
att/AdvertiseManager.java
att/GattService.java
33d1e341bf1556f111881004f23c8cda7189e159 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "AVRCP CT: Add getPlayStatus API" am: 5ad0b29afa am: 7a6d3525a8 am: 5cb9b65147
am: 0b0f123d7c

Change-Id: Icde202ae45e2a0ec649d1eba2404050381dc92ae
5cb9b651479479066e1ea91cd899412c01cf2d69 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "AVRCP CT: Add getPlayStatus API" am: 5ad0b29afa
am: 7a6d3525a8

Change-Id: I269c73f71081870f08859a8d2a2313f0c27f498c
7a6d3525a85992bf3bfa0039061716271f451e34 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "AVRCP CT: Add getPlayStatus API"
am: 5ad0b29afa

Change-Id: I7f1d643f55e8a37e98977de8772eef2c522b1a18
2610dbb678b0bfb44f4dbef3bf1491a86c670e72 29-Sep-2016 Sanket Agarwal <sanketa@google.com> 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)
2dpsink/mbs/A2dpMediaBrowserService.java
vrcpcontroller/AvrcpControllerService.java
ea14e69d8b1c7293869c0e4ae9180f36149a95b7 22-Sep-2016 Sanket Agarwal <sanketa@google.com> 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)
2dpsink/mbs/A2dpMediaBrowserService.java
vrcpcontroller/AvrcpControllerService.java
vrcpcontroller/AvrcpControllerStateMachine.java
3094e297ff2f74b54a5d424086f8a00be5214480 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Fixes for HFP & AVRCP am: 92926b8d8f am: 383bbcb844 am: ab7c4851a9
am: 3de0cb6ba0

Change-Id: I10b15ba30da4a1b47518b082ce686d5a5b243c8a
cf7f65c158b5c124a876407033b135793730a5a8 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Support Rewind and FF transport controls am: 827955c0a5 am: 5f29f638d7 am: 66b081047e
am: 412279553c

Change-Id: I567c16d288b363d1a16e09a6db6ecefccad88cb1
0f9bba2be46d87eac20db7068b437bcfe1a50283 01-Nov-2016 AnubhavGupta <anubhavg@codeaurora.org> AVRCP CT: Add support to send stop command am: 8955f548d6 am: a7b76a47f1 am: 7fbd374a67
am: 1fa7408b2f

Change-Id: I10f61b0da7de1d59035ed68c376eff3f35520cfb
ab7c4851a9ee15dd3cb517078c6807a432d64150 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Fixes for HFP & AVRCP am: 92926b8d8f
am: 383bbcb844

Change-Id: I7dd4de8c4a04cbc05815296d58c06f9fe3f81984
66b081047e8d4ed56eaffd592fd287e109df2be5 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Support Rewind and FF transport controls am: 827955c0a5
am: 5f29f638d7

Change-Id: I0868a8b2960d1733065200e91b73ac25fe458919
7fbd374a67808ace2ec208099df3eb8b7587e244 01-Nov-2016 AnubhavGupta <anubhavg@codeaurora.org> AVRCP CT: Add support to send stop command am: 8955f548d6
am: a7b76a47f1

Change-Id: I901f977e9ef3aae5c83d29c790fa3b8e81c4163d
383bbcb844bc6d994a9b73c1d131213110a6a588 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Fixes for HFP & AVRCP
am: 92926b8d8f

Change-Id: I65723818220c8ba4f27708f001e38d1cb8de4855
5f29f638d7becb37f1fe01ea32422d19e07c7589 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Support Rewind and FF transport controls
am: 827955c0a5

Change-Id: If55017dafbc03cb25528eadb4209b875fea5f8cf
a7b76a47f1e8646512f2ec1b582c14f7b1b78be6 01-Nov-2016 AnubhavGupta <anubhavg@codeaurora.org> AVRCP CT: Add support to send stop command
am: 8955f548d6

Change-Id: I1471ca86ce3f04d517a2594738bb57b71d1af72c
57502f92c164cdfc666890dfbed3523b9c7cd0ca 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Implement set addressed player functionality." am: ec761e2ee4 am: 6c18a401c5 am: 12259d157e
am: 4388579472

Change-Id: I9ca371a3e486460b037325964b0c039023fb0916
12259d157e5a930c4543ca1624744ce9f61c9739 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Implement set addressed player functionality." am: ec761e2ee4
am: 6c18a401c5

Change-Id: I1717bbcd8d67aba8064acb0c332f1f9d8b2ef13b
6c18a401c568f6c31f6ae84c05d34f5fc707adf2 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Implement set addressed player functionality."
am: ec761e2ee4

Change-Id: I521e25cc02f3574b1c1a8fccb7b90529dd443bd1
92926b8d8f6c2c1bd97868919204f5447603ea38 22-Sep-2016 Sanket Agarwal <sanketa@google.com> 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)
2dpsink/mbs/A2dpMediaBrowserService.java
fpclient/HeadsetClientStateMachine.java
827955c0a52a19c9ce15d34b10bc3bc8203690f6 21-Sep-2016 Sanket Agarwal <sanketa@google.com> Support Rewind and FF transport controls

- Mainly to support PTS use cases

Change-Id: If595d89f783c6bee4249fe5fc995ef2997eb2b0a
(cherry picked from commit bd2b6578e1b047aedcee6f8f3628ca793e482f3c)
2dpsink/mbs/A2dpMediaBrowserService.java
8955f548d6b4fe8dd7cb1b59280ba7f073b46d88 09-Sep-2016 AnubhavGupta <anubhavg@codeaurora.org> AVRCP CT: Add support to send stop command

Change-Id: I586b6c0657100a3d1c6fd59eaa2411cc31ca0297
(cherry picked from commit 8a0b4621c3c4c005447529970bb6f3db58bf7c3a)
2dpsink/mbs/A2dpMediaBrowserService.java
a7c3906cd449598a2960f9574a79edbadb96f034 16-Sep-2016 Sanket Agarwal <sanketa@google.com> Implement set addressed player functionality.

Bug: b/31554234

Change-Id: Ibe1170bae58e3a3d68dc942b998ca2deee3b27f8
(cherry picked from commit f178c8072f4478a8773fcda5759d825f0b41efd2)
vrcpcontroller/AvrcpControllerService.java
vrcpcontroller/AvrcpControllerStateMachine.java
vrcpcontroller/BrowseTree.java
242cfb36b3c56b1a3b5fb192e1990ea58e13bfbd 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Implement non-blocking pagination for a long song list." am: 2e9d0c75a5 am: 248663d57d am: a10220a9cb
am: 2523236785

Change-Id: If25e97b55205fc040cc1b6d85094db607c2a5c5f
a10220a9cb69f74944d92b3ba7d83bf0b720035e 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Implement non-blocking pagination for a long song list." am: 2e9d0c75a5
am: 248663d57d

Change-Id: Ia6491ecba91599220c42d2a6a58a965e47f632a4
248663d57d54b04df37d6c010e7ea4f4834a0b6e 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Merge "Implement non-blocking pagination for a long song list."
am: 2e9d0c75a5

Change-Id: Ib7f8c48517b6001363cbf87d3851b964129a76bc
a42566d2001ad48046d3eb5743e1d90209acf91b 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Remove hashcode() override for Connection am: 6b7afaa650 am: 09301508f4 am: f0927455a9
am: 9152694d67

Change-Id: I57aed3878de6523c9c7bae9039588fc5d21d71d8
652eeb25d5ff05ff22de1edc186d6c2fe7f36842 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Handle the case of disconnecting -> active for PTS am: b88c0d7495 am: 52b2f37f2e am: 1f5ff49071
am: f42414976d

Change-Id: Ica75310228ce55f8b1e4583bd2ee85d054cc79a7
708dbf877120974e9f98bcff8fa8c86a473c603d 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Cleanup state while transitioning to disconnected. am: 4132738814 am: 7cdcca2d7a am: 3f0e495e43
am: d348a055cf

Change-Id: I9bb05f4485ca67f272b9c2b0870a6834fa343f92
f0927455a94dbebc6b8b5925b0b5309ce47611d6 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Remove hashcode() override for Connection am: 6b7afaa650
am: 09301508f4

Change-Id: Icbf51fce69233e33151d4790ae56eea94beb6ad7
1f5ff490719eb9487d2a0599e768f2b9b98f6a83 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Handle the case of disconnecting -> active for PTS am: b88c0d7495
am: 52b2f37f2e

Change-Id: I027254796e977dfc0360129047f5f7e08e5ed7ac
3f0e495e4313168543bd22c8f2068fb74edb3c5c 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Cleanup state while transitioning to disconnected. am: 4132738814
am: 7cdcca2d7a

Change-Id: I2c87365b95f61857f8a57740e9fd55667f383c22
09301508f4ebac529cce4fb76746d98e77844d72 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Remove hashcode() override for Connection
am: 6b7afaa650

Change-Id: Idff494034926074f4d569f55433ddf836a5552d6
52b2f37f2ec3f4cae224fb7e0cdcb404d5a9924c 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Handle the case of disconnecting -> active for PTS
am: b88c0d7495

Change-Id: Ied286050a3b8025a407a7bdedb688b7c4ec29cb5
7cdcca2d7a639c263e99f0a5972cf37965984671 01-Nov-2016 Sanket Agarwal <sanketa@google.com> Cleanup state while transitioning to disconnected.
am: 4132738814

Change-Id: If3c6fb2a03f7383853610e0fcd18991365e54c82
8e509db28e65be858598365b3ad25d08532a32f9 26-Aug-2016 Sanket Agarwal <sanketa@google.com> Implement non-blocking pagination for a long song list.

Bug: b/31253501

Change-Id: I39f7ba180a33729301618db8191821ad2745917f
2dpsink/mbs/A2dpMediaBrowserService.java
vrcpcontroller/AvrcpControllerService.java
vrcpcontroller/AvrcpControllerStateMachine.java
vrcpcontroller/BrowseTree.java
c00ea05da87571946299e241996654d59765d6fc 01-Nov-2016 Sanket Agarwal <sanketa@google.com> 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.
b591388d33256915f8ba246ae3acfd798dcf16cd 31-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Make Bluetooth SQL query strict to prevent injection" am: 1b1bd218e6
am: 7dacffe598

Change-Id: I5c683cd4082ecf176d92e04fdc1b1da8264a4817
7dacffe5988fbad84aae40e8f8842eef59bb6a21 31-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Make Bluetooth SQL query strict to prevent injection"
am: 1b1bd218e6

Change-Id: I6d4c993987c673592d35349601d4805c5a0c90f1
1b1bd218e64873fce9ca632b449655c19a4562af 31-Oct-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Make Bluetooth SQL query strict to prevent injection"
7ee01948fa06e356d0da7cce88aae90f57d85a87 31-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Implement autoconnect for PAN." am: 63552e3412 am: d66ddc133a am: 3e0feaa6a3
am: beb0031397

Change-Id: Ie9615319e591a4db22e5c1308d7848737045a027
3e0feaa6a3377cb1cd9a5010f97fd2485f4474b7 31-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Implement autoconnect for PAN." am: 63552e3412
am: d66ddc133a

Change-Id: I957739007480bad7eda13c5c9b73c1ba5f1f6f00
d66ddc133abb68e91e4b7b1e62e53ec5ca0a57ca 31-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Implement autoconnect for PAN."
am: 63552e3412

Change-Id: I3c324a21a5d4f4f173084825d0e58a5da046195e
6b7afaa650ff89cc8f6a6580760307dc2657df92 08-Sep-2016 Sanket Agarwal <sanketa@google.com> 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
fpclient/connserv/HfpClientConnection.java
b88c0d7495471f3986844e8c8b2aca7f7f2f4c8e 29-Aug-2016 Sanket Agarwal <sanketa@google.com> 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
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientConnectionService.java
413273881431c8e88e81e6f4e8e969938d6d29e0 26-Aug-2016 Sanket Agarwal <sanketa@google.com> 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
fpclient/HeadsetClientStateMachine.java
41922a948e47d8f7752211e8ded6dcd0280f23f3 05-Aug-2016 Sanket Agarwal <sanketa@google.com> Implement autoconnect for PAN.

Bug: b/30679978
Change-Id: I52c9ac49ec72a419e5f02c656abc46f2c7e4c7cc
(cherry picked from commit 599c56d2b8f09ee126b734b9c62727d255f3e8b3)
tservice/AdapterService.java
an/PanService.java
bapclient/PbapClientService.java
bde9072307960ac90f44bfdc9dc80ee84f00bf18 23-Sep-2016 Ajay Panicker <apanicke@google.com> Make Bluetooth SQL query strict to prevent injection

Bug: 20531462
Change-Id: I8a90c81b727415fa566547f66bf0f64872850189
(cherry picked from commit 760fe9462f8fd177a7c626742fa81486ef1ab770)
pp/BluetoothOppProvider.java
760fe9462f8fd177a7c626742fa81486ef1ab770 23-Sep-2016 Ajay Panicker <apanicke@google.com> Make Bluetooth SQL query strict to prevent injection

Bug: 20531462
Change-Id: I8a90c81b727415fa566547f66bf0f64872850189
pp/BluetoothOppProvider.java
656e9afbf0e6ea26897742fd75c4937fedecfc7e 29-Oct-2016 Victor Chan <victorchan@google.com> Set session to active for A2dpMediaBrowserService. am: 887b468292 am: 945f1506d6 am: 65f8d89e12
am: 7a086467ce

Change-Id: Ia8b82ff84d46e304d462d1e847214c0ee2550b82
681804283974f4b4ea8a06a571b9aefdfe789a6f 29-Oct-2016 Joseph Pirozzo <pirozzoj@google.com> handlePassthroughRsp parameter update am: 4d59223bd4 am: 60d5b131ba am: 707cd5d7ef
am: dcb58e3aca

Change-Id: I1b46cbbd88c0f7c0e535dc951a76f37e6f7c84a2
65f8d89e1284a72845a568b5638842a89f9337b8 29-Oct-2016 Victor Chan <victorchan@google.com> Set session to active for A2dpMediaBrowserService. am: 887b468292
am: 945f1506d6

Change-Id: I89e0d63ea837072d01bdedcc3608973a4d671ca4
707cd5d7ef3e5ae7df246e5bccdfd2691991c394 29-Oct-2016 Joseph Pirozzo <pirozzoj@google.com> handlePassthroughRsp parameter update am: 4d59223bd4
am: 60d5b131ba

Change-Id: I2885571fdde995e3f8b6bbe8c210e14da2bef3e1
945f1506d634b9b064c0dd9e3233016276cc751c 29-Oct-2016 Victor Chan <victorchan@google.com> Set session to active for A2dpMediaBrowserService.
am: 887b468292

Change-Id: I7b3456e157fb0ad9a485687390f4011154e5a9df
60d5b131baf55ae762dcd27ddd0318643348ff9f 29-Oct-2016 Joseph Pirozzo <pirozzoj@google.com> handlePassthroughRsp parameter update
am: 4d59223bd4

Change-Id: Iad003e602be0b1e0ed1785ee9b8a5f3fe88d4d7d
2b42a4906be952d3761d8b47134fba5a277a7765 29-Oct-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge changes I2e454747,I780186f5

* changes:
Set session to active for A2dpMediaBrowserService.
handlePassthroughRsp parameter update
a7b8ff8d1eb13325a57df87509819e5a5ba2d7f2 29-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Prevent bonded device from being removed from the property map"
am: 24f283e25f

Change-Id: If300ffa03ef3598a789c9139be24c6aba9659693
c2e323fb6c2a9499751736c06661ceb372bde67b 22-Oct-2016 Ajay Panicker <apanicke@google.com> Prevent bonded device from being removed from the property map

Bug: 31947953
Test: Manual
Change-Id: Ia2d25b305c07949a9251af83e855db4511ff887f
(cherry picked from commit c4b1ccb46884a0e23e5411f2bbb2da72fcb267ca)
tservice/RemoteDevices.java
350d235bb2ea295d21dea6b935e446827a20eba0 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Improve connection handling logic in ConnService am: 2a32ce9915 am: cbcfc80014 am: 75805c1776
am: b08daa60d9

Change-Id: I611de9172cf2eb13da8859513c164b8a7d05064a
42efd1fb6cff82730d227ddd4353198df5847764 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Let audio HAL know when BT is turned off" am: cfd98a3959
am: 371374f26b

Change-Id: I576f834b784f7d45b2bebc0a9d0a8fc642474fdd
bafcd881332329c37034e188caef1c60d5b6f19f 28-Oct-2016 Joseph Pirozzo <pirozzoj@google.com> PBAP over L2CAP am: b2c3dc9562
am: a93f49fbdd

Change-Id: Ib9b7b9a66330c1ef697e1d48a36fe75040694f0f
243796884fd490da09523e7aa7af50e9130b4a4b 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Unset the priorities for car profiles on unpair. am: cdc84a399a
am: 926cb6d179

Change-Id: I2443419b1fe1187e87f5110c16baac749479f8a3
34f9dc8954e9f14ff60f20e451dcf3acc41f4470 28-Oct-2016 Sanket Agarwal <sanketa@google.com> HFP should timeout in Java services if Native never replied am: 525bb0caa0
am: eba3bd322b

Change-Id: Idc4c3763f9b627f4807e016216aee2e05140eedc
ed5e8c93e26468401a3f3c431602566d7837be2b 28-Oct-2016 Sanket Agarwal <sanketa@google.com> HF should wait for AG to change conference am: 1ec9ba7d55
am: 3ca51430ac

Change-Id: I60a146aae2caff6784e84aa036cd0cf4e1b3da41
48dd7359e10673485405b2b49b16dd67cebcd749 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Conference calling via HFP am: edb38dfa0a
am: c22c1370b2

Change-Id: I0d0579120cd979bdb72b339e641e0b539cc7e324
75805c1776693b52d35cfe6d475c61bde1b44dd6 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Improve connection handling logic in ConnService am: 2a32ce9915
am: cbcfc80014

Change-Id: Ic08adb7d1c663762ff3698071d64b1ce874a3d06
371374f26b1527d1efdbc82929b0286da61a66b5 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Let audio HAL know when BT is turned off"
am: cfd98a3959

Change-Id: Ia3c9f7592d25b6426ee5260d90abe98badeea838
a93f49fbdd78ac55fa0681f4043c086b87e1346f 28-Oct-2016 Joseph Pirozzo <pirozzoj@google.com> PBAP over L2CAP
am: b2c3dc9562

Change-Id: I1731e397c57289b0894d54f69c54765ce30782c5
926cb6d179292a5423600455300c4623f274b18e 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Unset the priorities for car profiles on unpair.
am: cdc84a399a

Change-Id: If11d1ee390146ac9d88a9e766a82a9086145361b
eba3bd322b81a6b8aff9df8af724d6ad93d209d9 28-Oct-2016 Sanket Agarwal <sanketa@google.com> HFP should timeout in Java services if Native never replied
am: 525bb0caa0

Change-Id: I6e9deec5b80689ac1916900eb5ed9834848edecd
3ca51430ac3e3d740559a9e700996d3dade43e2d 28-Oct-2016 Sanket Agarwal <sanketa@google.com> HF should wait for AG to change conference
am: 1ec9ba7d55

Change-Id: Ia1f3bec0f045b53617632ecc026c0d3c135e36ad
c22c1370b2f3e63eaa9a702df8440186d23abcb0 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Conference calling via HFP
am: edb38dfa0a

Change-Id: I66987c64796a88b861fd81c8f9729216a3419d91
cbcfc80014b0a8f4343b8d9b25091080df79e01a 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Improve connection handling logic in ConnService
am: 2a32ce9915

Change-Id: I042b3a58fe83a76252096ba1db18a69a4a1c2f54
887b46829235828923e4952db84fb8250c35dcc4 26-Mar-2016 Victor Chan <victorchan@google.com> 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)
2dpsink/mbs/A2dpMediaBrowserService.java
4d59223bd4d3b8a0bea746dd41ac1a4babf5478a 25-Oct-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
vrcpcontroller/AvrcpControllerService.java
0127919805131d25a3470522ec28ca67f37b7adf 21-Oct-2015 Satish Kodishala <skodisha@codeaurora.org> 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)
fpclient/HeadsetClientStateMachine.java
d4be1bd1fd36f9f0c8f412484217a923d854351f 28-Oct-2016 Sanket Agarwal <sanketa@google.com> 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
c443d0f5950978dd53a423642ad49171e7b00b99 28-Oct-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Limit number of stored device properties"
8121b104427d7aaa8e2a0df2566188ddf23ef662 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Redesign HFP Client call handling" am: a5008e1a9b
am: 4849e4460d

Change-Id: If8388ca39adc6b2b6fee2b0f4a5039366e89dedb
4849e4460d4983baaa0f80ece271fa24aa46d5d5 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Redesign HFP Client call handling"
am: a5008e1a9b

Change-Id: Ibe73e9f82e00d10fd9693d68d318b292bdba94f4
b2c3dc95628314b060cef05d59ce2fe4ef747b84 26-Aug-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
bapclient/BluetoothPbapObexAuthenticator.java
bapclient/BluetoothPbapRequest.java
bapclient/BluetoothPbapRequestPullPhoneBook.java
bapclient/ObexAppParameters.java
bapclient/PbapClientConnectionHandler.java
bapclient/PbapClientService.java
bapclient/PbapClientStateMachine.java
cdc84a399a2fc8b7a48f28877da7125ae6b50a24 22-Aug-2016 Sanket Agarwal <sanketa@google.com> 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)
2dpsink/A2dpSinkService.java
tservice/BondStateMachine.java
525bb0caa0d8f4a8093890cab4bc058ef909a637 15-Aug-2016 Sanket Agarwal <sanketa@google.com> 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)
fpclient/HeadsetClientStateMachine.java
1ec9ba7d555fc54f5b60aeb06fb38cab26f302a0 06-Jul-2016 Sanket Agarwal <sanketa@google.com> 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)
fpclient/connserv/HfpClientConference.java
fpclient/connserv/HfpClientConnectionService.java
edb38dfa0ab86e2e747a6d5799138c8445013789 30-Jun-2016 Sanket Agarwal <sanketa@google.com> 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)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientConnectionService.java
2a32ce991573191acde4d5d2f875658ada301874 29-Jun-2016 Sanket Agarwal <sanketa@google.com> 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)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientConnectionService.java
465bb42f5bcb1147e8bab5ae10cbc871baeae14e 22-Sep-2016 Andre Eisenbach <eisenbach@google.com> Limit number of stored device properties

Bug: 31651689
Change-Id: I6e31b4f89d6ebf9e6a0c6df5ea4e1a7be61a125a
(cherry picked from commit e8d2b5c0f591311c90e428d88b94cd89b88ed342)
tservice/RemoteDevices.java
ca6e7c65b87c52f5e81b273d7ad979a81b52f991 28-Jun-2016 Sanket Agarwal <sanketa@google.com> 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)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/ConnectionKey.java
fpclient/connserv/HfpClientConference.java
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientConnectionService.java
3ee63fdfb7fa5896bff7e172be60c763919c9f63 27-Oct-2016 Christine Hallstrom <hallstrom@google.com> Disable HFP audio path when HFP call goes on hold/resume when goes off hold

This fixes the issue where a cellular call made to a watch when an
HFP call is in progress causes the cellular audio to go through the
HFP path.

Bug: 32164561
Change-Id: I179ba4e1f1a1e76496f3062cc29bc20014fe5661
fpclient/HeadsetClientStateMachine.java
8b57adfba71cdd6e0f287963460841cf7791fd5d 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Remove calls when device gets disconnected" am: 680396106c
am: e6c65c2966

Change-Id: Ideb94b0a4d1ac6aba2956f4409992fd3d17f569c
e6c65c29667cee7581b01a26097810e5dba24465 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Remove calls when device gets disconnected"
am: 680396106c

Change-Id: I19a0dd745520700895c036aca02b747d86cff401
fe8c324138eccb4812b802a46bf94c52a6ea1d7c 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Normalize the number before inserting into list of calls in connectionservice am: c557430697
am: b0416d1444

Change-Id: I4d4776d1367b20cf1dbe7ba491194ad98b3bd1fd
49c6c4a6272070d2873404fb3db83255e7243669 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Owner Card" am: 0d75b08f2a
am: 7ff044a7d9

Change-Id: I2dc259c7df765979726cb4ee6d75b07175e9b09c
eda7a9850530e3607d2d4f1cacefe363dc6b7b98 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "PBAP Handle IllegalArgumentException" am: b1f66e2a5b
am: 455497b3a0

Change-Id: I025d27e6446d5f36baa69e4ba50c8a01839be51f
5f6e49eb95560886e9ff4413948612d7585eee6e 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Remove contacts at shutdown." am: c87c400b9f
am: 92e5069fb4

Change-Id: Icc8967195068df4bfc4291ff46a37e638dc28011
b0416d1444800592c28fc3fe7cc3fc3425fc814c 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Normalize the number before inserting into list of calls in connectionservice
am: c557430697

Change-Id: Ifb64098dfcb5094090058b69b5a78fd43e5f8173
7ff044a7d90b52e3e1d6091770211b88208c06aa 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Owner Card"
am: 0d75b08f2a

Change-Id: Idc939600af1e7d0426c76a7763cb300e20bec6c6
455497b3a08c5f418de4d477b59b2681b59239ad 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "PBAP Handle IllegalArgumentException"
am: b1f66e2a5b

Change-Id: I70ab4ab2623030c7c92b1a42b1287dd190111936
92e5069fb4b0c07564980a5545854fd6114b206a 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Remove contacts at shutdown."
am: c87c400b9f

Change-Id: I6e27f156629f4c5d4cdb84c1b60aa09a156b50af
44af936f673e7b14dcb994cab349edf7f57645c1 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "PBAP check device on disconnect" am: caad481d6e
am: cb7d4a6b0b

Change-Id: I9af458b0d267c0e4c43a8a07f1411edb577b692c
939044a7da79e96ccceaf5f98adc7892bfdbb011 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Bluetooth Connect Other Profiles" am: f6d6a68b55
am: 0b1142f8e6

Change-Id: I7e0147623025ee3d80485e8610df74f43aeaff07
3557be73466390d07c89b6970fe6be8f8c947dc8 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "PbapClientStateMachine legacyCode removal." am: a7097d64ed
am: 0487e85af2

Change-Id: I932aff091af48509442bad201d91f46836877199
fd29a650e71b622d489f49ebb28108827aa135d9 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "PBAP vcard parser" am: 323dce928b
am: bc6dd05401

Change-Id: I8398184b9c6ca0208be52988f96dcbdf2e60a939
cb7d4a6b0b3e24ae838ecc6a2c8c8b4b11f42768 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "PBAP check device on disconnect"
am: caad481d6e

Change-Id: I482eb1672b0683f5b485d53b02e3bb6d541da6f9
cbaeac78c3139b007c2a3d766c100f2cb973e3e4 21-Jun-2016 Sanket Agarwal <sanketa@google.com> Remove calls when device gets disconnected

Bug: b/29170324
Change-Id: I4e9ae948801f80d8f22fb737812e1ed403077bff
(cherry picked from commit 8b2711a9c8537df86e73a0d01b9c3f737f29c643)
fpclient/connserv/HfpClientConnectionService.java
c5574306972592c1c2b9db5ca67ad49174605c12 20-Jun-2016 Sanket Agarwal <sanketa@google.com> 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)
fpclient/connserv/ConnectionKey.java
70688bcd795de95f2d3e218aa6f2488f329bf3b8 04-Jun-2016 Joseph Pirozzo <pirozzoj@google.com> Owner Card

Start phonebook download at card 1 to skip owner card.

bug: 29127941
Change-Id: I1d85cb4a6a372a707081aee7dd4936c83babf888
(cherry picked from commit 0ac9cfe106b82a1c58d859c1fbb0181a654af9b4)
bapclient/PbapClientConnectionHandler.java
a1122651e6c22208c08f610c00f4edaaa66ae4ac 09-May-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
bapclient/PbapClientStateMachine.java
ac43017192acb95e4fc6f3bac142f463da257864 05-May-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
bapclient/PbapClientConnectionHandler.java
bapclient/PbapClientStateMachine.java
0b1142f8e6187a88e41c5ab465ce13ecded2c468 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Bluetooth Connect Other Profiles"
am: f6d6a68b55

Change-Id: I9fc12f90bb9f7bef1b4d616647060d49a1d8206b
0487e85af2bfe4a0ebe476a68c286fe217ba32e9 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "PbapClientStateMachine legacyCode removal."
am: a7097d64ed

Change-Id: I5f806c418f55b22a6950f75d95ca6b33ca78ba15
bc6dd054014e16ad23e13f9f643c48fedca773b6 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "PBAP vcard parser"
am: 323dce928b

Change-Id: I52a13de5e6081ab1eeda494c14400f95fd66ec18
361e9498e4c02366c56ae579c4b4ff72cce52ea0 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Connect PbapClient Profile" am: 774fe94dc4
am: 0d9746e404

Change-Id: Ibc41927077b2eda434010e5f5ef75a5bb688e781
b6d0cf0b37d7bae8f835690d8cc4585b6e2570a4 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "PBAP Download Contacts in state machine" am: 511c4d82aa
am: 232f791afd

Change-Id: Ie25cd245ec400da5699bec2483b9d483503235e7
07b789e8bb035c834ca977d40034405f081abe56 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "PBAPClient State Machine" am: 8fb6cc9cbe
am: 9de3d56f9f

Change-Id: Id87fd18a5220edea6a2e1344151c47931a9d62d7
d7462e7b2c4cdf4ca16fd7177ab29511ad9215f4 02-May-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
bapclient/PbapClientStateMachine.java
d4ec0c2295e114c385f7d8ac6253fef0e42ae37d 29-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
tservice/AdapterService.java
cc9b268c333198db613bd98656da15f29e325155 28-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> PbapClientStateMachine legacyCode removal.

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

bug: 28249138
Change-Id: I95b362136609a8de033a057578c1b08bd46cced3
(cherry picked from commit 992274c189ae23ce454fa2136c1b164105006004)
bapclient/BluetoothPbapCard.java
bapclient/BluetoothPbapClient.java
bapclient/BluetoothPbapObexAuthenticator.java
bapclient/BluetoothPbapObexSession.java
bapclient/BluetoothPbapRequestPullPhoneBook.java
bapclient/BluetoothPbapRequestPullPhoneBookSize.java
bapclient/BluetoothPbapRequestPullVcardEntry.java
bapclient/BluetoothPbapRequestPullVcardListing.java
bapclient/BluetoothPbapRequestPullVcardListingSize.java
bapclient/BluetoothPbapRequestSetPath.java
bapclient/BluetoothPbapSession.java
bapclient/BluetoothPbapVcardList.java
bapclient/BluetoothPbapVcardListing.java
bapclient/CallLogPullRequest.java
bapclient/ObexAppParameters.java
bapclient/PbapClientConnectionHandler.java
bapclient/PbapHandler.java
bapclient/PbapPCEClient.java
bapclient/PhonebookPullRequest.java
bapclient/utils/BmsgTokenizer.java
bapclient/utils/ObexAppParameters.java
bapclient/utils/ObexTime.java
0d9746e404c2a67e9174b191627b938ee70dd0ae 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Connect PbapClient Profile"
am: 774fe94dc4

Change-Id: I9c400a9b0905cc78e469e1824f8c64b20212143b
232f791afde2ff0b8ba8945289ee902e604c50d5 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "PBAP Download Contacts in state machine"
am: 511c4d82aa

Change-Id: I7da795776a6d429c7e5e6be5e01c5954ee840f6d
9de3d56f9fc4a90806113ce43bc4141b7a4edc6e 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "PBAPClient State Machine"
am: 8fb6cc9cbe

Change-Id: I68b34c47aeb0dc52b6a6f9c1af4b5cad7c7816f0
64dcaf0f21762473fbf8242fd35066533e17ce44 27-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
bapclient/PhonebookPullRequest.java
a3d61e3a5d5a80a3eb1e0db76efe3dd1a1f7d337 26-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
bapclient/PbapClientConnectionHandler.java
bapclient/PbapClientService.java
bapclient/PbapClientStateMachine.java
e950b9d396056707ec5560f6675020974b8bd494 22-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
bapclient/PbapClientConnectionHandler.java
bapclient/PbapClientService.java
bapclient/PbapClientStateMachine.java
e0a3b23b18192f409d90ba08f8c8bd1b0c321160 20-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> 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)
bapclient/PbapClientConnectionHandler.java
bapclient/PbapClientService.java
bapclient/PbapClientStateMachine.java
8fce0efb091738c4d2888cfc239d6a7d1caa3edc 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Tackle changing phone numbers by relying on IDs wherever possible." am: 2a234c6e9f
am: d05706a7ca

Change-Id: I87cc2ec642b41db6886ded1842f6b53fb09129f6
d05706a7ca025c6b0db3ce8932c85b504bbbbdb9 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Tackle changing phone numbers by relying on IDs wherever possible."
am: 2a234c6e9f

Change-Id: If6aa63a1923eee3bfa2ed801d91db636b560acec
d6b566fb2997ff4b9bab359f4ceb636df8001b1f 17-May-2016 Sanket Agarwal <sanketa@google.com> 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)
fpclient/connserv/ConnectionKey.java
fpclient/connserv/HfpClientConnectionService.java
3fbd4c5eb200219ca355ef62577e184c3dfef623 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "A2DP MediaSession active state management and NPE" am: b116845cdd
am: 24f17debbf

Change-Id: Ic8844aea9662bf4ce91524854e452ecd0bb31b28
24f17debbfad7eaef578d27d07458cafb2142c09 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "A2DP MediaSession active state management and NPE"
am: b116845cdd

Change-Id: I645f11df37ae4b99abbd569f8761ba7cc69289ca
af075aed79dc450c7e9eb5359e80c7c3665568ce 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Race in hfp call termination when local termination faster than HFP update." am: e1c4c4cd25
am: d716e5cb93

Change-Id: I6e24ab3d6e807a2db922ad8f6f6c30b3e35712dc
d716e5cb934d418f525ec88cf9f92881e8b0f708 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Race in hfp call termination when local termination faster than HFP update."
am: e1c4c4cd25

Change-Id: Ide8de881d3b242ec3baf28fd2dcea0dec57ec783
974aa63dcf9fa79be242267d8169bdfa5954b553 22-Apr-2016 Sanket Agarwal <sanketa@google.com> 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)
2dpsink/mbs/A2dpMediaBrowserService.java
fpclient/connserv/HfpClientConnectionService.java
2b48337c2b9a20298bd5cbf363366b16bc4b917c 20-Apr-2016 Sanket Agarwal <sanketa@google.com> 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)
fpclient/connserv/HfpClientConnection.java
93323324dd9d735180626d6fba325fb917f91aa9 28-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Separate LE scanner from GATT client (2/4)" am: c10a46f70f am: c020464494 am: 77da2e5bfe
am: 6584405db9

Change-Id: I2270b8a83a15d3241006e1fb39163be159135685
7092317e9b38929d1a53e0eadedcb4122ab1ef68 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Replace NOT_SUPPORTED string constants with empty strings." am: fe24c5e475
am: f0ee7c09fa

Change-Id: I7ad543ebcf26b6f42d8b5a3dda01d9d5c08bfd5f
f0ee7c09fa3f1ff3ba5da4c31e36dac2d52314d8 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "Replace NOT_SUPPORTED string constants with empty strings."
am: fe24c5e475

Change-Id: Ie296bd441a990cb9f99167c0fe67bd5adeab7a2d
9c509a704a715e47c9b36aefef0deafe8bf8277b 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "A2dpSink sends CONNECTED instead of DISCONNECTED when connection timeout" am: fda02ace5b
am: 8f8bdc8380

Change-Id: If2e4bc96c5cb2afe6ec43b38e68967195e1bb023
8f8bdc838049210e99595b127a063dd579b20cc6 28-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "A2dpSink sends CONNECTED instead of DISCONNECTED when connection timeout"
am: fda02ace5b

Change-Id: I44166c77dec9915f6fe7d94352077ea1d07590bd
77da2e5bfed460cc5cd155b80dd01cfaa7f1fd82 28-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Separate LE scanner from GATT client (2/4)" am: c10a46f70f
am: c020464494

Change-Id: Ibff79f9f94534abbe525937420e0a14f5515d0cf
c020464494d24314a509ce49b424ad6a3e5d8b3e 28-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Separate LE scanner from GATT client (2/4)"
am: c10a46f70f

Change-Id: I4ffaf101f006d66aa33eba5422793af9d11e4184
0c71be918a515b621553586eaa78e0186c866452 18-Apr-2016 Sanket Agarwal <sanketa@google.com> 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)
vrcp/AvrcpControllerClasses.java
vrcp/AvrcpControllerConstants.java
bapclient/PbapClientService.java
820cfec619ae724b7f4fa7490bc19d5a8de10db6 19-Apr-2016 Sanket Agarwal <sanketa@google.com> A2dpSink sends CONNECTED instead of DISCONNECTED when connection
timeout

When a timeout happens for an outgoing A2DP Sink connection we are (most
likely a typo) sending a CONNECTED instead of DISCONNECTED event. This
confuses the UI and shows it as connected instead of disconnected.

Change-Id: I2fc5a9df86781b45e5c5ff9368a7c49c6c910294
(cherry picked from commit 688344c5ed34758c1e96a1dec9212e10107a7263)
2dpsink/A2dpSinkStateMachine.java
f17d469c19b4fc24c185d4022eeb26f4929be5a7 26-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Separate LE scanner from GATT client (2/4)

Right now, LE scanning functionality is combined with the GATT client.
This is the source of various bugs, like scans suddenly stoppinging when
a GATT client is killed. It also increases memory consumption, because
we associate many structures with a GATT client, which are not necessary
when just scanning.

Test: sl4a BleScanApiTest ConcurrentBleScanTest
Bug: 30622771
Change-Id: Ie4a20abe7fa112bf501619651e288ae46d28e209
att/GattService.java
att/ScanClient.java
att/ScanManager.java
43c1e4d74eb117220c6c88675b6ca186a3d3f98b 27-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Define cover art attribute id" am: 33578853ec am: 0875a34a1a am: 1e3ae38ca4
am: 7fb84a979e

Change-Id: Idbc941714219484b32b0ea7f017f61fcb56980f2
1e3ae38ca425fe0f1ab64a696985f0119343d7d5 27-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Define cover art attribute id" am: 33578853ec
am: 0875a34a1a

Change-Id: If9c736f132828f559f7205eab4a3133edd698a59
0875a34a1ae53a4da13a238a2d1616c246b32a93 27-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Define cover art attribute id"
am: 33578853ec

Change-Id: I85dffa80183b72da66e1701d15860e902f9de983
417d1b696e6bcf1e22478b93e79aa5936537483a 14-Oct-2016 Ajay Panicker <apanicke@google.com> Define cover art attribute id

Test: Tested manually
Bug: 32081388
Change-Id: Ib9df511a36d19f1bd5197836ad34b19edba73748
vrcp/AddressedMediaPlayer.java
vrcp/AvrcpConstants.java
vrcp/BrowsedMediaPlayer.java
26e8680e8f61901f3aca5f6eb4c1c8e2405092a5 26-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Add AVRCP unit tests and switch to using mockable interfaces" am: 232bd83d3b am: 69d4506245 am: 2a67cddaaa
am: 98ce1b84e5

Change-Id: Ic94757d1637c710232044b6396bd889d6eb913ee
2a67cddaaacb0a43bce2b85fb263e6773f023844 26-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Add AVRCP unit tests and switch to using mockable interfaces" am: 232bd83d3b
am: 69d4506245

Change-Id: Id5f83572fe235934b4d7d6fe9f53e0cd1389d398
69d4506245ed2d3c12ebee37bbce5e991fef1812 26-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Add AVRCP unit tests and switch to using mockable interfaces"
am: 232bd83d3b

Change-Id: Ie1ab559fcfcc3d152ee6893d29a6a480f6838d80
d996f17ea97b2c592338bcfbc93056d0224da1cd 21-Oct-2016 Ajay Panicker <apanicke@google.com> Add AVRCP unit tests and switch to using mockable interfaces

Add a mockable interface for MediaController in order to add unit
tests for AddressedMediaPlayer.

Bug: 32416674
Test: Tested manually
Change-Id: I081c37915fc15e58f3de37c3a16e03747503860c
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpHelperClasses.java
vrcp/BrowsedMediaPlayer.java
vrcp/mockable/MediaController.java
d4556a51be798c16ec8db2a563fa8929a0516cd5 26-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Change how Advertise Data is passed to BTIF (3/3)" am: fd121217a4 am: dfbb839c60 am: 8e382afdcc
am: 602007cfa7

Change-Id: I9fe021f1d1b1ff68f9693069d291c7c18d70b572
8e382afdcc6e6dc55ea9e9b9affcdd1992546309 26-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Change how Advertise Data is passed to BTIF (3/3)" am: fd121217a4
am: dfbb839c60

Change-Id: I77d5b50e34762fba4e37e5aa44c54d90197d0079
dfbb839c60a56f7dcc6e2095e1a7830fd4a7b7ab 26-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Change how Advertise Data is passed to BTIF (3/3)"
am: fd121217a4

Change-Id: I427d27acf325b4319bd10e0942a3233440b5c0eb
5335419d1b6f366c284037ca38524141f0e80d74 19-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Change how Advertise Data is passed to BTIF (3/3)

The way that AD data is passed right now put some additional
limitations, i.e. only one manufacturer specific data can be set, or
only one service UUID. By moving AD generation to upper layers, aother
set of limitations is removed.

Test: Covered by BleAdvertiseApiTest sl4a test
Bug: 30622771
Change-Id: I5444455a89ee085dcccfdc98846955374d58c374
tservice/AdapterService.java
att/AdvertiseManager.java
70d2cbe759a69eb4b88a50c7f2cd47181b32273a 22-Oct-2016 Ajay Panicker <apanicke@google.com> Prevent bonded device from being removed from the property map am: c4b1ccb468 am: 283c7ead04
am: 6706cb3177

Change-Id: I4229e1a1efe84912f2c31fb419611686a28e4607
6706cb317761768702c5f386ec11685537756d51 22-Oct-2016 Ajay Panicker <apanicke@google.com> Prevent bonded device from being removed from the property map am: c4b1ccb468
am: 283c7ead04

Change-Id: I9cc84cb71bf5ee0d200d4a90a21aceee5fbf9ff4
283c7ead04930b5d54837ba55835aa8c07b9b966 22-Oct-2016 Ajay Panicker <apanicke@google.com> Prevent bonded device from being removed from the property map
am: c4b1ccb468

Change-Id: I9d41d8834a5524c98bcb1e1d1ff2e67deb0a9501
c4b1ccb46884a0e23e5411f2bbb2da72fcb267ca 22-Oct-2016 Ajay Panicker <apanicke@google.com> Prevent bonded device from being removed from the property map

Bug: 31947953
Test: Manual
Change-Id: Ia2d25b305c07949a9251af83e855db4511ff887f
tservice/RemoteDevices.java
1a08d3ab7dd8577a7078efc21c26068792cebab7 21-Oct-2016 Ajay Panicker <apanicke@google.com> Add additional logging for device properties am: 055babc4ab am: 37b54633cc
am: e9374026cd

Change-Id: I02a93fd901ad0faf88bb3ee95fccb7820a603314
e9374026cd90834f1f2ddaed4e5db62a99255ff9 21-Oct-2016 Ajay Panicker <apanicke@google.com> Add additional logging for device properties am: 055babc4ab
am: 37b54633cc

Change-Id: I81a17d92f833981cc0d4280a47ab4063261b1669
37b54633cc402f8ea65b8ee632dbc994d9722a4d 21-Oct-2016 Ajay Panicker <apanicke@google.com> Add additional logging for device properties
am: 055babc4ab

Change-Id: I4bd929045faa9a0c59d639bb56ee5d56dfdfac42
055babc4ab16a11320ffd44e2a1dea97047feb55 20-Oct-2016 Ajay Panicker <apanicke@google.com> Add additional logging for device properties

Bug: 31947953
Test: Manual
Change-Id: I7e23b55c03e7f0382d59efe9a94221ed4bdf57ab
tservice/RemoteDevices.java
e057fa20b643ac4bfca7887feceb5f1e9ce6d07a 18-Oct-2016 Bryce Lee <brycelee@google.com> resolve merge conflicts of b7e2f97 to nyc-mr1-dev-plus-aosp
am: 180855c856

Change-Id: I16a0e676093ee99acb9a0fd69e95705553e1c9b4
180855c85669681141b4821b644fc2d72bc9b3c4 18-Oct-2016 Bryce Lee <brycelee@google.com> resolve merge conflicts of b7e2f97 to nyc-mr1-dev-plus-aosp

Change-Id: I6a7df800b77cfc3431ae54913a1791cd246806cc
996250e6d3c2d54db8c76e6b972235f40ff361c3 18-Oct-2016 Bryce Lee <brycelee@google.com> Merge "Implement new API for retrieving supported Bluetooth profiles." into cw-f-dev
00cd7278bf92208ec69ee81095d027c7039bf7b2 18-Oct-2016 Shuki Hashimoto <shuki.x.hashimoto@sonymobile.com> Merge "OPP: Fix "0%" progress even after file transfer finished" am: 17227a122d am: 089772d449
am: cdf659d655

Change-Id: I5419cfaf042871ba2e2ac469028a655376ae94a6
089772d4493a85be928a70ce32538c2a838fac9d 18-Oct-2016 Shuki Hashimoto <shuki.x.hashimoto@sonymobile.com> Merge "OPP: Fix "0%" progress even after file transfer finished"
am: 17227a122d

Change-Id: Idb8003add2df20febf6d0d4f74fedc816211c6ca
17227a122d0a131ee7242974732029afadaca5e3 18-Oct-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "OPP: Fix "0%" progress even after file transfer finished"
b085c4d30f17af420378469f7db393168c9436b2 17-Oct-2016 Sanket Agarwal <sanketa@google.com> Merge "AVRCP 1.6 CT implementation"
am: c024cec3fc

Change-Id: Ie05ec01d57d855f568f5801e14afdabbf1def4fa
2df89213f063ef9d38f1531253299f80fdb0739d 10-Sep-2016 Sanket Agarwal <sanketa@google.com> AVRCP 1.6 CT implementation

Bug: b/28791287
Change-Id: Ie4cb76b301bb3f36a750658fb86caa0def1eb503
(cherry picked from commit 4b491c2c874395c436949183bcbd84ebb2493131)
2dpsink/A2dpSinkService.java
2dpsink/A2dpSinkStateMachine.java
2dpsink/A2dpSinkStreamingStateMachine.java
2dpsink/mbs/A2dpMediaBrowserService.java
vrcp/AvrcpControllerService.java
vrcpcontroller/AvrcpControllerService.java
vrcpcontroller/AvrcpControllerStateMachine.java
vrcpcontroller/AvrcpPlayer.java
vrcpcontroller/BrowseTree.java
vrcpcontroller/PlayerApplicationSettings.java
vrcpcontroller/RemoteDevice.java
vrcpcontroller/TrackInfo.java
tservice/Config.java
4b7462055ae34b4da7101e675420dab6a2c641bf 29-Sep-2016 Shuki Hashimoto <shuki.x.hashimoto@sonymobile.com> OPP: Fix "0%" progress even after file transfer finished

When the file is small enough to be sent together with header in one
packet, PrivateOutputStream#write() never calls back ClientOperation,
because OBEX Client has no more data to send.
In this case, response code in ClientOperation is not updated from
default value (-1) until the PrivateOutputStream is closed.
It causes progress bar not updated from 0%.

The patch adds PrivateOutputStream#close() call after the first write
operation when file and header are sent in one packet, and ensures
progress bar to be updated properly.

Bug: 31895670
Test: manual

Change-Id: I735a872b756ab1c8892c2f8bbf2dce51ae24fc5a
pp/BluetoothOppObexClientSession.java
2404f96fd16dd7394ba78732710156ad29d01a4a 12-Oct-2016 Andre Eisenbach <eisenbach@google.com> Merge "Fix error where root folder depth was set as 1 instead of 0" am: a4d91e722e am: 122cb07fae am: fbfc2d0f16
am: 2806b12623

Change-Id: Ia2bc1e11968fee11e2bff1fec9d710851bc85fc0
2806b12623c554f80109a5faddffcd23452b1ed1 12-Oct-2016 Andre Eisenbach <eisenbach@google.com> Merge "Fix error where root folder depth was set as 1 instead of 0" am: a4d91e722e am: 122cb07fae
am: fbfc2d0f16

Change-Id: I9487ab2385a44a3da163f1d956d5dc2f88aa5c40
fbfc2d0f161e5d192c2aae505e8b51601b4153ed 12-Oct-2016 Andre Eisenbach <eisenbach@google.com> Merge "Fix error where root folder depth was set as 1 instead of 0" am: a4d91e722e
am: 122cb07fae

Change-Id: I184f48b2317e7e0e778bc0c5ab5fb0cd3aa65eaa
a4d91e722eeea59a37a00cef30e2a54dcbd4063d 12-Oct-2016 Andre Eisenbach <eisenbach@google.com> Merge "Fix error where root folder depth was set as 1 instead of 0"
d5efe736347e232fd2c7f7696038372dff03d725 12-Oct-2016 Andre Eisenbach <eisenbach@google.com> Merge "Reduce AdapterState log spam on isTurning*() functions" am: 96b343175f am: 009e7e74e8 am: c4ff53a4bb
am: 74078dab3a

Change-Id: I1d6aa25a0df9833447d8da5eadbd55fd35352ecf
74078dab3a01bd7ffcf757a453878c4c9be34554 12-Oct-2016 Andre Eisenbach <eisenbach@google.com> Merge "Reduce AdapterState log spam on isTurning*() functions" am: 96b343175f am: 009e7e74e8
am: c4ff53a4bb

Change-Id: I69f4e2610615d68ee40762d2121570f39f8d4f0a
c4ff53a4bb929847e401ebbc52eda1cfb08685b0 12-Oct-2016 Andre Eisenbach <eisenbach@google.com> Merge "Reduce AdapterState log spam on isTurning*() functions" am: 96b343175f
am: 009e7e74e8

Change-Id: Ic60d88ff785717bc0a6a5c109f6c5cad05554eab
5b0dcf64aa76cb7ab8a50b033ef4e9ce23d3f4aa 10-Oct-2016 Andre Eisenbach <eisenbach@google.com> Reduce AdapterState log spam on isTurning*() functions

Bug: 31857542
Test: manual
Change-Id: Ia3658509af727714820a38c9f94398d714813046
tservice/AdapterState.java
33fa358d46e1ffa04b065de75379ae90d9821f75 11-Oct-2016 Ajay Panicker <apanicke@google.com> Fix error where root folder depth was set as 1 instead of 0

Test: Tested by hand
Bug: 32082139
Change-Id: Id46c3dab1e21d166691620cb762d64893ce5d41d
vrcp/BrowsedMediaPlayer.java
a27b9a7f7e9b12878242b96c8902420e9df8efe5 11-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Prevent Null Pointer Exception caused by race condition in AVRCP init" am: e58b7c22b7 am: 2ef090525a am: 9360a5cfd7
am: 5b7f441b6d

Change-Id: Iaad633bd66aa41a735a2887037e642fdff7a07e9
5b7f441b6d792f55f92d812344090b78b4ad1fc0 11-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Prevent Null Pointer Exception caused by race condition in AVRCP init" am: e58b7c22b7 am: 2ef090525a
am: 9360a5cfd7

Change-Id: I2a59964994d95d987aebc4be99b7edda4962f08d
9360a5cfd77de4f7cc5ed8e4bcd093ad438ee86c 11-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Prevent Null Pointer Exception caused by race condition in AVRCP init" am: e58b7c22b7
am: 2ef090525a

Change-Id: I9d505f5ef4585701a9169408226024da0af09e94
4a8273edcbd19725246ef08fa2e5c999ff5339e3 11-Oct-2016 Ajay Panicker <apanicke@google.com> Prevent Null Pointer Exception caused by race condition in AVRCP init

The object |mMPList| could be null if AVRCP started handling messages before
the phone was unlocked. Now we always initialize the Media Player List.

Test: Manual testing
Bug: 32060313
Change-Id: I66cba51159586da8abe51297dba94a3e1dc1b067
vrcp/Avrcp.java
24fd0f48ddfd1dbbe41f908dedadf97acc84d800 11-Oct-2016 Wei Liu <luciferleo@google.com> Add some debug logs to the HeadsetClientService. am: 33acd22084
am: 6b2ff5e648

Change-Id: I55c71d4d991e1f1113831cb173854be790f4f262
6b2ff5e6484d441dd29bcc2101c432ac295feaa9 11-Oct-2016 Wei Liu <luciferleo@google.com> Add some debug logs to the HeadsetClientService.
am: 33acd22084

Change-Id: I4abe7bd9090d18240c0c9c7605d791797eae7ff7
58e622c32afa964d8fb336501821dd90632b26b5 11-Oct-2016 Marie Janssen <jamuraa@google.com> Merge "style: Remove commented-out code" am: 544c68dc6b am: 11eff466ae am: 614d47b29e
am: 346fbe4d8f

Change-Id: I699d9377b4273495f993030a37eed3d7a9593340
346fbe4d8f4190c6104a2a1bc3f01c95bd6923f7 11-Oct-2016 Marie Janssen <jamuraa@google.com> Merge "style: Remove commented-out code" am: 544c68dc6b am: 11eff466ae
am: 614d47b29e

Change-Id: I747d26447fe24abfb5d99e0985c288855dccd3a7
614d47b29e1a8423c50eabbd0a0dbc910092adaf 11-Oct-2016 Marie Janssen <jamuraa@google.com> Merge "style: Remove commented-out code" am: 544c68dc6b
am: 11eff466ae

Change-Id: I965c41c25a578d14bba4dcdbe225e525cf0174f6
33acd2208455171249084dd86ae0ed95db1e4c49 10-Oct-2016 Wei Liu <luciferleo@google.com> Add some debug logs to the HeadsetClientService.

b/31976064

Change-Id: I13602fbe6ef45f039a15d36ea0d1ac3802a9fddd
fpclient/HeadsetClientService.java
91c7bbd92117da7f8fdde343a9a5108a14693387 10-Oct-2016 Marie Janssen <jamuraa@google.com> style: Remove commented-out code

Test: continues to compile
Change-Id: I94f3e869621bcffd1aba678894ac14fc3800184f
ap/BluetoothMapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
b7e2f972a0633b4d8c8843d025819d61e71053e7 09-Oct-2016 Bryce Lee <brycelee@google.com> Implement new API for retrieving supported Bluetooth profiles.

Bug: 26451648
Change-Id: I552882034e0289b643377d14bac4fb01c9018046
tservice/AdapterService.java
tservice/Config.java
686261c34315fea0d91b6c8dfcf2fd6be526aae3 09-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Make AVRCP encryption aware" am: 4ae401b6e9 am: 852cbd4136 am: 509f8213b3
am: 3bb2c69909

Change-Id: I7c8c3de5f97b1bcabec534f1984b0caa1d9518e4
3bb2c6990992c77dc5ab9cbf86a90cbbad199034 09-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Make AVRCP encryption aware" am: 4ae401b6e9 am: 852cbd4136
am: 509f8213b3

Change-Id: I61b4cfd6c110086524e7725c6c291f744348da5b
509f8213b3875071b11ee4ef7c3b1718dd578981 09-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Make AVRCP encryption aware" am: 4ae401b6e9
am: 852cbd4136

Change-Id: I194015beb5bdeee51c5eec2e4acea69711a117b6
0427c02017744a749b99230b5bd080e2d4cfa3e1 08-Oct-2016 Ajay Panicker <apanicke@google.com> Make AVRCP encryption aware

AVRCP can't access the different media players while the user hasn't
unlocked the phone or if Bluetooth is turned on before the phone
has booted all the way.

Bug: 31966072
Change-Id: Id022e2a8068257885ddb06c5be3d4b04c026ac53
vrcp/Avrcp.java
7aaa0464525bcd96ec0a91927e71af12695a05d8 07-Oct-2016 Andre Eisenbach <eisenbach@google.com> Merge "Ensure LE scan clients are removed when the related app dies" am: 310ff21b03
am: c4bc0b68b7

Change-Id: Icb63ec61320992f1488b66b1623486b0d156bf6f
4773c6523d0fbb76de19dbe7eff2e1b23709d2ea 07-Oct-2016 Andre Eisenbach <eisenbach@google.com> Ensure LE scan clients are removed when the related app dies am: 5185d1989c am: e891e19551
am: 015c1a95c0

Change-Id: Icaa2ce4e7ded74f529b823df7a124980bff35570
015c1a95c027951d4a197836848e1a4afa7351d8 07-Oct-2016 Andre Eisenbach <eisenbach@google.com> Ensure LE scan clients are removed when the related app dies am: 5185d1989c
am: e891e19551

Change-Id: I58f8e5273a2afa001c3bc49e6aa93c3b7f004fb8
e891e195514684ca3ab370dcc00b8a5084e1e1c8 07-Oct-2016 Andre Eisenbach <eisenbach@google.com> Ensure LE scan clients are removed when the related app dies
am: 5185d1989c

Change-Id: I1e88954325ae3483442391357579fbf614805e46
212ae6d734ecab7583065ee9136553a6f7c4a236 07-Oct-2016 Andre Eisenbach <eisenbach@google.com> Ensure LE scan clients are removed when the related app dies

Use the passed in ScanClient in handleStopScan() to ensure that the
client appDied flag is in the correct state to ensure proper removal of
the client application reference.

Bug: 30681588
Test: manual
Change-Id: I0e0067a8e21ebd5f89870a7054b1f4092fe63ae1
(cherry picked from commit 5185d1989c93faa3ce4b4410ef49a0205f43b239)
att/ScanManager.java
49d84275edf5bea6b68be60c80074591057c8f53 07-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix connecting to profiles when bonding from local device (2/3)" am: d3b54eaed4 am: bea791fa16 am: 202f0d90fa
am: 955a9d0e62

Change-Id: I6f2236917b4930d7ba20502a25a893976e5350e4
5185d1989c93faa3ce4b4410ef49a0205f43b239 07-Oct-2016 Andre Eisenbach <eisenbach@google.com> Ensure LE scan clients are removed when the related app dies

Use the passed in ScanClient in handleStopScan() to ensure that the
client appDied flag is in the correct state to ensure proper removal of
the client application reference.

Bug: 30681588
Change-Id: I0e0067a8e21ebd5f89870a7054b1f4092fe63ae1
att/ScanManager.java
955a9d0e62242c2fc9d8cc01b0615d05587b4a72 06-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix connecting to profiles when bonding from local device (2/3)" am: d3b54eaed4 am: bea791fa16
am: 202f0d90fa

Change-Id: I9d3b2bffc87d48a67f893bf622b6a9098fce97d1
202f0d90fa4e23c06d8757da31cf3d77d32e6b2c 06-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix connecting to profiles when bonding from local device (2/3)" am: d3b54eaed4
am: bea791fa16

Change-Id: I35ac9f4aa8f4f7d12153f43f946a5f029ca3ca12
66734225c1baa37ef03005ac77780453246f58d8 20-Jul-2016 Jakub Pawlowski <jpawlowski@google.com> Fix connecting to profiles when bonding from local device (2/3)

When bond is created from Bluetooth Settings, profiles gets properly
auto connected when services are discovered. If pairing is done from any
other app, i.e. NFC app, the bond is not being recognized as initiated
from local device, and profiles are not connected.

This patch makes sure that if bonding is initiated, no matter from which
app, it will cause proper profiles to connect.

Bug: 30211618
Change-Id: Icda038447554f429b9cbfc74d68c679e63572bdb
tservice/AdapterService.java
tservice/RemoteDevices.java
270362509705675155faff6843f1515eb8d89c96 05-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Offset browsing media entry UID by one" am: be4507f68a am: 9370f10c05 am: a9777ad326
am: f24f88ae47

Change-Id: Iac1d0bfd4fe14084c59c65bcd8a1eaf40488d96f
f24f88ae47a1dc7cbf180cdd0c303c73f625723d 05-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Offset browsing media entry UID by one" am: be4507f68a am: 9370f10c05
am: a9777ad326

Change-Id: If606e396e84659a99e5cf5712a93892f9c4195d9
a9777ad32642b32533d2b260f3030d54d76cffb3 05-Oct-2016 Ajay Panicker <apanicke@google.com> Merge "Offset browsing media entry UID by one" am: be4507f68a
am: 9370f10c05

Change-Id: I4f0ee710491ca138fb8825014a537bbfd60f7ba9
be4507f68a6569b2a06ec6cd9eb1a31a1e72da9e 05-Oct-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Offset browsing media entry UID by one"
8f44af47bbcb33e2a44b5ed1a3b1a226afe1e7c3 05-Oct-2016 Andre Eisenbach <eisenbach@google.com> Merge "Re-enable browsing support for AVRCP" am: 252a336e4b am: 735c195301 am: 71b6644e65
am: eea1212f8e

Change-Id: I380e341b531c56e4860441d58bb426b4e43bb2b9
eea1212f8e3ae7b73a80c3f91948d4d0fa01e449 05-Oct-2016 Andre Eisenbach <eisenbach@google.com> Merge "Re-enable browsing support for AVRCP" am: 252a336e4b am: 735c195301
am: 71b6644e65

Change-Id: I25fdd0fc25bed0fa6c7efd433b0cce1010e76344
71b6644e65e752bbe3abccf0a167e8845192b60b 05-Oct-2016 Andre Eisenbach <eisenbach@google.com> Merge "Re-enable browsing support for AVRCP" am: 252a336e4b
am: 735c195301

Change-Id: I6f93f90eae56afb82415eef0ac7ca77d2c5880f0
1b70ec148be773651d5ad00e3ce0d28b3a63306d 05-Oct-2016 Ajay Panicker <apanicke@google.com> Re-enable browsing support for AVRCP

Bug: 31941615
Change-Id: Ia6846b3d6133c42863ae3cc630c980bea3e6bf20
vrcp/Avrcp.java
a2d70c884a330dcdac82d34314ddbb815bd84543 05-Oct-2016 Ajay Panicker <apanicke@google.com> Offset browsing media entry UID by one

Offset AVRCP UID by one for browsing since UID 0 is reserved for
getElementAttributes.

Bug: 31962824
Change-Id: I7efcd0546ebb0d02b4b1bfb05038a86d9fa0835f
vrcp/BrowsedMediaPlayer.java
aadff7797afd2602ba2564db4780f88f211ee8d8 29-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Cleanup BluetoothPbapReceiver log messages am: c295ebb2a7 am: 0d527ed0da
am: d232945cfe

Change-Id: I4a79ac2cfce4d0720193d87d2754d4accc86a4f9
d232945cfea830ff7d2acf7b5b035c8912e59fed 29-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Cleanup BluetoothPbapReceiver log messages am: c295ebb2a7
am: 0d527ed0da

Change-Id: Ia2a2a6489a075332d87544bbc28aa97e43e3530d
0d527ed0da7cb0ab1056af2cbab6a1cbf967a03e 29-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Cleanup BluetoothPbapReceiver log messages
am: c295ebb2a7

Change-Id: I08de1ce6fa6b40077a86787455155a0a7f5f0141
354e7ab635291c120306254df257bd2fb9ee1c4a 29-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Cleanup BluetoothPbapReceiver log messages" am: 1e06bd574a
am: 4c424aedfe

Change-Id: Ide2c0d350236bd0d1278efa9d4dec256492fe68e
c295ebb2a781b86550e54639d7488a5b1aa7ab29 29-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Cleanup BluetoothPbapReceiver log messages

Bug: 31442739
Bug: 31457305
Test: manual - checked logcat output for (lack of) excessive logs
Change-Id: I76f32dd950afd0a2949f38bfa6c0d4212b83357c
(cherry picked from commit f36fc254ad196339a59c2ab00b555f4d8f601718)
bap/BluetoothPbapReceiver.java
f36fc254ad196339a59c2ab00b555f4d8f601718 29-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Cleanup BluetoothPbapReceiver log messages

Bug: 31442739
Bug: 31457305
Test: manual - checked logcat output for (lack of) excessive logs
Change-Id: I76f32dd950afd0a2949f38bfa6c0d4212b83357c
bap/BluetoothPbapReceiver.java
57c8dc2f712c3c738cb7a87fc84a4d21b29b03ca 27-Sep-2016 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP over L2CAP"
4719fc68998e703015fbef33b55e4a70b44fbea9 24-Sep-2016 Andre Eisenbach <eisenbach@google.com> Limit number of stored device properties am: e8d2b5c0f5 am: 35ba33f70c
am: 561693138d

Change-Id: I219054aa1eb6a117d04beb74ea9807e3320b215a
561693138df65e7d91f05a24fd7dd4f818345c9c 24-Sep-2016 Andre Eisenbach <eisenbach@google.com> Limit number of stored device properties am: e8d2b5c0f5
am: 35ba33f70c

Change-Id: I50a96810900eff760d752e612878c17ce6367582
35ba33f70c37ed4d9220ebe1caf716b04edd51d7 24-Sep-2016 Andre Eisenbach <eisenbach@google.com> Limit number of stored device properties
am: e8d2b5c0f5

Change-Id: I02e2934b8afc9018ca0036e369a4569f2528f8a9
02760b328051eb23be4bb0ebbcfd01cefb266868 24-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Don't try to stop advertising on death of GATT clients" am: db403d3f6e am: be26effc03 am: 5e7499b6c4
am: 0eb2e09aca

Change-Id: Ie2028f0227d70915b534c3cb127b266f02f14116
0eb2e09acafe171855b4396882a5affa08b3c066 24-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Don't try to stop advertising on death of GATT clients" am: db403d3f6e am: be26effc03
am: 5e7499b6c4

Change-Id: I846b0a00b4e89ed4bb9af528726d36e767dd55f6
5e7499b6c43918cd85ee321cc96ae96cbc9e07ff 24-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Don't try to stop advertising on death of GATT clients" am: db403d3f6e
am: be26effc03

Change-Id: I03b24bb19e931f1db25c8bec3812e93b26108eca
db403d3f6e7b52e76aac62cae3845738123b3455 23-Sep-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Don't try to stop advertising on death of GATT clients"
e478ab8044502f0042cee621caab9189f7932fd5 23-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Enable debug logs for Bluetooth AdapterService" am: c364eb3eb3 am: f2287d1e54 am: a73e67014b
am: 49c9cba159

Change-Id: Ie9bbf08e5273487f35ee0baa8720ceca96abc90a
ea12a27e7f94a17e443eba5af7a56efd2552f04e 23-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Enable debug logs by default in BluetoothPbapReceiver" am: 5810700831 am: 1d0294e19e am: 6c2fb91066
am: b0f170db60

Change-Id: I0d738af7c7bb02922fc125df2fc615fc75a3fa10
d828b42ed91213bd6115b84bc16809f13fc7afe6 19-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Don't try to stop advertising on death of GATT clients

We should no longer stop advertising for GATT clients. Advertisers
are kept in AdvertiseClient, and their death is handled in
AdvertiserDeathRecipient.

Bug: 30622771
Test: Kill app with GATT client registered
Change-Id: I21f246042d1632824ed3d2d8937f13bcafe380ab
att/GattService.java
e8d2b5c0f591311c90e428d88b94cd89b88ed342 22-Sep-2016 Andre Eisenbach <eisenbach@google.com> Limit number of stored device properties

Bug: 31651689
Change-Id: I6e31b4f89d6ebf9e6a0c6df5ea4e1a7be61a125a
tservice/RemoteDevices.java
09de55a27faf9ba392d5ea43f762607eb4139a48 23-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Enable debug logs by default in BluetoothPbapReceiver
am: dda1ef8844

Change-Id: Ic7117c244513f9d47b50596c93d117b251ec755d
779ec089243d8ce51dad28f365379ee61f1314ff 23-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Enable debug logs for Bluetooth AdapterService
am: baf3b9b6c4

Change-Id: I3e7869b4f1c6ccd3ecf501af8737864edefa57ab
6f54bb49508af469c9a4f6cec0e0ba4818988644 23-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Enable debug logs by default in BluetoothPbapReceiver" into nyc-mr1-dev
49c9cba1599dd5809a18fd97822ccdb3ed41624e 23-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Enable debug logs for Bluetooth AdapterService" am: c364eb3eb3 am: f2287d1e54
am: a73e67014b

Change-Id: I4b5d5dbfa3096b439bea38e2568fffc01d2e7bf1
b0f170db6099f1c290724996cf8af68eeafed89c 23-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Enable debug logs by default in BluetoothPbapReceiver" am: 5810700831 am: 1d0294e19e
am: 6c2fb91066

Change-Id: I15d005ba7a54ead5d5fc10e42d62891e8c802c9a
a73e67014b6c0e6277e5de0703793dd8fddc3ac4 23-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Enable debug logs for Bluetooth AdapterService" am: c364eb3eb3
am: f2287d1e54

Change-Id: I7c32bd076d565d83a7aa1a3dcba386c764c5e9b6
6c2fb9106651d93c45836be885b2040fbfd5ee5f 23-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Enable debug logs by default in BluetoothPbapReceiver" am: 5810700831
am: 1d0294e19e

Change-Id: I876ec928362d38380d3c41c01bbd8cb28558a405
528ce06542ece519ada0a5b96a7bdd4334f61436 23-Sep-2016 Andre Eisenbach <eisenbach@google.com> Merge "Do not downgrade filtered scans to opportunistic" am: f11c61f078
am: 7db902348f

Change-Id: I112cc9b4ded3c2fea18a0854fdb877763b849fec
c364eb3eb3b83b458360b44a3e4e3361c9975670 22-Sep-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Enable debug logs for Bluetooth AdapterService"
5810700831a0920681d515f2ed1da4522e006221 22-Sep-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Enable debug logs by default in BluetoothPbapReceiver"
cd50e74da9d04d2d6c8390c96941cc6e7fbb8cd9 22-Sep-2016 pkanwar <pkanwar@google.com> Collect number of paired BT devices. am: f4386904eb am: 4045be13b1
am: 397dcaa3b3

Change-Id: I51eb1b33dc54b034f09f2a95dfe033ee2e1b941a
397dcaa3b3ba6b3c9a7fb8a3d4637daa9480da71 22-Sep-2016 pkanwar <pkanwar@google.com> Collect number of paired BT devices. am: f4386904eb
am: 4045be13b1

Change-Id: I523f32b79789cbb13d00be9e7f6d79c0040b01a1
4045be13b11e2f03fa8071727f5327eb796203c1 22-Sep-2016 pkanwar <pkanwar@google.com> Collect number of paired BT devices.
am: f4386904eb

Change-Id: I57553542fa8201d1353adee0a02947f01e088b89
baf3b9b6c40e0e940a82e3651e4705fdf5a2b5d4 22-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Enable debug logs for Bluetooth AdapterService

Enabled log messages that are useful to debug the AdapterService state.
Remaining log messages are controlled by AdapterService.VERBOSE flag
and are disabled by default.

Bug: 31442739
Test: manual, and "frameworks/base/core/tests/bluetoothtests" unit tests
Change-Id: I7d81fd605f64e64f29aee37314821384234b286d
(cherry picked from commit 32a92489e9779d10c613a57d86135a7de6d3d7c4)
tservice/AdapterService.java
dda1ef88441ef5361aa891670b4e542230bd3bc1 15-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Enable debug logs by default in BluetoothPbapReceiver

Enabled more logs to help identify issues when Bluetooth
is started because of PBAP.

Bug: 31442739
Bug: 31457305
Test: manual - checked logcat output for (lack of) excessive logs
Change-Id: I6348fe57a8b3546a8152416a5db95b8b2226e166
(cherry picked from commit beacc3b09d1192c70c6385c5666e5706f7662a75)
bap/BluetoothPbapReceiver.java
32a92489e9779d10c613a57d86135a7de6d3d7c4 22-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Enable debug logs for Bluetooth AdapterService

Enabled log messages that are useful to debug the AdapterService state.
Remaining log messages are controlled by AdapterService.VERBOSE flag
and are disabled by default.

Bug: 31442739
Test: manual, and "frameworks/base/core/tests/bluetoothtests" unit tests
Change-Id: I7d81fd605f64e64f29aee37314821384234b286d
tservice/AdapterService.java
beacc3b09d1192c70c6385c5666e5706f7662a75 15-Sep-2016 Pavlin Radoslavov <pavlin@google.com> Enable debug logs by default in BluetoothPbapReceiver

Enabled more logs to help identify issues when Bluetooth
is started because of PBAP.

Bug: 31442739
Bug: 31457305
Test: manual - checked logcat output for (lack of) excessive logs
Change-Id: I6348fe57a8b3546a8152416a5db95b8b2226e166
bap/BluetoothPbapReceiver.java
2b8f0acc2ceb2c027201bfe981546018a3ffd20b 22-Sep-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Collect number of paired BT devices." into nyc-mr1-dev
969932cee13f9613ee98bc8d86c8a65565bdbc8e 19-Sep-2016 Andre Eisenbach <eisenbach@google.com> Do not downgrade filtered scans to opportunistic

Fixes: 31308591
Test: manual
Change-Id: I0d8bcffef9951c03607f7f3b25b79557062a9bec
(cherry picked from commit 8d6abb0a65bd4e9f4726a9c565b0c74fb6aed1a1)
att/ScanManager.java
f4386904ebbcb1af27828617ba287c512b7223ec 20-Sep-2016 pkanwar <pkanwar@google.com> Collect number of paired BT devices.

Bug: 31602591
Change-Id: I61adee8b20d57e2a1e284ed21a46d1766f059d4a
tservice/AdapterService.java
tservice/bluetooth.proto
9977e10e5fca431da86aae4d1b81e833bdcfddc9 21-Sep-2016 Andre Eisenbach <eisenbach@google.com> Do not downgrade filtered scans to opportunistic am: 8d6abb0a65 am: 26e572be79
am: 6b5a37929a

Change-Id: Ifb60ab10f1955917249587e2781f746e1ec8b842
cced340d42c04b4059a2e6ae576529462b008df6 21-Sep-2016 Jack He <siyuanh@google.com> Merge "Update deprecated Notification builder to new API" am: c536e6001e am: 64cbb327aa am: 1883fe3468
am: bfbc7c0a19

Change-Id: I1d0ad4a3af85cae460596af30e962617eec8157a
5f61157539061b032ca7220654b5053fa611e904 21-Sep-2016 Ajay Panicker <apanicke@google.com> Fix setPairingConfirmation permissions issue (1/2) am: df3304a333 am: f8a47ce8ee am: 3ea7d86110 am: ccca20484c am: 4a20ca7bae am: 827bfd6b25
am: 63f504bbef

Change-Id: Ifb7ab76df4fcd8b81baf675b077b2202b7a86f59
6b5a37929a2744f503b2a694ce6edd0bca8de1bc 21-Sep-2016 Andre Eisenbach <eisenbach@google.com> Do not downgrade filtered scans to opportunistic am: 8d6abb0a65
am: 26e572be79

Change-Id: I2b9bf93b0d1fe651a2d704562a3b4c570301ab1e
bfbc7c0a1945315b08c138ad34eab989b98bbdea 21-Sep-2016 Jack He <siyuanh@google.com> Merge "Update deprecated Notification builder to new API" am: c536e6001e am: 64cbb327aa
am: 1883fe3468

Change-Id: I77b6357a2374dbc4013d7a0d8d6a4a9a45016c60
1883fe346824ce2f9d7e90c3c30b7372e5328ba3 21-Sep-2016 Jack He <siyuanh@google.com> Merge "Update deprecated Notification builder to new API" am: c536e6001e
am: 64cbb327aa

Change-Id: I759eabbcdc586e4929899e151bb0bddac6fe88aa
c1ab98b71ae88c16fca5eb8b8ef7d6a1723302f9 21-Sep-2016 Ajay Panicker <apanicke@google.com> Fix setPairingConfirmation permissions issue (1/2) am: df3304a333 am: f8a47ce8ee am: 3ea7d86110 am: ccca20484c am: 4a20ca7bae am: 8e9f9f4bd8
am: 9166d903bc

Change-Id: If486bbc25cda349d6a0298041f0c07a07f0ebe02
26e572be79d0cebf134beb2bbbd49674f4ee1c5f 21-Sep-2016 Andre Eisenbach <eisenbach@google.com> Do not downgrade filtered scans to opportunistic
am: 8d6abb0a65

Change-Id: I4e3427a9b3a3155023f10a3f90b8182415b26293
9166d903bcdc8c451a8b14f985e6493c41d7dcc1 21-Sep-2016 Ajay Panicker <apanicke@google.com> Fix setPairingConfirmation permissions issue (1/2) am: df3304a333 am: f8a47ce8ee am: 3ea7d86110 am: ccca20484c am: 4a20ca7bae
am: 8e9f9f4bd8

Change-Id: Iecae3b133a96b2195c64894f55a2330534834d5b
63f504bbef2c9afc67cc34f670d3922369070448 21-Sep-2016 Ajay Panicker <apanicke@google.com> Fix setPairingConfirmation permissions issue (1/2) am: df3304a333 am: f8a47ce8ee am: 3ea7d86110 am: ccca20484c am: 4a20ca7bae
am: 827bfd6b25

Change-Id: I4acd14f26cb74abd83c194e69259c9ea84876b7e
827bfd6b25f714053b2e0c15075e21485c81330d 21-Sep-2016 Ajay Panicker <apanicke@google.com> Fix setPairingConfirmation permissions issue (1/2) am: df3304a333 am: f8a47ce8ee am: 3ea7d86110 am: ccca20484c
am: 4a20ca7bae

Change-Id: I4172756c290efa2ba66da96f109d3fb058be790d
8e9f9f4bd81466c3a9b7274177f9ec0287dfec22 21-Sep-2016 Ajay Panicker <apanicke@google.com> Fix setPairingConfirmation permissions issue (1/2) am: df3304a333 am: f8a47ce8ee am: 3ea7d86110 am: ccca20484c
am: 4a20ca7bae

Change-Id: I4a9f4408bf601c7e06290210e8e199969af64420
4a20ca7bae7517776da9cc7099040e19bd01f5bc 21-Sep-2016 Ajay Panicker <apanicke@google.com> Fix setPairingConfirmation permissions issue (1/2) am: df3304a333 am: f8a47ce8ee am: 3ea7d86110
am: ccca20484c

Change-Id: I549bf83ae4a98257a45c0fee77257cebdbe67b4f
8d6abb0a65bd4e9f4726a9c565b0c74fb6aed1a1 19-Sep-2016 Andre Eisenbach <eisenbach@google.com> Do not downgrade filtered scans to opportunistic

Change-Id: I0d8bcffef9951c03607f7f3b25b79557062a9bec
Fixes: 31308591
att/ScanManager.java
ccca20484c180f09d21a998b48d3a70bae24e733 21-Sep-2016 Ajay Panicker <apanicke@google.com> Fix setPairingConfirmation permissions issue (1/2) am: df3304a333 am: f8a47ce8ee
am: 3ea7d86110

Change-Id: Iba991daf03a221a4fff7a575dcdffd7181a70861
3ea7d8611043a48942ca3e14cf67198636b89098 21-Sep-2016 Ajay Panicker <apanicke@google.com> Fix setPairingConfirmation permissions issue (1/2) am: df3304a333
am: f8a47ce8ee

Change-Id: Ia73de9a88d22342fe27f5f1e965cc76b088a7a0d
4f6e5cabf9757f362fdfbef8fca30e80523fbf45 19-Sep-2016 Jack He <siyuanh@google.com> Update deprecated Notification builder to new API

* Replace Notification.setLastEventInfo() and various variable
assignments with the corresponding Notification.Builder API calls.
* Explicitly choose theme for getColor() using Context.getTheme() as
previous getColor() method is deprecated as well.

Bug: 31218737
Test: TestTracker/63162/3975
Change-Id: I696cb7f07b50b04551e56c3b4a02fea87f23589c
pp/BluetoothOppNotification.java
bap/BluetoothPbapService.java
f8a47ce8ee4fa8d6280e7e8f97891f474e965c81 21-Sep-2016 Ajay Panicker <apanicke@google.com> Fix setPairingConfirmation permissions issue (1/2)
am: df3304a333

Change-Id: Idc90fd17ec010ba786412d76496cd6f89df139b5
4b491c2c874395c436949183bcbd84ebb2493131 10-Sep-2016 Sanket Agarwal <sanketa@google.com> AVRCP 1.6 CT implementation

Bug: b/28791287
Change-Id: Ie4cb76b301bb3f36a750658fb86caa0def1eb503
2dpsink/A2dpSinkService.java
2dpsink/A2dpSinkStateMachine.java
2dpsink/A2dpSinkStreamingStateMachine.java
2dpsink/mbs/A2dpMediaBrowserService.java
vrcp/AvrcpControllerService.java
vrcp/AvrcpControllerStateMachine.java
vrcp/PlayerApplicationSettings.java
vrcp/PlayerInfo.java
vrcp/RemoteDevice.java
vrcp/TrackInfo.java
vrcpcontroller/AvrcpControllerService.java
vrcpcontroller/AvrcpControllerStateMachine.java
vrcpcontroller/AvrcpPlayer.java
vrcpcontroller/BrowseTree.java
vrcpcontroller/PlayerApplicationSettings.java
vrcpcontroller/RemoteDevice.java
vrcpcontroller/TrackInfo.java
tservice/Config.java
9ac0cb4d53f9fa60c2a9615c728851a6b2434714 13-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth: split setting params and enabling advertising (1/3)" am: 6b30601de2 am: b834e66619 am: 2cc8236e52
am: e99f02a2ce

Change-Id: Iba6d053a2314538f89a7af9fc3cc3873a6350d48
e99f02a2cef8906bcd01b6a5b90f7cfa4d42b995 13-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Bluetooth: split setting params and enabling advertising (1/3)" am: 6b30601de2 am: b834e66619
am: 2cc8236e52

Change-Id: I3247465313f1c084bb0388c479fe75b73eaee9a5
a017a7dbd303ee779e876d2e8b25f2a5629cae78 23-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Bluetooth: split setting params and enabling advertising (1/3)

Proper order of commands when starting advertising:
* set parameters
* set data
* enable advertising

This cannot be achieved when setting advertising parameters and enabling
advertising is put together in one function. Enabling before setting
data might cause first advertisements to be empty. If a device with
hardware filter pick up such advertisement, it might fail to properly
recognize our device.

Bug: 30622771
Bug: 19372779

Change-Id: I66c71f1b2c07c832eda0983ead816741798e923b
att/AdvertiseManager.java
att/GattService.java
a9aa2228ac08b58d714eb0e46755a449160b3c30 12-Sep-2016 Ajay Panicker <apanicke@google.com> Change MAP to send one new message event when encrypted storage is unlocked
am: 35b8fc00f7

Change-Id: Ifc32d772784f21466a3b5a13285436af80d0d5ff
35b8fc00f781819232b674078d5482a67f250521 24-Aug-2016 Ajay Panicker <apanicke@google.com> Change MAP to send one new message event when encrypted storage is unlocked

The MAP service will now send one new message event for all messages
when device storage is unlocked instead of sending an event per message.

Bug: 30809925
Change-Id: Iec902c414c3c229043aa089d19871d80d62f557f
ap/BluetoothMapContentObserver.java
ea2543a5009459fee3581d2fd8b2271511d31a4c 26-Aug-2016 Joseph Pirozzo <pirozzoj@google.com> 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 f7beee20f03acfd01df009f6580dd16caf0193cd)
bapclient/BluetoothPbapObexAuthenticator.java
bapclient/BluetoothPbapRequest.java
bapclient/BluetoothPbapRequestPullPhoneBook.java
bapclient/ObexAppParameters.java
bapclient/PbapClientConnectionHandler.java
bapclient/PbapClientService.java
bapclient/PbapClientStateMachine.java
df3304a333d8c385f9d5cb0e691fb72d940ec273 08-Sep-2016 Ajay Panicker <apanicke@google.com> Fix setPairingConfirmation permissions issue (1/2)

setPairingConfirmation was set to only require BLUETOOTH_ADMIN
permission which shouldn't be able to set the confirmation itself.

This is restricted to BLUETOOTH_PRIVILEGED permission.

Bug: 29043989
Change-Id: Iae8e31b25795989446265fdcc5eb27e6ffaf29aa
tservice/AdapterService.java
72ae630234ab99cc4f40b03d4e04975b76ef4a0c 08-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Fix ConcurrentModificationException in GattService.onScanResult
am: b0ef94dcec

Change-Id: I3883499a28a8b270d62d1777887e9de5acb18d44
32c5f6d64d88f9d1a238bfa6981807e90c581082 02-Sep-2016 Ajay Panicker <apanicke@google.com> Merge "AVRCP 1.6: media browsing support on Target(3/3)" am: 62fa1bc1b6 am: 3d03d79df3
am: 079917c777

Change-Id: Ifb399ce9c0f1ab908e7495ca96395a0b594f31ba
ebd1c5e8dc50038f624e23d6b9901e18688dc41b 02-Sep-2016 Erik Wolsheimer <ewol@google.com> Match semantics of ArrayList#toArray in Config's use thereof am: 19f672c2a5
am: 99c8fe9dcd

Change-Id: Ied09be7f5ddc6bc6469838e114cb2cc3a6442054
62fa1bc1b6da240adf6e90fd3c77cf009a26c4dd 02-Sep-2016 Ajay Panicker <apanicke@google.com> Merge "AVRCP 1.6: media browsing support on Target(3/3)"
99c8fe9dcdfaf551bf0e1c7df6712e1575b5ca73 02-Sep-2016 Erik Wolsheimer <ewol@google.com> Match semantics of ArrayList#toArray in Config's use thereof
am: 19f672c2a5

Change-Id: I4861b8f817d8025cce5902b33e1ba6c2cc72a716
e90c830b72f97189935e99e9e4f5a0c4f216ba72 22-Jun-2016 Avish Shah <avish.shah@broadcom.com> AVRCP 1.6: media browsing support on Target(3/3)

Description:-
This patch provides Media browsing support for AVRCP using
new Media Browsing APIs provided from Android 5.0

Features:-
1) setAddressedPlayer
- Change the control to the specified player
2) setBrowsedPlayer
- Change the player with which fileSystem is being browsed
Browsing commands:
3) getFolderItems scope=MediaPlayers/VFS/NowPlaying
4) changePath
5) getItemAttributes
6) playItem
7) getTotalNumberOfItems

Handling notifications:-
1) ADDRESSED_PLAYER_CHANGED
2) AVAILABLE_PLAYERS_CHANGED
3) NOW_PLAYING_CONTENT_CHANGED

Added support for dual RC

New files added:-
AvrcpHelperClasses.java
- Helper classes used for callback/response of browsing commands.
AvrcpConstants.java
- Group all the constants used in Avrcp.
AddressedMediaPlayer.java
- Interface to communicate with media controller for NowPlayingItems.
BrowseMediaPlayer.java
- Interface to communicate with MediaPlayer for browsing FileSystem.
AvrcpMediaRspInterface.java
- Interface to communicate with the native layer.

Verification:-
AVRCP 1.5/1.6 functionality has been verified with
google MediaBrowserService sample app.

Bug: 19361366
Merged-In: I0ab7f0c7d87c06fe4f454151d20494c56aceae12
Change-Id: I40b9e7aae81d994a709559844928b0749c603ea8
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpConstants.java
vrcp/AvrcpControllerService.java
vrcp/AvrcpHelperClasses.java
vrcp/AvrcpMediaRspInterface.java
vrcp/BrowsedMediaPlayer.java
19f672c2a572ca68c7f43b9e64917d4b5613cb4c 02-Sep-2016 Erik Wolsheimer <ewol@google.com> Match semantics of ArrayList#toArray in Config's use thereof

BUG: 28706561
Change-Id: Ia8b5a126ab742f02cf2e1f83294d8488b133a822
tservice/Config.java
b0ef94dcec73d7e4840880e8421519b07dff2b8d 01-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Fix ConcurrentModificationException in GattService.onScanResult

If a scan client is added or removed while iterating over
mRegularScanClients, a concurrent modification exception will be thrown,
because we use a regular hash map.

Use a ConcurrentHashMap instead to fix this issue.

Bug: 31122137
Change-Id: Icbd427ebbe63adc6b5bd4ee950ef3a874ce6067b
(cherry picked from commit 92d52b44ac480a23f98749c3a2884a5b3a23ff32)
att/ScanManager.java
2b22bcd66d59eae2578c7c2955ff62d941845910 27-May-2016 ugo_yu <ugo_yu@htc.com> Mercedes Benz MAP message listing workaround

Use case:
Sync MAP message to Benz NTG 4.5

Precondition:
1. One of SMS message contains any special characters not ASCII

Steps:
1. Connect with Benz NTG 4.5.
2. Sync SMS message from carkit.

Failure:
Carkit always shows "No Message".

Root Cause:
When this carkit requests the message listing, and any message subject has
non-ASCII special characters in it, the carkit will stop all MAP activity
and stay idle.

Fix:
Strip special characters in the subject tline in message listing
for this carkit.

This change also introduces a Java bases interop database for future
use/expansion.

Bug: 29025011
Change-Id: I4255cbeb068c82f32a68b1022285dfa723e199ec
(cherry picked from commit 4786e5fffff14d92b795084b4470b785de66dfd0)
ap/BluetoothMapMessageListingElement.java
ap/BluetoothMapService.java
til/Interop.java
601a396cdc635a5a6dc5a528c5b775e960822387 22-Jun-2016 Avish Shah <avish.shah@broadcom.com> AVRCP 1.6: media browsing support on Target(3/3)

Description:-
This patch provides Media browsing support for AVRCP using
new Media Browsing APIs provided from Android 5.0

Features:-
1) setAddressedPlayer
- Change the control to the specified player
2) setBrowsedPlayer
- Change the player with which fileSystem is being browsed
Browsing commands:
3) getFolderItems scope=MediaPlayers/VFS/NowPlaying
4) changePath
5) getItemAttributes
6) playItem
7) getTotalNumberOfItems

Handling notifications:-
1) ADDRESSED_PLAYER_CHANGED
2) AVAILABLE_PLAYERS_CHANGED
3) NOW_PLAYING_CONTENT_CHANGED

Added support for dual RC

New files added:-
AvrcpHelperClasses.java
- Helper classes used for callback/response of browsing commands.
AvrcpConstants.java
- Group all the constants used in Avrcp.
AddressedMediaPlayer.java
- Interface to communicate with media controller for NowPlayingItems.
BrowseMediaPlayer.java
- Interface to communicate with MediaPlayer for browsing FileSystem.
AvrcpMediaRspInterface.java
- Interface to communicate with the native layer.

Verification:-
AVRCP 1.5/1.6 functionality has been verified with
google MediaBrowserService sample app.

Bug: 19361366
Change-Id: I40b9e7aae81d994a709559844928b0749c603ea8
vrcp/AddressedMediaPlayer.java
vrcp/Avrcp.java
vrcp/AvrcpConstants.java
vrcp/AvrcpControllerService.java
vrcp/AvrcpHelperClasses.java
vrcp/AvrcpMediaRspInterface.java
vrcp/BrowsedMediaPlayer.java
39b70cdd077e6de695851430f1ec7534c2a42520 02-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix ConcurrentModificationException in GattService.onScanResult" am: 098f4e1044 am: 35d82a503a am: d79969fd91
am: 9b97b12268

Change-Id: I3cd10fc6f176e540dbcb62838dd513c12a06c734
9b97b122683c8f30a30337b8839739f154d921b2 02-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix ConcurrentModificationException in GattService.onScanResult" am: 098f4e1044 am: 35d82a503a
am: d79969fd91

Change-Id: Ic514fd015d023c1d1611798e98049bb8f67da9b8
92d52b44ac480a23f98749c3a2884a5b3a23ff32 01-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Fix ConcurrentModificationException in GattService.onScanResult

If a scan client is added or removed while iterating over
mRegularScanClients, a concurrent modification exception will be thrown,
because we use a regular hash map.

Use a ConcurrentHashMap instead to fix this issue.

Bug: 31122137
Change-Id: Icbd427ebbe63adc6b5bd4ee950ef3a874ce6067b
att/ScanManager.java
81bbcb8c84cc44d02dcd30f05d48a716c1c6e475 01-Sep-2016 Ajay Panicker <apanicke@google.com> Merge "Change MAP to send one new message event upon storage unlock" am: c8f861fb79 am: 5c6e6ba361 am: 2d415bcc1f
am: 3827575f2c

Change-Id: I7b38905eedb5a3f507572ba40ec7c39ba7996b52
61c7ef78fa20b1d5579bc190ba9a5c5542b15555 01-Sep-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Separate advertiser from GATT client (2/4)" am: 9b85e57908 am: 1c3e2bd4a3 am: 28bf62be5f
am: 43a1c952fd

Change-Id: Id9cbf114967fdd4489fd27d436db5850a9dfe168
3827575f2c2d929dd2a4bcd3e0dab72bbc1995f9 31-Aug-2016 Ajay Panicker <apanicke@google.com> Merge "Change MAP to send one new message event upon storage unlock" am: c8f861fb79 am: 5c6e6ba361
am: 2d415bcc1f

Change-Id: I0d80b811a9b823b6f271e4ea7fc123dc1f1b6d2d
c8f861fb790b53ecc93035a0c1dd6e8a26ad4c9b 31-Aug-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Change MAP to send one new message event upon storage unlock"
4cefad479487c9325dde8b6738fa3917d50c54d6 31-Aug-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "ContextMap: Remove connection references when an app is removed"
725c70cfb004690027ded41f080bfe1bb17d2285 24-Aug-2016 Ajay Panicker <apanicke@google.com> Change MAP to send one new message event upon storage unlock

The MAP service will now send one new message event for all messages
when device storage is unlocked instead of sending an event per message.

Bug: 30809925
Change-Id: I1c9e10125c9a754bf4f6c25718fc0422d79cf37e
(cherry picked from commit 8b02ffef2611c8f21d751e5a196bcb765a9e997e)
(cherry picked from commit ac3a80eed68e2374151abb59e66d95bb2e66cf61)
ap/BluetoothMapContentObserver.java
52073ce88d9c55a4a7d357f871bb82d7858c8026 31-Aug-2016 Kyle Horimoto <khorimoto@google.com> ContextMap: Remove connection references when an app is removed am: 660208ad2e am: a17703b027
am: 9b6f93f30c

Change-Id: I57bc025d20537756674c4c4998374427b30b1221
43a1c952fd70955be0c16e51cb769f0e6f9edbc0 31-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Separate advertiser from GATT client (2/4)" am: 9b85e57908 am: 1c3e2bd4a3
am: 28bf62be5f

Change-Id: I4b1d24d07062de120481999fa19b0246f47644e5
9b6f93f30cf382e00edef95f0b3fa628ee6fb2fa 31-Aug-2016 Kyle Horimoto <khorimoto@google.com> ContextMap: Remove connection references when an app is removed am: 660208ad2e
am: a17703b027

Change-Id: If182787e3d975976c77808729b946a5fa593537b
a17703b027e12cebc9e095658a0e61f5d1e14683 31-Aug-2016 Kyle Horimoto <khorimoto@google.com> ContextMap: Remove connection references when an app is removed
am: 660208ad2e

Change-Id: Ief6374e50288b58108c816915798f8456f2611d2
9d2ae23701114aedad1c8ea9ef17f93cc07adfd0 31-Aug-2016 Kyle Horimoto <khorimoto@google.com> ContextMap: Remove connection references when an app is removed

This fixes an issue which could cause a stale Bluetooth address to be
used. The issue would manifest itself when an app is added with a
connection ID, then the app is removed and app is re-added, causing
the original connection ID (which could be stale) to be used.

Bug: 30765855
Change-Id: Idacbbfb07d895bf9276fdd986100e832a54d81b0
(cherry picked from commit 660208ad2ee2ea394adab0d1c1cea9b068bb70c6)
att/ContextMap.java
64bf8e33481bb787aec895c603748eedb634a93b 13-Jul-2016 Jakub Pawlowski <jpawlowski@google.com> Separate advertiser from GATT client (2/4)

Bug: 30622771
Change-Id: Icacf1fa6a526d67ffadb8acc056d2acfefc5e895
att/AdvertiseClient.java
att/AdvertiseManager.java
att/GattService.java
89de413eba69b0c5e128a82e0ad179cec9152578 21-Jul-2016 Ajay Panicker <apanicke@google.com> Don't use SMS database until after the phone is unlocked

When the device is encrypted and a passcode is set,
the SMS database isn't available and the MAP service
crashes when trying to access it. The service will now
respond with OBEX_SERVICE_UNAVAILABLE until the phone
is unlocked. At this point, the SMS database will
notify the content observer that all the messages are
available, and send corresponding events.

Bug: 29990836
Change-Id: I53f12d0e114212d94f16b56df7c7dbe73f6254df
(cherry picked from commit db8d8ae565b3db6a5e3187170dcb7b281a79f9da)
Merged-In: I53f12d0e114212d94f16b56df7c7dbe73f6254df
ap/BluetoothMapContentObserver.java
ap/BluetoothMapObexServer.java
660208ad2ee2ea394adab0d1c1cea9b068bb70c6 31-Aug-2016 Kyle Horimoto <khorimoto@google.com> ContextMap: Remove connection references when an app is removed

This fixes an issue which could cause a stale Bluetooth address to be
used. The issue would manifest itself when an app is added with a
connection ID, then the app is removed and app is re-added, causing
the original connection ID (which could be stale) to be used.

Bug: 30765855
Change-Id: Idacbbfb07d895bf9276fdd986100e832a54d81b0
att/ContextMap.java
eb00f18ad00b09e3be2a80c01791fe65a69c488f 25-Jun-2016 Pavlin Radoslavov <pavlin@google.com> Set the Adapter Service onCreate()

We should call setAdapterService(this) inside onCreate() instead of
inside BleOnProcessStart(). The former is more robust.

Change-Id: Ide1d98dfdde148645f3efe246e6fbf95659195a7
(cherry picked from commit 39d7556b76036e02b87a6c4288a9a090e2bd6686)
tservice/AdapterService.java
cd8da5b2faf1659d3d608d3bc3538b362a0a692b 25-Aug-2016 Ajay Panicker <apanicke@google.com> Fix initMsgList() check to return if encrypted storage is locked am: 29cab6e8ea am: 539fa0868e
am: 8f322f84b0

Change-Id: I169eb18153fe2ff966e92c55dd18ed69ca127e04
8f322f84b066a0be7986dc3b00a818836c085c69 25-Aug-2016 Ajay Panicker <apanicke@google.com> Fix initMsgList() check to return if encrypted storage is locked am: 29cab6e8ea
am: 539fa0868e

Change-Id: I3fac36def33106792be9c876814ef76df815ade9
539fa0868e8b50985ebf2bb2cd5a616f7187036b 25-Aug-2016 Ajay Panicker <apanicke@google.com> Fix initMsgList() check to return if encrypted storage is locked
am: 29cab6e8ea

Change-Id: I7192271fa6c81adf261d29ed124372e07a07d32f
29cab6e8ea1014179fd15fb067e621ae4b066085 25-Aug-2016 Ajay Panicker <apanicke@google.com> Fix initMsgList() check to return if encrypted storage is locked

Bug: 30809925
Change-Id: I3f02779116bbae3bfcd006a8bb2012b517cda7e7
ap/BluetoothMapContentObserver.java
cd29fbf80159c5a7d4573f1eb9d3eee751084f48 22-Aug-2016 Sanket Agarwal <sanketa@google.com> 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 5312f3c9017634ed596a941fc375a6f70ed3aa13)
2dpsink/A2dpSinkService.java
tservice/BondStateMachine.java
c3e91ea964e116ff12e879faa391dcc3e6503717 23-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Fix a deadlock in service discovery callbacks
am: 3fffb5a79d

Change-Id: I059421dcd59cec21f91b5100c737176fe135a31f
c0d311b11fc96ff680293dc5865667556fbb47bc 22-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix a deadlock in service discovery callbacks" am: 6fcd0081eb am: 8cb5645a4e am: 19da94f05a
am: 9da98e41f1

Change-Id: Id7b92a2761cd0cb8a20983cfe8e81870debd147d
9da98e41f19d6d696afb3e71534e1da33d46522f 22-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix a deadlock in service discovery callbacks" am: 6fcd0081eb am: 8cb5645a4e
am: 19da94f05a

Change-Id: I331a446b36454c67e3f546ce8c37c553cf85b62b
8cb5645a4e158a09d2f9daa77a67ea81fc63bfbd 22-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix a deadlock in service discovery callbacks"
am: 6fcd0081eb

Change-Id: I6e343bbc3ef5c54e372687ee989e1baa133a01c8
3fffb5a79db220b2a870a73d70194e6cb7bc5d6a 19-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Fix a deadlock in service discovery callbacks

onSearchCompleted calling gattClientGetGattDbNative directly, might
cause deadlock if the jni_workqueue is full.

Bug: 30835367
Change-Id: I05de735aa189dd2d250f2c5816d38c2ddcabb864
att/GattService.java
31ef05df3ad5f98466baf5928b6e0de7fd4c886d 19-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Fix a deadlock in service discovery callbacks

onSearchCompleted calling gattClientGetGattDbNative directly, might
cause deadlock if the jni_workqueue is full.

Bug: 30835367
Change-Id: I05de735aa189dd2d250f2c5816d38c2ddcabb864
att/GattService.java
9c40e6fbb16338f2136413ca38b027611f9f036e 18-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Fix NPE in permissionCheck
am: 36294bfd68

Change-Id: I07d6d05cb6049d5cdcbe8be279a87d535ed86954
36294bfd684158211f5f4962372c63ddd0f2f859 18-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Fix NPE in permissionCheck

permissionCheck can throw NPE when notification is received before
GATT database is discovered. Assume that permission is granted when
receiving notifications for unknown characteristic.

Bug: 30853729
Change-Id: I02aab1197b036584b2021d76f290c2c57db24a19
att/GattService.java
faa4ba557644a02d63ac716f0f5922449e4a88d8 18-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix NPE in permissionCheck" am: 64ed2357e3 am: a49721050d am: 1575de4601
am: c59840538f

Change-Id: I97584f899644fec703e1fba7b76c11524fdfec18
c59840538f3ac9b49cc80ac775d6abcf150fa776 18-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix NPE in permissionCheck" am: 64ed2357e3 am: a49721050d
am: 1575de4601

Change-Id: Ie7c245768ed5f6584b6e713a99910b9d3fb672e4
a49721050d2e2a532aa19283f94e889e0c138bc6 18-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix NPE in permissionCheck"
am: 64ed2357e3

Change-Id: Ief4258ed339822801b97c9a85309608d59e98286
34d865a17a184161ed27da3aaec6f6160376d27e 18-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Fix NPE in permissionCheck

permissionCheck can throw NPE when notification is received before
GATT database is discovered. Assume that permission is granted when
receiving notifications for unknown characteristic.

Bug: 30853729
Change-Id: I02aab1197b036584b2021d76f290c2c57db24a19
att/GattService.java
617b75198109f2ddf2af31bbb5a5db691a351186 09-May-2016 Lianchao Song <songlianchao@huawei.com> Add missing null pointer check inside HeadSetClientService.stop()

Bug: 28664857

Change-Id: I62abc4eb4127db2d4f0cde44eca618996f099b49
Signed-off-by: Lianchao Song <songlianchao@huawei.com>
cherry-picked from AOSP bebc4dd9edb40710d9588b4a2010eef227756a8e
fpclient/HeadsetClientService.java
7e7b555fc9539f5d9def892208b416c095543303 15-Aug-2016 Sanket Agarwal <sanketa@google.com> 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 b5daad858badf2555416f1a50954165ccdebd54d)
fpclient/HeadsetClientStateMachine.java
619e48d1c82ff9b0ef25dee9ef3c391c41a61a58 15-Jul-2016 Myles Watson <mylesgw@google.com> RemoteDevices: Optimize adding new remote devices

RemoteDevices keeps track of the Bluetooth devices which have been
seen since the Bluetooth stack was initialized. Each time a remote
device is discovered, it is added to a hash map. When the size of the
hash map grows beyond a few hundred devices, the performance degrades.

This patch:
- creates the address string once per search
reducing the average search time with 300 devices from ~20ms to ~1ms
- uses the hash of the address string to search
further reducing the time with 1200 devices from ~2ms to ~1ms

HashMap<BluetoothDevice, DeviceProperties> became
HashMap<String, DeviceProperties>

mDevice now stores the BluetoothDevice in each instance of
DeviceProperties.

TEST: Used System.nanoTime() to measure the elapsed time of
getDeviceProperties()
Bug: 30828758

Change-Id: Id44886143fb2910955294341d4938d638c72f7f9
Signed-off-by: Myles Watson <mylesgw@google.com>
(cherry picked from commit 1fb90c4f25ba33b0f951e6ac092d05f85d355e2f)
tservice/RemoteDevices.java
5a2dcca599e68a22cdb81fb096848976aba5f98e 10-Aug-2016 Ajay Panicker <apanicke@google.com> Merge "Prevent LE scanning apps from being wrongflully downgraded to opportunistic"
am: c9db1189d8

Change-Id: I216d43f760661274145b7140efb68e5c01528073
d2564c514f5aa6209d931b132fffe7407ae2b71d 10-Aug-2016 Ajay Panicker <apanicke@google.com> Prevent LE scanning apps from being wrongflully downgraded to opportunistic am: a1c7315ed0 am: f1db4c984a
am: a41edffdae

Change-Id: I5ca6895ad5d8ddf09ed420756097d7af1af50a51
a41edffdae9c97380d3eef96f8f22fd6fe94c883 10-Aug-2016 Ajay Panicker <apanicke@google.com> Prevent LE scanning apps from being wrongflully downgraded to opportunistic am: a1c7315ed0
am: f1db4c984a

Change-Id: Icc466c5f601f0805b435c9f720b11c5eb9016c46
a4f88fbd7b54c23a0265ba3d4fd2f3203f5b36b0 04-Aug-2016 Ajay Panicker <apanicke@google.com> Prevent LE scanning apps from being wrongflully downgraded to opportunistic

Bug: 30648104
Change-Id: I9d749a20eefdbeb126fa25a425d636205a22b2ef
(cherry picked from commit a1c7315ed05df04599e7cdc5f4bcf7d3ec8d3392)
att/ScanManager.java
828baf996851119865fc630e483c1b67c739a6b8 10-Aug-2016 Andre Eisenbach <eisenbach@google.com> Merge "Change URI accessed to properly update read status"
am: f337ee1fe0

Change-Id: Iad683df58a9067e275bc07c0701cce2dfb94fd83
ec2a06e660ad540a399c2a1c19b6152e22e2d034 10-Aug-2016 Andre Eisenbach <eisenbach@google.com> Merge "Protect against SecurityException generated by query"
am: 369f6662fa

Change-Id: I9e379db4c8d54a7733bba873da2cb6abc73493e6
a1c7315ed05df04599e7cdc5f4bcf7d3ec8d3392 04-Aug-2016 Ajay Panicker <apanicke@google.com> Prevent LE scanning apps from being wrongflully downgraded to opportunistic

Bug: 30648104
Change-Id: I9d749a20eefdbeb126fa25a425d636205a22b2ef
att/ScanManager.java
9944703186475606478594cab832b1a3ee2d8098 28-Jul-2016 Ajay Panicker <apanicke@google.com> Change URI accessed to properly update read status

Bug: 28970262
Change-Id: I07d9ab24d10396baa4ddbfbdfad5b1eec1b8e9d5
ap/BluetoothMapContentObserver.java
08141e5a4bb40378df37948ef3587eeaba08fd37 08-Aug-2016 Ajay Panicker <apanicke@google.com> Prevent OPP connections from staying open forever am: 8528cc9283 am: 243cc94e95
am: 472177b8d6

Change-Id: I7c18e1c20193d209c9b8dfeea20c18874b521b4e
472177b8d6f2a3505359d92463280cc0b6fb25e5 08-Aug-2016 Ajay Panicker <apanicke@google.com> Prevent OPP connections from staying open forever am: 8528cc9283
am: 243cc94e95

Change-Id: I4fceeb8e6884358d962b9c9f35a6d91ec993bca6
8528cc92839eaabb68dc2aa1d0a67eebb31c639f 05-Aug-2016 Ajay Panicker <apanicke@google.com> Prevent OPP connections from staying open forever

OPP connections could possibly stay open forever if no response to
the put request is received after transfering very small files. Fixed
by waiting to clear the timeout message until after the response is
received.

Bug: 30645605
Change-Id: I0743685e98e74195b99eff7012dc8c8044c425ca
pp/BluetoothOppObexClientSession.java
d4e518bf3d2733228dec784a2477c800ea0b70a3 04-Aug-2016 Ajay Panicker <apanicke@google.com> Protect against SecurityException generated by query am: 3b00f32c41 am: 0cd2912836
am: 89f5b9c3a4

Change-Id: I0c89bd7a66d37ef68aa0fa7c0e3ffaa4eadf85a8
89f5b9c3a45457aa5416bacf5bd7fafe4be428fd 04-Aug-2016 Ajay Panicker <apanicke@google.com> Protect against SecurityException generated by query am: 3b00f32c41
am: 0cd2912836

Change-Id: I8b1a11ee66b122f8ce8313be68eccadd4f61dbe3
a531ddfe687c42fb92dc142b7338e7508f0e411e 03-Aug-2016 Ajay Panicker <apanicke@google.com> Protect against SecurityException generated by query

Bug: 30444661
Change-Id: I1d93645f1d4475cf603cda8bb28df0b960ccb445
pp/BluetoothOppSendFileInfo.java
pp/BluetoothOppUtility.java
3b00f32c411a7c5d352a6c427cf56a0429114b0c 03-Aug-2016 Ajay Panicker <apanicke@google.com> Protect against SecurityException generated by query

Bug: 30444661
Change-Id: I1d93645f1d4475cf603cda8bb28df0b960ccb445
pp/BluetoothOppSendFileInfo.java
pp/BluetoothOppUtility.java
8deecc545444dd9a66dd71cd0b24b8ffa9e40539 04-Aug-2016 Mudumba Ananth <ananthm%broadcom.com@gtempaccount.com> Merge "HFP 1.7 profile update (4/4)"
am: 1b9d2081e0

Change-Id: Ib18e452187c7d673e8ae387da99bf9e6faf43bda
003ef8ff43533b17d1b7f0d4d9c5eaf2fe3496bb 29-Feb-2016 Mudumba Ananth <ananthm%broadcom.com@gtempaccount.com> HFP 1.7 profile update (4/4)

-> Added HF Indicator support.
-> Sent a Broadcast intent upon receiving AT + BIND and
AT + BIEV Events with the required parameters
-> Support for sending +BIND response on indicator
status change

Bug: 19983867
Change-Id: I2580fc771080f1bc92fc4ddd5ca7c7cb57773183
(cherry picked from commit 2ab50a41dac634a78cef60a419c3bcc848c1aa78)
fp/HeadsetHalConstants.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
3f0419a3571d8289ab2b20c83adb45efa7ca0cc0 04-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Remove write type from GATT descriptor writes (2/4)" am: ddd61d3443 am: 7afffc61e7 am: 6a0a67b8a1
am: caf0b77749

Change-Id: I64aa98358fd5f2f21b1aa3dbd8c209b420ac368a
caf0b77749c94e3503f88ddc36a848180774e181 04-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Remove write type from GATT descriptor writes (2/4)" am: ddd61d3443 am: 7afffc61e7
am: 6a0a67b8a1

Change-Id: I1be021676f11bb6a89b2ccca6762606e8a883b3d
7afffc61e70249aad83341d166171035ada0ee58 04-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Remove write type from GATT descriptor writes (2/4)"
am: ddd61d3443

Change-Id: I08ecf740a524cb511d86aa771809ccbc4afbf57b
44234cde4eea7d9452481f016ac6231ac318ed39 31-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Remove write type from GATT descriptor writes (2/4)

According to the Bluetooth Core specification v4.2, Vol 3, Part G,
section 4.12.3: "The Attribute Protocol WRITE REQUEST is used used
for this sub-procedure".

Change-Id: I557a55d2ba8e998bce552e40ec7031d91bc82752
att/GattService.java
e1d61a7f4552303baea14f909c87a72730581dfc 01-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> GATT Server refactoring (3/4)

Bug: 27999121
Change-Id: I45fec0fa6d0e8e26e40e1856ba9fee6f7fbd4f7b
att/ContextMap.java
att/GattDbElement.java
att/GattService.java
att/ServiceDeclaration.java
c7a7f89786fb7de8a151d10cb841e2184af5df99 03-Aug-2016 Ajay Panicker <apanicke@google.com> Merge "Move file lookup to its own thread for beaming"
am: 001643829c

Change-Id: I6849f122ad600984b8e99a38576343d67ae86033
cc162f0d72b5d004012100f13f78643dcb60b3c9 26-Jul-2016 Ajay Panicker <apanicke@google.com> Move file lookup to its own thread for beaming

Bug: 28973021
Change-Id: I40f6d32ffadd58e60dbd1e44802a629b9fab64e4
(cherry picked from commit 9b6816400cbb35df12eaf5fd59d1996d3d0dad84)
pp/BluetoothOppHandoverReceiver.java
cf301e1945c2c5b7ea2bc19682d2d936b1f97c1d 03-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Revert "resolve merge conflicts of 593bbe3 to master"

This reverts commit b4b54e0782a50f8a0a826bff7ef6712d7d624a0d.

Change-Id: I8f60d8ca55a4e4cfd5271754823421737120e5c9
att/GattService.java
att/ServiceDeclaration.java
b4b54e0782a50f8a0a826bff7ef6712d7d624a0d 03-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> resolve merge conflicts of 593bbe3 to master

Change-Id: I049192551b70fd8b45d0ced7238681a785e65fd0
593bbe3ca3d72a3ae78c51ecf53f57b8a1b11143 03-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> resolve merge conflicts of ebe5b95 to stage-aosp-master am: de2637a1bc
am: 00f841f2ef

Change-Id: I99a268fc165f374555aeebb9365b936c23c6de2e
fd67dbf471046b4df34fc54813b9e4d6b4527871 03-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> Revert "resolve merge conflicts of ebe5b95 to stage-aosp-master"

This reverts commit 0f90008844e9926528627764b7257460bb38c4c5.

Change-Id: Ib5592727ff250287ae1a3265fa8e34b0b78acc35
att/ContextMap.java
att/GattDbElement.java
att/GattService.java
att/ServiceDeclaration.java
de2637a1bc06ee5122a208a0648702a19747e801 03-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> resolve merge conflicts of ebe5b95 to stage-aosp-master

Change-Id: I8c9ef03ff5e26128c9c6d69635355c4637075a45
0f90008844e9926528627764b7257460bb38c4c5 03-Aug-2016 Jakub Pawlowski <jpawlowski@google.com> resolve merge conflicts of ebe5b95 to stage-aosp-master

Change-Id: I5d8cae2079332998617311d7a289a2575b5d648b
05405f01802e6b5210575ad348ca441edb5cfb8b 01-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> GATT Server refactoring (3/4)

Bug: 27999121
Change-Id: I45fec0fa6d0e8e26e40e1856ba9fee6f7fbd4f7b
att/ContextMap.java
att/GattDbElement.java
att/GattService.java
att/ServiceDeclaration.java
3008d5b9a075f4f5c2a64f0aa77af2201d9ac23c 03-Aug-2016 Myles Watson <mylesgw@google.com> Merge "RemoteDevices: Optimize adding new remote devices" am: 55e58872c3 am: 7ceadd1029 am: 271d3f743a
am: 58f9f0d544

Change-Id: I5993cf0f533011502da1f242f6034dd5084f7a3c
58f9f0d54482ac33291205ff82fb4b5d47b79aef 03-Aug-2016 Myles Watson <mylesgw@google.com> Merge "RemoteDevices: Optimize adding new remote devices" am: 55e58872c3 am: 7ceadd1029
am: 271d3f743a

Change-Id: Ibe54389ba36b5f60553674032554811be490f1ff
7ceadd102906eb2bd38ce7e82979ad64462b3544 03-Aug-2016 Myles Watson <mylesgw@google.com> Merge "RemoteDevices: Optimize adding new remote devices"
am: 55e58872c3

Change-Id: I85799db7e1fd3069815254afd2d6ebb559894d5a
0e742574e6938bc706ff7c99aea781d0c78bf755 03-Aug-2016 Ajay Panicker <apanicke@google.com> Move file lookup to its own thread for beaming am: 9b6816400c am: a4788f406d
am: 13e57fc462

Change-Id: Idd86f0cf941e567b0aea9ada29663e1cfe86b95e
13e57fc4623dcf378faa8db324ac08a9db0dcb13 03-Aug-2016 Ajay Panicker <apanicke@google.com> Move file lookup to its own thread for beaming am: 9b6816400c
am: a4788f406d

Change-Id: I3ab51d18fcc8f02f7345fbabbb787c25cda12e52
1fb90c4f25ba33b0f951e6ac092d05f85d355e2f 15-Jul-2016 Myles Watson <mylesgw@google.com> RemoteDevices: Optimize adding new remote devices

RemoteDevices keeps track of the Bluetooth devices which have been
seen since the Bluetooth stack was initialized. Each time a remote
device is discovered, it is added to a hash map. When the size of the
hash map grows beyond a few hundred devices, the performance degrades.

This patch:
- creates the address string once per search
reducing the average search time with 300 devices from ~20ms to ~1ms
- uses the hash of the address string to search
further reducing the time with 1200 devices from ~2ms to ~1ms

HashMap<BluetoothDevice, DeviceProperties> became
HashMap<String, DeviceProperties>

mDevice now stores the BluetoothDevice in each instance of
DeviceProperties.

TEST: Used System.nanoTime() to measure the elapsed time of
getDeviceProperties()

Change-Id: Id44886143fb2910955294341d4938d638c72f7f9
Signed-off-by: Myles Watson <mylesgw@google.com>
tservice/RemoteDevices.java
9b6816400cbb35df12eaf5fd59d1996d3d0dad84 26-Jul-2016 Ajay Panicker <apanicke@google.com> Move file lookup to its own thread for beaming

Bug: 28973021
Change-Id: I40f6d32ffadd58e60dbd1e44802a629b9fab64e4
pp/BluetoothOppHandoverReceiver.java
7d4aa832cb9a8a9f21ce0fad5510ae82526c3d28 27-Jul-2016 Marie Janssen <jamuraa@google.com> Fix bugs in play status and play pos notifications

Fix multiple issues with status notificatios:
* Playback state was not being sent when state wasn't sent
accompanying a metadata change
* Play state was being sent without an update
* Position was being sent without a change and with the wrong
indicator
* Position was not being scheduled for update when playing.
* Position was being scheduled for update when paused / stopped.

Bug: 30459664
Bug: 29400658
Bug: 28639383
Change-Id: Ic550dcab0430be45187b0267cc77875740388a2a
(cherry picked from commit fa81085f6cda571d56c62eb1d646ae4a52cb90ee)
vrcp/Avrcp.java
97e92834b2562c0594976a3c69310be95e947dee 30-Jul-2016 Marie Janssen <jamuraa@google.com> Merge \\\\"Fix bugs in play status and play pos notifications\\\\" am: 764eb24d86 am: 0613023813 am: d88546c4b1
am: 6475fa4396

Change-Id: I034d9569aa8e85b88004ff4d0fb62a0100fcf389
6475fa43967d1a3bb8850477e4be03a2eceb2e8d 30-Jul-2016 Marie Janssen <jamuraa@google.com> Merge \\\"Fix bugs in play status and play pos notifications\\\" am: 764eb24d86 am: 0613023813
am: d88546c4b1

Change-Id: Ia9947835c199cc8fc44118f8048c235058f890e1
06130238138c1675fc571999959d17a9256dec98 30-Jul-2016 Marie Janssen <jamuraa@google.com> Merge \"Fix bugs in play status and play pos notifications\"
am: 764eb24d86

Change-Id: I6a5119996813069494b3c7ee666025474d1d9763
fa81085f6cda571d56c62eb1d646ae4a52cb90ee 27-Jul-2016 Marie Janssen <jamuraa@google.com> Fix bugs in play status and play pos notifications

Fix multiple issues with status notificatios:
* Playback state was not being sent when state wasn't sent
accompanying a metadata change
* Play state was being sent without an update
* Position was being sent without a change and with the wrong
indicator
* Position was not being scheduled for update when playing.
* Position was being scheduled for update when paused / stopped.

Bug: 30459664
Bug: 29400658
Bug: 28639383
Change-Id: Ic550dcab0430be45187b0267cc77875740388a2a
vrcp/Avrcp.java
a70fd1dbc691a37bfb9c54700a07c7cbbf29cc1f 28-Jul-2016 Ajay Panicker <apanicke@google.com> Change URI accessed to properly update read status am: cdf75c3f2b am: 237f8de011
am: 534725331f

Change-Id: I23963634db60486d5b3c6cc12382db1d9ec6e830
534725331f0a17131a44934ee8107dd9c3a00056 28-Jul-2016 Ajay Panicker <apanicke@google.com> Change URI accessed to properly update read status am: cdf75c3f2b
am: 237f8de011

Change-Id: I9d5670e43201dec50fc30a5c8ce33c1c8729bd1c
cdf75c3f2b9e0e367ea2a4ce92018a6de662f4cd 28-Jul-2016 Ajay Panicker <apanicke@google.com> Change URI accessed to properly update read status

Bug: 28970262
Change-Id: I07d9ab24d10396baa4ddbfbdfad5b1eec1b8e9d5
ap/BluetoothMapContentObserver.java
764de0b13057da964d739232781f3538ddb8dc06 27-Jul-2016 Ajay Panicker <apanicke@google.com> Don\\'t use SMS database until after the phone is unlocked am: db8d8ae565
am: 621a319d78

Change-Id: Id0a9cc5b742ca2a7ce7ebf3a3aed80239b2e6ee4
621a319d78185d22d19b8b6d125daff8f6d0a569 27-Jul-2016 Ajay Panicker <apanicke@google.com> Don\'t use SMS database until after the phone is unlocked
am: db8d8ae565

Change-Id: Iba27a3b5695ea1346531df0ecb81a55bbc9c5a01
986c5d4484870e6f0025f688e557c0f45e59ee6b 27-Jul-2016 Ajay Panicker <apanicke@google.com> Merge "Don't use SMS database until after the phone is unlocked" into nyc-mr1-dev
db8d8ae565b3db6a5e3187170dcb7b281a79f9da 21-Jul-2016 Ajay Panicker <apanicke@google.com> Don't use SMS database until after the phone is unlocked

When the device is encrypted and a passcode is set,
the SMS database isn't available and the MAP service
crashes when trying to access it. The service will now
respond with OBEX_SERVICE_UNAVAILABLE until the phone
is unlocked. At this point, the SMS database will
notify the content observer that all the messages are
available, and send corresponding events.

Bug: 29990836
Change-Id: I53f12d0e114212d94f16b56df7c7dbe73f6254df
ap/BluetoothMapContentObserver.java
ap/BluetoothMapObexServer.java
06c566ebd3462ec18624f1db9f49f81c2eec0cef 08-Jul-2016 Lianchao Song <songlianchao@huawei.com> Add foreground flag to AG_CALL_CHANGED broadcast intent.

To fix the issue that the watch is still ringing after answer an
incoming call on phone. It is caused by the ACTION_CALL_CHANGED
broadcast reception processing delayed.

Bug:29931814

Change-Id: I8d8f297c3a13dfe65674eca94724a50d82618f5e
Signed-off-by: m00230717 <m00230717@notesmail.huawei.com>
(cherry picked from commit 6b375a456e971ae8ef7ddf1d7d41876ca39e44bc)
fpclient/HeadsetClientStateMachine.java
9ebceb7b7d544e56cacf4a79436331022ebeee30 13-May-2016 Joseph Pirozzo <pirozzoj@google.com> AVRCP Statemachine

Refactor AVRCP profile to reflect state machine design as seen in other
bluetooth profiles. This update will include all features required for
AVRCP 1.3 along with absolute volume control from 1.4. Interface logic
will be seperated out into the Service class and policy logic will be
maintained within the StateMachine.

bug: 28671900
Change-Id: I710bac73e3113a7729f449ea9dbb854ceb2438fb
vrcp/AvrcpControllerClasses.java
vrcp/AvrcpControllerConstants.java
vrcp/AvrcpControllerService.java
vrcp/AvrcpControllerStateMachine.java
vrcp/NowPlaying.java
vrcp/PlayerApplicationSettings.java
vrcp/PlayerInfo.java
vrcp/RemoteDevice.java
vrcp/RemoteMediaPlayers.java
vrcp/TrackInfo.java
b83b782b4913b687bb94cbea11768f05214c7fb0 19-Jul-2016 Chenjie Luo <cjluo@google.com> Merge \\\\"Add foreground flag to AG_CALL_CHANGED broadcast intent.\\\\" am: df005bf244 am: 6a15ebb73f am: e9789c7e89
am: 3532f9b31f

Change-Id: Ib209ef502d2c92815375f08fd6b42a654bf31fcc
3532f9b31f7cd3b76449f209a37490f768b34141 19-Jul-2016 Lianchao Song <songlianchao@huawei.com> Merge \\\"Add foreground flag to AG_CALL_CHANGED broadcast intent.\\\" am: df005bf244 am: 6a15ebb73f
am: e9789c7e89

Change-Id: I13b56a0ade475485a94f3d2e9db3583aa3233b85
6a15ebb73f8fa1fe50d930c175324530fc676537 19-Jul-2016 Lianchao Song <songlianchao@huawei.com> Merge \"Add foreground flag to AG_CALL_CHANGED broadcast intent.\"
am: df005bf244

Change-Id: I0c8d2337e82c472fe4bd07d90f61c8b39e56dd80
df005bf2443da3737b4f9c645b6302d8497acf71 19-Jul-2016 Chenjie Luo <cjluo@google.com> Merge "Add foreground flag to AG_CALL_CHANGED broadcast intent."
9b04e432dee914b685ea30a310d0626d85689f4a 12-Jul-2016 Marie Janssen <jamuraa@google.com> Fix AVRCP crash, position and state tracking

When the MediaController goes away (media stops) a NPE would cause a
crash.

Initialize the position so that an initial notification gets sent
when position is requested, send it when the music is paused, and
send play state whenever the app sends us a play state update.

Bug: 30039744
Bug: 29416450
Change-Id: I44397b3dc40d328fa75a2c15875fad298a5090dd
(cherry picked from commit 84d3f084d4d1a65eb7a481e5a7fe4a6ac827be7b)
vrcp/Avrcp.java
2be5946285b5956fc752f4e1fbbaf9a3f87e20e5 30-Jun-2016 Marie Janssen <jamuraa@google.com> Refactor playback position tracking

Use PlaybackState directly to track the position through time. Update
the state when necessary (track changes, etc.)

Remove complex logic and centralize sending of Play Position
Notificaiton response and scheduling.

Update dumpsys and add current package session.

Bug: 29416450
Bug: 29606822

Change-Id: Ie82b48d6d7f9e1a05b64835731433d05a3a3a41a
(cherry picked from commit eb9e6ef0ecde4929fa2df1aa4cc8954d88d3b452)
vrcp/Avrcp.java
ca077668fb4dcf335280e194ceda7931ef966e01 15-Jul-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Remove redundant call to sendShutdownMessage to prevent crash am: 983e5e14f9
am: 49dbf0e861

Change-Id: I3969078fd870a15eac1c1de87605f13ccfaeff0a
5b4e35e4e3b642441c4eb58501e568273390cb3b 15-Jul-2016 Hemant Gupta <hemantg@codeaurora.org> Merge \"MAP: Remove redundant call to sendShutdownMessage to prevent crash\"
am: 0786878b88

Change-Id: Ic62f273f84ae4b6b3c4d63ae089511b19723c1e4
49dbf0e8616c517d0338b0fb08f610f25a84eb10 15-Jul-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Remove redundant call to sendShutdownMessage to prevent crash
am: 983e5e14f9

Change-Id: I6b94817118b438ee0643c5f35fee761512f8a9bc
983e5e14f9d4ef8e42876f67227777f1b6510ba0 06-Jun-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Remove redundant call to sendShutdownMessage to prevent crash

Usecase:
Perform BT off/on repeatedly.

Issue:
Bluetooth crashes.

Fix:
Remove redundant call to sendShutdownMessage() from stop API to prevent
MapServiceMessageHandler becoming null and being dereferenced.

Bug: 29149190
Change-Id: I739664975043c4a1895fd2113869c87cdb704338
(cherry picked from commit 5847ca3c7068500b1f2a4cd4cf5ff373347f8fbf)
ap/BluetoothMapService.java
5847ca3c7068500b1f2a4cd4cf5ff373347f8fbf 06-Jun-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Remove redundant call to sendShutdownMessage to prevent crash

Usecase:
Perform BT off/on repeatedly.

Issue:
Bluetooth crashes.

Fix:
Remove redundant call to sendShutdownMessage() from stop API to prevent
MapServiceMessageHandler becoming null and being dereferenced.

Bug: 29149190
Change-Id: I739664975043c4a1895fd2113869c87cdb704338
ap/BluetoothMapService.java
f64a40992fa6f8be5b294a3b80fa4f8d6fa21818 15-Jul-2016 Andreas Gampe <agampe@google.com> Avrcp: Fix duplicate
am: dd52cecc0a

Change-Id: I594e8585ae9e0024b0b7964ae4dd796d99842e42
dd52cecc0a3026529a9229f22ab203be1633d69e 15-Jul-2016 Andreas Gampe <agampe@google.com> Avrcp: Fix duplicate

Introduced by commit a85380b8b5f2cb1a2a983cee18343976774334dd.

Change-Id: I7907fcb34156ebf9119ba0c844c9845ec349ffd4
vrcp/Avrcp.java
61da8b01a05406fecc03c6e302ae77a99a516d71 15-Jul-2016 Marie Janssen <jamuraa@google.com> resolve merge conflicts of eb9e6ef to nyc-mr1-dev-plus-aosp
am: a85380b8b5

Change-Id: If61737d23c69d4a853a45a19c21ae951ef8333a5
a85380b8b5f2cb1a2a983cee18343976774334dd 15-Jul-2016 Marie Janssen <jamuraa@google.com> resolve merge conflicts of eb9e6ef to nyc-mr1-dev-plus-aosp

Change-Id: I67063e627d4d7c9827cb656658b456acd4956816
83037083f3448c576ae960c033fbe0d5bcc5956b 14-Jul-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "PAN: Avoid reconfiguration of bt-pan interface in NAP role" into nyc-mr1-dev
0a75d4090855858f9dbc91af28965312409312e5 14-Jul-2016 Hemant Gupta <hemantg@codeaurora.org> Merge \\\\"PAN: Avoid reconfiguration of bt-pan interface in NAP role\\\\" am: aa83abd905 am: 31bd447ec8 am: 65d42eb5b6
am: 894cfc61df

Change-Id: I87f234b0ee670bb2632bee4ffa2bf96d0a3374a9
894cfc61df17c26644bc77a47f6ff2b9e5cb1043 14-Jul-2016 Hemant Gupta <hemantg@codeaurora.org> Merge \\\"PAN: Avoid reconfiguration of bt-pan interface in NAP role\\\" am: aa83abd905 am: 31bd447ec8
am: 65d42eb5b6

Change-Id: I83dde0d53af97c13c8f09f95604164579936b6c0
31bd447ec80ee7fc3b53387a1a955242a4afbca7 14-Jul-2016 Hemant Gupta <hemantg@codeaurora.org> Merge \"PAN: Avoid reconfiguration of bt-pan interface in NAP role\"
am: aa83abd905

Change-Id: I084e393e11a893744a6b05b9a9ed3227b0df121a
fe85d07eca1b97ea667caa5cdd6b3fab59670188 16-Jun-2016 Nitin Shivpure <nshivpur@codeaurora.org> PAN: Avoid reconfiguration of bt-pan interface in NAP role

Issue:
Browsing is not working with multiple remote PANU Device(s).

Root Cause:
When the 1st remote PANU is connected, the bt-pan interface gets
configured. As soon as 2nd PANU is connected, the bt-pan interface
goes into a bad state. The second device is able to write Ethernet
packets on the bt-pan interface (TUN driver) after reconfiguration,
but it is unable to read Ethernet packets from the interface.

Fix:
If the bt-pan interface is already configured in the NAP role,
then do not reconfigure bt-pan when the 2nd PANU is connected.

Bug: 29992925
Change-Id: Ib6e0cb91d573649af45ffe25c7095a4bd74a5022
an/PanService.java
fa5be2f2cca685332d48c8bafe1b3988ae92bbc5 16-Jun-2016 Hemant Gupta <hemantg@codeaurora.org> PAN: Avoid reconfiguration of bt-pan interface in NAP role

Issue:
Browsing is not working with remote PANU Device(s).

RCA:
DUT is in NAP role, bt-pan interface is configured for NAP role,
when 1st remote PANU is connected. bt-pan interface is being
reconfigured, whenever 2nd PANU is connected, which leads bt-pan
interface to go in bad state. BT is able to write Ethernet packets on
bt-pan interface(TUN driver) after reconfiguration, but it's
unable to read Ethernet packets from bt-pan interface(TUN driver).

Fix:
If bt-pan interface is already configured in NAP role,
then do not reconfigure bt-pan, when 2nd PANU is connected.

BUG: 29992925
Change-Id: Ib6e0cb91d573649af45ffe25c7095a4bd74a5022
an/PanService.java
84d3f084d4d1a65eb7a481e5a7fe4a6ac827be7b 12-Jul-2016 Marie Janssen <jamuraa@google.com> Fix AVRCP crash, position and state tracking

When the MediaController goes away (media stops) a NPE would cause a
crash.

Initialize the position so that an initial notification gets sent
when position is requested, send it when the music is paused, and
send play state whenever the app sends us a play state update.

Bug: 30039744
Bug: 29416450
Change-Id: I44397b3dc40d328fa75a2c15875fad298a5090dd
vrcp/Avrcp.java
eb9e6ef0ecde4929fa2df1aa4cc8954d88d3b452 30-Jun-2016 Marie Janssen <jamuraa@google.com> Refactor playback position tracking

Use PlaybackState directly to track the position through time. Update
the state when necessary (track changes, etc.)

Remove complex logic and centralize sending of Play Position
Notificaiton response and scheduling.

Update dumpsys and add current package session.

Bug: 29416450
Bug: 29606822

Change-Id: Ie82b48d6d7f9e1a05b64835731433d05a3a3a41a
vrcp/Avrcp.java
a24b1d6a989b38e9bf3467493e017695a20b5f35 14-Jul-2016 Ajay Panicker <apanicke@google.com> Allow MAP to accept and list draft messages without recipients am: c06dad4b6c
am: 467169d322

Change-Id: I5b01160b7a5c78d2ce672c25f09728ae6ebfc913
467169d322ec315f4d16cbd2328b01132f1b29f2 14-Jul-2016 Ajay Panicker <apanicke@google.com> Allow MAP to accept and list draft messages without recipients
am: c06dad4b6c

Change-Id: Ie52bbcdf6dd372e02c936ed2909e35c34b7e321d
c06dad4b6c213f57da06fe74903a25733ef6579f 06-Jul-2016 Ajay Panicker <apanicke@google.com> Allow MAP to accept and list draft messages without recipients

Bug: 28970268
Change-Id: I5bdef6cd67708036352ed37ea35b027d6a54af03
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapObexServer.java
bc70d0c097c4c8777512e102c270e8a0a73590d7 21-Oct-2015 Satish Kodishala <skodisha@codeaurora.org> 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)
fpclient/HeadsetClientStateMachine.java
daf9fe1f6a146f7eb03a8abefc5202b13598cdd2 13-Jul-2016 Marie Janssen <jamuraa@google.com> Merge \\\\"Fix AVRCP crash, position and state tracking\\\\" am: 5b8a0db93b am: aaa4f6f36f am: d7f5fb9c4a
am: c2d627cacc

Change-Id: I74e7c1e6d85667aaac4f04f87e8864fd436611a7
c2d627caccd362d30a2dba83235d1d2770739c47 13-Jul-2016 Marie Janssen <jamuraa@google.com> Merge \\\"Fix AVRCP crash, position and state tracking\\\" am: 5b8a0db93b am: aaa4f6f36f
am: d7f5fb9c4a

Change-Id: I63cf6868fc934d86a768bc7cb4594aa5708f7909
aaa4f6f36f07e33b8c4ff51383b168576df76350 13-Jul-2016 Marie Janssen <jamuraa@google.com> Merge \"Fix AVRCP crash, position and state tracking\"
am: 5b8a0db93b

Change-Id: Ic553fbdb7e2bbb2356b0525e8d54a2a59945d27e
3635a926bd7316a55b288a54d409a1070a9c19e8 12-Jul-2016 Marie Janssen <jamuraa@google.com> Fix AVRCP crash, position and state tracking

When the MediaController goes away (media stops) a NPE would cause a
crash.

Initialize the position so that an initial notification gets sent
when position is requested, send it when the music is paused, and
send play state whenever the app sends us a play state update.

Bug: 30039744
Bug: 29416450
Change-Id: I44397b3dc40d328fa75a2c15875fad298a5090dd
vrcp/Avrcp.java
6b375a456e971ae8ef7ddf1d7d41876ca39e44bc 08-Jul-2016 Lianchao Song <songlianchao@huawei.com> Add foreground flag to AG_CALL_CHANGED broadcast intent.

To fix the issue that the watch is still ringing after answer an
incoming call on phone. It is caused by the ACTION_CALL_CHANGED
broadcast reception processing delayed.

Bug:29931814

Change-Id: I8d8f297c3a13dfe65674eca94724a50d82618f5e
Signed-off-by: m00230717 <m00230717@notesmail.huawei.com>
fpclient/HeadsetClientStateMachine.java
7f39e26e61d97333b1a779d8bf0f6f123e087378 08-Jul-2016 Satish Kodishala <skodisha@codeaurora.org> Check for call/call setup state before creating SCO am: 4b84ae9813
am: bd4c72e7b4

Change-Id: I86708d6e7088d260a358bd93075c56416245cb35
bd4c72e7b4ce413441ba1d766d6e277db7400e4b 08-Jul-2016 Satish Kodishala <skodisha@codeaurora.org> Check for call/call setup state before creating SCO
am: 4b84ae9813

Change-Id: Idf65fc98fb23ecf86010bafc3a857878f932aec3
cf8c10755f6f9c90f4627d4fbcb73e3b1a1d389c 08-Jul-2016 Satish Kodishala <skodisha@codeaurora.org> Merge \"Check for call/call setup state before creating SCO\"
am: 598902d8e2

Change-Id: I74d86b349b86efb7c82f114aa72be4a4af55ce0a
96c327c3d12102ecb02bf02f3183afef00b85a7f 04-May-2016 Satish Kodishala <skodisha@codeaurora.org> Check for call/call setup state before creating SCO

Use case:
1. Run HFP AG PTS test cases.
or
1. Pair and connect phone with Sony xba-bt75 Bluetooth headset.
2. Make incoming call and accept it.

Failure:
PTS test cases fail. There will be no call audio on
Sony xba-bt75 headset.

Root cause:
Telephony asking to create SCO before incoming call
is accepted.

Fix:
If there is no active/held call, outgoing call setup
in progress, we should not create SCO. Telephony will
ask to create SCO for incoming call before the call
becomes active, this creates IOT issues and fail below
PTS test cases.
TC_AG_ACC_BV_08_I
TC_AG_ACC_BV_10_I
TC_AG_ACC_BV_11_I
TC_AG_ACC_BV_12_I
TC_AG_ACC_BV_13_I
TC_AG_ACC_BV_14_I

Bug: 29417803
Change-Id: I0c1002b31da65cbc0b0e74b590468d37ea51d065
fp/HeadsetStateMachine.java
de8d996c5eb073949210f53b739ef12c2c3054ee 06-Jul-2016 Sanket Agarwal <sanketa@google.com> 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 a0aa296e1311cbc72ba0ef18c434f68b60c8f935)
fpclient/connserv/HfpClientConference.java
fpclient/connserv/HfpClientConnectionService.java
2b32bc5c037a04239b24e3bdb7d193d0091eac02 30-Jun-2016 Sanket Agarwal <sanketa@google.com> 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 94e2ae2ef4aa4d08855d829251da20585ad977d1)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientConnectionService.java
4b84ae9813878f957b6009d6f0d86bbfb6a36067 04-May-2016 Satish Kodishala <skodisha@codeaurora.org> Check for call/call setup state before creating SCO

Use case:
1. Run HFP AG PTS test cases.
or
1. Pair and connect phone with Sony xba-bt75 Bluetooth headset.
2. Make incoming call and accept it.

Failure:
PTS test cases fail. There will be no call audio on
Sony xba-bt75 headset.

Root cause:
Telephony asking to create SCO before incoming call
is accepted.

Fix:
If there is no active/held call, outgoing call setup
in progress, we should not create SCO. Telephony will
ask to create SCO for incoming call before the call
becomes active, this creates IOT issues and fail below
PTS test cases.
TC_AG_ACC_BV_08_I
TC_AG_ACC_BV_10_I
TC_AG_ACC_BV_11_I
TC_AG_ACC_BV_12_I
TC_AG_ACC_BV_13_I
TC_AG_ACC_BV_14_I

Bug: 29417803
Change-Id: I0c1002b31da65cbc0b0e74b590468d37ea51d065
(cherry picked from commit c01a35486da7fa801b4cb6ad4d1bb7702ab4f272)
fp/HeadsetStateMachine.java
aec2f01b54afe0c0f20c2bc786365e1c746edf43 02-Jul-2016 Marie Janssen <jamuraa@google.com> Merge \\\\"Refactor playback position tracking\\\\" am: 0d83e2969a am: 33bbc33e8b am: 629be9ed3a
am: 720cf9307a

Change-Id: I7794c863f5d0906fdcd141f702d2360f5f13af4a
720cf9307ac4d657c19d25cccba487757de4f1aa 02-Jul-2016 Marie Janssen <jamuraa@google.com> Merge \\\"Refactor playback position tracking\\\" am: 0d83e2969a am: 33bbc33e8b
am: 629be9ed3a

Change-Id: Ieda928b5450999418a65aec9ae4e10b7479345ad
33bbc33e8b0001d2cdee0931c31187ccc2cf615f 02-Jul-2016 Marie Janssen <jamuraa@google.com> Merge \"Refactor playback position tracking\"
am: 0d83e2969a

Change-Id: I02e4595765448e2b475b7192d8468eb588a774c5
f7942360dd9d807bea087c4ef42773f5e800c0c4 30-Jun-2016 Marie Janssen <jamuraa@google.com> Refactor playback position tracking

Use PlaybackState directly to track the position through time. Update
the state when necessary (track changes, etc.)

Remove complex logic and centralize sending of Play Position
Notificaiton response and scheduling.

Update dumpsys and add current package session.

Bug: 29416450
Bug: 29606822

Change-Id: Ie82b48d6d7f9e1a05b64835731433d05a3a3a41a
vrcp/Avrcp.java
61ca891c486de3f2b42b4619b6095b9eef5b7b47 01-Jul-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Fix work profile app not being able to create bond"
1ff2e6e9306272bd113c8633c9b52fb169eddcb3 29-Jun-2016 Sanket Agarwal <sanketa@google.com> 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 aa09a41a685e957786b69d4101f5107b9d6d1d9b)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientConnectionService.java
05462fe44531f887fe91ac173ec645e91b236025 28-Jun-2016 Sanket Agarwal <sanketa@google.com> 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 184038a1db6482eeb4e54f834b286ea70ea030d9)
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/ConnectionKey.java
fpclient/connserv/HfpClientConference.java
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientConnectionService.java
be6f455a86e68a66cd549cd1c7ba0b4a2c21a4a9 25-Jun-2016 Pavlin Radoslavov <pavlin@google.com> Set the Adapter Service onCreate() am: 39d7556b76
am: 7c4a993186

Change-Id: I14d3607031745c3bdfffa5a25a1dc5dff36f4e81
7c4a9931865483dbc01fa39270d04395de37cb09 25-Jun-2016 Pavlin Radoslavov <pavlin@google.com> Set the Adapter Service onCreate()
am: 39d7556b76

Change-Id: I202858f6c0daf7eab60d157b344952666033d337
39d7556b76036e02b87a6c4288a9a090e2bd6686 25-Jun-2016 Pavlin Radoslavov <pavlin@google.com> Set the Adapter Service onCreate()

We should call setAdapterService(this) inside onCreate() instead of
inside BleOnProcessStart(). The former is more robust.

Change-Id: Ide1d98dfdde148645f3efe246e6fbf95659195a7
tservice/AdapterService.java
34fc6e6f09098ed3d15713999a1dc86b971f4f81 24-Jun-2016 Calvin On <con@google.com> Use the live AdapterService in ProfileService.
am: d4152d61ac

Change-Id: I4755e0a99783caf68b4c6a84f9507d6764a87b87
d4152d61ac6e9ec32c63c628d40ba2bf14b9a970 22-Jun-2016 Calvin On <con@google.com> Use the live AdapterService in ProfileService.

Previously, if AdapterService was null while ProfileService is
created, the ProfileService would never work because it would
store a stale reference to the AdapterService.

This change ensures that ProfileService accesses the current
AdapterService at any given time.

Bug: 29519304
Bug: 29610505

Change-Id: I25efbf4a58932f519ac9f0b89c4112a442c994eb
(cherry picked from commit b55c6a1f4ce60ad552e9c9a6d06fab6781a4dadb)
tservice/AdapterService.java
tservice/ProfileService.java
a9bb39883981bd84ead436496e1c208d722529e3 23-Jun-2016 Calvin On <con@google.com> Merge \\"Use the live AdapterService in ProfileService.\\" into nyc-mr1-dev am: ae20236ee9
am: 0d3d71c1db

Change-Id: I5e4c2418c646812e880662d861b84a5b7bdc9589
0d3d71c1db27ef23168e9449d9d48f6c915806d7 23-Jun-2016 Calvin On <con@google.com> Merge \"Use the live AdapterService in ProfileService.\" into nyc-mr1-dev
am: ae20236ee9

Change-Id: I295257c0afd078410881f2d709dcf68c5ab03947
ae20236ee98b1c0884b48ec3773b28fd01764520 23-Jun-2016 Calvin On <con@google.com> Merge "Use the live AdapterService in ProfileService." into nyc-mr1-dev
184af10d93ed09be4dc1ebf554d555c747b947c8 23-Jun-2016 Ajay Panicker <apanicke@google.com> Close output stream before getting response am: e026ad5004 am: 12d518f51f
am: d4362de2c0

Change-Id: Ifc5a514761a536ace0e990d0ba6d363bdf1d4e24
d4362de2c0993a302cd4a95f31ef8b9b8b2f1d12 23-Jun-2016 Ajay Panicker <apanicke@google.com> Close output stream before getting response am: e026ad5004
am: 12d518f51f

Change-Id: I724d5e6386af9606fb437ad9a5e28a9ae3fec8f9
12d518f51fbdac3aa618155563ebb884e4942df9 23-Jun-2016 Ajay Panicker <apanicke@google.com> Close output stream before getting response
am: e026ad5004

Change-Id: I54248b785427cce08568d7fed2bb329f90b3af02
5f40beebd693d937989506043f7131bd5f45e8c4 23-Jun-2016 Ajay Panicker <apanicke@google.com> Close output stream before getting response
am: e026ad5004

Change-Id: I55fc6fee16f4e25817fc6cbad37e83052a41a7dd
e026ad5004a084c95b86a061924c692546a10395 23-Jun-2016 Ajay Panicker <apanicke@google.com> Close output stream before getting response

If the output stream is still open after finishing the sending of
a file, a CONTINUE response code is received instead of an OK code.

Bug: 29583227
Change-Id: I1b2515e8fe5eec208bbbe1df17f96cc20c5ea884
pp/BluetoothOppObexClientSession.java
b55c6a1f4ce60ad552e9c9a6d06fab6781a4dadb 22-Jun-2016 Calvin On <con@google.com> Use the live AdapterService in ProfileService.

Previously, if AdapterService was null while ProfileService is
created, the ProfileService would never work because it would
store a stale reference to the AdapterService.

This change ensures that ProfileService accesses the current
AdapterService at any given time.

Bug: 29519304

Change-Id: I25efbf4a58932f519ac9f0b89c4112a442c994eb
tservice/AdapterService.java
tservice/ProfileService.java
2e51bef439b498664a3a162056d7437d06c53ac8 22-Jun-2016 Adam Lesinski <adamlesinski@google.com> Merge commit \\'303ef0bd1343806adba9b00e39ca05b7c9e50a4f\\' into manual_merge_303ef0b am: d2d127b950
am: a2c9d3447c

Change-Id: If3f3daafeb62e92a10045203e619c0ef5cc6816a
a2c9d3447c3aac71c6e86c97ae6bf06c1f698035 22-Jun-2016 Adam Lesinski <adamlesinski@google.com> Merge commit \'303ef0bd1343806adba9b00e39ca05b7c9e50a4f\' into manual_merge_303ef0b
am: d2d127b950

Change-Id: Id89a8157ec0a2ee524564b7401e85377527f0af0
d2d127b95044331cfd073afbe5ef177c807c0c0d 22-Jun-2016 Adam Lesinski <adamlesinski@google.com> Merge commit '303ef0bd1343806adba9b00e39ca05b7c9e50a4f' into manual_merge_303ef0b

Change-Id: I9cfbac32c1a9758860e856bd0cbfa4f9985d6690
ff83745aa575d979c926bcbca56b42ea25c10378 22-Jun-2016 Adam Lesinski <adamlesinski@google.com> Merge \"Prevent energy data overflow\" into nyc-dev
am: 303ef0bd13

Change-Id: Ic6927d8d5b929954b78c616d64332c29b24e55bf
303ef0bd1343806adba9b00e39ca05b7c9e50a4f 22-Jun-2016 Adam Lesinski <adamlesinski@google.com> Merge "Prevent energy data overflow" into nyc-dev
a2eb761dc9c8497f9cd8b365f7c2da9802c6f18c 22-Jun-2016 Ajay Panicker <apanicke@google.com> Fix how file size is calculated if not provided am: 120ba1db4d am: c55f14ae33
am: ad681e8f68

Change-Id: Idfae8cd631078868ac5f8fbba83fc3c26e82b9d0
ad681e8f6882289e0f776789579950b8748ba204 22-Jun-2016 Ajay Panicker <apanicke@google.com> Fix how file size is calculated if not provided am: 120ba1db4d
am: c55f14ae33

Change-Id: I806a2961726309fd78570f1f82b8fb651ed483eb
c91452a0a18b88a84e86e4d2a5e691d19863b20b 22-Jun-2016 Ajay Panicker <apanicke@google.com> Fix how file size is calculated if not provided
am: 120ba1db4d

Change-Id: I240f7fc0955aa6ec9d1e4e18cf217eac2b3aa394
c55f14ae33a170743877b01b34c0c66a71e792fe 22-Jun-2016 Ajay Panicker <apanicke@google.com> Fix how file size is calculated if not provided
am: 120ba1db4d

Change-Id: I891ecc0ba9c66d37ac785df4412a0ab69390026b
120ba1db4d2c8822473ce2e0623297dbf08449a4 21-Jun-2016 Ajay Panicker <apanicke@google.com> Fix how file size is calculated if not provided

Currently if there is no file size provided, InputStream.available()
is used to guess how many bytes are available. According to the
java documentation, available() should not be used to calculate
file sizes, as it isn't guarenteed to return the total number of
bytes in the stream. This is fixed by reading the stream to
calculate the length, then resetting the stream.

Bug: 29334784
Change-Id: Ic851c46d053157e4d5404352d76f9ff87a509607
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppSendFileInfo.java
cca335e2cb94b74d1955f65ca76e80411618f0dc 21-Jun-2016 Adam Lesinski <adamlesinski@google.com> Prevent energy data overflow

- Stores energy data as longs
- Monitors for overflow and logs + discards sample

Bug:27598905
Change-Id: I442c0f63adb5197a45e7982e68f1260c856ed351
tservice/AdapterService.java
8b2711a9c8537df86e73a0d01b9c3f737f29c643 21-Jun-2016 Sanket Agarwal <sanketa@google.com> Remove calls when device gets disconnected

Bug: b/29170324
Change-Id: I4e9ae948801f80d8f22fb737812e1ed403077bff
(cherry picked from commit ee3ef8f68c0c757d7ce3c40c9ecb2fe4671a4b9b)
fpclient/connserv/HfpClientConnectionService.java
7ec95a31b30a586d1b58a892651dee2e80abddad 20-Jun-2016 Sanket Agarwal <sanketa@google.com> 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 3338faa770a4c7e81910da3153cc0e9c22fc4765)
fpclient/connserv/ConnectionKey.java
ccc23af735d97a0aa5b4c20ef4bd91a9cb96d294 17-Jun-2016 Joseph Pirozzo <pirozzoj@google.com> Merge changes from topic 'merge_pbap_from_nyc_car_dev'

* changes:
Owner Card
PBAP Handle IllegalArgumentException
Remove contacts at shutdown.
PBAP check device on disconnect
Bluetooth Connect Other Profiles
PbapClientStateMachine legacyCode removal.
PBAP vcard parser
Connect PbapClient Profile
PBAP Download Contacts in state machine
PBAPClient State Machine
245b6b455e05f49786966c1a13a61baa33e62466 17-Jun-2016 Andre Eisenbach <eisenbach@google.com> Merge \\\\"Fix sender name string to match MAP spec\\\\" am: 6b9c9d4458 am: a2823f7e34 am: e5a4c3b426
am: b10e26581a

Change-Id: Id8ca96ff425c7bdf539cf89c9e2ce4d63f194ae3
0ac9cfe106b82a1c58d859c1fbb0181a654af9b4 04-Jun-2016 Joseph Pirozzo <pirozzoj@google.com> Owner Card

Start phonebook download at card 1 to skip owner card.

bug: 29127941
Change-Id: I1d85cb4a6a372a707081aee7dd4936c83babf888
bapclient/PbapClientConnectionHandler.java
0d4b767f9b815a5d6a12e30860a83f5fa3cf8bbe 09-May-2016 Joseph Pirozzo <pirozzoj@google.com> 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
bapclient/PbapClientStateMachine.java
16159961f4060636b4f778b39ef2d006807fc803 05-May-2016 Joseph Pirozzo <pirozzoj@google.com> Remove contacts at shutdown.

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

bug: 28630194
Change-Id: Ibaec25d6f1f5f5aca4dc00c0437af54d3d534be4
bapclient/PbapClientConnectionHandler.java
bapclient/PbapClientStateMachine.java
9541d943d7ca14b2e154199eaadce67a4bf12704 02-May-2016 Joseph Pirozzo <pirozzoj@google.com> 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
bapclient/PbapClientStateMachine.java
71669e2bfde4f3c76f3f93d9e118793b4eb79dfa 29-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> 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
tservice/AdapterService.java
992274c189ae23ce454fa2136c1b164105006004 28-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> PbapClientStateMachine legacyCode removal.

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

bug: 28249138
Change-Id: I95b362136609a8de033a057578c1b08bd46cced3
bapclient/BluetoothPbapCard.java
bapclient/BluetoothPbapClient.java
bapclient/BluetoothPbapObexAuthenticator.java
bapclient/BluetoothPbapObexSession.java
bapclient/BluetoothPbapRequestPullPhoneBook.java
bapclient/BluetoothPbapRequestPullPhoneBookSize.java
bapclient/BluetoothPbapRequestPullVcardEntry.java
bapclient/BluetoothPbapRequestPullVcardListing.java
bapclient/BluetoothPbapRequestPullVcardListingSize.java
bapclient/BluetoothPbapRequestSetPath.java
bapclient/BluetoothPbapSession.java
bapclient/BluetoothPbapVcardList.java
bapclient/BluetoothPbapVcardListing.java
bapclient/CallLogPullRequest.java
bapclient/ObexAppParameters.java
bapclient/PbapClientConnectionHandler.java
bapclient/PbapHandler.java
bapclient/PbapPCEClient.java
bapclient/PhonebookPullRequest.java
bapclient/utils/BmsgTokenizer.java
bapclient/utils/ObexAppParameters.java
bapclient/utils/ObexTime.java
e14009c22dfce52531f4e34fc1d58a9440539140 27-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> 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
bapclient/PhonebookPullRequest.java
8b0649c5b76fb40fe0acb7772a71fa3ca727c34e 26-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> 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
bapclient/PbapClientConnectionHandler.java
bapclient/PbapClientService.java
bapclient/PbapClientStateMachine.java
8bc55a6586b985f3f9d7a7c796a86fdc47c9b4b8 22-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> 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
bapclient/PbapClientConnectionHandler.java
bapclient/PbapClientService.java
bapclient/PbapClientStateMachine.java
427695a7992c8fc3fb503794bbaff1f705451133 20-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> 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
bapclient/PbapClientConnectionHandler.java
bapclient/PbapClientService.java
bapclient/PbapClientStateMachine.java
bb3dc297c976f4fab23f93f9cae00cd495739ea4 17-May-2016 Sanket Agarwal <sanketa@google.com> 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 893033ca82e75e668d74f496938adc94cd443dea)
fpclient/connserv/ConnectionKey.java
fpclient/connserv/HfpClientConnectionService.java
b10e26581a3309a3b1d41609cd428e372352696b 17-Jun-2016 Ajay Panicker <apanicke@google.com> Merge \\\"Fix sender name string to match MAP spec\\\" am: 6b9c9d4458 am: a2823f7e34
am: e5a4c3b426

Change-Id: I0d8f81867caf7a4c637cbb2a3d1f2fbe4e17980f
a2823f7e3484c3df3a248a39b72fbf20d917c1f7 16-Jun-2016 Ajay Panicker <apanicke@google.com> Merge \"Fix sender name string to match MAP spec\"
am: 6b9c9d4458

Change-Id: I7d528b876ebaf7ed0e048cdd72eb3521c1f1a309
69f86872f09052f9c2ff7f75e87e66134f65c91c 19-Feb-2016 Ajay Panicker <apanicke@google.com> Fix sender name string to match MAP spec

In section 3.1.6 of the Bluetooth MAP spec version
1.2.2, the field name should be "sender_name" instead
of "senderName".

Bug: 26904410
Change-Id: I0dacaf50b0830239d2c2e7e787dc7998f3ed6723
(cherry picked from commit 9a18a9fc4349f90e49d036ccafc91d8b5befe973)
ap/BluetoothMapContentObserver.java
9a18a9fc4349f90e49d036ccafc91d8b5befe973 19-Feb-2016 Ajay Panicker <apanicke@google.com> Fix sender name string to match MAP spec

In section 3.1.6 of the Bluetooth MAP spec version
1.2.2, the field name should be "sender_name" instead
of "senderName".

Bug: 26904410
Change-Id: I0dacaf50b0830239d2c2e7e787dc7998f3ed6723
ap/BluetoothMapContentObserver.java
5829fc6f88b71b60920b7c57ab978c1ef7dcbad3 16-Jun-2016 Jakub Pawlowski <jpawlowski@google.com> Merge \\\\"Fix null callback in updateCurrentMediaControllers\\\\" am: f533643e2b am: ed7ceb136f am: c36b0f6b73
am: 90099d897e

Change-Id: I9672c91aed407c29d570ff9bd5dd4c62252eb680
90099d897ef3480a65224328bd1d3452b519dba0 16-Jun-2016 Jakub Pawlowski <jpawlowski@google.com> Merge \\\"Fix null callback in updateCurrentMediaControllers\\\" am: f533643e2b am: ed7ceb136f
am: c36b0f6b73

Change-Id: I2e0f0909804f2d78de5fc8ad491d3222bfca90e8
ed7ceb136f160ddbcd7f4580e0fa3f990dd22480 16-Jun-2016 Jakub Pawlowski <jpawlowski@google.com> Merge \"Fix null callback in updateCurrentMediaControllers\"
am: f533643e2b

Change-Id: I29edb9f667095e0089f864aaabd5ef0b9090f26e
9d4035307b85e78f10fba961e225ca09bfb7d0c7 16-Jun-2016 Jakub Pawlowski <jpawlowski@google.com> Fix null callback in updateCurrentMediaControllers

Change-Id: I0f134ce147b8a7396c87900fb4770606d53dd765
vrcp/Avrcp.java
4673897018c42f7ebba3ea612a04f1b70deb0e44 16-Jun-2016 Marie Janssen <jamuraa@google.com> Merge \\\\"AVRCP: Handle multiple MediaController instances\\\\" am: d6d2993587 am: 9350175ee7 am: d41eb69025
am: db6af62926

Change-Id: If6e42c8f652afb6c97d81451e925f2ee1b82eaa1
db6af62926e32fe45c1c5752fdea879979a79ac2 16-Jun-2016 Marie Janssen <jamuraa@google.com> Merge \\\"AVRCP: Handle multiple MediaController instances\\\" am: d6d2993587 am: 9350175ee7
am: d41eb69025

Change-Id: I017074a00186c2976fdf23905bf021e5034538b7
9350175ee7be5a27642ee08a2547a64fcfc45a25 16-Jun-2016 Marie Janssen <jamuraa@google.com> Merge \"AVRCP: Handle multiple MediaController instances\"
am: d6d2993587

Change-Id: I3c041a36caaf4ca5ef9d12ee0cc389acab1bfce5
2b903c7262c9b8c0493e36b93b37831e7e075bfc 14-Jun-2016 Marie Janssen <jamuraa@google.com> AVRCP: Handle multiple MediaController instances

Find a MediaController with metadata to show when there are more than
one.

Display more information about the MediaControllers so that we can tell
which packages are being used.

Bug: 29169493
Change-Id: Ifecad6eb44d3461c03685b6650d469721752dfdd
vrcp/Avrcp.java
701e4a335d0521dccd4d21fe760fa8d061bee291 10-Jun-2016 ugo_yu <ugo_yu@htc.com> Mercedes Benz MAP message listing workaround am: 4786e5ffff
am: 7ce25a8991

Change-Id: I714ac47096e6a273f8575029e29f5b1b24055468
7ce25a8991140da037def93d72318cb80afef448 10-Jun-2016 ugo_yu <ugo_yu@htc.com> Mercedes Benz MAP message listing workaround
am: 4786e5ffff

Change-Id: If94acb83525f10cc1868c1f5620a68c40677c11e
4786e5fffff14d92b795084b4470b785de66dfd0 27-May-2016 ugo_yu <ugo_yu@htc.com> Mercedes Benz MAP message listing workaround

Use case:
Sync MAP message to Benz NTG 4.5

Precondition:
1. One of SMS message contains any special characters not ASCII

Steps:
1. Connect with Benz NTG 4.5.
2. Sync SMS message from carkit.

Failure:
Carkit always shows "No Message".

Root Cause:
When this carkit requests the message listing, and any message subject has
non-ASCII special characters in it, the carkit will stop all MAP activity
and stay idle.

Fix:
Strip special characters in the subject tline in message listing
for this carkit.

This change also introduces a Java bases interop database for future
use/expansion.

Bug: 29025011
Change-Id: I4255cbeb068c82f32a68b1022285dfa723e199ec
ap/BluetoothMapMessageListingElement.java
ap/BluetoothMapService.java
til/Interop.java
fc2ae300d5bf5aadee1120ca1e58b67e7f06875c 25-May-2016 Marie Janssen <jamuraa@google.com> Prevent crash on invalid URIs, remove ACTION_OPEN

Previously if an invalid URI for a notification is received
with ACTION_OPEN, Bluetooth crashed. This fixes this.

It also removes ACTION_OPEN as it is internal-only and unused.

Bug: 28940687
Change-Id: I54e17b7180e770bb8a5cf48c3d4b2a35657cb67f
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppReceiver.java
pp/Constants.java
d8c5314d44eaabced47d7ed58c40a7d9313be7b8 08-Jun-2016 Marie Janssen <jamuraa@google.com> resolve merge conflicts of 39957c0 to nyc-dev-plus-aosp am: 4a7ba7568d
am: ec83a6ce89

Change-Id: If5f58c53069532893c0b68965c484fa83e2a103b
ec83a6ce89ed195285292b4a37d2b18022df0f13 08-Jun-2016 Marie Janssen <jamuraa@google.com> resolve merge conflicts of 39957c0 to nyc-dev-plus-aosp
am: 4a7ba7568d

Change-Id: Ibb37d4080261604a57af6a37e147b0ae2cf82473
4a7ba7568de2b00b8d9cdb92137604643fe5d34d 08-Jun-2016 Marie Janssen <jamuraa@google.com> resolve merge conflicts of 39957c0 to nyc-dev-plus-aosp

Change-Id: Ifa06a51ac390cc2b2f7401b65fb6428313a1f6fd
eb7b90f5b93db1230a5b64caa3d8d05a642e33a6 10-May-2016 Marie Janssen <jamuraa@google.com> Cleanup unused requires in java files

Change-Id: I7b055c1d3d3f6a69e9f49c077853ab45fcad7106
bexRejectServer.java
bexServerSockets.java
ignedLongLong.java
2dp/A2dpService.java
2dp/A2dpSinkService.java
2dp/A2dpSinkStateMachine.java
2dp/A2dpStateMachine.java
vrcp/Avrcp.java
vrcp/AvrcpControllerClasses.java
vrcp/AvrcpControllerConstants.java
vrcp/AvrcpControllerService.java
vrcp/NowPlaying.java
vrcp/RemoteMediaPlayers.java
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
tservice/Config.java
tservice/ProfileService.java
tservice/RemoteDevices.java
att/CallbackInfo.java
att/ContextMap.java
att/GattDbElement.java
att/GattService.java
att/ServiceDeclaration.java
dp/HealthService.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
id/HidService.java
ap/BluetoothMapAccountLoader.java
ap/BluetoothMapAppObserver.java
ap/BluetoothMapAppParams.java
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapConvoContactElement.java
ap/BluetoothMapFolderElement.java
ap/BluetoothMapMasInstance.java
ap/BluetoothMapMessageListing.java
ap/BluetoothMapMessageListingElement.java
ap/BluetoothMapSettings.java
ap/BluetoothMapSettingsAdapter.java
ap/BluetoothMapSmsPdu.java
ap/BluetoothMapbMessageEmail.java
ap/MmsFileProvider.java
pp/BluetoothOppBtEnablingActivity.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppNotification.java
pp/BluetoothOppProvider.java
pp/BluetoothOppReceiveFileInfo.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppTransferHistory.java
pp/BluetoothOppUtility.java
an/BluetoothTetheringNetworkFactory.java
an/PanService.java
bap/BluetoothPbapActivity.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
bap/BluetoothPbapVcardManager.java
ap/SapMessage.java
ap/SapRilReceiver.java
ap/SapServer.java
ap/SapService.java
239cf0ec7dd507549817826cb717ee7272de994b 03-Jun-2016 Marie Janssen <jamuraa@google.com> Check exception to prevent crash on invalid URIs am: eacf805631
am: 397d80ad96

* commit '397d80ad96fa265c5c506948665846f9b9fa3d65':
Check exception to prevent crash on invalid URIs

Change-Id: I5b51c507f7c2835d8d00fa7ae7d828d372c42ac5
8c6f71ddc0b760a66f4aef6cc32d3a3538aaf496 03-Jun-2016 Marie Janssen <jamuraa@google.com> Check exception to prevent crash on invalid URIs
am: eacf805631

* commit 'eacf805631c3fb557ba7210dc6da3eb4dd1a04b2':
Check exception to prevent crash on invalid URIs

Change-Id: I0b656810f5165dde186fc80a47eb5c4339ef8a66
397d80ad96fa265c5c506948665846f9b9fa3d65 03-Jun-2016 Marie Janssen <jamuraa@google.com> Check exception to prevent crash on invalid URIs
am: eacf805631

* commit 'eacf805631c3fb557ba7210dc6da3eb4dd1a04b2':
Check exception to prevent crash on invalid URIs

Change-Id: I6c697a50c6078ba89f0f5bd0018ddcf99ef869d2
65f365979876e8355f5f50b9a0b7398f59f9b751 02-Jun-2016 Mudumba Ananth <ananthm%broadcom.com@gtempaccount.com> HFP 1.7 profile update (4/4) am: 2ab50a41da
am: 0ca488af56

* commit '0ca488af56810000261737b86fafda89bf051a20':
HFP 1.7 profile update (4/4)

Change-Id: I379f1c4387207ec63556d81af4e32101f5dcc5ec
0ca488af56810000261737b86fafda89bf051a20 02-Jun-2016 Mudumba Ananth <ananthm%broadcom.com@gtempaccount.com> HFP 1.7 profile update (4/4)
am: 2ab50a41da

* commit '2ab50a41dac634a78cef60a419c3bcc848c1aa78':
HFP 1.7 profile update (4/4)

Change-Id: I8e544dd7e3e68dd6c7c246db675474488aa77be2
2ab50a41dac634a78cef60a419c3bcc848c1aa78 29-Feb-2016 Mudumba Ananth <ananthm%broadcom.com@gtempaccount.com> HFP 1.7 profile update (4/4)

-> Added HF Indicator support.
-> Sent a Broadcast intent upon receiving AT + BIND and
AT + BIEV Events with the required parameters
-> Support for sending +BIND response on indicator
status change

Bug: 19983867
Change-Id: I2580fc771080f1bc92fc4ddd5ca7c7cb57773183
fp/HeadsetHalConstants.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
eacf805631c3fb557ba7210dc6da3eb4dd1a04b2 25-May-2016 Marie Janssen <jamuraa@google.com> Check exception to prevent crash on invalid URIs

Previously if an invalid URI for a notification is received,
Bluetooth crashed.

Bug: 28940687
Change-Id: I54e17b7180e770bb8a5cf48c3d4b2a35657cb67f
pp/BluetoothOppReceiver.java
2a14fd2bbefddd595a9e1cd716f62a333e0f7e06 25-May-2016 Marie Janssen <jamuraa@google.com> Check exception to prevent crash on invalid URIs

Previously if an invalid URI for a notification is received,
Bluetooth crashed.

Bug: 28940687
Change-Id: I54e17b7180e770bb8a5cf48c3d4b2a35657cb67f
pp/BluetoothOppReceiver.java
f99cec85c8a6ff944ccdc56c41176b372a43ecf5 25-May-2016 rongbo.x.chi <rongbo.x.chi@sonymobile.com> Only allow access to MAP if SMS is not supported am: 4d2c98fcf1 am: cd42dafa7b
am: 94c3a2bffa

* commit '94c3a2bffa5f6c0979e95bca7eee95f0d92ae632':
Only allow access to MAP if SMS is not supported

Change-Id: I13d3080a986512776639a95045a383cfcbf95d56
94c3a2bffa5f6c0979e95bca7eee95f0d92ae632 25-May-2016 rongbo.x.chi <rongbo.x.chi@sonymobile.com> Only allow access to MAP if SMS is not supported am: 4d2c98fcf1
am: cd42dafa7b

* commit 'cd42dafa7b46ed7add0705862632fdf70e9e19a9':
Only allow access to MAP if SMS is not supported

Change-Id: I56704c020b97401e63876ca303c7879dcd9e5b58
b1a7dbf860fc3a66113fce83c64fe23aacdd311c 25-May-2016 rongbo.x.chi <rongbo.x.chi@sonymobile.com> Only allow access to MAP if SMS is not supported
am: 4d2c98fcf1

* commit '4d2c98fcf1abc4b07dc2d4601952f30f5d008470':
Only allow access to MAP if SMS is not supported

Change-Id: I33a25eb06427b65297cb72fac7c7325dec0e2067
cd42dafa7b46ed7add0705862632fdf70e9e19a9 25-May-2016 rongbo.x.chi <rongbo.x.chi@sonymobile.com> Only allow access to MAP if SMS is not supported
am: 4d2c98fcf1

* commit '4d2c98fcf1abc4b07dc2d4601952f30f5d008470':
Only allow access to MAP if SMS is not supported

Change-Id: If15223d47b3c56297aa7289d71dc23b18816275a
4d2c98fcf1abc4b07dc2d4601952f30f5d008470 07-Dec-2015 rongbo.x.chi <rongbo.x.chi@sonymobile.com> Only allow access to MAP if SMS is not supported

Bluetooth MAP shows SMS/MMS instance and when SMS is not supported.
Don't create SMS/MMS instance if device does not support SMS.

Fixes: 28803983
Change-Id: I807fe7e10bf51316729fe56ff6181a9161a410ef
ap/BluetoothMapService.java
69689c0098a7582f8bba393f72b2575ed5508e71 25-May-2016 Ajay Panicker <apanicke@google.com> Add guest mode functionality (3/3)
am: af5b1764da

* commit 'af5b1764daa3b212d471f000d7091ac07c040453':
Add guest mode functionality (3/3)

Change-Id: I2591d37bb52e2bda796200100f7f21bf00f55d7a
30a5b9153f8154c72d877a56e57b257dbfa27c50 24-May-2016 Alain Vongsouvanh <alainv@google.com> Merge "GATT: Move connection parameters to config.xml" into nyc-mr1-dev
96d55ca658f111f1c475ccdb8dd83f47bd70d87c 23-May-2016 Pavlin Radoslavov <pavlin@google.com> Removed unnecessary "synchronized" statements

Bug: 28734075
Bug: 28799467
Change-Id: I6ba8867c179dc416bb0dd06c69ce426c10ea7585
(cherry picked from commit e741f05c93343241123095acab011dc8a0700bc6)
tservice/AdapterProperties.java
c4ad06aa8b24fa9e512c52779265efe976b4ecde 24-May-2016 Pavlin Radoslavov <pavlin@google.com> Removed unnecessary "synchronized" statements am: e741f05c93 am: 1566daef82
am: d347cb3df5

* commit 'd347cb3df5429b36db1839939273bcf14eb3399e':
Removed unnecessary "synchronized" statements

Change-Id: If537bf08c6abb180db1c6ae67f29afa4f9a0a47a
d347cb3df5429b36db1839939273bcf14eb3399e 24-May-2016 Pavlin Radoslavov <pavlin@google.com> Removed unnecessary "synchronized" statements am: e741f05c93
am: 1566daef82

* commit '1566daef8262b3df354dc8d856d878ecf0182088':
Removed unnecessary "synchronized" statements

Change-Id: I739b069bde2d56cc9a9f988274affcb3d0d35ad8
1566daef8262b3df354dc8d856d878ecf0182088 24-May-2016 Pavlin Radoslavov <pavlin@google.com> Removed unnecessary "synchronized" statements
am: e741f05c93

* commit 'e741f05c93343241123095acab011dc8a0700bc6':
Removed unnecessary "synchronized" statements

Change-Id: Id0e12a4367d43f056a04ed8d877adbb2b1735424
628d48f52097c2c9656e66849e126d0c6ed0613f 24-May-2016 Pavlin Radoslavov <pavlin@google.com> Removed unnecessary "synchronized" statements
am: e741f05c93

* commit 'e741f05c93343241123095acab011dc8a0700bc6':
Removed unnecessary "synchronized" statements

Change-Id: Id0db840569d83817dbb4a65619f9e63618370354
e741f05c93343241123095acab011dc8a0700bc6 23-May-2016 Pavlin Radoslavov <pavlin@google.com> Removed unnecessary "synchronized" statements

Bug: 28734075
Bug: 28799467
Change-Id: I6ba8867c179dc416bb0dd06c69ce426c10ea7585
tservice/AdapterProperties.java
0ec1e3f37edfebc3336c1554719ed1caa4e4f72b 13-May-2016 Alain Vongsouvanh <alainv@google.com> GATT: Move connection parameters to config.xml

This makes it easier for OEMs to customize the high prioriy, balanced
and low power mode connection parameters through overlays.

Bug: 18013697
Change-Id: I8b486b772fdb871f2800238cb5e45c4ff0663952
(cherry-picked from d65009d591017319a429be1a920fdf763e71cebd)
att/GattService.java
f20b2c49dca6706b6819849c330b8269be2cb737 23-May-2016 venkata Jagadeesh <vjagad@codeaurora.org> Broadcast UUIDS on BT state transition to ON
am: 6fb4b2407f

* commit '6fb4b2407f2ae6d87b1f026870f66d717a915973':
Broadcast UUIDS on BT state transition to ON

Change-Id: Ie3f311eb23193c3da4a5d54e0a956caeaf9a0084
6fb4b2407f2ae6d87b1f026870f66d717a915973 12-Jan-2016 venkata Jagadeesh <vjagad@codeaurora.org> Broadcast UUIDS on BT state transition to ON

Use case: Phone and media connection is not happening
after BT reset during swapping between the HeadSet.

Precondition:
1. WIFI should be on and connected with AP.

Steps:
1. Pair and connect from DUT to PLT legend device.
2. Make an Mobile originated (MO) call.
3. Pair and connect from DUT to sony carkit.
4. Swap connection between PLT legend and sony carkit.
5. During swapping turn OFF BT from DUT.
6. Turn ON DUT and wait for auto connection from DUT.
7. Repeat step from 4-6 10 times.

Failure: Failed to connect with HS.

Root cause:
Broadcarst UUIDS on receiving the on event
from lower layers even though the state is not
transitioned to ON.

Fix:
Broadcast UUIDS on BT state is transitioned to ON
to avoid timing issues related UUIDS.

Bug: 27665220
Change-Id: Ibdbaecd60cf36c599700b1ca353481b8149efa90
tservice/AdapterService.java
tservice/AdapterState.java
tservice/RemoteDevices.java
d492e91facbc0ed85fe873dc031479ede13076ca 21-May-2016 Ajay Panicker <apanicke@google.com> Change scan downgrade timeout from 5 min to 30 min
am: 63d9d9ffbe

* commit '63d9d9ffbec2facf7b90aa552e37168e66c497eb':
Change scan downgrade timeout from 5 min to 30 min

Change-Id: I1d6e11fd61b70f5c2cb69a90671319f1b885e1e0
6b73fa8542f33f16778a0a5fe8470269257c64b4 21-May-2016 Ajay Panicker <apanicke@google.com> Merge "Change scan downgrade timeout from 5 min to 30 min" am: 31c02c5a77 am: b292cb0ad3 am: 35c85dcf75
am: d44d87c9df

* commit 'd44d87c9dffd542efde2a9347bd9a24deabbba9b':
Change scan downgrade timeout from 5 min to 30 min

Change-Id: I2d12b7e6a5487f30e9b0e4d92c17c5a2abae6333
d44d87c9dffd542efde2a9347bd9a24deabbba9b 21-May-2016 Ajay Panicker <apanicke@google.com> Merge "Change scan downgrade timeout from 5 min to 30 min" am: 31c02c5a77 am: b292cb0ad3
am: 35c85dcf75

* commit '35c85dcf7570b7893f548798459d7e2b14719dea':
Change scan downgrade timeout from 5 min to 30 min

Change-Id: I3c356188b29e64c26258b383263b05f715d9a997
35c85dcf7570b7893f548798459d7e2b14719dea 21-May-2016 Ajay Panicker <apanicke@google.com> Merge "Change scan downgrade timeout from 5 min to 30 min" am: 31c02c5a77
am: b292cb0ad3

* commit 'b292cb0ad3070f7ba869d9acc5fe2623d43d9e60':
Change scan downgrade timeout from 5 min to 30 min

Change-Id: I6882ad07b4a67f245d1e8aa76ab9e731a8d70a95
31c02c5a770c0c12becb0856b2c7132470a49939 21-May-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Change scan downgrade timeout from 5 min to 30 min"
63d9d9ffbec2facf7b90aa552e37168e66c497eb 21-May-2016 Ajay Panicker <apanicke@google.com> Change scan downgrade timeout from 5 min to 30 min

Bug: 28824606
Change-Id: Ic4d1f7832aaa33ce0177905f6a64fea8eb048eae
att/ScanManager.java
623b906dcd0e4c0b85db20c67df76b3bb2884e74 21-May-2016 Ajay Panicker <apanicke@google.com> Change scan downgrade timeout from 5 min to 30 min

Bug: 28824606
Change-Id: Ic4d1f7832aaa33ce0177905f6a64fea8eb048eae
att/ScanManager.java
8dda49cf64cc641089e6315ce01d57fc4fa54eb5 20-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix 2 instances of a field being assigned itself in a constructor." into nyc-mr1-dev
4ceb4e23e69a7d6996490dd914302523495e8f12 20-May-2016 Andre Eisenbach <eisenbach@google.com> Merge "Fix 2 instances of a field being assigned itself in a constructor." am: f28ab8051e am: b3ad81b75a am: 7f0b5f759e
am: 807147be5f

* commit '807147be5fe41992366d20f78f8541dc4915c61f':
Fix 2 instances of a field being assigned itself in a constructor.

Change-Id: I6814ad6e1db3e6887edeb4d65061970fb3072987
897433b1bff871dd394a47d9b2d1e75a6ebfa15b 20-May-2016 Ian Rogers <irogers@google.com> Merge "Fix a test related to GATT client that could never succeed" am: 128622ac45 am: e28292e65a am: f7ee3ec9b0
am: f0af239c6e

* commit 'f0af239c6ef6f6d414df72349c426d6c4448d238':
Fix a test related to GATT client that could never succeed

Change-Id: Ieb9d71fd909371915504e6c5e4ceef86db839840
50a3e9c70694358d12afa90cf67b4c371351a8e3 19-May-2016 Ian Rogers <irogers@google.com> Fix a test related to GATT client that could never succeed

Caught by Error Prone:
warning: [CollectionIncompatibleType] Argument 'clientIf' should not be
passed to this method; its type int is not compatible with its
collection's type argument AdvertiseClient.

Bug: 27723540
Change-Id: I395b17a46c3734afd0f49866b7aa0bd0f1c6cef4
(cherry picked from commit c6064ccebc5f55b49628296ce578288b3ad704e1)
att/AdvertiseManager.java
00a378afa5d8de9eadae15ab578baa2058b614ce 16-Mar-2016 Ian Rogers <irogers@google.com> Fix 2 instances of a field being assigned itself in a constructor.

The code had no effect so its safe to remove.
The issue was identified using error prone.

Bug: 27723540

Change-Id: I3803573c545c00e8066ba185c271b38a75bf28c6
(cherry picked from commit 3fc930b1883466cc0e3b35a57519e435426554ee)
att/HandleMap.java
807147be5fe41992366d20f78f8541dc4915c61f 19-May-2016 Ian Rogers <irogers@google.com> Merge "Fix 2 instances of a field being assigned itself in a constructor." am: f28ab8051e am: b3ad81b75a
am: 7f0b5f759e

* commit '7f0b5f759e12c945cc1fbb4f217254c46242ebbe':
Fix 2 instances of a field being assigned itself in a constructor.

Change-Id: I141ae59400cb044d4a9f21ed28148b3499b49da8
f0af239c6ef6f6d414df72349c426d6c4448d238 19-May-2016 Ian Rogers <irogers@google.com> Merge "Fix a test related to GATT client that could never succeed" am: 128622ac45 am: e28292e65a
am: f7ee3ec9b0

* commit 'f7ee3ec9b08dd71ac804e3c40792d179b86f957e':
Fix a test related to GATT client that could never succeed

Change-Id: Ie15f2adebe482f58aa3838181cc2fc86e4d5be12
7f0b5f759e12c945cc1fbb4f217254c46242ebbe 19-May-2016 Andre Eisenbach <eisenbach@google.com> Merge "Fix 2 instances of a field being assigned itself in a constructor." am: f28ab8051e
am: b3ad81b75a

* commit 'b3ad81b75a5c6b3fad86413982f2d0a24fd63d01':
Fix 2 instances of a field being assigned itself in a constructor.

Change-Id: Id39ce8ca220feb0acda18ef455a00ac05a92a9e5
f7ee3ec9b08dd71ac804e3c40792d179b86f957e 19-May-2016 Ian Rogers <irogers@google.com> Merge "Fix a test related to GATT client that could never succeed" am: 128622ac45
am: e28292e65a

* commit 'e28292e65a93c866efc767a88137bfe601b9b3e9':
Fix a test related to GATT client that could never succeed

Change-Id: I443a006993bf575ac1e569fe445b0c4662da6c5a
3fc930b1883466cc0e3b35a57519e435426554ee 16-Mar-2016 Ian Rogers <irogers@google.com> Fix 2 instances of a field being assigned itself in a constructor.

The code had no effect so its safe to remove.
The issue was identified using error prone.

Bug: 27723540

Change-Id: I3803573c545c00e8066ba185c271b38a75bf28c6
att/HandleMap.java
c6064ccebc5f55b49628296ce578288b3ad704e1 19-May-2016 Ian Rogers <irogers@google.com> Fix a test related to GATT client that could never succeed

Caught by Error Prone:
warning: [CollectionIncompatibleType] Argument 'clientIf' should not be
passed to this method; its type int is not compatible with its
collection's type argument AdvertiseClient.

Bug: 27723540
Change-Id: I395b17a46c3734afd0f49866b7aa0bd0f1c6cef4
att/AdvertiseManager.java
1107f28db1c8aaccce3662ab68728754fb0c278f 18-May-2016 Zach Johnson <zachoverflow@google.com> Merge "GATT: Move connection parameters to config.xml" am: 7eb11d6593 am: a85495cfc5 am: 8a128d3f9d
am: bf63b25d06

* commit 'bf63b25d064327cb317e2c1e156754259245f660':
GATT: Move connection parameters to config.xml

Change-Id: Idcbe4326252b8dd18299bcd2f065507a7ffbd0f3
bf63b25d064327cb317e2c1e156754259245f660 18-May-2016 Alain Vongsouvanh <alainv@google.com> Merge "GATT: Move connection parameters to config.xml" am: 7eb11d6593 am: a85495cfc5
am: 8a128d3f9d

* commit '8a128d3f9df2491656a1cb797e6119d871055aff':
GATT: Move connection parameters to config.xml

Change-Id: I42a0bdcfdc3a6092863bb6a2776dc9b9e1f1a709
8a128d3f9df2491656a1cb797e6119d871055aff 18-May-2016 Zach Johnson <zachoverflow@google.com> Merge "GATT: Move connection parameters to config.xml" am: 7eb11d6593
am: a85495cfc5

* commit 'a85495cfc5516ba5c931ebc947994cbd617bdb93':
GATT: Move connection parameters to config.xml

Change-Id: I65e24c1044eb9f6fad8ad71a3dd70d26d88a7292
26f325ad37145b0de56518f63c97319e322c976b 13-May-2016 Alain Vongsouvanh <alainv@google.com> DO NOT MERGE ANYWHERE GATT: Move connection parameters to config.xml

This makes it easier for OEMs to customize the high prioriy, balanced
and low power mode connection parameters through overlays.

Bug: 18013697
Change-Id: I8b486b772fdb871f2800238cb5e45c4ff0663952
(cherry-picked from d65009d591017319a429be1a920fdf763e71cebd)
att/GattService.java
d65009d591017319a429be1a920fdf763e71cebd 13-May-2016 Alain Vongsouvanh <alainv@google.com> GATT: Move connection parameters to config.xml

This makes it easier for OEMs to customize the high prioriy, balanced
and low power mode connection parameters through overlays.

Bug: 18013697
Change-Id: I8b486b772fdb871f2800238cb5e45c4ff0663952
att/GattService.java
e3bfb1dae780e5f081fb68b1a828a7c49c9913e5 17-May-2016 Matadeen Mishra <matade@codeaurora.org> Merge "GATT: Fix FD leak caused by GATT profile" am: 0a689a6645 am: 4ae09f60b6 am: 338f5dc21a
am: 419e85e9ea

* commit '419e85e9eac7e7b62fc54c5f4e9f04132844c7af':
GATT: Fix FD leak caused by GATT profile

Change-Id: Iaed9e403335c108ea02c81ce1541937622ed1728
419e85e9eac7e7b62fc54c5f4e9f04132844c7af 17-May-2016 Matadeen Mishra <matade@codeaurora.org> Merge "GATT: Fix FD leak caused by GATT profile" am: 0a689a6645 am: 4ae09f60b6
am: 338f5dc21a

* commit '338f5dc21ae96b88fd8ac9051e296520bfd48f72':
GATT: Fix FD leak caused by GATT profile

Change-Id: I188be0e15863a327f21153de5708dc2f2bd7327b
338f5dc21ae96b88fd8ac9051e296520bfd48f72 17-May-2016 Matadeen Mishra <matade@codeaurora.org> Merge "GATT: Fix FD leak caused by GATT profile" am: 0a689a6645
am: 4ae09f60b6

* commit '4ae09f60b64da7052a08e52834790fc56ffa7bf6':
GATT: Fix FD leak caused by GATT profile

Change-Id: I71bb1fb45e1411f99c679fa78a86fe6adda563d1
03bd68dfb8b44c4b4f98577d9e71d7b6e354eeb5 17-May-2016 venkata Jagadeesh <vjagad@codeaurora.org> Merge "Broadcast UUIDS on BT state transition to ON" am: 8980266333 am: 30cc572e2b am: cead922da6
am: fc0b0993c3

* commit 'fc0b0993c30286d6c2df788d82534b5a8c3d89f2':
Broadcast UUIDS on BT state transition to ON

Change-Id: Id341a5e46fc4dfd53c78144a0619529e221c61d0
0a689a66458459eb7353e899d20e591a28cc895f 17-May-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "GATT: Fix FD leak caused by GATT profile"
fc0b0993c30286d6c2df788d82534b5a8c3d89f2 17-May-2016 venkata Jagadeesh <vjagad@codeaurora.org> Merge "Broadcast UUIDS on BT state transition to ON" am: 8980266333 am: 30cc572e2b
am: cead922da6

* commit 'cead922da6e8470e9fe7627e2e03b357acd2a6ba':
Broadcast UUIDS on BT state transition to ON

Change-Id: Ia46b2072c0a835a5f14cf6062f6a080da968d412
cead922da6e8470e9fe7627e2e03b357acd2a6ba 17-May-2016 venkata Jagadeesh <vjagad@codeaurora.org> Merge "Broadcast UUIDS on BT state transition to ON" am: 8980266333
am: 30cc572e2b

* commit '30cc572e2b84520bbba1626217ea244db2d81bef':
Broadcast UUIDS on BT state transition to ON

Change-Id: I90244d201d8c36ea56a171804e2048dabf43a4e5
ba73d4b554ff0016d6b11a6102c2a75b5b0c149d 12-Nov-2014 Matadeen Mishra <matade@codeaurora.org> GATT: Fix FD leak caused by GATT profile

Use case: BT ON/OFF with one BLE APP active

Failure: FD leak is observed with ON/OFF stress test
which eventually lead to crash due to unavailability
of FDs.

Steps:
BT ON/OFF with one BLE APP active to retain the
same Bluetooth process ID to check the FD leak issue.

Root Cause: As the Advertisementi manager and Scan
Manager are not cleaning up the looper instances as
part of cleanup, it causes FD leak.

Fix: Cleanup the handler threads in Advertisementmanager
and ScanManager so that there are no resource leaks.

Change-Id: Ia51899f449d57c1ef68a9516b8472d1fd492572b
att/AdvertiseManager.java
att/ScanManager.java
15f5322b5e2b0bb0b43d7363d2b518622fb5447f 17-May-2016 Andre Eisenbach <eisenbach@google.com> Merge "Stop profile services when Bluetooth enable times out" am: c21f27c021 am: 3665bc03f9 am: 6d9014b2ef
am: 08d37b8d41

* commit '08d37b8d4117d7a46e0e0f6e33b3370824323bdb':
Stop profile services when Bluetooth enable times out

Change-Id: I8db419859d039f82c74903fcb888522b60473843
08d37b8d4117d7a46e0e0f6e33b3370824323bdb 17-May-2016 Srinu Jella <sjella@codeaurora.org> Merge "Stop profile services when Bluetooth enable times out" am: c21f27c021 am: 3665bc03f9
am: 6d9014b2ef

* commit '6d9014b2ef8e5e0a3b5c020d556d07c896214251':
Stop profile services when Bluetooth enable times out

Change-Id: I478915eccbeb3314a92500de6f3ba848288cc0ce
6d9014b2ef8e5e0a3b5c020d556d07c896214251 17-May-2016 Andre Eisenbach <eisenbach@google.com> Merge "Stop profile services when Bluetooth enable times out" am: c21f27c021
am: 3665bc03f9

* commit '3665bc03f9eb42d390d9e97325655898cc605ffd':
Stop profile services when Bluetooth enable times out

Change-Id: I14cc19c3fc1b0a09f446f05669b84e6b3b34722e
c050578e447a96272daa7717de0ecf913b94e719 12-Jan-2016 venkata Jagadeesh <vjagad@codeaurora.org> Broadcast UUIDS on BT state transition to ON

Use case: Phone and media connection is not happening
after BT reset during swapping between the HeadSet.

Precondition:
1. WIFI should be on and connected with AP.

Steps:
1. Pair and connect from DUT to PLT legend device.
2. Make an Mobile originated (MO) call.
3. Pair and connect from DUT to sony carkit.
4. Swap connection between PLT legend and sony carkit.
5. During swapping turn OFF BT from DUT.
6. Turn ON DUT and wait for auto connection from DUT.
7. Repeat step from 4-6 10 times.

Failure: Failed to connect with HS.

Root cause: Broadcarst UUIDS on receiving the on event
from lower layers even though the state is not
transitioned to ON.

Fix: Broadcast UUIDS on BT state is transitioned to ON
to avoid timing issues related UUIDS.

Change-Id: Ibdbaecd60cf36c599700b1ca353481b8149efa90
tservice/AdapterService.java
tservice/AdapterState.java
tservice/RemoteDevices.java
4e34b45bdc8cdd1c744e46341419b4f838d82a5a 03-Mar-2016 Srinu Jella <sjella@codeaurora.org> Stop profile services when Bluetooth enable times out

While moving from OFF to BLE_ON state, we are able to switch
BLE_TURNING_ON state which starts the enable_timeout timer. After timing
out we are stopping profiles other than BLE which may still be active
and can send callbacks while clean-up is in process or complete.

Bug: 27678483
Change-Id: I75d88024a60967fb516ebd0941e8e216d00c20f6
tservice/AdapterState.java
8423914b1873debe3b71e15f137315cdd1b4f6d6 12-May-2016 Adam Lesinski <adamlesinski@google.com> Merge "BluetoothManager: Make requestControllerActivityInfo one call" into nyc-dev am: fc57cab5ba am: 7b7b99f938
am: b1c44cf897

* commit 'b1c44cf8975d5b7bde5e9e08bf142d1d522ca2f8':
BluetoothManager: Make requestControllerActivityInfo one call

Change-Id: I16066f4eed70c03d07972cdc518b56a83d080652
b1c44cf8975d5b7bde5e9e08bf142d1d522ca2f8 12-May-2016 Adam Lesinski <adamlesinski@google.com> Merge "BluetoothManager: Make requestControllerActivityInfo one call" into nyc-dev am: fc57cab5ba
am: 7b7b99f938

* commit '7b7b99f938ebd8f0f6bd1309569faaec5690b7b0':
BluetoothManager: Make requestControllerActivityInfo one call

Change-Id: Ie28604777dbb5043ef904641f34c400f84431b5a
7b7b99f938ebd8f0f6bd1309569faaec5690b7b0 12-May-2016 Adam Lesinski <adamlesinski@google.com> Merge "BluetoothManager: Make requestControllerActivityInfo one call" into nyc-dev
am: fc57cab5ba

* commit 'fc57cab5ba191752d0091c808f940fb677bac0ab':
BluetoothManager: Make requestControllerActivityInfo one call

Change-Id: I99a1a7b15e9f8c733abed28daf75692cd56afac9
fc57cab5ba191752d0091c808f940fb677bac0ab 12-May-2016 Adam Lesinski <adamlesinski@google.com> Merge "BluetoothManager: Make requestControllerActivityInfo one call" into nyc-dev
526cdd58546ff747c08cd712a5d4f1953762f6b6 12-May-2016 Harshavardhan Nalajala <hnalajala@nvidia.com> Merge "Correct message length calculation while sending SMS" am: 65f3adbe57 am: 42d14017b0 am: 75a92770b5
am: d13b561ccd

* commit 'd13b561ccdce16acf253196e6645a0057074f8c0':
Correct message length calculation while sending SMS

Change-Id: Idf57aa40ba63598004cc58a348810e835e453947
d13b561ccdce16acf253196e6645a0057074f8c0 12-May-2016 Harshavardhan Nalajala <hnalajala@nvidia.com> Merge "Correct message length calculation while sending SMS" am: 65f3adbe57 am: 42d14017b0
am: 75a92770b5

* commit '75a92770b569c6ad5dc1106669b746572c8e1f60':
Correct message length calculation while sending SMS

Change-Id: I0af74bddc48568995bcbded2b3a2156c368e5781
75a92770b569c6ad5dc1106669b746572c8e1f60 12-May-2016 Harshavardhan Nalajala <hnalajala@nvidia.com> Merge "Correct message length calculation while sending SMS" am: 65f3adbe57
am: 42d14017b0

* commit '42d14017b05650397b6c5133d09b040aa2012e4c':
Correct message length calculation while sending SMS

Change-Id: Ie7299ec9ae3b03fb72b1a35cbc5cfd96d47be6dc
59e88195582b51a719790d7fc8a570d4702e3f62 31-Aug-2015 Harshavardhan Nalajala <hnalajala@nvidia.com> Correct message length calculation while sending SMS

Messages are supposed to be sent with correct
length which is obtained from the "LENGTH:" field
in the line received. Current implementation
is sending a message with invalid length causing
NegativeNumberException when the message is read.

Change-Id: Ieb4239562f8d049ee001ebc547105df44ee70f08
ap/BluetoothMapbMessage.java
f1e73ef7c7ccbcdd9a47bf88313612a71f088372 10-May-2016 Adam Lesinski <adamlesinski@google.com> BluetoothManager: Make requestControllerActivityInfo one call

Instead of making multiple calls into the Bluetooth service,
make one call that can timeout. This helps prevent cases
when the Bluetooth process hangs and the system_server is calling into
it and causes a WATCHDOG restart.

Bug:28658141

Change-Id: I84d2c025f4ffb452975444e794a64c82569deb0a
tservice/AdapterService.java
90630ffc0aea89936fa3a5f79431dee2f62e8c2c 10-May-2016 Ajay Panicker <apanicke@google.com> Merge "Allow scan statistics to be displayed even if app hasn\'t scanned." am: a3a090a40f am: ca85ab538c am: e910ed57b3
am: 73af8f2418

* commit '73af8f2418af29e4a54630f7f9732afc3c65269f':
Allow scan statistics to be displayed even if app hasn't scanned.

Change-Id: I261137efb28755a73b4313410f09a3d24e9f207c
013cca6d0ce90b938880d1abc3a1028d9f08e439 10-May-2016 Chenjie Luo <cjluo@google.com> resolve merge conflicts of 45a85cf to nyc-dev-plus-aosp am: 562547733c
am: d8bbda09aa

* commit 'd8bbda09aa50622d2eae56177fbf58eafd1129ec':
Add missing null pointer check inside HeadSetClientService.stop()

Change-Id: Iaf6478428a8d071a458231b65e07af56b61f49a2
73af8f2418af29e4a54630f7f9732afc3c65269f 10-May-2016 Ajay Panicker <apanicke@google.com> Merge "Allow scan statistics to be displayed even if app hasn\'t scanned." am: a3a090a40f am: ca85ab538c
am: e910ed57b3

* commit 'e910ed57b3e3e6dfb4342ca535cff2c5fb28d41b':
Allow scan statistics to be displayed even if app hasn't scanned.

Change-Id: Ib74fa074f68397ee118deedb31f1846a39deb230
d8bbda09aa50622d2eae56177fbf58eafd1129ec 10-May-2016 Lianchao Song <songlianchao@huawei.com> resolve merge conflicts of 45a85cf to nyc-dev-plus-aosp
am: 562547733c

* commit '562547733c2dd517f3bdd30f29bfe43732fe9a13':
Add missing null pointer check inside HeadSetClientService.stop()

Change-Id: If2957138fda91ce9f8a81074ead715751b315bab
e910ed57b3e3e6dfb4342ca535cff2c5fb28d41b 10-May-2016 Ajay Panicker <apanicke@google.com> Merge "Allow scan statistics to be displayed even if app hasn\'t scanned." am: a3a090a40f
am: ca85ab538c

* commit 'ca85ab538ceb7184420cdd7d3c2a2a278664e95e':
Allow scan statistics to be displayed even if app hasn't scanned.

Change-Id: Ibcfcbaf9cb3af2f73f15b4a3ea105156d0f867dc
562547733c2dd517f3bdd30f29bfe43732fe9a13 10-May-2016 Chenjie Luo <cjluo@google.com> resolve merge conflicts of 45a85cf to nyc-dev-plus-aosp

Change-Id: I0b676ca373047044981d241ea305703354fd01b7
a3a090a40fa97301da43e9d6f5d7bf57f714e802 09-May-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Allow scan statistics to be displayed even if app hasn't scanned."
3fe282a78e8643329c5d6bc84ad5788cd4366b70 09-May-2016 Lianchao Song <songlianchao@huawei.com> DO NOT MERGE ANYWHERE Add missing null pointer check inside HeadSetClientService.stop()

Bug: 28664857

Change-Id: I62abc4eb4127db2d4f0cde44eca618996f099b49
Signed-off-by: Lianchao Song <songlianchao@huawei.com>
fpclient/HeadsetClientService.java
bebc4dd9edb40710d9588b4a2010eef227756a8e 09-May-2016 Lianchao Song <songlianchao@huawei.com> Add missing null pointer check inside HeadSetClientService.stop()

Bug: 28664857

Change-Id: I62abc4eb4127db2d4f0cde44eca618996f099b49
Signed-off-by: Lianchao Song <songlianchao@huawei.com>
fpclient/HeadsetClientService.java
aef39f16e48cbae0ace8136c3235136c0a096061 13-Apr-2016 Ajay Panicker <apanicke@google.com> Add protection against LE scanning abuse

Added two checks to prevent abuse. The first check ensures that an
app doesn't scan too frequently in a certain time period. It is
allowed to scan again after its oldest scan exceedes said time
period. The second check ensures that an app doesn't scan for too
long. Upon starting a scan, this code waits a certain amount of time.
If the app is still scanning by that point, this code stops
the scan and forces the app to use opportunistic scanning instead.

Bug: 27357274
Change-Id: Ic99ac1f838e15ed99fe2fae643ef073d74b5c96b
att/AppScanStats.java
att/GattService.java
att/ScanClient.java
att/ScanManager.java
ba3325bff1f8697c2ac3f8f4190b26fcd8fcc077 09-May-2016 Sanket Agarwal <sanketa@google.com> HfpClientConnectionService does not synchronize state am: a8fc504fed am: ed00b6e3b6
am: d3731ce013

* commit 'd3731ce0135ed9200b12ebbc0e9ff5eefe443a26':
HfpClientConnectionService does not synchronize state

Change-Id: Ia45a74a453df72a9d5160f4ac150f4ce206b05f5
d3731ce0135ed9200b12ebbc0e9ff5eefe443a26 09-May-2016 Sanket Agarwal <sanketa@google.com> HfpClientConnectionService does not synchronize state am: a8fc504fed
am: ed00b6e3b6

* commit 'ed00b6e3b6c67399a7c7601ed97ad6db17448f77':
HfpClientConnectionService does not synchronize state

Change-Id: Id9f71b02e69dc88ab7de40dcb998167fde7b2344
8c7399d2ed67477408685e35e2d4d2957e7a6614 09-May-2016 Sanket Agarwal <sanketa@google.com> HfpClientConnectionService does not synchronize state
am: a8fc504fed

* commit 'a8fc504fed7dcb5dc074980b9d4cfa7a56445424':
HfpClientConnectionService does not synchronize state

Change-Id: I433578eed7e085681b7d124232ee27bd838f427a
c82ac85eacc5607433592f476dbbe73d7670efe1 06-May-2016 Ajay Panicker <apanicke@google.com> Allow scan statistics to be displayed even if app hasn't scanned.

Bug: 28622714
Change-Id: I220d3110346e7d6f67ecfd7468779072d71b5788
att/AppScanStats.java
a8fc504fed7dcb5dc074980b9d4cfa7a56445424 27-Apr-2016 Sanket Agarwal <sanketa@google.com> HfpClientConnectionService does not synchronize state

Currently active device is a synchronizable state and the current
implementation was simply waiving it. Also the mechanism to create a
phone account was invalid since the PhoneAccountHandle was not unique
per device. PhoneAccountHandle not being unique is OK for now but fails
in case of multiple devices.

Bug: b/28068989
Change-Id: I729df5aa110a428b8ce23cf6658d81c5acbc16a2
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/HfpClientConnectionService.java
68c5f8c3e812f9f2053ac597b66b9eca94d508b0 07-May-2016 Ajay Panicker <apanicke@google.com> Merge commit \'98691c26ecdaf8689739966b1aeeaa54f3fd1eb2\' into manual_merge_98691c2 am: e308ed5889
am: 6cf5d90058

* commit '6cf5d900582c7ac2379694a80064ecf162097914':
Add protection against LE scanning abuse

Change-Id: I2af6f78d09648a45f6b9ce8020bf14a7fbf35a5e
6cf5d900582c7ac2379694a80064ecf162097914 07-May-2016 Ajay Panicker <apanicke@google.com> Merge commit \'98691c26ecdaf8689739966b1aeeaa54f3fd1eb2\' into manual_merge_98691c2
am: e308ed5889

* commit 'e308ed5889ddbc6b3fad2f4fd6f2a56ca83c9a2a':
Add protection against LE scanning abuse

Change-Id: Iaf6b9f8668f30318b2256fb1eb239e5bcf92df34
e308ed5889ddbc6b3fad2f4fd6f2a56ca83c9a2a 07-May-2016 Ajay Panicker <apanicke@google.com> Merge commit '98691c26ecdaf8689739966b1aeeaa54f3fd1eb2' into manual_merge_98691c2

Change-Id: I57aeffc87caa6da75773d811eb929d9c2aeca13d
1fdc7c138db776b02bc751fd7a80c519ea3324d1 13-Apr-2016 Ajay Panicker <apanicke@google.com> Add protection against LE scanning abuse

Added two checks to prevent abuse. The first check ensures that an
app doesn't scan too frequently in a certain time period. It is
allowed to scan again after its oldest scan exceedes said time
period. The second check ensures that an app doesn't scan for too
long. Upon starting a scan, this code waits a certain amount of time.
If the app is still scanning by that point, this code stops
the scan and forces the app to use opportunistic scanning instead.

Bug: 27357274
Change-Id: Ic99ac1f838e15ed99fe2fae643ef073d74b5c96b
att/AppScanStats.java
att/GattService.java
att/ScanClient.java
att/ScanManager.java
4c27db43b9fea3e38f73ee5a7ea75c4602b5203c 05-May-2016 Hua Song <shcalm@gmail.com> Merge "OPP: Use addFlags() instead of setFlags() when adding flags to the ACTION_VIEW intent" am: 5df2915a97 am: 01bdd183c2 am: ae215fe26a
am: c4434395b1

* commit 'c4434395b1d9497b64a53cc81cd05be6bef537ab':
OPP: Use addFlags() instead of setFlags() when adding flags to the ACTION_VIEW intent

Change-Id: I34e0b16b0df27b994239c78046b326480c132a53
c4434395b1d9497b64a53cc81cd05be6bef537ab 05-May-2016 Hua Song <shcalm@gmail.com> Merge "OPP: Use addFlags() instead of setFlags() when adding flags to the ACTION_VIEW intent" am: 5df2915a97 am: 01bdd183c2
am: ae215fe26a

* commit 'ae215fe26af65257d3fd0adb345402c4b91d1b34':
OPP: Use addFlags() instead of setFlags() when adding flags to the ACTION_VIEW intent

Change-Id: I6c11788982e850a0cd3f55bd430775f2fe047a31
ae215fe26af65257d3fd0adb345402c4b91d1b34 05-May-2016 Hua Song <shcalm@gmail.com> Merge "OPP: Use addFlags() instead of setFlags() when adding flags to the ACTION_VIEW intent" am: 5df2915a97
am: 01bdd183c2

* commit '01bdd183c2b0bda4814399e94fc967cb1cfe8794':
OPP: Use addFlags() instead of setFlags() when adding flags to the ACTION_VIEW intent

Change-Id: Ib4a753745884510afa83705c9adc281dd6846b51
0fcd081cccbf624a3a886fe4eb68adc3498e695c 25-Apr-2016 Marie Janssen <jamuraa@google.com> AVRCP: Provide more media attributes

Add track number, total tracks, genre, and consolidate MediaAttribute
handling into a single place.

Bug: 28589463

Change-Id: I53049bc2a43c0f30af9639fbc3d6a02cd8a74900
vrcp/Avrcp.java
27b250928cb3401d9a0a3a3f4b2026f1a431b6df 04-May-2016 Ian Rogers <irogers@google.com> Fix divergent equals and hashCode behavior

Calling Objects.hash with a byte[] will call the identity hashCode on the
byte[] (data, data_mask) and this doesn't agree with the use of
Objects.deepEquals in equals.
Bug caught by error prone.

Bug: 27723540
Change-Id: Ic33f9a341165db6c9339321f81f7af63d627a2cb
att/ScanFilterQueue.java
25f4b74d90ee2100fd09e08c1095b5d0abffedd7 05-May-2016 Hua Song <shcalm@gmail.com> OPP: Use addFlags() instead of setFlags() when adding flags to the ACTION_VIEW intent

Signed-off-by: Hua Song <shcalm@gmail.com>
Change-Id: Ie370b1fc599dbb1d8effca409de28e11f0e2b370
pp/BluetoothOppUtility.java
ce22fd622c57809b28db365739fbc688957a8ccf 05-May-2016 Ian Rogers <irogers@google.com> Merge "Fix divergent equals and hashCode behavior" am: c19deeb758 am: 953bc530a3 am: 25c9b7e2a4
am: a05d4b378b

* commit 'a05d4b378b4b384559713c4ef9565cab2901cbe1':
Fix divergent equals and hashCode behavior

Change-Id: Id562e7233725873c37e92d7807e05901ebc948e8
a05d4b378b4b384559713c4ef9565cab2901cbe1 05-May-2016 Ian Rogers <irogers@google.com> Merge "Fix divergent equals and hashCode behavior" am: c19deeb758 am: 953bc530a3
am: 25c9b7e2a4

* commit '25c9b7e2a486df02b462d2b89b674c5098c89e60':
Fix divergent equals and hashCode behavior

Change-Id: I91ab73c2bdad8e65b442782692ebcdc6919324e0
25c9b7e2a486df02b462d2b89b674c5098c89e60 05-May-2016 Ian Rogers <irogers@google.com> Merge "Fix divergent equals and hashCode behavior" am: c19deeb758
am: 953bc530a3

* commit '953bc530a3d16c5e73e95b0abacc56deb241996b':
Fix divergent equals and hashCode behavior

Change-Id: I8e40f7cd8db56d007e1a7f61f1a0f52e56116922
4f6ca743c663912bfd6f2feff20373bd8bb75473 04-May-2016 Ian Rogers <irogers@google.com> Fix divergent equals and hashCode behavior

Calling Objects.hash with a byte[] will call the identity hashCode on the
byte[] (data, data_mask) and this doesn't agree with the use of
Objects.deepEquals in equals.
Bug caught by error prone.

Bug: 27723540
Change-Id: Ic33f9a341165db6c9339321f81f7af63d627a2cb
att/ScanFilterQueue.java
26f1aa589186feb28ae9b846aab15c27a9153c60 05-May-2016 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Provide more media attributes" am: 124563d21a am: f9e644effb am: 1e56607e23
am: 5d5a280697

* commit '5d5a2806979a7216b25f40af820681f8f6fd5b34':
AVRCP: Provide more media attributes

Change-Id: I50f080b5d328d52701676b709163b52f50e7ca7f
5d5a2806979a7216b25f40af820681f8f6fd5b34 05-May-2016 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Provide more media attributes" am: 124563d21a am: f9e644effb
am: 1e56607e23

* commit '1e56607e2310341b96512bacb4e7258d44cbc9fa':
AVRCP: Provide more media attributes

Change-Id: I116e69d06905bac1fb3aaf00bd8ef2780bf3bc9d
1e56607e2310341b96512bacb4e7258d44cbc9fa 05-May-2016 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Provide more media attributes" am: 124563d21a
am: f9e644effb

* commit 'f9e644effb04eda411d453e5691fe699c8a215ca':
AVRCP: Provide more media attributes

Change-Id: I1b69d71566eb6667639d0a10adda6a45a75ab6a2
dd427ab717d90b324475a89f3fdcf9d415c699fd 05-May-2016 Jakub Pawlowski <jpawlowski@google.com> Fix work profile app not being able to create bond am: 11976279d5 am: 29e88d6e4d
am: 740b674bbc

* commit '740b674bbc11e02df9eb228fa3b87e50f965ef58':
Fix work profile app not being able to create bond

Change-Id: I1fb97eff026c7009511fc8f6c7b3a623f4e14174
3b9b0ca02d74a95c3f1f5b0d7bc58a8a1f9c44df 25-Apr-2016 Marie Janssen <jamuraa@google.com> AVRCP: Provide more media attributes

Add track number, total tracks, genre, and consolidate MediaAttribute
handling into a single place.

Bug: 28589463

Change-Id: I53049bc2a43c0f30af9639fbc3d6a02cd8a74900
vrcp/Avrcp.java
740b674bbc11e02df9eb228fa3b87e50f965ef58 05-May-2016 Jakub Pawlowski <jpawlowski@google.com> Fix work profile app not being able to create bond am: 11976279d5
am: 29e88d6e4d

* commit '29e88d6e4d3bd5cc8799f0e769efa826fbda93af':
Fix work profile app not being able to create bond

Change-Id: Icd7d9b8c60e749a788109a7fbd5e665583fc3473
29e88d6e4d3bd5cc8799f0e769efa826fbda93af 05-May-2016 Jakub Pawlowski <jpawlowski@google.com> Fix work profile app not being able to create bond
am: 11976279d5

* commit '11976279d5403fb65d9f0ea72b0e450dfd841958':
Fix work profile app not being able to create bond

Change-Id: I1a94f94aa7f12c1c46cb52f69e37418c792f6b99
11976279d5403fb65d9f0ea72b0e450dfd841958 15-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> Fix work profile app not being able to create bond

Bug: 28153078
Change-Id: I49c020d7d016c667a6cb3366ef862a1eb9dfb4d5
tservice/AdapterService.java
af5b1764daa3b212d471f000d7091ac07c040453 18-Mar-2016 Ajay Panicker <apanicke@google.com> Add guest mode functionality (3/3)

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: If4a8855faf362d7f6de509d7ddc7197d1ac75cee
tservice/AdapterService.java
tservice/AdapterState.java
18332ea94601a34a7866f7b7b27d02af6fa4a330 03-May-2016 Ajay Panicker <apanicke@google.com> Make Bluetooth encryption aware am: cf48e13e3b am: e01b52091b
am: a636a03d7b

* commit 'a636a03d7b5b51ec4f15607c23760b0bbd7ef1a9':
Make Bluetooth encryption aware

Change-Id: Ia6371766b2c55757671ad315765ab3405687843f
a636a03d7b5b51ec4f15607c23760b0bbd7ef1a9 03-May-2016 Ajay Panicker <apanicke@google.com> Make Bluetooth encryption aware am: cf48e13e3b
am: e01b52091b

* commit 'e01b52091b6197202ebba345cf7d230fd298c382':
Make Bluetooth encryption aware

Change-Id: I43f86ff920789938ac143b21a5579b4097c18bcf
e01b52091b6197202ebba345cf7d230fd298c382 03-May-2016 Ajay Panicker <apanicke@google.com> Make Bluetooth encryption aware
am: cf48e13e3b

* commit 'cf48e13e3bcfbc326bf860331d367a6e4524af8d':
Make Bluetooth encryption aware

Change-Id: Ie1a336ece5586f1cd7901cf86c1317a59b5c8683
cf48e13e3bcfbc326bf860331d367a6e4524af8d 12-Apr-2016 Ajay Panicker <apanicke@google.com> Make Bluetooth encryption aware

Allow the Bluetooth application to be bound to before the user
enters their lock pattern. Also move the file used for sharing
text blobs to private storage as that could contain private data.

Bug: 27332939
Change-Id: Iefa15939967afeb34c088957834ad5c35d7fd8fe
pp/BluetoothOppLauncherActivity.java
dd40b31189c0edbab98da3531436d54f30cec90b 26-Apr-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Log permission check failure as warning"
5bac298917ad71f95995eb630d06fca6472974d4 26-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Log permission check failure as warning" into nyc-dev am: 7a94490 am: b6f5bd6
am: 25a36f3

* commit '25a36f32887131383e30046384583a17d283e2c0':
Log permission check failure as warning

Change-Id: I14394ddda6f1b89ed44293fbd8be8d7dd1ba6d17
25a36f32887131383e30046384583a17d283e2c0 26-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Log permission check failure as warning" into nyc-dev am: 7a94490
am: b6f5bd6

* commit 'b6f5bd6970ca3e98b71d8c985aff76d700852da1':
Log permission check failure as warning

Change-Id: Ic419020f67c37609ca0d63280ece4bef62aa3b5e
dba17180bf4e9c25ec87f62dc20ea54a281b5e22 26-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Log permission check failure as warning" into nyc-dev
am: 7a94490

* commit '7a9449022d3ea672b96062df7a16d9259b2a66f0':
Log permission check failure as warning

Change-Id: Iaa81b40dbfc2f4fa7ab265e157d21664cee796ec
7a9449022d3ea672b96062df7a16d9259b2a66f0 26-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Log permission check failure as warning" into nyc-dev
667da1391fc8dcd68be6c86a9947c38dc3229c3f 26-Apr-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Absolute volume: Black list device if remote can\'t change volume" am: 0af237b am: 82e7f6b am: a664da8
am: d04363e

* commit 'd04363e38cd3528330825392e311a007b3efcb60':
Absolute volume: Black list device if remote can't change volume

Change-Id: I6ff9fcdbc9c62de3ed845d93ff16901a09b86bfd
d04363e38cd3528330825392e311a007b3efcb60 26-Apr-2016 Liejun Tao <baibai@motorola.com> Merge "Absolute volume: Black list device if remote can\'t change volume" am: 0af237b am: 82e7f6b
am: a664da8

* commit 'a664da8ab16e09bae6c25d015d13222bc6065c39':
Absolute volume: Black list device if remote can't change volume

Change-Id: I7bdf65a1aa3cad244c29f958fcb25eead1f5b6ed
a664da8ab16e09bae6c25d015d13222bc6065c39 26-Apr-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Absolute volume: Black list device if remote can\'t change volume" am: 0af237b
am: 82e7f6b

* commit '82e7f6b9d8acd290134a1b7b9eaea7077526dd35':
Absolute volume: Black list device if remote can't change volume

Change-Id: I4ae92f84e1915c7b13acd16bfd4015fe1f86b992
2583f09407c8265c12d198d408692c75eabf22a3 09-Mar-2016 Liejun Tao <baibai@motorola.com> Absolute volume: Black list device if remote can't change volume

If remote device failed to change volume too many times, black list it
to avoid using Absolute volume feature.

Bug: 26694114
Change-Id: Idb7a772b0ef936b2351bfc92722ec3c0d748822c
vrcp/Avrcp.java
f8201e1c6bf7fadc0a332151a652325a7f31255a 09-Mar-2016 Liejun Tao <baibai@motorola.com> Absolute volume: Black list device if remote can't change volume

If remote device failed to change volume too many times, black list it
to avoid using Absolute volume feature.

Bug: 26694114
Change-Id: Idb7a772b0ef936b2351bfc92722ec3c0d748822c
vrcp/Avrcp.java
a6ad5869940240d1f40649d9ca23e468f537b065 26-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> Log permission check failure as warning

Currently when permission check fails, there is no way for users to see
what went wrong. This patch fixes that by providing better log message.

Bug: 28328321
Change-Id: I11f336c6c0560c4be482fefefaf95b70a06a63d6
att/GattService.java
039883a2a1ea22308e0255189e390d2c90a5ee80 26-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> Log permission check failure as warning

Currently when permission check fails, there is no way for users to see
what went wrong. This patch fixes that by providing better log message.

Bug: 28328321
Change-Id: I11f336c6c0560c4be482fefefaf95b70a06a63d6
att/GattService.java
ffb10b682610a24d5c54e8828c11276fe5703d65 22-Apr-2016 Sanket Agarwal <sanketa@google.com> 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 faa30bec93650414fb90b60b5a488b32dd54b9ac)
2dpsink/mbs/A2dpMediaBrowserService.java
fpclient/connserv/HfpClientConnectionService.java
e062a53f929cfbb90a81c966f1e1b207510247f3 23-Apr-2016 Ajay Panicker <apanicke@google.com> Merge "Properly label app as unregistered and add NPE protection" into nyc-dev
c26b62d46ad1ce1b956297b5c2f6331391849fa0 23-Apr-2016 Calvin On <con@google.com> Synchronize access to ServiceDeclaration fields. am: f8ecbbb am: 5576218
am: 87d0bef

* commit '87d0bef7b77c31d7031ffd433bb6c7d438ea51e5':
Synchronize access to ServiceDeclaration fields.

Change-Id: I46b300230a47fc96f90719786f7fb51a9d7468a7
87d0bef7b77c31d7031ffd433bb6c7d438ea51e5 22-Apr-2016 Calvin On <con@google.com> Synchronize access to ServiceDeclaration fields. am: f8ecbbb
am: 5576218

* commit '5576218cafb4a39be3d0e70900d05bca5fbfe9a7':
Synchronize access to ServiceDeclaration fields.

Change-Id: Iac5477be509e2395b56888fb3bda2bc64f524517
5576218cafb4a39be3d0e70900d05bca5fbfe9a7 22-Apr-2016 Calvin On <con@google.com> Synchronize access to ServiceDeclaration fields.
am: f8ecbbb

* commit 'f8ecbbb375c6a41895e0144d8d8cd42587891570':
Synchronize access to ServiceDeclaration fields.

Change-Id: Ia0fda64b79de8bfcbe49da005364377b44eda25e
f8ecbbb375c6a41895e0144d8d8cd42587891570 20-Apr-2016 Calvin On <con@google.com> Synchronize access to ServiceDeclaration fields.

ServiceDeclaration objects are accessed by both the binder thread
(addService, addCharacteristic, etc) and the GattService callback thread
(onServiceAdded, etc) and so must be made thread-safe.

Bug: 28201656
Change-Id: Ic2e4b5c21dafceb62f33738b781f908f502f60b3
att/ServiceDeclaration.java
21dddc2daafa0616f4d178979ea84d4e1ffce70b 22-Apr-2016 Marie Janssen <jamuraa@google.com> resolve merge conflicts of ce65d54 to nyc-dev-plus-aosp am: 123e1f3d62
am: 81f1d75f1e

* commit '81f1d75f1e54881c8a5fa59aa4d69d70eae8df78':
AVRCP: Use MediaController

Change-Id: I801cf073752ecc1c78cf6edd82c2f02eeb2fed1f
81f1d75f1e54881c8a5fa59aa4d69d70eae8df78 22-Apr-2016 Marie Janssen <jamuraa@google.com> resolve merge conflicts of ce65d54 to nyc-dev-plus-aosp
am: 123e1f3d62

* commit '123e1f3d6252cb5505efaeaffd74c1f3895587df':
AVRCP: Use MediaController

Change-Id: Ie9c1227cf82e53801b0255a890bafa4d2d8a01f6
b37b80b24a26a697d302583c900c5e9237acb03a 20-Apr-2016 Ajay Panicker <apanicke@google.com> Properly label app as unregistered and add NPE protection

Bug: 28252914
Change-Id: I1e28a9af96bcf0d56914fcc676a8ff85400bc1c4
att/AppScanStats.java
att/ContextMap.java
123e1f3d6252cb5505efaeaffd74c1f3895587df 22-Apr-2016 Marie Janssen <jamuraa@google.com> resolve merge conflicts of ce65d54 to nyc-dev-plus-aosp

Change-Id: Icce0b121a472fda7d49ff00eb70f73a53ce62b1d
c57daee55d3cc561f26a64b958b6f664ad755b13 22-Apr-2016 Marie Janssen <jamuraa@google.com> AVRCP: Use MediaController am: 2fc493d0ea am: 739879c469
am: 5b1a73761b

* commit '5b1a73761bd09c16c211080b88e5ef9e26e1d123':
AVRCP: Use MediaController

Change-Id: I8d1a3f02a65142615373fa19d124c17b6bf6e8c0
5b1a73761bd09c16c211080b88e5ef9e26e1d123 22-Apr-2016 Marie Janssen <jamuraa@google.com> AVRCP: Use MediaController am: 2fc493d0ea
am: 739879c469

* commit '739879c4695ee6c3ee9ae6e306f091dc1a8bf011':
AVRCP: Use MediaController

Change-Id: Iaabaae1b5a583e4bc158efeb5762ab60997399c2
739879c4695ee6c3ee9ae6e306f091dc1a8bf011 22-Apr-2016 Marie Janssen <jamuraa@google.com> AVRCP: Use MediaController
am: 2fc493d0ea

* commit '2fc493d0ea2b504df25d783a488dfadfe301329e':
AVRCP: Use MediaController

Change-Id: I217d39edb9051fa400183317a9c7de66e8b9a2de
2fc493d0ea2b504df25d783a488dfadfe301329e 19-Apr-2016 Marie Janssen <jamuraa@google.com> AVRCP: Use MediaController

RemoteController has been depreciated since M.
MediaController lets us track a lot more things and update data as the
state of audio changes.

This also should fix some bugs related to metadata display not happening
on startup / track change / app change.

Bug: 27178384
Bug: 27745277
Bug: 26837775
Bug: 27534794
Bug: 27153373
Change-Id: I246d9641a5e921ed4434495f5c2dfac67d568952
vrcp/Avrcp.java
0e949676c5097e1f259caa2e549ecedf0c09269d 19-Apr-2016 Marie Janssen <jamuraa@google.com> AVRCP: Use MediaController

RemoteController has been depreciated since M.
MediaController lets us track a lot more things and update data as the
state of audio changes. We track and log some of these changes for bug
followup.

This also should fix some bugs related to metadata display not happening
on startup / track change / app change.

Bug: 27178384
Bug: 27745277
Bug: 26837775
Bug: 27534794
Bug: 27153373
Change-Id: I246d9641a5e921ed4434495f5c2dfac67d568952
vrcp/Avrcp.java
c8c74e5d4db70be47b01cc2cbdec8898d3d6677d 22-Apr-2016 Ajay Panicker <apanicke@google.com> Merge "Properly label app as unregistered and add NPE protection" am: d4a672f597 am: 73122688c6 am: e2ef4d1782
am: fba808f27e

* commit 'fba808f27e41eb172d519b39a546254f08229647':
Properly label app as unregistered and add NPE protection

Change-Id: I67995695b805f01de8487929f779268c94649667
fba808f27e41eb172d519b39a546254f08229647 21-Apr-2016 Ajay Panicker <apanicke@google.com> Merge "Properly label app as unregistered and add NPE protection" am: d4a672f597 am: 73122688c6
am: e2ef4d1782

* commit 'e2ef4d17825129779ab46105af66a4a805c5e7df':
Properly label app as unregistered and add NPE protection

Change-Id: Id43f76d7e42f2e91bd3ebd7bce43863724ab596d
e2ef4d17825129779ab46105af66a4a805c5e7df 21-Apr-2016 Ajay Panicker <apanicke@google.com> Merge "Properly label app as unregistered and add NPE protection" am: d4a672f597
am: 73122688c6

* commit '73122688c60586956205665d43748da430bef95e':
Properly label app as unregistered and add NPE protection

Change-Id: Ib46783b7eba4a7c359970b6369e0c6aa4eb3c506
a511ea0b7aa7978784b2aa545fe4062869024680 21-Apr-2016 Seven Shen <lingtongshen@gmail.com> "DO NOT MERGE" Add write SMS protection
am: 60e306ba5c

* commit '60e306ba5c132d5408ccae3a290e7cace020a49f':
"DO NOT MERGE" Add write SMS protection

Change-Id: I095cdaa7bd2674003f2fea3779fcce180af1f5f0
f939f71f1a2a21a89e82acf23154c73af5bea1f7 15-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> Fix work profile app not being able to create bond

Bug: 28153078
Change-Id: I49c020d7d016c667a6cb3366ef862a1eb9dfb4d5
tservice/AdapterService.java
57a102e5548a7a395bcd7feec3c1df6d61be8187 20-Apr-2016 Sanket Agarwal <sanketa@google.com> 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 52297bafb15107ef66b7edeb1879df28b26e5cc9)
fpclient/connserv/HfpClientConnection.java
a86ae2ce4305fb0af5522b3f46513b137e98836f 20-Apr-2016 Ajay Panicker <apanicke@google.com> Properly label app as unregistered and add NPE protection

Bug: 28252914
Change-Id: I1e28a9af96bcf0d56914fcc676a8ff85400bc1c4
att/AppScanStats.java
att/ContextMap.java
60e306ba5c132d5408ccae3a290e7cace020a49f 06-Apr-2016 Seven Shen <lingtongshen@gmail.com> "DO NOT MERGE" Add write SMS protection

Bug: 25138326
Change-Id: I9f418370b8725d49e3734406b6f435107bcff021
ap/BluetoothMapService.java
59fc7cf9a4e2c7f518833e03a38e77002d9d5665 20-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Replace NOT_SUPPORTED string constants with empty strings."
3558402aae35c6b01c505be012d6736b0c758802 18-Mar-2016 Ajay Panicker <apanicke@google.com> Add guest mode functionality (1/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: If4a8855faf362d7f6de509d7ddc7197d1ac75cee
tservice/AdapterService.java
tservice/AdapterState.java
599ce082b1b7bd5311ab31b4a3102f85bd1c7c4a 20-Apr-2016 Ajay Panicker <apanicke@google.com> Merge "Add guest mode functionality (1/4)" am: fae54a8 am: 35d1580 am: 6265c0e
am: 7ace4f3

* commit '7ace4f320fcef8259b5ad5dca8f431b90faa6dee':
Add guest mode functionality (1/4)

Change-Id: Ie8b07de696d80d83ce5622e0d78b2e14533ad65c
6265c0e229c7a5ac9143c100c4d654142043d145 19-Apr-2016 Ajay Panicker <apanicke@google.com> Merge "Add guest mode functionality (1/4)" am: fae54a8
am: 35d1580

* commit '35d1580a975dc5e9b3d4a7c987e30eb7ab1763be':
Add guest mode functionality (1/4)

Change-Id: I0d91fba1ca24c0868f6372cd811ba998bed2d190
b90c26765772a8cf5cf20c86a89dc24490cb1ccd 19-Apr-2016 Seven Shen <lingtongshen@gmail.com> "DO NOT MERGE" Add write SMS protection am: 64745b1 am: 9accc36
am: 6c32c81

* commit '6c32c815bfbe1058791c6dbee0a98c6b30792963':
"DO NOT MERGE" Add write SMS protection

Change-Id: I4cca8e8ac4b4659ce7dc28264ccd39a53d68098c
6c32c815bfbe1058791c6dbee0a98c6b30792963 19-Apr-2016 Seven Shen <lingtongshen@gmail.com> "DO NOT MERGE" Add write SMS protection am: 64745b1
am: 9accc36

* commit '9accc36b1a6a9779d31ea6edcc861a69167d37e5':
"DO NOT MERGE" Add write SMS protection

Change-Id: Id5bc27d73ed66c9f12ecf94ec2ef1dc727a6b5c4
9accc36b1a6a9779d31ea6edcc861a69167d37e5 19-Apr-2016 Seven Shen <lingtongshen@gmail.com> "DO NOT MERGE" Add write SMS protection
am: 64745b1

* commit '64745b114948ea0c774f74af5721b6283087247d':
"DO NOT MERGE" Add write SMS protection

Change-Id: Idb905753e4e4d711b11b7d5274e622df4e9c4251
e2c4671a8c5d01f053b5b8e0c728d69d561abdc2 15-Apr-2016 Marie Janssen <jamuraa@google.com> AVRCP: Don't assume 0:00 on metadata change

When changing between apps, and changing between songs, the Media
framework sends us the position data before the metadata, so
setting it to 0 wipes out our position.

Fixes: 27745277
Change-Id: I2d309df424c8889928da9601b367d488bba89919
vrcp/Avrcp.java
a525ff9f10b2ee0cee3269ab6082ddf09441199d 18-Apr-2016 Sanket Agarwal <sanketa@google.com> 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 00a113ff764ac9ae8517f54d79d917302ebf243b)
vrcp/AvrcpControllerClasses.java
vrcp/AvrcpControllerConstants.java
bapclient/PbapClientService.java
688344c5ed34758c1e96a1dec9212e10107a7263 19-Apr-2016 Sanket Agarwal <sanketa@google.com> A2dpSink sends CONNECTED instead of DISCONNECTED when connection
timeout

When a timeout happens for an outgoing A2DP Sink connection we are (most
likely a typo) sending a CONNECTED instead of DISCONNECTED event. This
confuses the UI and shows it as connected instead of disconnected.

Change-Id: I2fc5a9df86781b45e5c5ff9368a7c49c6c910294
(cherry picked from commit 996bedb82d33c56e1f1c24986c56c166afc9c77a)
2dpsink/A2dpSinkStateMachine.java
336e77eb762a8e80e41177c9e7a988c4400afc3d 19-Apr-2016 Adam Lesinski <adamlesinski@google.com> Merge "Implement new async response method for controller activity info" into nyc-dev am: 049173d am: ef1772a
am: d5537ef

* commit 'd5537ef83ed5b9d9783b802742f0fd5f10b73839':
Implement new async response method for controller activity info

Change-Id: I9c4d4ece75c56cd0bbdbdca8328fec65bc031920
ef1772ab9862e830067d91dc5c806f9fde4c0750 19-Apr-2016 Adam Lesinski <adamlesinski@google.com> Merge "Implement new async response method for controller activity info" into nyc-dev
am: 049173d

* commit '049173d572891011cc01f675d8bd0227ef55e381':
Implement new async response method for controller activity info

Change-Id: Iae86ab380cd053b3bcb678b858b5877d8900b40c
049173d572891011cc01f675d8bd0227ef55e381 19-Apr-2016 Adam Lesinski <adamlesinski@google.com> Merge "Implement new async response method for controller activity info" into nyc-dev
c63ef51ba5f9d355239959bcfe8803987adb1f38 18-Mar-2016 Ajay Panicker <apanicke@google.com> Add guest mode functionality (1/4)

Add a flag to enable() to start Bluetooth in restricted
mode. In restricted mode, all devices that are paired during
restricted mode are deleted upon leaving restricted mode.
Right now restricted mode is only entered while a guest
user is active.

Bug: 27410683
Change-Id: I561225652509b29ac6b0d194a3a50e29c5569365
tservice/AdapterService.java
tservice/AdapterState.java
3259e36c6541d38b5c6f051983dcb5dff1ff773c 16-Apr-2016 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Don\'t assume 0:00 on metadata change" am: b81be7b am: bd7e0bf
am: 322c601

* commit '322c6019a835508b668b55618b7fd8e17309fe86':
AVRCP: Don't assume 0:00 on metadata change

Change-Id: I50fee858953e16dde4764074c94a43b4d4505755
322c6019a835508b668b55618b7fd8e17309fe86 16-Apr-2016 Marie Janssen <jamuraa@google.com> Merge "AVRCP: Don\'t assume 0:00 on metadata change" am: b81be7b
am: bd7e0bf

* commit 'bd7e0bf92708a8da7166fa521b80ee830cc1f7aa':
AVRCP: Don't assume 0:00 on metadata change

Change-Id: If5b201739fbb6656b5d25930334c2af94d667531
1f8651b5ddeb19604bd178890d3429438dac8e5e 15-Apr-2016 Marie Janssen <jamuraa@google.com> AVRCP: Don't assume 0:00 on metadata change

When changing between apps, and changing between songs, the Media
framework sends us the position data before the metadata, so
setting it to 0 wipes out our position.

Fixes: 27745277
Change-Id: I2d309df424c8889928da9601b367d488bba89919
vrcp/Avrcp.java
5086accf9944ba92bf43f69e4651d8c87bfa913c 16-Apr-2016 Sanket Agarwal <sanketa@google.com> Handle all kinds of focuses and make fault tolerant to phone calls. am: bacd337
am: 9d925df

* commit '9d925df92e98d88695b5129ce0b257f6095e4a39':
Handle all kinds of focuses and make fault tolerant to phone calls.

Change-Id: I063dce2933e55846d131eb590d83df3f1125c234
9d925df92e98d88695b5129ce0b257f6095e4a39 16-Apr-2016 Sanket Agarwal <sanketa@google.com> Handle all kinds of focuses and make fault tolerant to phone calls.
am: bacd337

* commit 'bacd3374a5b2c2193e45aac0eafb8cc39762d9f5':
Handle all kinds of focuses and make fault tolerant to phone calls.

Change-Id: Ia5ba035536cfe8953fb7b6efc959ef06565c31b6
bacd3374a5b2c2193e45aac0eafb8cc39762d9f5 07-Apr-2016 Sanket Agarwal <sanketa@google.com> 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
2dpsink/A2dpSinkStateMachine.java
2dpsink/A2dpSinkStreamingStateMachine.java
fpclient/connserv/HfpClientConnection.java
aa218437c511755ac69f37e93753fcf289984f70 11-Apr-2016 Adam Lesinski <adamlesinski@google.com> Implement new async response method for controller activity info

Bug:26842468
Change-Id: I35e6bd6996d408aa2c8ccda754d5b2f05bcb8056
tservice/AdapterService.java
2975c2192f6c52d8c5fc678a97efe2c023490f3d 15-Apr-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Add a missing null-pointer check in HeadsetService.stop()" am: 7f0f52c am: 2144045
am: bad5778

* commit 'bad5778c63dd81b2465b52ada102c74ba069b4dd':
Add a missing null-pointer check in HeadsetService.stop()

Change-Id: Iecb00c70319413a3002e1d8a9177b63865fe85f7
bad5778c63dd81b2465b52ada102c74ba069b4dd 15-Apr-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Add a missing null-pointer check in HeadsetService.stop()" am: 7f0f52c
am: 2144045

* commit '214404558c638733aee9aec5a8481522ecaca86c':
Add a missing null-pointer check in HeadsetService.stop()

Change-Id: Ib80cb345580c497ae6352b80d299bb915c29c4d7
1b09c8cd4fa10c3f0918cb1e24bdd2fd60aeec88 15-Apr-2016 Pavlin Radoslavov <pavlin@google.com> Add a missing null-pointer check in HeadsetService.stop()

Bug: 27678483

Change-Id: I288b905d6b3f827a94365d512305cd29e186f3d4
fp/HeadsetService.java
bf12c61e7def530edebc12844f6a37f1299c60a8 15-Apr-2016 Pavlin Radoslavov <pavlin@google.com> Add a missing null-pointer check in HeadsetService.stop()

Bug: 27678483

Change-Id: I288b905d6b3f827a94365d512305cd29e186f3d4
fp/HeadsetService.java
c1b48cf21758e627fb9738a176fb1aae36c27c65 26-Mar-2016 Victor Chan <victorchan@google.com> 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
2dpsink/mbs/A2dpMediaBrowserService.java
cfe27c30d1c63cc537aaf1a9a8c721536b2b792f 13-Apr-2016 Calvin On <con@google.com> Fix PEERS_MAC_ADDRESS permission for Ble Scanning.

This changes the location permissions check to only throw a SecurityException
if *both* location and peers mac address permissions are missing.

Bug: 27837639
Change-Id: I5e10c8f0564d1f7edab23ad22dbd5aa5fdcbbf76
tils.java
62ee66fe433b8614171057c10b27a071170aace2 13-Apr-2016 Calvin On <con@google.com> Fix PEERS_MAC_ADDRESS permission for Ble Scanning.
am: e041e1b

* commit 'e041e1b073d81516073223da4aef23e91cc823e7':
Fix PEERS_MAC_ADDRESS permission for Ble Scanning.

Change-Id: Ice6b8e751576badddcd814b8d9139af5d0ba387e
e041e1b073d81516073223da4aef23e91cc823e7 13-Apr-2016 Calvin On <con@google.com> Fix PEERS_MAC_ADDRESS permission for Ble Scanning.

This changes the location permissions check to only throw a SecurityException
if *both* location and peers mac address permissions are missing.

Bug: 27837639
Change-Id: I5e10c8f0564d1f7edab23ad22dbd5aa5fdcbbf76
tils.java
64745b114948ea0c774f74af5721b6283087247d 06-Apr-2016 Seven Shen <lingtongshen@gmail.com> "DO NOT MERGE" Add write SMS protection

Bug: 25138326
Change-Id: I9f418370b8725d49e3734406b6f435107bcff021
ap/BluetoothMapService.java
7b3ca8223e55fa86b7abcb9163345168946fce07 08-Apr-2016 Sanket Agarwal <sanketa@google.com> Bluetooth streaming should wait for AVRCP to start.
am: f3db7dc

* commit 'f3db7dcf88a585d133f73b8579012f8217965728':
Bluetooth streaming should wait for AVRCP to start.

Change-Id: Id4a786f6b41e123d3bf4560fe21b8727d630cacd
f3db7dcf88a585d133f73b8579012f8217965728 07-Apr-2016 Sanket Agarwal <sanketa@google.com> Bluetooth streaming should wait for AVRCP to start.

Currently we are waiting for A2DP to come up before we can start
streaming. This is not ideal since unless AVRCP comes up we cannot show
the UI reliably. That said, for compatibility with devices only having
A2DP we will need to modify this code. For now the A2DP SNK is only
supposed to work with AVRCP TG implementation on the remote.

Bug: b/27744764
Change-Id: I972cf94f5b276d9b0e08315175ae605ccfe6a423
2dpsink/mbs/A2dpMediaBrowserService.java
e60e6ded4e8f4d9b123b6feb1fcfb6dfa246ce44 07-Apr-2016 Marie Janssen <jamuraa@google.com> Merge "Enable logging for AVRCP Metadata changes" am: 5faf9f0
am: 353e820

* commit '353e820f5b64e26ea2b57ea997073e7616b55ad9':
Enable logging for AVRCP Metadata changes

Change-Id: I9cf01a6ac27e6939c43a3d577ec5ad1213379f45
65e7943d098113c5aa56e9822b68f0c51c6dbe36 05-Apr-2016 Marie Janssen <jamuraa@google.com> Enable logging for AVRCP Metadata changes

We're seeing a lot of AVRCP metadata issues, so enable some logging of
metadata in hopes of collecting more information.

Bug: 26837775
Bug: 27153373
Bug: 27178384
Bug: 27745277
Change-Id: Ie425ad2a5e090aa4363dab6b853479eeda35cef6
vrcp/Avrcp.java
c1124a7c6679f612b80926a19084655f9a71580a 05-Apr-2016 Marie Janssen <jamuraa@google.com> Enable logging for AVRCP Metadata changes

We're seeing a lot of AVRCP metadata issues, so enable some logging of
metadata in hopes of collecting more information.

Bug: 26837775
Bug: 27153373
Bug: 27178384
Bug: 27745277
Change-Id: Ie425ad2a5e090aa4363dab6b853479eeda35cef6
vrcp/Avrcp.java
f6f74322ced5c6fb4681c2a1cb42c66f8c82c774 05-Apr-2016 Ajay Panicker <apanicke@google.com> Fix name collected for scan initiator

Private information was being collected for the scan statistics.

Bug: 27996307
Change-Id: Idab438967f80f86f4f92e7f03cc5787f8d54e8a1
att/AppScanStats.java
5358335885818c026f9d7d8a60cda4b80ae96ee8 06-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> Make PBAP PCE (Client) role auto-connectable.
am: 3c75851

* commit '3c75851b93fe42d7d4650adc6a5d680c6f43eb42':
Make PBAP PCE (Client) role auto-connectable.

Change-Id: I759a1d25b65ee4f9dfe73e3c839d64e60a0ce206
3c75851b93fe42d7d4650adc6a5d680c6f43eb42 05-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> Make PBAP PCE (Client) role auto-connectable.

Set the default flag to enable contact sharing from Car Kit by default
like the other autoconnect profiles.

Bug: 27977457
Change-Id: Ibbd09ea93ff402193e8a03ba77148dea9417a488
tservice/AdapterService.java
83c1c42e24d440cbeeaca2c36e8e7a4dd4d9b4a6 06-Apr-2016 Ajay Panicker <apanicke@google.com> Merge "Fix name collected for scan initiator" am: ca4d161
am: 033bfdb

* commit '033bfdb04dbd5b6ad81421c9707c4dfe1e17e2d0':
Fix name collected for scan initiator

Change-Id: I94dbd95910ba84109dcf418561b05b185563e460
3d69ae195b8d3918958ea703a188cc77e511da6c 05-Apr-2016 Ajay Panicker <apanicke@google.com> Fix name collected for scan initiator

Private information was being collected for the scan statistics.

Bug: 27996307
Change-Id: Idab438967f80f86f4f92e7f03cc5787f8d54e8a1
att/AppScanStats.java
a5c4fec36081826e09a6bb368e85523a5e13d5ed 06-Apr-2016 Sanket Agarwal <sanketa@google.com> Merge commit '92870384369a8a5345bfe868b97d2d384f433103' into manual_merge_9287038

Change-Id: I7696c00ff3787104caeeb22d7225e2ba665fa7f6
92870384369a8a5345bfe868b97d2d384f433103 31-Mar-2016 Sanket Agarwal <sanketa@google.com> Move MediaBrowserService to Bluetooth Process

MediaBrowserService exports A2DP streaming features to the rest of stack
using the MediaBrowser API. Currently it was being stareted by
BOOT_COMPLETE which made it start very late. Also that meant that some
of the broadcasts for the connection events is lost. Now it is started
by the A2DP state machine so that we do not miss any state changes.

Bug: 27744764
Change-Id: I193b4adfea09cbd90e41f1a217383b6aa234ef2b
2dp/A2dpSinkService.java
2dp/A2dpSinkStateMachine.java
2dp/A2dpSinkStreamingStateMachine.java
2dpsink/A2dpSinkService.java
2dpsink/A2dpSinkStateMachine.java
2dpsink/A2dpSinkStreamingStateMachine.java
2dpsink/mbs/A2dpMediaBrowserService.java
vrcp/AvrcpControllerService.java
tservice/AdapterService.java
tservice/Config.java
c473ba2b2f5c8cad8c7f08f4a5d69594261bb736 23-Mar-2016 Ajay Panicker <apanicke@google.com> Add GATT server scan stats and extra protection

Bug: 27811549
Change-Id: I9138193f8e0dec4e548c57b635bad3703961088f
att/GattService.java
7169fd06211df36a3b5c0fd09364b17eaed00b4b 04-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> Autoconnect Car Profiles
am: 79b693f

* commit '79b693f44a0508d2a794635f0ec3bd84f8f5ede0':
Autoconnect Car Profiles

Change-Id: Ib739cd394017f58f4e54925d9eb67138f8d4b7ab
79b693f44a0508d2a794635f0ec3bd84f8f5ede0 02-Apr-2016 Joseph Pirozzo <pirozzoj@google.com> Autoconnect Car Profiles

Update profiles used in Car to enable and require PRIORITY_AUTO_CONNECT
to automatically connect when Adapter turns on.

Bug: 27899874
Change-Id: I33bf7cabe959b47954e3aced2af8a5ce8444b9ad
tservice/AdapterService.java
bapclient/PbapClientService.java
bapclient/PbapPCEClient.java
62a730f79420bc4f335a520331ac31f314fda445 26-Mar-2016 Sharvil Nanavati <sharvil@google.com> Fix NPE when performing BLE scans.

Bug: 27811549
Change-Id: I017b34745682dd9db5487921df5c01dfde93d67c
att/ContextMap.java
5beb5d65e7fda236bc1c24be807c14a3b096beae 30-Mar-2016 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP client priority settings." into nyc-dev
am: af98f39

* commit 'af98f39707768b300b29f552e29ec644e8f75dcd':
PBAP client priority settings.

Change-Id: I9c66454b97308b3bf6296e9ec45620dd5a4a17f3
af98f39707768b300b29f552e29ec644e8f75dcd 30-Mar-2016 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP client priority settings." into nyc-dev
403fca1b0ccbdbbbe2ef7ee2ed2d8496a0ec2306 26-Mar-2016 Joseph Pirozzo <pirozzoj@google.com> PBAP client priority settings.

Implement get/setPriority for PbapClient such that the settings dialog
and connect at startup work appropriately.

Bug: 27642222
Change-Id: I9c02d4d08809c6cc4230c71031d880b3d09f0cc4
tservice/AdapterService.java
bapclient/PbapClientService.java
bapclient/PbapPCEClient.java
f924b023dbe14a1183ca9d9688c38406e8717381 30-Mar-2016 Pavlin Radoslavov <pavlin@google.com> Add a missing null check inside A2dpService.resetAvrcpBlacklist()

Add a missing null pointer check inside method
A2dpService.resetAvrcpBlacklist()

Also:
- Removed BondStateMachine.setProfilePriority() because it is
not used.
- Fix a typo "priorty" -> "priority"
- Fix a log message.

Bug: 27837879
Change-Id: Ieabf00d2ff1e49aa06598674f14e97eb9086d432
2dp/A2dpService.java
tservice/BondStateMachine.java
f0fb7365544801a9c6b82163651533e9dcbeb586 30-Mar-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Add a missing null check inside A2dpService.resetAvrcpBlacklist()" am: 855104e
am: c9dfd16

* commit 'c9dfd167f599715f737c31b00ce0e15485c224d9':
Add a missing null check inside A2dpService.resetAvrcpBlacklist()

Change-Id: I7cd2bada2064d23984b7986efb0288b10e6879c8
ff495eca3027c9b3aa7d8ef4e9cfd2cde3bbb664 30-Mar-2016 Pavlin Radoslavov <pavlin@google.com> Add a missing null check inside A2dpService.resetAvrcpBlacklist()

Add a missing null pointer check inside method
A2dpService.resetAvrcpBlacklist()

Also:
- Removed BondStateMachine.setProfilePriority() because it is
not used.
- Fix a typo "priorty" -> "priority"
- Fix a log message.

Bug: 27837879
Change-Id: Ieabf00d2ff1e49aa06598674f14e97eb9086d432
2dp/A2dpService.java
tservice/BondStateMachine.java
10311829fa54ed7cfa3048357e5248c460be7494 29-Mar-2016 Ajay Panicker <apanicke@google.com> Merge "Add GATT server scan stats and extra protection" am: 4e8da47
am: 25f233e

* commit '25f233ebea0ec6cb46835d7c95185ddc6e980611':
Add GATT server scan stats and extra protection

Change-Id: Ida1ee11b2e57e38c3bd097c57b045bd30c3a5f23
62c17211ad512abcc64ad8e5173e80b580c8f59d 23-Mar-2016 Ajay Panicker <apanicke@google.com> Add GATT server scan stats and extra protection

Bug: 27811549
Change-Id: I9138193f8e0dec4e548c57b635bad3703961088f
att/GattService.java
e9fbe54ee33433860cd902c0f2b62aa86113f5a3 29-Mar-2016 Ajay Panicker <apanicke@google.com> Revert "Add guest mode functionality (1/5)"
am: fa08821

* commit 'fa0882174bb9479e307b6faea1d1c0f174d38f43':
Revert "Add guest mode functionality (1/5)"
e1f79a46e33b17fe07617e22964ca7e1b3859455 29-Mar-2016 Ajay Panicker <apanicke@google.com> Add guest mode functionality (1/5)
am: 6e2c4a1

* commit '6e2c4a130d93e448decc67991690fd8d1f83a343':
Add guest mode functionality (1/5)
fa0882174bb9479e307b6faea1d1c0f174d38f43 28-Mar-2016 Ajay Panicker <apanicke@google.com> Revert "Add guest mode functionality (1/5)"

This reverts commit 6e2c4a130d93e448decc67991690fd8d1f83a343.

Change-Id: Iae9ecfc53a4e405bc04d21822a79112f7dc63247
tservice/AdapterService.java
tservice/AdapterState.java
6e2c4a130d93e448decc67991690fd8d1f83a343 18-Mar-2016 Ajay Panicker <apanicke@google.com> Add guest mode functionality (1/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: I561225652509b29ac6b0d194a3a50e29c5569365
tservice/AdapterService.java
tservice/AdapterState.java
44058414f6508fc7c731b2993b92bb84d137b749 28-Mar-2016 Andre Eisenbach <eisenbach@google.com> Merge changes from topic \'pts-test-fix-sync-20160335-1\' into nyc-dev
am: 4afd6b9

* commit '4afd6b9c12b0cfa753b388b9eaace86692b4fc2f': (22 commits)
Fix more merge issues in BluetoothPbapVcardManager.java
PBAPS: Don't filter out DateTime when requested
PBAPS: Fix duplicate entries fetched from database
PBAPS: Get vcard when asked in alphabetical order
PBAPS: Enable contact search with full or part of given string
SAP: Fix ANR(s) in SAP server code
SAP: Remove sdp record while BT is being turned off to prevent leak
SAP: Fix issue of socket listener not getting re-started
SAP: Update UI connection and notifications properly
SAP: Handle disconnect request during call ongoing state
OPP: Update share status when interrupted at remote side.
OPP: Use long instead of int
MAP: Fix ANR for blocking operations on UI thread
MAP: Track ProfileState, register and unregister of BroadcastReceivers
MAP: CleanUp for SDP record in MAP Service shutdown
MAP: GETMessagesLisitng include mandatory field always.
MAP: Cleanup PendingIntent in cancelUserTimeoutAlarm.
MAP: Handle possible NPE while disconnect map.
MAP: Add MNS SDP Search during setNotificationRegistration.
MAP: Declare and fetch only 'INTERESTED_MESSAGE_TYPE_CLAUSE' MMS.
...
4afd6b9c12b0cfa753b388b9eaace86692b4fc2f 28-Mar-2016 Andre Eisenbach <eisenbach@google.com> Merge changes from topic 'pts-test-fix-sync-20160335-1' into nyc-dev

* changes:
Fix more merge issues in BluetoothPbapVcardManager.java
PBAPS: Don't filter out DateTime when requested
PBAPS: Fix duplicate entries fetched from database
PBAPS: Get vcard when asked in alphabetical order
PBAPS: Enable contact search with full or part of given string
SAP: Fix ANR(s) in SAP server code
SAP: Remove sdp record while BT is being turned off to prevent leak
SAP: Fix issue of socket listener not getting re-started
SAP: Update UI connection and notifications properly
SAP: Handle disconnect request during call ongoing state
OPP: Update share status when interrupted at remote side.
OPP: Use long instead of int
MAP: Fix ANR for blocking operations on UI thread
MAP: Track ProfileState, register and unregister of BroadcastReceivers
MAP: CleanUp for SDP record in MAP Service shutdown
MAP: GETMessagesLisitng include mandatory field always.
MAP: Cleanup PendingIntent in cancelUserTimeoutAlarm.
MAP: Handle possible NPE while disconnect map.
MAP: Add MNS SDP Search during setNotificationRegistration.
MAP: Declare and fetch only 'INTERESTED_MESSAGE_TYPE_CLAUSE' MMS.
MAP: Synchronize notifcationReg reply and MNS connect action.
Send error for if VR is initiated during call.
c92a17a7e1788d304b0762c795fd277a0c8d8cd8 26-Mar-2016 Sharvil Nanavati <sharvil@google.com> Fix NPE when performing BLE scans.
am: 2a6d08a

* commit '2a6d08a87c210918a0ad5b4c01bb5152cce2ba69':
Fix NPE when performing BLE scans.
2a6d08a87c210918a0ad5b4c01bb5152cce2ba69 26-Mar-2016 Sharvil Nanavati <sharvil@google.com> Fix NPE when performing BLE scans.

Bug: 27811549
Change-Id: I017b34745682dd9db5487921df5c01dfde93d67c
att/ContextMap.java
c438463431b171a67b22b50886ef8dd737c44004 25-Mar-2016 Andre Eisenbach <eisenbach@google.com> Fix more merge issues in BluetoothPbapVcardManager.java

Change-Id: I901042e69b3beea93684fe1a194353664fabd0c2
bap/BluetoothPbapVcardManager.java
5211519fa7617f3e34b214264f59157db9f495aa 14-Aug-2015 Smriti Gupta <smritig@qti.qualcomm.com> PBAPS: Don't filter out DateTime when requested

This only adds a special exception for DateTime,
the other "X-" fields are already filtered out since
for vcard 2.1, it is mandatory to provide DateTime
if requested by remote.

Change-Id: Ib25a9b085d5692548156068b9700e2b007c4bcee
bap/BluetoothPbapVcardManager.java
6a50944dff2081fc161974cfae7d85d834b123cf 30-Nov-2015 Smriti Gupta <smritig@codeaurora.org> PBAPS: Fix duplicate entries fetched from database

Precondition
================
Have multple contacts with either same number or name in DUT

Steps to reproduce:
===================
1. Perform BT pairing from DUT->RD<1>
2. Search for name from remote.

Expected Result:
================
Single entry with the name should be returned

Actual Result:
==============
Single name entry with different numbers are duplicating

Fix
========
This patch will remove the duplicate entries having same handle
and name fetched from the database sometimes. The check was
there in the stock code but that was not sufficient and was
comparing with the previous value only if these are duplicates
and not with the whole list. I have updated this check to
compare the fetched value if the exact duplicate value
(same ID and NAME) is present in the final list of contacts
which is to be returned.

Change-Id: If32526076baed813d39ce298c307196b63bc46fd
bap/BluetoothPbapVcardManager.java
3c8b50f8dc1c4ce11168fb42a884f604d1810c46 23-Nov-2015 Hemant Gupta <hemantg@codeaurora.org> PBAPS: Get vcard when asked in alphabetical order

Precondition:
=============
- PSE should have atleast 40 contacts with all alphabetical permutations

Step by Step procedure:
=======================
1. Establish PBAP session. Navigate to "Browse" Tab
2. Select telecom/pb.vcf on remote device and select "SETPHONEBOOK"
3. Select "Get Size" from remote device
4. Select default sorting, maxlistcount = 5000 and click "Search" to
browse phonebook
5. Select "Alphabetical" sorting, maxlistcount = 5000 and click "Search"
to browse phonebook

Actual Result
============================
After alphabetical sorting the contacts are displayed according to index
but not with sorted request

Expected result:
=========================
When contacts are sorted according to alphabets the contact info should
also be displayed according to contacts.

Root Cause:
========================
While quering vcard entry from database, proper checks of the order (indexed/alphabetical)
was not there in M Stock code compared to L Stock code.

Change-Id: Ie7990992b4dd22add3526aa0050121e680567bb8
bap/BluetoothPbapVcardManager.java
c3a43ae7d1f54495fb4d830d08386aee75e0e997 07-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> PBAPS: Enable contact search with full or part of given string

Enables searching of text in contact name starting with a given
matching string instead of matching the complete string.

Change-Id: I91258391b7b7cb014d55e17e1ed3b92267a2c7da
bap/BluetoothPbapObexServer.java
71a7019b7ae6809085ba1ae8de74e3d3b1f83513 06-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> SAP: Fix ANR(s) in SAP server code

Fix ANR in SAP Server code in following scenarios:

- Multiple call to stop in Sapservice leads to ANR, as check was not
present in stop to prevent unregistering BroadcastReceiver if not
already registred.
- Remove redundant call to closeServerSocket from initSocket as this could
lead to ANR when there is simultaneous call to closeService as part of BT
being switched off and call to start SAP as part of BT being turned on when
BT on off sequence is tried repeatedly.

Change-Id: Ia6bc5ca7c9da9ae4a4c12e8207fb9ff6b9159e82
ap/SapService.java
e7142c9e7dc0e01b10b1186c74463cda0d124742 06-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> SAP: Remove sdp record while BT is being turned off to prevent leak

Remove sdp record created dynamically for SAP server during BT off state.
Without this call, there is leak in sdp layer in stack as sdp record is
never removed, even though the socket is closed.
Also proper checks are added to prevent call to remove sdp record when
adapter is null.

Change-Id: I739cc3115f6cd7fedf9085e8522c96da257e9568
ap/SapService.java
df7a2ae3b9728b62562e6b98321c8715b43d722f 07-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> SAP: Fix issue of socket listener not getting re-started

Add logic to properly handle ACL_DISCONNECTED to restart socketListener
to handle scenarios where socket listener was not getting started due to
abnormal ACL disconnect.

Change-Id: Iac5ec52f485e692b14bb0065e30a68cae007a49d
ap/SapService.java
9d3697e063a63830cc3ea3a28d4708bb225a3df7 07-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> SAP: Update UI connection and notifications properly

Update connection state to upper layers only when SAP SLC is connected
i.e. status indication is sent to SAP Client.
Also notification to disconnect SAP Server from UI is shown only when SAP
is successfully connected, and not when SapServer object is created.

Change-Id: Iaf40584220b51f6193bed9a54d159cffd32698e9
ap/SapServer.java
ap/SapService.java
8b8c62f5118d1ecd63356808587768b175a71e1f 07-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> SAP: Handle disconnect request during call ongoing state

Handle disconnect request during call ongoing state properly.
Previously if disconnect was received from SAP client while in
call ongoing state, it was not handled properly, leading to
Server not sending the DISCONNECT response thereby violating
Bluetooth SAP Specification.

Change-Id: I666fab4b4513abfa00df4be5b3a7aab95d5f0331
ap/SapServer.java
8c7fcbf3f2564724f82e954a959081ff5d46a1bb 11-Sep-2015 Hemant Gupta <hemantg@codeaurora.org> OPP: Update share status when interrupted at remote side.

Use case:
1) Select a file on DUT and send to Remote device through OPP
2) Accept the incoming file on Remote
3) While file transfer is in progress, stop the file transfer on Remote.
4) Again send the same file or different file to the same Remote Device.

Result:
OPP file transfer does not start.

Fix:
Update interrupted outbound content resolver entry when
Transfer is stopped at remote side. Otherwise DUT fails
To push OPP file after earlier OPP file is stopped on
Remote Device.

Change-Id: I9944bdd47ff9e31d0f9f8a157592e407e000e96c
pp/BluetoothOppObexClientSession.java
5f10fd1ef7709ce6c89414ad732831b6759b982a 10-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> OPP: Use long instead of int

Use long instead of int data type in OPP Java code to prevent
overflow of timestamp and filesize during transfer of large files
which caused transfer failures.

Change-Id: I58c9b49f59d47f6f162156eb6594e66731732580
pp/BluetoothOppService.java
pp/BluetoothOppShareInfo.java
1ff5a0a6b42eff4c5728f0327440c127f8d3bb1c 11-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Fix ANR for blocking operations on UI thread

UseCase:
Stability Testing steps followed:
1. Pair and connect with remote phone.
2. Verify successful profile connection.
3. Pair & Connect LE device.
4. Disconnect & Unpair LE device.
5. Reset BT multiple times.
6. Repeat above steps 50 times

Failure:
ANR(s) reported for long running operations perfromed on main thread.

Fix:
- Attach MAPService session handler to looper from a
worker thread to avoid long running tasks handling
for messages posted from UI thread.

- Move AppObserver Account onChange() handling
to worker thread instead of UI thread.

- Avoid running contentobserver for SMS/MMS instance on
main thread looper to fix ANR reported while handling
content changes for SMS and MMS listing. Add NPE checks
hit during stability testing.

Change-Id: Ie146cd284fd191f7c7be7f0c1e7ed4877b36ae76
ap/BluetoothMapAppObserver.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapService.java
5cd7c89d0e17a9176337a36a27792bab3dd76fe9 10-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Track ProfileState, register and unregister of BroadcastReceivers

Use Case:
1. Pair and connect with remote phone.
2. Verify successful profile connection.
3. Pair & Connect LE device.
4. Disconnect & Unpair LE device.
5. Reset BT multiple times.
6. Repeat above steps 50 times

Failure:
BT Crashed, failed to start MAP services after BT reset.

RootCause:
BT Crash for not handling following exceptions:

- java.lang.IllegalArgumentException: Receiver not registered
at: android.app.IntentReceiverLeaked: Service
com.android.bluetooth.map.BluetoothMapService
has leaked IntentReceiver com.android.bluetooth.map.BluetoothMapAppObserver:
Are you missing a call to unregisterReceiver()?

Fix:
- This issue is hit when onStop() for MAPService is triggered without onStart()
being triggered by the time shutdown process gets invoked.
- Track registration and unregistration for BluetoothMapAppObserver BroadcastReceiver
to fix IntentReceiver leaks and also added validation for the AppObserver Data.

Change-Id: Ia1c2160fef369bbff42e8da3ea7d925c483e0a12
ap/BluetoothMapAppObserver.java
ap/BluetoothMapService.java
0ce2b96bbb55ab21037168fa4912375e063b5e9a 10-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: CleanUp for SDP record in MAP Service shutdown

Remove SDP record per MAS Instance during MAP Service
shutdown procedure.
Add more relevant debug logging.

Change-Id: I222ad97d719b9a2c45db3ab8526dd3de9c553f3d
ap/BluetoothMapMasInstance.java
c3b54d78578345cca88f3694ec7735593fed13fe 11-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: GETMessagesLisitng include mandatory field always.

Pre condition:
Atleast one SMS is present in any of the folders
with no subject.

UseCase:
1. Connect MAP connection from MCE to DUT
2. Set folder to Telecom/msg/inbox
3. Execute MessageListing with the required data

Failure:
Mandatory field "subject" is not included for few entries
in messagesListing.

Fix:
For GETMessagesLisitng ensure blank subject string is
set to include this mandatory feild and handle possible
"null" value fetched from database.

Change-Id: Ie29a61c83b22db9008184090a2f5b17d1f34b72b
ap/BluetoothMapContent.java
0f67816e838489474a0c3c57a8d856f6d51ba45f 07-Jan-2016 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Cleanup PendingIntent in cancelUserTimeoutAlarm.

Handle cleanup for timeout Intent and pending Intent
in cancelUserTimeoutAlarm API.

Change-Id: I4f4184785675b2deffa3be8c9dd70b2673020b51
ap/BluetoothMapService.java
1682d51711c917a440be14a600eb8ab89ad36f61 27-Oct-2015 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Handle possible NPE while disconnect map.

Precondition:
Verified with IOT: MecApp in MCE role

UseCase:
1. Connect MAS
2. Register Mas Instance via MNS
3. Disconnect MAS

Failure:
Bluetooth App crash sometimes when disconnect map profile.

Root Cause:
The issue is hit when MAS disconnect is finished before MNS unregister.
In this case NullpointerException is happening because of clearing
BluetoothMapContentObserver already as a part of cleanup.

Fix:
Handle Null pointer exception while last
MAS instance disconnect is handled before MNS
unregistration.

Change-Id: I4e72038a5ddc6c3ac8c515def57cb4f98fe87675
ap/BluetoothMapService.java
fc8dfd1e037cda063919d9160c9cdb604b9adfef 10-Sep-2015 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Add MNS SDP Search during setNotificationRegistration.

Precondition:
Verified with remote MCE device that starts MNS server
only before issuing setNotification Registration to MSE.

Use Case:
1. Discover and Pair with MSE from MCE.
2. Connect to MSE on Mas insance 0.
3. Enable Notification Registration for MAS Instance 0

Failure:
MNS connection happens over RFCOMM
and MAS Instance is connected over L2CAP.

Root Cause:
Current design performs MNS SDP search only at the time
of successful MAS Instance Connect. MNS connect implementation
tries connection over insecure RFCOMM channel based on UUID
when MNS Server record is not available.

Fix:
Add implementation to check and perform MNS SDP search
if this info is not available when MCE requests
setNotificationRegistration. This fix is required to
handle MCE implementation that start MNS Sever and
expose SDP only before sending setNotificationRegistration.

Change-Id: If1e8d33dcac078f04d13b8bacf8e1d1513c119e1
ap/BluetoothMapContentObserver.java
ap/BluetoothMapMasInstance.java
ap/BluetoothMapService.java
ap/BluetoothMnsObexClient.java
86b9ddefbcc4e1abb4a3054bff3cb6a2a88f5966 22-Dec-2015 Hemant Gupta <hemantg@codeaurora.org> MAP: Declare and fetch only 'INTERESTED_MESSAGE_TYPE_CLAUSE' MMS.

Precondition:

Messaging App Settings configured to receive delivery reports for MMS.

Use Case:
Follow standard steps to perform messagesListing type MMS from MCE.
1. Connect to MSE on Mas instance 0.
2. Set Path to root.
3. Set Path to telecom.
4. Set Path to msg.
5. Set Path to inbox.
6. GET messagesListing type MMS.

Failure:
Extra entries like delivery reports that are stored in DB and
which are not user interested types are also included
in MSE messageListing for MMS type.

Fix:
OMA-TS-MMS-ENC MMS Standard defines many types in X-Mms-Message-Type.
Extra entries like delivery reports which is stored in DB are not
required to be shown to user, so these should be filtered, and
only m-send-req (128), m-retrieve-conf (132), m-notification-ind (130)
types should be fetched and shown to user in messageListing response.
This patch removes these unecessary message types from MMS Messaging Listing.

Change-Id: I1cb5d6e58477a32a89693f555a268e0855267b9a
ap/BluetoothMapContent.java
2dd6813dc36bff3bbb6c81f61b5321b0269673fb 21-Sep-2015 Hemant Gupta <hemantg@codeaurora.org> MAP: Synchronize notifcationReg reply and MNS connect action.

Use Case:
1. Connect to carkit
2. Disconnect connection with carkit.
3. Reconnect to carkit

Failure:
MNS Failure during Reconnection.
User will in some timing conditions not get notification
of new messages and then turns OFF/ON the carkit.
MAS is connected fine but for MNS car sends BAD REQUEST.

Root Cause:
This isssue is reported only with one particular carkit in MCE role,
where in MNS Connect request issued before acknowleding
the setNotificationReg Request.

Fix:
Synchronize handleRegistration method in handler thread to ensure
setNotificationReg response from MSE is sent before requesting
a MNS Connect to MCE.

Change-Id: I30559c643af7733754fce551b97e31543a0cb160
ap/BluetoothMapAccountLoader.java
ap/BluetoothMnsObexClient.java
73a94f90b838e767edd8a425353c159e02f6d4ee 28-Jan-2016 Satish Kodishala <skodisha@codeaurora.org> Send error for if VR is initiated during call.

Use case:
Connect to BT headset.
Make a call. Let the call audio be on BT headset.
Initiate voice recognition(VR) from BT headset.

Failure:
AG is not sending error for VR when initiated during call.
Headset might go into bad state if AG don't send error.

Rootcause:
AG is not sending error for VR when initiated during call.

Fix:
When VR is activated during call, send error response to headset.

Change-Id: Ib12d464fc6a6948ddf22250a65a9e5bfeb4a8fb1
fp/HeadsetStateMachine.java
8cadeab1bada7993f1c2ac83dee991a0741e4aa5 23-Mar-2016 Andre Eisenbach <eisenbach@google.com> Fixed merge error in BluetoothPbapVcardManager.java

Change-Id: Idf60aae9a94527479e3cc9c9552fc19ec15a396c
bap/BluetoothPbapVcardManager.java
6d40286e787c781579999354721c49cb5d0e6fb7 23-Mar-2016 Smriti Gupta <smritig@qti.qualcomm.com> Merge "PBAPS: Don\'t filter out DateTime when requested"
am: 57a0f6d

* commit '57a0f6de8be75aeab2c314b2b71a9b7056d6a1fd':
PBAPS: Don't filter out DateTime when requested
103f9712f63e0e2a5c3fef5bf0b98cfe77c3dc81 23-Mar-2016 Ajay Panicker <apanicke@google.com> Remove duplicate scan event definitions

Change-Id: I94c9e308101a56438212fc0305202ed719579d84
(cherry picked from commit 5bd9ecab4094b4873359463dc21af30410f3d448)
att/GattService.java
9acaa72b63ab65373effae8e684f503006148f71 23-Mar-2016 Andre Eisenbach <eisenbach@google.com> Merge "resolve merge conflicts of c90db0f to nyc-dev-plus-aosp" into nyc-dev-plus-aosp
2f07b366ba0e42f37029e2ba79913fc5ea1a340b 23-Mar-2016 Ajay Panicker <apanicke@google.com> Add scan results to scan stats
am: e90db93

* commit 'e90db937c008f365f47e7199d6d86f9eb13bed1e':
Add scan results to scan stats
65f15bb051c1e0898a9cd2053f41f26c600a96fc 23-Mar-2016 Andre Eisenbach <eisenbach@google.com> resolve merge conflicts of c90db0f to nyc-dev-plus-aosp

Change-Id: Id0969c26659549c31f2947bede8c55bf7d366688
e90db937c008f365f47e7199d6d86f9eb13bed1e 09-Mar-2016 Ajay Panicker <apanicke@google.com> Add scan results to scan stats

Ex:
GATT Client Map
Entries: 1

no.nordicsemi.android.mcp
LE scans (started/stopped) : 3 / 3
Scan time in ms (min/max/avg/total): 3050 / 6901 / 4815 / 14447
Total number of results : 338
Last 3 scans :
1970/01/01 08:20:06 - 6901ms 0 results
1970/01/01 08:20:13 - 4496ms 171 results
1970/01/01 08:20:39 - 3050ms 167 results

Bug: 27294154
Change-Id: I32fd6da035f2c37302a105733ac6a9817547b7a3
att/AppScanStats.java
att/ContextMap.java
att/GattService.java
cd03335b0e429a1851d84d238408eb6712c5f755 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "PBAPS: Enable contact search with full or part of given string"
am: 4cece2c

* commit '4cece2cfd1350ba525cb7058e7f80eee01cb2d0b':
PBAPS: Enable contact search with full or part of given string
09d367bdaeab9b64f1fa0b9c7465179872de6faf 14-Aug-2015 Smriti Gupta <smritig@qti.qualcomm.com> PBAPS: Don't filter out DateTime when requested

This only adds a special exception for DateTime,
the other "X-" fields are already filtered out since
for vcard 2.1, it is mandatory to provide DateTime
if requested by remote.

Change-Id: Ib25a9b085d5692548156068b9700e2b007c4bcee
bap/BluetoothPbapVcardManager.java
8c87f7204c1366928f1c6f68e72053f6566a0a88 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "SAP: Fix ANR(s) in SAP server code"
am: 2f224e9

* commit '2f224e914e86bec65acd61ed2baadd2dea972ab0':
SAP: Fix ANR(s) in SAP server code
d799e680c488c802ccad4b3eb23df525a5f86b44 30-Nov-2015 Smriti Gupta <smritig@codeaurora.org> PBAPS: Fix duplicate entries fetched from database

Precondition
================
Have multple contacts with either same number or name in DUT

Steps to reproduce:
===================
1. Perform BT pairing from DUT->RD<1>
2. Search for name from remote.

Expected Result:
================
Single entry with the name should be returned

Actual Result:
==============
Single name entry with different numbers are duplicating

Fix
========
This patch will remove the duplicate entries having same handle
and name fetched from the database sometimes. The check was
there in the stock code but that was not sufficient and was
comparing with the previous value only if these are duplicates
and not with the whole list. I have updated this check to
compare the fetched value if the exact duplicate value
(same ID and NAME) is present in the final list of contacts
which is to be returned.

Change-Id: If32526076baed813d39ce298c307196b63bc46fd
bap/BluetoothPbapVcardManager.java
584d5b4b50936552a6b662ab5a0b910c49e65a9d 23-Nov-2015 Hemant Gupta <hemantg@codeaurora.org> PBAPS: Get vcard when asked in alphabetical order

Precondition:
=============
- PSE should have atleast 40 contacts with all alphabetical permutations

Step by Step procedure:
=======================
1. Establish PBAP session. Navigate to "Browse" Tab
2. Select telecom/pb.vcf on remote device and select "SETPHONEBOOK"
3. Select "Get Size" from remote device
4. Select default sorting, maxlistcount = 5000 and click "Search" to
browse phonebook
5. Select "Alphabetical" sorting, maxlistcount = 5000 and click "Search"
to browse phonebook

Actual Result
============================
After alphabetical sorting the contacts are displayed according to index
but not with sorted request

Expected result:
=========================
When contacts are sorted according to alphabets the contact info should
also be displayed according to contacts.

Root Cause:
========================
While quering vcard entry from database, proper checks of the order (indexed/alphabetical)
was not there in M Stock code compared to L Stock code.

Change-Id: Ie7990992b4dd22add3526aa0050121e680567bb8
bap/BluetoothPbapVcardManager.java
d5438b4bd3bdb1c1adae319540e01b288d0c768c 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "SAP: Remove sdp record while BT is being turned off to prevent leak"
am: a51595c

* commit 'a51595cc0ea0b9d5e050b77e90fd4cdec512dc56':
SAP: Remove sdp record while BT is being turned off to prevent leak
47bb76e9b56df50c5de6cb14e02a9d2e12941e9e 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "SAP: Fix issue of socket listener not getting re-started"
am: 8731128

* commit '8731128aa44e55278412647d60979a0643f32479':
SAP: Fix issue of socket listener not getting re-started
497613a155981294e5b30cc766f3cd4f2597fea8 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "SAP: Update UI connection and notifications properly"
am: 61f1405

* commit '61f1405379888a6a3c6380e834243be4fd215f54':
SAP: Update UI connection and notifications properly
43b159084b4cdd0da8355b766c5c10fea4e12535 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "SAP: Handle disconnect request during call ongoing state"
am: 02be62d

* commit '02be62dd6c903bb5fd6043a055cecee3ddbb2c3d':
SAP: Handle disconnect request during call ongoing state
e6ac49ca0ed706b5a953b5cb953c335b2efde17a 07-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> PBAPS: Enable contact search with full or part of given string

Enables searching of text in contact name starting with a given
matching string instead of matching the complete string.

Change-Id: I91258391b7b7cb014d55e17e1ed3b92267a2c7da
bap/BluetoothPbapObexServer.java
a86b03167e6949f1afd0eb0e57c4339b6f8b5200 06-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> SAP: Fix ANR(s) in SAP server code

Fix ANR in SAP Server code in following scenarios:

- Multiple call to stop in Sapservice leads to ANR, as check was not
present in stop to prevent unregistering BroadcastReceiver if not
already registred.
- Remove redundant call to closeServerSocket from initSocket as this could
lead to ANR when there is simultaneous call to closeService as part of BT
being switched off and call to start SAP as part of BT being turned on when
BT on off sequence is tried repeatedly.

Change-Id: Ia6bc5ca7c9da9ae4a4c12e8207fb9ff6b9159e82
ap/SapService.java
0e0883602b97ed9bf2a86c49a93345c91da5167e 06-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> SAP: Remove sdp record while BT is being turned off to prevent leak

Remove sdp record created dynamically for SAP server during BT off state.
Without this call, there is leak in sdp layer in stack as sdp record is
never removed, even though the socket is closed.
Also proper checks are added to prevent call to remove sdp record when
adapter is null.

Change-Id: I739cc3115f6cd7fedf9085e8522c96da257e9568
ap/SapService.java
222d110bd00c9120f776c5893374d5427053e452 07-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> SAP: Fix issue of socket listener not getting re-started

Add logic to properly handle ACL_DISCONNECTED to restart socketListener
to handle scenarios where socket listener was not getting started due to
abnormal ACL disconnect.

Change-Id: Iac5ec52f485e692b14bb0065e30a68cae007a49d
ap/SapService.java
987a8cdbdc36548f76ad63fc5ab33f8b3ce2f69a 07-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> SAP: Update UI connection and notifications properly

Update connection state to upper layers only when SAP SLC is connected
i.e. status indication is sent to SAP Client.
Also notification to disconnect SAP Server from UI is shown only when SAP
is successfully connected, and not when SapServer object is created.

Change-Id: Iaf40584220b51f6193bed9a54d159cffd32698e9
ap/SapServer.java
ap/SapService.java
b8984f61f6fd31fd25e37745e8ba505ca287b274 07-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> SAP: Handle disconnect request during call ongoing state

Handle disconnect request during call ongoing state properly.
Previously if disconnect was received from SAP client while in
call ongoing state, it was not handled properly, leading to
Server not sending the DISCONNECT response thereby violating
Bluetooth SAP Specification.

Change-Id: I666fab4b4513abfa00df4be5b3a7aab95d5f0331
ap/SapServer.java
1e2b7186e57e3012f0f0ea07b6e8bc568efb1270 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Update share status when interrupted at remote side."
am: f4de2e0

* commit 'f4de2e0631c0a2f553c27b2351c0d13fba481466':
OPP: Update share status when interrupted at remote side.
cd75ef686d87fdda970edd0c6b19958398f9cc85 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "OPP: Use long instead of int"
am: 245367e

* commit '245367e89200c59be5d65959e10e0a91a13dc288':
OPP: Use long instead of int
076020e00e229bfbcf268372ef65b93ef35ec4b9 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Fix ANR for blocking operations on UI thread"
am: 5c20542

* commit '5c205429a8003a68fd189915c5265296388b9e08':
MAP: Fix ANR for blocking operations on UI thread
f3c25c8805f790ada5f3e2b11e8b1d816b3cffa7 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Track ProfileState, register and unregister of BroadcastReceivers"
am: dc85454

* commit 'dc85454495d48056ca8bb190a908d4c9889583da':
MAP: Track ProfileState, register and unregister of BroadcastReceivers
cb136395d7977aaa85ee0840a976c77ca811647f 11-Sep-2015 Hemant Gupta <hemantg@codeaurora.org> OPP: Update share status when interrupted at remote side.

Use case:
1) Select a file on DUT and send to Remote device through OPP
2) Accept the incoming file on Remote
3) While file transfer is in progress, stop the file transfer on Remote.
4) Again send the same file or different file to the same Remote Device.

Result:
OPP file transfer does not start.

Fix:
Update interrupted outbound content resolver entry when
Transfer is stopped at remote side. Otherwise DUT fails
To push OPP file after earlier OPP file is stopped on
Remote Device.

Change-Id: I9944bdd47ff9e31d0f9f8a157592e407e000e96c
pp/BluetoothOppObexClientSession.java
def48bd39db63087d076d2eacdef1d496394b2d8 10-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> OPP: Use long instead of int

Use long instead of int data type in OPP Java code to prevent
overflow of timestamp and filesize during transfer of large files
which caused transfer failures.

Change-Id: I58c9b49f59d47f6f162156eb6594e66731732580
pp/BluetoothOppService.java
pp/BluetoothOppShareInfo.java
a52089aeccde8a98cc185a44c8319e719b00e016 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: CleanUp for SDP record in MAP Service shutdown"
am: f9e3eaa

* commit 'f9e3eaa9528d75986a8e50a97c73692e4c9ba638':
MAP: CleanUp for SDP record in MAP Service shutdown
500cee667e75207745374921890c610d5e6fb40c 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: GETMessagesLisitng include mandatory field always."
am: 68277e5

* commit '68277e56f5ba90d51e83f5b0027b97f8c9add354':
MAP: GETMessagesLisitng include mandatory field always.
b6fdf260e28b4eb6b5cdb19f53710c0470ffcad2 11-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Fix ANR for blocking operations on UI thread

UseCase:
Stability Testing steps followed:
1. Pair and connect with remote phone.
2. Verify successful profile connection.
3. Pair & Connect LE device.
4. Disconnect & Unpair LE device.
5. Reset BT multiple times.
6. Repeat above steps 50 times

Failure:
ANR(s) reported for long running operations perfromed on main thread.

Fix:
- Attach MAPService session handler to looper from a
worker thread to avoid long running tasks handling
for messages posted from UI thread.

- Move AppObserver Account onChange() handling
to worker thread instead of UI thread.

- Avoid running contentobserver for SMS/MMS instance on
main thread looper to fix ANR reported while handling
content changes for SMS and MMS listing. Add NPE checks
hit during stability testing.

Change-Id: Ie146cd284fd191f7c7be7f0c1e7ed4877b36ae76
ap/BluetoothMapAppObserver.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapService.java
b74f5d74e2cd2e55895d0a5bcaf6daa195b91b6c 23-Mar-2016 Ashwini Munigala <AshwiniM@codeaurora.org> Merge "MAP: Cleanup PendingIntent in cancelUserTimeoutAlarm."
am: da10fe7

* commit 'da10fe73a8f19cc4e28213bd353b412aca5680f2':
MAP: Cleanup PendingIntent in cancelUserTimeoutAlarm.
19a1a8259c6352b1afe4f86034708221a87594e5 10-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: Track ProfileState, register and unregister of BroadcastReceivers

Use Case:
1. Pair and connect with remote phone.
2. Verify successful profile connection.
3. Pair & Connect LE device.
4. Disconnect & Unpair LE device.
5. Reset BT multiple times.
6. Repeat above steps 50 times

Failure:
BT Crashed, failed to start MAP services after BT reset.

RootCause:
BT Crash for not handling following exceptions:

- java.lang.IllegalArgumentException: Receiver not registered
at: android.app.IntentReceiverLeaked: Service
com.android.bluetooth.map.BluetoothMapService
has leaked IntentReceiver com.android.bluetooth.map.BluetoothMapAppObserver:
Are you missing a call to unregisterReceiver()?

Fix:
- This issue is hit when onStop() for MAPService is triggered without onStart()
being triggered by the time shutdown process gets invoked.
- Track registration and unregistration for BluetoothMapAppObserver BroadcastReceiver
to fix IntentReceiver leaks and also added validation for the AppObserver Data.

Change-Id: Ia1c2160fef369bbff42e8da3ea7d925c483e0a12
ap/BluetoothMapAppObserver.java
ap/BluetoothMapService.java
4b26248d63bafbd864fba91f0b9c904d228b0385 10-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: CleanUp for SDP record in MAP Service shutdown

Remove SDP record per MAS Instance during MAP Service
shutdown procedure.
Add more relevant debug logging.

Change-Id: I222ad97d719b9a2c45db3ab8526dd3de9c553f3d
ap/BluetoothMapMasInstance.java
1fd6b9280f90c1dc50e682d19a01a993a4540b8d 23-Mar-2016 Ashwini Munigala <AshwiniM@codeaurora.org> Merge "MAP: Handle possible NPE while disconnect map."
am: 7cbec75

* commit '7cbec75e7310370c6cb03cfcc48dc4ff1db951c8':
MAP: Handle possible NPE while disconnect map.
fb21ad82f677817d7ffac060e5230f0387d33643 23-Mar-2016 Ashwini Munigala <AshwiniM@codeaurora.org> Merge "MAP: Add MNS SDP Search during setNotificationRegistration."
am: 9556063

* commit '9556063902bda98d28a0942509f94ea6973ebba9':
MAP: Add MNS SDP Search during setNotificationRegistration.
2d55a876d9031c5a56b98431cb148a05b220d428 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Declare and fetch only \'INTERESTED_MESSAGE_TYPE_CLAUSE\' MMS."
am: 5bc6229

* commit '5bc6229907607e2857e603f4a5010851b3479b7d':
MAP: Declare and fetch only 'INTERESTED_MESSAGE_TYPE_CLAUSE' MMS.
aa852f71699b29af8353d596f2ddaba6cf2a1ae0 11-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> MAP: GETMessagesLisitng include mandatory field always.

Pre condition:
Atleast one SMS is present in any of the folders
with no subject.

UseCase:
1. Connect MAP connection from MCE to DUT
2. Set folder to Telecom/msg/inbox
3. Execute MessageListing with the required data

Failure:
Mandatory field "subject" is not included for few entries
in messagesListing.

Fix:
For GETMessagesLisitng ensure blank subject string is
set to include this mandatory feild and handle possible
"null" value fetched from database.

Change-Id: Ie29a61c83b22db9008184090a2f5b17d1f34b72b
ap/BluetoothMapContent.java
8458fc313d1e9f072efc03a331dce151d476c596 07-Jan-2016 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Cleanup PendingIntent in cancelUserTimeoutAlarm.

Handle cleanup for timeout Intent and pending Intent
in cancelUserTimeoutAlarm API.

Change-Id: I4f4184785675b2deffa3be8c9dd70b2673020b51
ap/BluetoothMapService.java
d798065556066d1ea3c679df112553aa9112b0f3 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Synchronize notifcationReg reply and MNS connect action."
am: 075283f

* commit '075283fe6272b77521511bf26ac2516146532cbc':
MAP: Synchronize notifcationReg reply and MNS connect action.
421d92eba334eb7082928c456c706182b08f4183 23-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Synchronize mMsgList to avoid extra MessageDeleted MNS event"
am: 3b377be

* commit '3b377bee36cd6f5427f48feaa4f921a6d902cf01':
MAP: Synchronize mMsgList to avoid extra MessageDeleted MNS event
ce52d7f87eaac401d7d3db75db6b505098989295 27-Oct-2015 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Handle possible NPE while disconnect map.

Precondition:
Verified with IOT: MecApp in MCE role

UseCase:
1. Connect MAS
2. Register Mas Instance via MNS
3. Disconnect MAS

Failure:
Bluetooth App crash sometimes when disconnect map profile.

Root Cause:
The issue is hit when MAS disconnect is finished before MNS unregister.
In this case NullpointerException is happening because of clearing
BluetoothMapContentObserver already as a part of cleanup.

Fix:
Handle Null pointer exception while last
MAS instance disconnect is handled before MNS
unregistration.

Change-Id: I4e72038a5ddc6c3ac8c515def57cb4f98fe87675
ap/BluetoothMapService.java
e6564029f132077c8a4877431a95899db201e506 10-Sep-2015 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Add MNS SDP Search during setNotificationRegistration.

Precondition:
Verified with remote MCE device that starts MNS server
only before issuing setNotification Registration to MSE.

Use Case:
1. Discover and Pair with MSE from MCE.
2. Connect to MSE on Mas insance 0.
3. Enable Notification Registration for MAS Instance 0

Failure:
MNS connection happens over RFCOMM
and MAS Instance is connected over L2CAP.

Root Cause:
Current design performs MNS SDP search only at the time
of successful MAS Instance Connect. MNS connect implementation
tries connection over insecure RFCOMM channel based on UUID
when MNS Server record is not available.

Fix:
Add implementation to check and perform MNS SDP search
if this info is not available when MCE requests
setNotificationRegistration. This fix is required to
handle MCE implementation that start MNS Sever and
expose SDP only before sending setNotificationRegistration.

Change-Id: If1e8d33dcac078f04d13b8bacf8e1d1513c119e1
ap/BluetoothMapContentObserver.java
ap/BluetoothMapMasInstance.java
ap/BluetoothMapService.java
ap/BluetoothMnsObexClient.java
1ce48531cb795d2ca180e3d92c044d3fac72e022 22-Dec-2015 Hemant Gupta <hemantg@codeaurora.org> MAP: Declare and fetch only 'INTERESTED_MESSAGE_TYPE_CLAUSE' MMS.

Precondition:

Messaging App Settings configured to receive delivery reports for MMS.

Use Case:
Follow standard steps to perform messagesListing type MMS from MCE.
1. Connect to MSE on Mas instance 0.
2. Set Path to root.
3. Set Path to telecom.
4. Set Path to msg.
5. Set Path to inbox.
6. GET messagesListing type MMS.

Failure:
Extra entries like delivery reports that are stored in DB and
which are not user interested types are also included
in MSE messageListing for MMS type.

Fix:
OMA-TS-MMS-ENC MMS Standard defines many types in X-Mms-Message-Type.
Extra entries like delivery reports which is stored in DB are not
required to be shown to user, so these should be filtered, and
only m-send-req (128), m-retrieve-conf (132), m-notification-ind (130)
types should be fetched and shown to user in messageListing response.
This patch removes these unecessary message types from MMS Messaging Listing.

Change-Id: I1cb5d6e58477a32a89693f555a268e0855267b9a
ap/BluetoothMapContent.java
189cc4ca1c36018977e7b9ad62b07ddbefc7f2ba 21-Sep-2015 Hemant Gupta <hemantg@codeaurora.org> MAP: Synchronize notifcationReg reply and MNS connect action.

Use Case:
1. Connect to carkit
2. Disconnect connection with carkit.
3. Reconnect to carkit

Failure:
MNS Failure during Reconnection.
User will in some timing conditions not get notification
of new messages and then turns OFF/ON the carkit.
MAS is connected fine but for MNS car sends BAD REQUEST.

Root Cause:
This isssue is reported only with one particular carkit in MCE role,
where in MNS Connect request issued before acknowleding
the setNotificationReg Request.

Fix:
Synchronize handleRegistration method in handler thread to ensure
setNotificationReg response from MSE is sent before requesting
a MNS Connect to MCE.

Change-Id: I30559c643af7733754fce551b97e31543a0cb160
ap/BluetoothMapAccountLoader.java
ap/BluetoothMnsObexClient.java
ea6b2c977e8a621f160f37ef0d36db91d5c29834 21-Aug-2015 Hemant Gupta <hemantg@codeaurora.org> MAP: Synchronize mMsgList to avoid extra MessageDeleted MNS event

Precondition:
There are no messages in Messaging App.

Use Case:
1. Connect to MSE on Mas insance 0,
Register and Enable Event Notifications from any MCE.
2. Set Path to root.
3. Set Path to telecom.
4. Set Path to msg.
5. Set Path to outbox.
6. Compose an SMS and add the recipient.
7. Click PushMessage option.

Failure:
Map Server sends a unexpected MessageDeleted EventReport Notification
even though PushMessage received from MCE is processed Successfully.

Root Cause:
Issue happens only for one corner case, where onChange() gets triggered
while processing a local initiated pushMsg before the entry is appended
to database, as local MsgListSms contains an extra entry for newly added
msg from MCE.

Fix:
Synchronize contentObserver mMsgList SMS/MMS to update list with
local initiated changes before fetching complete database list and
handling onChange() to avoid extra MessageDeleted MNS event.

Change-Id: Id4d5dad4d2b4b1e17f40218c11d13e39c9b885a0
ap/BluetoothMapContentObserver.java
441ed84bc2f16e8ad7a398e15a587e4ac95abcd3 23-Mar-2016 Satish Kodishala <skodisha@codeaurora.org> Merge "Send error for if VR is initiated during call."
am: a43811a

* commit 'a43811a9c6945aeb8c5ca8a15412c5913e2dad24':
Send error for if VR is initiated during call.
b23390c15910de8b127d23bfdc7c9b6ae215a7b4 28-Jan-2016 Satish Kodishala <skodisha@codeaurora.org> Send error for if VR is initiated during call.

Use case:
Connect to BT headset.
Make a call. Let the call audio be on BT headset.
Initiate voice recognition(VR) from BT headset.

Failure:
AG is not sending error for VR when initiated during call.
Headset might go into bad state if AG don't send error.

Rootcause:
AG is not sending error for VR when initiated during call.

Fix:
When VR is activated during call, send error response to headset.

Change-Id: Ib12d464fc6a6948ddf22250a65a9e5bfeb4a8fb1
fp/HeadsetStateMachine.java
ada0b77f78517b1080aa2afc20ad2d5bc51d5137 22-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Fix register for notification logic
am: 55296d1

* commit '55296d1fb8e3daef4681205a9591f0af522b099e':
Fix register for notification logic
55296d1fb8e3daef4681205a9591f0af522b099e 22-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Fix register for notification logic

Bug: 27790582
Change-Id: I118071b907ec16faad401ba6583ca395d08d6d6e
att/GattService.java
ba4bab5dddac41d46f683eb215662eba78aeb3bd 22-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Fix register for notification logic

Bug: 27790582
Change-Id: I118071b907ec16faad401ba6583ca395d08d6d6e
att/GattService.java
d0deca6c54d636957c3602e8e0cd966f3671ea42 22-Mar-2016 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP abort operations when disconnected" into nyc-dev
am: d7bdccf

* commit 'd7bdccf934d5dfb7407dd024f44dbaf93b7d193b':
PBAP abort operations when disconnected
d7bdccf934d5dfb7407dd024f44dbaf93b7d193b 22-Mar-2016 Joseph Pirozzo <pirozzoj@google.com> Merge "PBAP abort operations when disconnected" into nyc-dev
32dc7a6b919375aede777f3c821fa316d85449ae 17-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Use handles to identify GATT attributes (3/4)

Bug: 27778668
Change-Id: Id6ec1229998c9fc2ecd4d0a908405a7148703bec
att/CallbackInfo.java
att/GattService.java
02a821a0df99bdef55d2282530e13541fee8d36f 02-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Change how services are passed up to the stack

Bug: 27455533
Change-Id: I4c8218fb4c7437ab4597071ad9b580a797e34339
att/GattService.java
aa935f98f6c200298325027705b9ea031fce3467 26-Feb-2016 Jakub Pawlowski <jpawlowski@google.com> Get whole GATT db, instead of one by one element.

This patch uses new get_gatt_db method instead of current set of
callback to obtain GATT db.t

Bug: 27455533
Change-Id: I52e12253dd850ce8de35297c941638189cbbed1e
att/GattDbElement.java
att/GattService.java
att/SearchQueue.java
78a98c05ae0c872bbbbb6e7ba1b6768fbc272849 22-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Use handles to identify GATT attributes (3/4)"
am: 65acaf4

* commit '65acaf4cd11df55c810984184513aeb7205fb538':
Use handles to identify GATT attributes (3/4)
5900a31a8c9b07d131cf83331c0073b057972a60 17-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Use handles to identify GATT attributes (3/4)

Bug: 27778668
Change-Id: Id6ec1229998c9fc2ecd4d0a908405a7148703bec
att/CallbackInfo.java
att/GattService.java
fae6b54e8d3edf8c890ca3be212b27d591acad03 21-Mar-2016 Andre Eisenbach <eisenbach@google.com> Make sure wakelock is held before releaseing it

Bug: 27748109
Change-Id: I38c8ec640f5def7c53348d2dd96a0a2492ff00cc
tservice/AdapterService.java
a9d5a686f820aedb30b21145bca23fbbcacc3682 18-Mar-2016 Andre Eisenbach <eisenbach@google.com> Do not delete/re-create wakelock on acquisition/release

Also provide additional status for wakelock acquisition/release errors.

Bug: 27721443
Change-Id: Iac544226fed4a73a50bd954e74d96edd4bed93d2
tservice/AdapterService.java
7a3cfba99e1e99c937901fb1695c97b954f34121 21-Mar-2016 Joseph Pirozzo <pirozzoj@google.com> PBAP abort operations when disconnected

Push long running activities relating to the contacts database onto its
own thread such that the main service thread can remain responsive to
new bluetooth requests.

Bug: 27697738
Change-Id: I0202962a49d6a0279b5672152955840dd02bdf31
bapclient/CallLogPullRequest.java
bapclient/PbapPCEClient.java
bapclient/PhonebookPullRequest.java
bapclient/PullRequest.java
844518bb897a099f333c3d3b980f0c36721834ae 22-Mar-2016 Sanket Agarwal <sanketa@google.com> Forward in iPhone leads to play state being presisted as STOP.
am: 26469ff

* commit '26469ff3f9f4ab96ad288e0934220023a0c159f1':
Forward in iPhone leads to play state being presisted as STOP.
26469ff3f9f4ab96ad288e0934220023a0c159f1 21-Mar-2016 Sanket Agarwal <sanketa@google.com> Forward in iPhone leads to play state being presisted as STOP.

When we press forward in iPhone (via AVRCP pass through or iPhone UI)
while connected over AVRCP we are resetting the state and expecting
AVRCP to give us a new play state when next song resumes. Turns out that
iPhone always keeps it state to be Playing.

The fix is to keep the mRemoteMediaPlayers a replica of what AVRCP says
so that when song resumes (from A2dpSinkService via startAvrcpUpdates)
we can restore the playing state.

Tested on iPhone and regression tested on Nexus 5X.

Bug: b/27768620
Change-Id: I8caf56072fa5743f28e1680860c161d3cd75b83c
vrcp/AvrcpControllerService.java
5b849d6b99e07d9b0e09eef7c38baacabda69522 21-Mar-2016 Andre Eisenbach <eisenbach@google.com> Make sure wakelock is held before releaseing it
am: e94f8eb

* commit 'e94f8eb85b68b351319499337af937835730b508':
Make sure wakelock is held before releaseing it
e94f8eb85b68b351319499337af937835730b508 21-Mar-2016 Andre Eisenbach <eisenbach@google.com> Make sure wakelock is held before releaseing it

Bug: 27748109
Change-Id: I38c8ec640f5def7c53348d2dd96a0a2492ff00cc
tservice/AdapterService.java
9d906fca22eec9173ccdfe89a2daaf484f017683 21-Mar-2016 Ajay Panicker <apanicke@google.com> Merge "Add scan results to scan stats"
am: 7296f05

* commit '7296f0530c435e88df31d08519705a0517943b5a':
Add scan results to scan stats
c30f06668bc683b13319a33775ee8f9def3283c8 09-Mar-2016 Ajay Panicker <apanicke@google.com> Add scan results to scan stats

Ex:
GATT Client Map
Entries: 1

no.nordicsemi.android.mcp
LE scans (started/stopped) : 3 / 3
Scan time in ms (min/max/avg/total): 3050 / 6901 / 4815 / 14447
Total number of results : 338
Last 3 scans :
1970/01/01 08:20:06 - 6901ms 0 results
1970/01/01 08:20:13 - 4496ms 171 results
1970/01/01 08:20:39 - 3050ms 167 results

Bug: 27294154
Change-Id: I32fd6da035f2c37302a105733ac6a9817547b7a3
att/AppScanStats.java
att/ContextMap.java
att/GattService.java
9eded69b7d3d306ca1ffbf6dee1ab0aa1e3b8b51 18-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Change how services are passed up to the stack"
am: d8166b9

* commit 'd8166b935f0a973b52b74149ae542146e4b30df2':
Change how services are passed up to the stack
c02f775acced5eb0fd059ad2383a7cae7de4e478 18-Mar-2016 Andre Eisenbach <eisenbach@google.com> Do not delete/re-create wakelock on acquisition/release
am: 00a465e

* commit '00a465ed6160246b369629b6777836a4d1b11834':
Do not delete/re-create wakelock on acquisition/release
00a465ed6160246b369629b6777836a4d1b11834 18-Mar-2016 Andre Eisenbach <eisenbach@google.com> Do not delete/re-create wakelock on acquisition/release

Also provide additional status for wakelock acquisition/release errors.

Bug: 27721443
Change-Id: Iac544226fed4a73a50bd954e74d96edd4bed93d2
tservice/AdapterService.java
3f8fcc331cb4491f406f8bffef47e5c542893903 02-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Change how services are passed up to the stack

Bug: 27455533
Change-Id: I4c8218fb4c7437ab4597071ad9b580a797e34339
att/GattService.java
fe417f3193996cdcb21501d522da34c000e778c8 16-Mar-2016 Joseph Pirozzo <pirozzoj@google.com> Implement PBAP PCE client role service.
am: b874a1d1cf

* commit 'b874a1d1cf25f90947ba87f791d42a404cad7d85':
Implement PBAP PCE client role service.
b874a1d1cf25f90947ba87f791d42a404cad7d85 10-Mar-2016 Joseph Pirozzo <pirozzoj@google.com> Implement PBAP PCE client role service.

Migrate code from frameworks/opt/bluetooth for pbap client to support
pbap as a bluetooth profile.

Bug: 27490041
Change-Id: I7a486af1c58d17ee10348aae044786df670a781e
tservice/AdapterService.java
tservice/Config.java
bapclient/AuthenticationService.java
bapclient/Authenticator.java
bapclient/BluetoothPbapCard.java
bapclient/BluetoothPbapClient.java
bapclient/BluetoothPbapObexAuthenticator.java
bapclient/BluetoothPbapObexSession.java
bapclient/BluetoothPbapObexTransport.java
bapclient/BluetoothPbapRequest.java
bapclient/BluetoothPbapRequestPullPhoneBook.java
bapclient/BluetoothPbapRequestPullPhoneBookSize.java
bapclient/BluetoothPbapRequestPullVcardEntry.java
bapclient/BluetoothPbapRequestPullVcardListing.java
bapclient/BluetoothPbapRequestPullVcardListingSize.java
bapclient/BluetoothPbapRequestSetPath.java
bapclient/BluetoothPbapSession.java
bapclient/BluetoothPbapVcardList.java
bapclient/BluetoothPbapVcardListing.java
bapclient/CallLogPullRequest.java
bapclient/PbapClientService.java
bapclient/PbapHandler.java
bapclient/PbapPCEClient.java
bapclient/PhonebookEntry.java
bapclient/PhonebookPullRequest.java
bapclient/PullRequest.java
bapclient/utils/BmsgTokenizer.java
bapclient/utils/ObexAppParameters.java
bapclient/utils/ObexTime.java
be1170c4b8e58b1964b9fd730b88a9a33b90cb88 15-Mar-2016 Sanket Agarwal <sanketa@google.com> Merge "HFP is exposed via Telecom ConnectionService." into nyc-dev
am: 8b9e874162

* commit '8b9e874162c99178d0a3a857dce1f76ebfc55b57':
HFP is exposed via Telecom ConnectionService.
8b9e874162c99178d0a3a857dce1f76ebfc55b57 14-Mar-2016 Sanket Agarwal <sanketa@google.com> Merge "HFP is exposed via Telecom ConnectionService." into nyc-dev
41093afc1f5a9109f414e942985f25e74758e8c6 14-Mar-2016 Ajay Panicker <apanicke@google.com> Print bluetooth state as a string

Bug: 27294154
Change-Id: I992f720d94be1f0762424ebad36ec1b6af58600b
tservice/AdapterService.java
c5c743673b1099aac4dbc36577b6ead625e09e10 14-Mar-2016 Ajay Panicker <apanicke@google.com> Merge "Print bluetooth state as a string"
am: e3a3acf3e0

* commit 'e3a3acf3e0b69b27540922bb71770d9b019f1217':
Print bluetooth state as a string
f7f1a09d1345bef9cf2ebc34af35336b7fd0007f 14-Mar-2016 Ajay Panicker <apanicke@google.com> Print bluetooth state as a string

Bug: 27294154
Change-Id: I992f720d94be1f0762424ebad36ec1b6af58600b
tservice/AdapterService.java
a9ad98ec1222093baecd70b32611c3a74ba7f2d8 10-Mar-2016 Sanket Agarwal <sanketa@google.com> HFP is exposed via Telecom ConnectionService.

Telecom provides a ConnectionService mechanism where in order to make
calls you only need to provide the right phone account (which can be
queried using a predefined scheme).

This change adds a new middleware called ConnectionService which
provides a translation medium from Bluetooth <-> Telecom. Anyone who
wishes to use HFP HF role can then simply use TelecomManager (and
TelecomManager's InCallService) interfaces.

Bug: b/26757899

Change-Id: I66e47b6ff6330cfd9040a4a6cf4edadac28d63de
fpclient/HeadsetClientStateMachine.java
fpclient/connserv/HfpClientConference.java
fpclient/connserv/HfpClientConnection.java
fpclient/connserv/HfpClientConnectionService.java
1be5eb16d4e3af4ab74270a91b055c5e197fcf87 09-Mar-2016 Ajay Panicker <apanicke@google.com> Add enabled time to dump output
am: b03b1ce32f

* commit 'b03b1ce32fe4f39139d9f62b002cf329a0cd72aa':
Add enabled time to dump output
b03b1ce32fe4f39139d9f62b002cf329a0cd72aa 09-Mar-2016 Ajay Panicker <apanicke@google.com> Add enabled time to dump output

Ex:
Bluetooth Status
enabled: true
state: 12
address: F8:CF:C5:CE:F5:69
name: AOSP on Shamu
time since enabled: 00:00:32.999

Bug: 27294154
Change-Id: Ie65964411e2095434a082f3d988133190c1f2f59
tservice/AdapterService.java
14bc7705930e23eba5cc70f840796df7e4c99709 09-Mar-2016 Ajay Panicker <apanicke@google.com> Add enabled time to dump output

Ex:
Bluetooth Status
enabled: true
state: 12
address: F8:CF:C5:CE:F5:69
name: AOSP on Shamu
time since enabled: 00:00:32.999

Bug: 27294154
Change-Id: Ie65964411e2095434a082f3d988133190c1f2f59
tservice/AdapterService.java
cd58100530d5330a23a2fb8837a2d4cf7fe21953 09-Mar-2016 Ajay Panicker <apanicke@google.com> Move ScanStats to its own file
am: 7a068c2a08

* commit '7a068c2a0861e12a3916cec313cf105395871999':
Move ScanStats to its own file
7a068c2a0861e12a3916cec313cf105395871999 02-Mar-2016 Ajay Panicker <apanicke@google.com> Move ScanStats to its own file

ScanStats was growing too large and had many components so
it was moved into its own file.

Bug: 27294154
Change-Id: Ic20c9e74d5d8b074f7e966625fb1bffab6c94f2d
att/AppScanStats.java
att/ContextMap.java
att/GattService.java
f89e6ff031d6e1dcbf393e4b30728bf0e3022b69 09-Mar-2016 Sanket Agarwal <sanketa@google.com> AutoConnect A2DP and HFP for Car Kitt roles.
am: f848f42a0e

* commit 'f848f42a0ec33519a8143f01a1acfe835e2cd1bc':
AutoConnect A2DP and HFP for Car Kitt roles.
b7af521b6c2d1ccaaea687207dfbcd0c34489a3c 02-Mar-2016 Ajay Panicker <apanicke@google.com> Move ScanStats to its own file

ScanStats was growing too large and had many components so
it was moved into its own file.

Bug: 27294154
Change-Id: Ic20c9e74d5d8b074f7e966625fb1bffab6c94f2d
att/AppScanStats.java
att/ContextMap.java
att/GattService.java
f848f42a0ec33519a8143f01a1acfe835e2cd1bc 09-Mar-2016 Sanket Agarwal <sanketa@google.com> AutoConnect A2DP and HFP for Car Kitt roles.

1. Current auto connect sequence is not enabled for HeadsetClient.
2. On profile init consider A2DP and HFP in Car Kitt roles as
privellaged profiles.

Bug: b/27551485

Change-Id: I477b34ad1598d0a3ab9563ccd5b3770a4a1e2a57
tservice/AdapterService.java
d774f39fbe5460673601ec35554a6cc4693ab483 08-Mar-2016 Sanket Agarwal <sanketa@google.com> Audio Focus for A2DP.
am: 94a38610a1

* commit '94a38610a17e019818719cfecde1b3e80601a2bd':
Audio Focus for A2DP.
94a38610a17e019818719cfecde1b3e80601a2bd 12-Feb-2016 Sanket Agarwal <sanketa@google.com> Audio Focus for A2DP.

When AVRCP is available we provide the following focus management on
SINK role:
a) Both AVRCP CT and AVRCP TG can notify the A2DP SNK about play status
change. A2DP SNK will only play when either CT or TG says play.
b) If AVRCP does not exist or neither of CT or TG have explicitly said
play (pass through or notification) then we simply throw away the data.

TODO:
Implement additional policy where we take the data from the A2DP SRC
irrespective of whether AVRCP exists or not. This should be implemented
as a separate streaming state machine and we should be able to flip the
state machine at run time (via settings app).

Bug: b/26928143

Change-Id: Ie5fab15ba4cdd5738c59fa646ca0824770489ec5
2dp/A2dpSinkService.java
2dp/A2dpSinkStateMachine.java
2dp/A2dpSinkStreamingStateMachine.java
vrcp/AvrcpControllerConstants.java
vrcp/AvrcpControllerService.java
1172d642bb8888c979f735e20c0d689bd2b9d45b 07-Mar-2016 Franck Lenormand <franckx.lenormand@intel.com> Merge "Prevent javacrash when TELEPHONY_SERVICE is not found" am: 8367ebbea6
am: 5dc01a914a

* commit '5dc01a914a741406be9a1204c75411db481fd813':
Prevent javacrash when TELEPHONY_SERVICE is not found
5dc01a914a741406be9a1204c75411db481fd813 07-Mar-2016 Franck Lenormand <franckx.lenormand@intel.com> Merge "Prevent javacrash when TELEPHONY_SERVICE is not found"
am: 8367ebbea6

* commit '8367ebbea6f2298736457345cefe28882ef2e60a':
Prevent javacrash when TELEPHONY_SERVICE is not found
ec61e0d95c3feb6fa49e88b473e6b2fa5cddcc3a 08-Apr-2015 Franck Lenormand <franckx.lenormand@intel.com> Prevent javacrash when TELEPHONY_SERVICE is not found

The API context.getSystemService can return NULL
A Javacrash can happend when trying to obtain the TELEPHONY_SERVICE
and getting null instead.

The patch warn about the value of the instance of the service returned.
It also log and prevent its use in function startListenForPhoneState and
stopListenForPhoneState.

If the TELEPHONY_SERVICE is not available, the internal variables wont
change.

Change-Id: I9e4abc88a58f7f037bbc4f3f7c1cf1b44328ce38
Signed-off-by: franck Lenormand <franckx.lenormand@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
fp/HeadsetPhoneState.java
b525b4317c610c1e5d1b2a0c6afee53896dfecca 04-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Support messageListing PARAMETER_MASK_ALL_ENABLED by default." am: 6dfb1505ad
am: 0a5cbbd020

* commit '0a5cbbd02046f5b1c9348ed7305d02c89c41da54':
MAP: Support messageListing PARAMETER_MASK_ALL_ENABLED by default.
0a5cbbd02046f5b1c9348ed7305d02c89c41da54 04-Mar-2016 Hemant Gupta <hemantg@codeaurora.org> Merge "MAP: Support messageListing PARAMETER_MASK_ALL_ENABLED by default."
am: 6dfb1505ad

* commit '6dfb1505ade8b7543f1ffaaf28d80f4bcac45ab8':
MAP: Support messageListing PARAMETER_MASK_ALL_ENABLED by default.
281a499162f86d2ce148b5020bfcfc277b84c5b9 22-Dec-2015 Hemant Gupta <hemantg@codeaurora.org> MAP: Support messageListing PARAMETER_MASK_ALL_ENABLED by default.

Support application parameter mask to enable and send across
all optional and mandatory feilds in GET messagesListing response
instead of only mandatory feilds to handle IOT Specific behavior
that donot include parameter mask attribute in messageListing request.

Some carkits in MCE role show read messages as unread when
"read" feild (optional) is not included in messagesListing
response by default.

Change-Id: I1fc65d85c35573e21d0c9d5bfdefd58de2dcf3ae
ap/BluetoothMapContent.java
dad6e6b3fa311bd3c79a475b09dd037cfc5aeeaf 04-Mar-2016 AnubhavGupta <anubhavg@codeaurora.org> Merge "Stop accessing statemachine after cleanup" am: 0ef82f788d
am: ee8ae43488

* commit 'ee8ae434883c521c1f1ca7b371279d76717104b1':
Stop accessing statemachine after cleanup
ee8ae434883c521c1f1ca7b371279d76717104b1 04-Mar-2016 AnubhavGupta <anubhavg@codeaurora.org> Merge "Stop accessing statemachine after cleanup"
am: 0ef82f788d

* commit '0ef82f788d6362b21a06792d3189a7a57ff9be38':
Stop accessing statemachine after cleanup
d5fbe937a40abe94a93ef318d23f3c7a4ee869e7 04-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Resolve merge conflicts of c85dd0c175 to nyc-dev-plus-aosp

Change-Id: Ie575fc196f392853959ee6ab60d1011987ec7a29
bd177ad722fe0cdcd5b23a72db077f8688fbde35 15-Sep-2015 AnubhavGupta <anubhavg@codeaurora.org> Stop accessing statemachine after cleanup

Usecase:
-pair and connect DUT with Remote
-Start A2DP streaming
-Initiate disconnection from DUT

Failure:
Bluetoth crashed after initiating disconnect from DUT

Rootcause:
Accessing state machine context after cleanup.

Fix:
Bluetooth: Added null check to stop accessing state machine after cleanup

Change-Id: I85ca55aaa0b7604125e45a62e32ae02eca605e43
2dp/A2dpSinkService.java
c85dd0c175b04c860dce93200a94582f5ec0b9a5 04-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> Merge "Get whole GATT db, instead of one by one element."
am: 34ab8dd613

* commit '34ab8dd6136e674715d2732d0b610cb36008a720':
Get whole GATT db, instead of one by one element.
418f1c1e242313ab8b83eb9e38ffeee52e6e9445 26-Feb-2016 Jakub Pawlowski <jpawlowski@google.com> Get whole GATT db, instead of one by one element.

This patch uses new get_gatt_db method instead of current set of
callback to obtain GATT db.t

Bug: 27455533
Change-Id: I52e12253dd850ce8de35297c941638189cbbed1e
att/GattDbElement.java
att/GattService.java
att/SearchQueue.java
4197f6ea729b046ccdd19df2513b67253059ae83 03-Mar-2016 Wei Wang <weiwa@google.com> Merge "Fix a bug where batch scan wasn\'t stopped correctly." into nyc-dev
am: a2821fd1fe

* commit 'a2821fd1fe8770c5e6f82be3f3eb5b7ed895e958':
Fix a bug where batch scan wasn't stopped correctly.
a2821fd1fe8770c5e6f82be3f3eb5b7ed895e958 03-Mar-2016 Wei Wang <weiwa@google.com> Merge "Fix a bug where batch scan wasn't stopped correctly." into nyc-dev
15503005c966ce10a4fa57a5499dcb92e392407c 03-Mar-2016 Satish Kodishala <skodisha@codeaurora.org> Merge "Proper handling of BTRH command in HFP client" am: e8915edfdc
am: a4a71837ad

* commit 'a4a71837ad54fd1d9717df7ca53f41cde8d97461':
Proper handling of BTRH command in HFP client
a4a71837ad54fd1d9717df7ca53f41cde8d97461 03-Mar-2016 Satish Kodishala <skodisha@codeaurora.org> Merge "Proper handling of BTRH command in HFP client"
am: e8915edfdc

* commit 'e8915edfdc2d0c28d1dec94ae848566f6f7de471':
Proper handling of BTRH command in HFP client
5d416dcbe1ef10b66c1203530d101c2a82716b01 11-Feb-2016 Satish Kodishala <skodisha@codeaurora.org> Proper handling of BTRH command in HFP client

Usecase:
1. Enable hf client role and connect to AG.
2. Run PTS test case RHH/BV-04.

Failure:
PTS test case fails since the test expects the call to be active.

Rootcause:
Hf client is not sending AT+BTRH for accepting held call

Fix:
Remove unnecessary check against of action policy flag while
executing BTRH command

Change-Id: Iebd5e02f3bf70cc39288219340cd47ebad3d8349
fpclient/HeadsetClientStateMachine.java
337ee9418b0122e6a89ff38cd49f031ba80aa24c 01-Mar-2016 Ajay Panicker <apanicke@google.com> Add more statistics to scan logs

Added length of connection time to connections. Also added scan type
(opportunistic/background) to last X scans.

Example of new print:
GATT Client Map
Entries: 2

no.nordicsemi.android.mcp (Registered)
LE scans (started/stopped) : 2 / 2
Scan time in ms (min/max/avg/total): 1604 / 7274 / 4439 / 8878
Last 2 scans :
1970/02/19 21:30:20 - 1604ms
1970/02/19 23:59:00 - 7274ms
Application ID : 6
UUID : 0c452531-a57e-44df-9ac6-e2b780d2f715
Connections: 1
6: FF:08:11:53:44:A1 10008ms

com.example.apanicke.bletest (Registered)
LE scans (started/stopped) : 2 / 2
Scan time in ms (min/max/avg/total): 2946 / 9996 / 6471 / 12942
Last 2 scans :
1970/02/19 21:30:07 - 2946ms Opp
1970/02/19 21:30:17 - 9996ms Opp
Application ID : 5
UUID : f25c1bdf-559f-43a6-8348-40ca92975b33
Connections: 0

Bug: 27294154
Change-Id: I7460fb1568f20a1ce13b01d101517852cf9aec4a
att/ContextMap.java
6e08c3a1a8349b96e4d09226f7c1402e1f0ffec3 01-Mar-2016 Wei Wang <weiwa@google.com> Fix a bug where batch scan wasn't stopped correctly.

Stop batch was broken as the current logic tried to find
batch client information from regular scan clients when
stopping scans.

Bug:27209867
Change-Id: I935119950de1d839a6cfce672dfc00f4540f21dc
att/ScanManager.java
c1d65f9bb05907cbdceaf1d1a187f394a93eef63 02-Mar-2016 Ajay Panicker <apanicke@google.com> Merge "Add more statistics to scan logs"
am: 939ea0884b

* commit '939ea0884bbfddba164b43ab5e2340a015448d02':
Add more statistics to scan logs
f6ca9c52dc4fd4a531e73c8cfbe01cb3a6065130 01-Mar-2016 Ajay Panicker <apanicke@google.com> Add more statistics to scan logs

Added length of connection time to connections. Also added scan type
(opportunistic/background) to last X scans.

Example of new print:
GATT Client Map
Entries: 2

no.nordicsemi.android.mcp (Registered)
LE scans (started/stopped) : 2 / 2
Scan time in ms (min/max/avg/total): 1604 / 7274 / 4439 / 8878
Last 2 scans :
1970/02/19 21:30:20 - 1604ms
1970/02/19 23:59:00 - 7274ms
Application ID : 6
UUID : 0c452531-a57e-44df-9ac6-e2b780d2f715
Connections: 1
6: FF:08:11:53:44:A1 10008ms

com.example.apanicke.bletest (Registered)
LE scans (started/stopped) : 2 / 2
Scan time in ms (min/max/avg/total): 2946 / 9996 / 6471 / 12942
Last 2 scans :
1970/02/19 21:30:07 - 2946ms Opp
1970/02/19 21:30:17 - 9996ms Opp
Application ID : 5
UUID : f25c1bdf-559f-43a6-8348-40ca92975b33
Connections: 0

Bug: 27294154
Change-Id: I7460fb1568f20a1ce13b01d101517852cf9aec4a
att/ContextMap.java
a0ff3af53c2299fc20d4c1cc2bcced4a0d2ff5c9 29-Feb-2016 Ajay Panicker <apanicke@google.com> Protect ScanStats from race conditions

Bug: 27294154
Change-Id: Icc0b0a6cfb93fca4a9a2aee49b94c0be1d62527f
att/ContextMap.java
0492abab3ec07fd1c89799636e335a9f3b36eaed 01-Mar-2016 Ajay Panicker <apanicke@google.com> Merge "Protect ScanStats from race conditions"
am: 3e1e2f6e9e

* commit '3e1e2f6e9ecd3604c63e96ca535a10bebf87d6e2':
Protect ScanStats from race conditions
7bf0b76ff1024d8eb3cd37eb238ce2946440aa12 01-Mar-2016 Adam Lesinski <adamlesinski@google.com> Fix race in reportActivityInfo causing NPE

Bug:27162966
Change-Id: Id43898440824c1bbb24cef5a23a3f2a4fcde0534
tservice/AdapterService.java
90b78410c20e3232954891d66bed3352fc5c97e7 29-Feb-2016 Bryce Lee <brycelee@google.com> DO NOT MERGE ANYWHERE Implement new API for retrieving supported Bluetooth profiles.

Bug: 26451648
Change-Id: Ice55556d64208656824d5a6f9b90230d17f0c3bc
tservice/AdapterService.java
tservice/Config.java
8ac61cea59b89be104fd66710cfd44eaf12153b9 29-Feb-2016 Ajay Panicker <apanicke@google.com> Protect ScanStats from race conditions

Bug: 27294154
Change-Id: Icc0b0a6cfb93fca4a9a2aee49b94c0be1d62527f
att/ContextMap.java
ef437b17ba8b192488cb77ffd39daa3e83ba4aea 27-Feb-2016 Ajay Panicker <apanicke@google.com> Fix logic for repeated record scan calls

If recordStartScan or recordStopScan is called multiple times,
there are issues where logged values are incorrect.

Bug: 27294154
Change-Id: Ie049e917ae26fec4c50874ed703e404146c15044
att/ContextMap.java
c96e0b2e1e0a274e5baff197d5b11ed8ba33a7ea 27-Feb-2016 Ajay Panicker <apanicke@google.com> Merge "Fix logic for repeated record scan calls"
am: 3f5e211e2b

* commit '3f5e211e2bb4320db5a9f8af3fb29623983ff72e':
Fix logic for repeated record scan calls
9d48f7ed161cb7c201b91f21fb1be36522a562e0 27-Feb-2016 Ajay Panicker <apanicke@google.com> Fix logic for repeated record scan calls

If recordStartScan or recordStopScan is called multiple times,
there are issues where logged values are incorrect.

Bug: 27294154
Change-Id: Ie049e917ae26fec4c50874ed703e404146c15044
att/ContextMap.java
f0202e094a55e51d1e1399f18ad255fb636dd381 25-Feb-2016 Ajay Panicker <apanicke@google.com> Mark background and opportunistic scans in scan statistics

Bug: 27294154
Change-Id: I71d8f388aa83da581958d2169ca9a5eb6088a367
att/ContextMap.java
att/GattService.java
88d64af7d3f07a346eb7024a3fe3eaf8285aa53c 27-Feb-2016 Ajay Panicker <apanicke@google.com> Merge "Mark background and opportunistic scans in scan statistics"
am: fcdb8bd4a3

* commit 'fcdb8bd4a3aebeecb89bd733dd678263e45e892b':
Mark background and opportunistic scans in scan statistics
45c63ddeca7ccb3bbf1cb3a7234c89c9eee177cf 25-Feb-2016 Ajay Panicker <apanicke@google.com> Mark background and opportunistic scans in scan statistics

Bug: 27294154
Change-Id: I71d8f388aa83da581958d2169ca9a5eb6088a367
att/ContextMap.java
att/GattService.java
92a815aaf0faf68a4c43d5640caa447021ff7e12 26-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Fix the argument processing when dumping Bluetooth state

Apparently, when dump() is invoked via bugreport for
Bluetooth's AdapterServe, the optional arguments contain "-a".
The existing logic for checking the arguments for "--proto"
and return the result in Protobuf format failed to detect that,
and suppressed any output.

Now any unrecognized options are ignored, and the default
(text) output is returned.

[Cherry-pick from AOSP]

Bug: 27293885
Change-Id: I0f0d94507ebf6fed7628d49cd1de2a1b2801e6ad
tservice/AdapterService.java
8b7ff28178b7e853127192688eef7d1f18c86f81 26-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Fix the argument processing when dumping Bluetooth state"
am: ac9407b0c3

* commit 'ac9407b0c3657b945d4371bc1e827a8dd5958720':
Fix the argument processing when dumping Bluetooth state
b050c497e553ca0be0913d906ef705f9f712bbe6 26-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Fix the argument processing when dumping Bluetooth state

Apparently, when dump() is invoked via bugreport for
Bluetooth's AdapterServe, the optional arguments contain "-a".
The existing logic for checking the arguments for "--proto"
and return the result in Protobuf format failed to detect that,
and suppressed any output.

Now any unrecognized options are ignored, and the default
(text) output is returned.

Bug: 27293885
Change-Id: I0f0d94507ebf6fed7628d49cd1de2a1b2801e6ad
tservice/AdapterService.java
408bcf3b6436d28057bdc4551039f9d11c48f98d 25-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Add a missing null pointer check for AdapterService"
am: 2871b49c82

* commit '2871b49c827a9cb994e4ba82af5a20a026cf8f71':
Add a missing null pointer check for AdapterService
52a0ff2d6eb7c57228bbe5ea821bd87eaa5493fe 24-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Add a missing null pointer check for AdapterService

Add a missing null pointer check for AdapterService
inside class AdapterServiceBinder when receiving
a Binder request to dump Bluetooth state.

[Cherry-picked from AOSP]

Bug: 27343461
Change-Id: I62e67120f6eb6edb5a93b19a9cca5c09862d6506
tservice/AdapterService.java
7f4f9303f6ad367e29ac60f195b23c69e748c338 24-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Add a missing null pointer check for AdapterService

Add a missing null pointer check for AdapterService
inside class AdapterServiceBinder when receiving
a Binder request to dump Bluetooth state.

Bug: 27343461
Change-Id: I62e67120f6eb6edb5a93b19a9cca5c09862d6506
tservice/AdapterService.java
1feb854b0c7c7106c89dbabd26843810596819b9 24-Feb-2016 Ajay Panicker <apanicke@google.com> Merge "Add timestamp to last scans"
am: 781af1e9b1

* commit '781af1e9b11912f706a7ca00f8b20427fbfe996a':
Add timestamp to last scans
5c07523b0b5d32176d7ff3ab28555123123261dd 24-Feb-2016 Ajay Panicker <apanicke@google.com> Add timestamps to last LE scan log

Ex:
no.nordicsemi.android.mcp (Registered)
LE scans (started/stopped) : 5 / 4
Scan time in ms (min/max/avg) : 97 / 1476 / 897
Last 4 scans (timestamp - duration):
1970/02/13 21:10:19 - 1476ms
1970/02/13 21:10:21 - 97ms
1970/02/13 21:10:23 - 929ms
1970/02/13 21:10:25 - 531ms
Application ID : 5
UUID : f77437a1-5e86-4e2d-8223-6193a095c7f5
Current scan duration in ms : 1452
Connections: 0


Bug: 27294154
Change-Id: I66ba6b4bc2d45ced7d6414db007394a16a30956e
att/ContextMap.java
bcc88d63a2168c0eabaf0056435076c4864e5bef 19-Feb-2016 Ajay Panicker <apanicke@google.com> Clean up gatt dump output

Bug: 27294154
Change-Id: Ia411bb3446b657b06a1748daa14628da79d59ca0
att/GattService.java
899ebeb890b5564b1515ee289b7877399a4b47fe 24-Feb-2016 Ajay Panicker <apanicke@google.com> Add timestamp to last scans

Ex:
no.nordicsemi.android.mcp (Registered)
LE scans (started/stopped) : 5 / 4
Scan time in ms (min/max/avg) : 97 / 1476 / 897
Last 4 scans (timestamp - duration):
1970/02/13 21:10:19 - 1476ms
1970/02/13 21:10:21 - 97ms
1970/02/13 21:10:23 - 929ms
1970/02/13 21:10:25 - 531ms
Application ID : 5
UUID : f77437a1-5e86-4e2d-8223-6193a095c7f5
Current scan duration in ms : 1452
Connections: 0


Bug: 27294154
Change-Id: I66ba6b4bc2d45ced7d6414db007394a16a30956e
att/ContextMap.java
9e6146ee2f94c0301d8cc19ca4655e197528829c 24-Feb-2016 Andre Eisenbach <eisenbach@google.com> Merge "DO NOT MERGE Read Bluetooth interop database entries from settings (2/2)" into mnc-dr-dev
am: e836319052

* commit 'e8363190528d0d95a35ab265ab91c591eb17a7c3':
DO NOT MERGE Read Bluetooth interop database entries from settings (2/2)
e8363190528d0d95a35ab265ab91c591eb17a7c3 24-Feb-2016 Andre Eisenbach <eisenbach@google.com> Merge "DO NOT MERGE Read Bluetooth interop database entries from settings (2/2)" into mnc-dr-dev
1a1169dcb2627c9667153232a356984e81f24e82 18-Dec-2015 Liejun Tao <baibai@motorola.com> DO NOT MERGE Enhance AVRCP Absolute Volume control implementation

1. Remember the current local volume level, current remote volume level.
When user adjusts the volume, compare the returned remote volume
level with desired volume level, if they don't match, do retry.

2.Learn and remember the volume mapping between phone volume level and
remote volume level as the user adjusts volume. When user adjusts to one
remembered volume level, use the mapping directly. Otherwise calculate
the remote volume level and try with method described in step one.

3. Blacklist device if remote device does not tell its initial volume.

4. Define optional threshold for initial volume level to avoid headset
being too loud upon re-connection.

Signed-off-by: Liejun Tao <baibai@motorola.com>
Change-Id: I78112f5f401666f5a680561473a5c7f914071fbe
2dp/A2dpService.java
vrcp/Avrcp.java
tservice/BondStateMachine.java
1434997b9c404f44a3d9e5f2e0aeb0fb0df4d168 14-Jan-2016 Andre Eisenbach <eisenbach@google.com> DO NOT MERGE Read Bluetooth interop database entries from settings (2/2)

Interop database entries are stored in the system settings entry
"BluetoothInteropDatabase". The format is a list of entries separated by
";". An entry consists of a BDA fragment, followed by a comma and an
integer representing a feature from interop.h.

Example:
To disable LE secure connections for devices starting with BDA 11:22:33,
use "11:22:33,0".

Bug: 26548845
Change-Id: I5903930178b70d1eb52d64b1c6051ce8ee346da4
tservice/AdapterService.java
fe0f221cf5e6bb81a2be0cfb22b2ea1a6531cbe5 17-Feb-2016 Erik Kline <ek@google.com> Use IpManager when feeling Pan-tastic

Convert Bluetooth PAN from dhcpcd to IpManager.

Bug: 26991160
Change-Id: Iec8a48294702a8d214f43bea5ef9a041fa52d20f
an/BluetoothTetheringNetworkFactory.java
8b6b4213f509a69731d04e00dce450e86434c0f7 20-Feb-2016 Ajay Panicker <apanicke@google.com> Merge "Clean up gatt dump output"
am: afdc8ec399

* commit 'afdc8ec399bc0d4ab118a83e3cacec41263e2d15':
Clean up gatt dump output
e852adacf44eaad5756b9c7d176fe343abd5d86a 19-Feb-2016 Ajay Panicker <apanicke@google.com> Clean up gatt dump output

Change-Id: Ia411bb3446b657b06a1748daa14628da79d59ca0
att/GattService.java
db32e0ef467d70961b28913fc86c38cd68f8701e 14-Jan-2016 Andre Eisenbach <eisenbach@google.com> Read Bluetooth interop database entries from settings (2/2)

Interop database entries are stored in the system settings entry
"BluetoothInteropDatabase". The format is a list of entries separated by
";". An entry consists of a BDA fragment, followed by a comma and an
integer representing a feature from interop.h.

Example:
To disable LE secure connections for devices starting with BDA 11:22:33,
use "11:22:33,0".

Bug: 26548845
Change-Id: I5903930178b70d1eb52d64b1c6051ce8ee346da4
(cherry picked from commit 8ecd371d3b90878c211785bae4612d24e06abfca)
tservice/AdapterService.java
e3d0e6f817346cca57ce6230bd98180b425a0a64 18-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Output the Protobuf result in Base64 string

Outputing in binary format does not work, because
the reader assumes the output is a string.

Change-Id: If24797264e82c649c21f9b984f04ec70adbcec94
tservice/AdapterService.java
3122e5171ef26ff487f10826786606df848ca25e 16-Feb-2016 Ajay Panicker <apanicke@google.com> Add Java Protobuf dump and ScanEvent Protobuf

Add Protobuf dumping for the Java layer. Also add ScanEvent Protobuf
to already existing scan event logging.

Change-Id: Ib05973c8d98df3bead84b22b3773c42effb25c87
tservice/AdapterService.java
tservice/ProfileService.java
tservice/bluetooth.proto
att/ContextMap.java
att/GattService.java
cc810f757b28d95d3a67d1810426bbedd69a0d88 09-Oct-2015 Deepak A Metri <deepak.a.metri@intel.com> Improve BT OPP throughput

Progress Bar updation during OPP takes around 40ms for each update.
This causes a significant delay in OPP file transfer, which eventually
will decrease the throughput.
To improve the throughput, invoke the progressBar updation only if there
is a change in the percentage.

Change-Id: I64a0b47093698959026d2b97f296c709a7d92703
Signed-off-by: Deepak A Metri <deepak.a.metri@intel.com>
Signed-off-by: Cedric Bondier <cedric.bondier@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
0787917a687e31cbd1a9d8af5eca6b684a3ef894 14-Aug-2014 jun.x.wang <jun.x.wang@sonymobile.com> Fix NPE crash while removeBatch

When unpairing two devices, the BluetoothOppShareInfo
in BluetoothOppBatch may be null during transfer.

Change-Id: I7b4fbd0f291250deebdeaea4bf2d2f540fe233dc
pp/BluetoothOppService.java
b5dde8c7ec12952afb9fee7a41707e65d2a61737 08-Jan-2016 Ajay Panicker <apanicke@google.com> Null terminate MAP instance information

Bug: 26437927
Change-Id: I673de7f7c68b9a02b234bb99c6f89c7fc36f90c9
ap/BluetoothMapUtils.java
c9ba9199e0812b3921799b6190bb6a7305caf029 18-Feb-2016 Andre Eisenbach <eisenbach@google.com> Merge "Output the Protobuf result in Base64 string"
am: f481ad9463

* commit 'f481ad94638e3db693a6ada090afec659cd2ec7c':
Output the Protobuf result in Base64 string
13e969ef645add2ca8c5e44cce915c2aa588c52c 18-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Output the Protobuf result in Base64 string

Outputing in binary format does not work, because
the reader assumes the output is a string.

Change-Id: If24797264e82c649c21f9b984f04ec70adbcec94
tservice/AdapterService.java
5c27af0aad853f51263ecfa38de643554223ac06 18-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Merge "Add Java Protobuf dump and ScanEvent Protobuf"
am: 03a1b4fc09

* commit '03a1b4fc094ab32ccf0c48d299c3cee1348bab3f':
Add Java Protobuf dump and ScanEvent Protobuf
f7435f2f832ab1faa9ca254143796e9516905c63 16-Feb-2016 Ajay Panicker <apanicke@google.com> Add Java Protobuf dump and ScanEvent Protobuf

Add Protobuf dumping for the Java layer. Also add ScanEvent Protobuf
to already existing scan event logging.

Change-Id: Ib05973c8d98df3bead84b22b3773c42effb25c87
tservice/AdapterService.java
tservice/ProfileService.java
tservice/bluetooth.proto
att/ContextMap.java
att/GattService.java
abdbe8346c368588d8ed36a5bb922651ce0fa984 18-Feb-2016 Andre Eisenbach <eisenbach@google.com> Merge "Improve BT OPP throughput"
am: ceba109434

* commit 'ceba109434fca8bf56b051edd888244adf54687d':
Improve BT OPP throughput
944be107f513c90a7a8319f19bbe132b236ef1e7 09-Oct-2015 Deepak A Metri <deepak.a.metri@intel.com> Improve BT OPP throughput

Progress Bar updation during OPP takes around 40ms for each update.
This causes a significant delay in OPP file transfer, which eventually
will decrease the throughput.
To improve the throughput, invoke the progressBar updation only if there
is a change in the percentage.

Change-Id: I64a0b47093698959026d2b97f296c709a7d92703
Signed-off-by: Deepak A Metri <deepak.a.metri@intel.com>
Signed-off-by: Cedric Bondier <cedric.bondier@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
1af8d21d56d7d00f644514db067a3c63fc7d640a 17-Feb-2016 Bill Yi <byi@google.com> Merge commit 'f54b7cfd127ce744d1957947a631a92a242748f8' into HEAD
082275e31109a282c9ba1a00467d3d11bd65067c 08-Jan-2016 Ajay Panicker <apanicke@google.com> [DO NOT MERGE ANYWHERE] Null terminate MAP instance information

Bug: 26437927
Change-Id: I673de7f7c68b9a02b234bb99c6f89c7fc36f90c9
ap/BluetoothMapUtils.java
fa0cc588384967de363ab08d3ed10d8350a2a70d 01-Feb-2016 Marie Janssen <jamuraa@google.com> Alternate dumpsys output for arguments

The metrics collection uses the dumpsys function with extra arguments to
provide different formatted output.

When arguments are provided, skip the normal output and use
alternatives.

Change-Id: Ie43b9134c4b21bb2761228934b954e68f2360c2f
(cherry picked from commit c0f578772f03361c48a8aba034e8812e2315c8ee)
tservice/AdapterService.java
9fd2069d25d38bc3ae6b1d14732cbaa24be292e8 14-Aug-2014 jun.x.wang <jun.x.wang@sonymobile.com> Fix NPE crash while removeBatch

When unpairing two devices, the BluetoothOppShareInfo
in BluetoothOppBatch may be null during transfer.

Change-Id: I7b4fbd0f291250deebdeaea4bf2d2f540fe233dc
pp/BluetoothOppService.java
4a63ad1df0fb61e74cdbaccdd280c0bf95a3112f 01-Feb-2016 Marie Janssen <jamuraa@google.com> Alternate dumpsys output for arguments

The metrics collection uses the dumpsys function with extra arguments to
provide different formatted output.

When arguments are provided, skip the normal output and use
alternatives.

Change-Id: Ie43b9134c4b21bb2761228934b954e68f2360c2f
tservice/AdapterService.java
bc5ec351447ea8841b9a27e18772aefd62b047bc 08-Jan-2016 Ajay Panicker <apanicke@google.com> Null terminate MAP instance information

Bug: 26437927
Change-Id: I673de7f7c68b9a02b234bb99c6f89c7fc36f90c9
ap/BluetoothMapUtils.java
5e5ec9a2c715137cdef73e13cedc96c345daf935 06-Feb-2016 Adam Lesinski <adamlesinski@google.com> Merge "Reset ble scans in BatteryStats on start up"
7a51f31646fa78a10bb89ff691a9e1fb8b8a1e34 05-Feb-2016 Andre Eisenbach <eisenbach@google.com> Merge "Enhance AVRCP Absolute Volume control implementation" am: b8a26db0b7
am: 6b82837c0f

* commit '6b82837c0facc5f3c343a00f407abd6ee2312496':
Enhance AVRCP Absolute Volume control implementation
6b82837c0facc5f3c343a00f407abd6ee2312496 05-Feb-2016 Andre Eisenbach <eisenbach@google.com> Merge "Enhance AVRCP Absolute Volume control implementation"
am: b8a26db0b7

* commit 'b8a26db0b7c4eabcd7784d087793dd8c8f9973a2':
Enhance AVRCP Absolute Volume control implementation
11798b011c962b602217b479130d413f3b30f19a 18-Dec-2015 Liejun Tao <baibai@motorola.com> Enhance AVRCP Absolute Volume control implementation

1. Remember the current local volume level, current remote volume level.
When user adjusts the volume, compare the returned remote volume
level with desired volume level, if they don't match, do retry.

2.Learn and remember the volume mapping between phone volume level and
remote volume level as the user adjusts volume. When user adjusts to one
remembered volume level, use the mapping directly. Otherwise calculate
the remote volume level and try with method described in step one.

3. Blacklist device if remote device does not tell its initial volume.

4. Define optional threshold for initial volume level to avoid headset
being too loud upon re-connection.

Signed-off-by: Liejun Tao <baibai@motorola.com>
Change-Id: I78112f5f401666f5a680561473a5c7f914071fbe
2dp/A2dpService.java
vrcp/Avrcp.java
tservice/BondStateMachine.java
28e370be5bbe2c54bb91c70f54b05326063e32ce 04-Feb-2016 Andre Eisenbach <eisenbach@google.com> Merge "Implement createBondOutOfBand"
am: c450f89460

* commit 'c450f89460855d6dfeb4d28364091f3b99bab447':
Implement createBondOutOfBand
7ecde7c02c3f803cd182fe5c7bef8a410449b50e 29-Dec-2015 Jakub Pawlowski <jpawlowski@google.com> Implement createBondOutOfBand

This patch implements out of band pairing that uses optional data.
Currently it works only for LE transport, using Temporary Key value.
In future fields might be added to OOBData to support other options for
optional data.

Change-Id: I1b4942e656be7b5d1ae5a4bf9d867ffd74753798
tservice/AdapterService.java
tservice/BondStateMachine.java
214b72b021e94649f5015ab3e5ae64a4e2012c1b 28-Jan-2016 Adam Lesinski <adamlesinski@google.com> Reset ble scans in BatteryStats on start up

Bug:22718669
Change-Id: I89b0106776aadfd383a11c509f6eba660461bd31
tservice/AdapterService.java
ce1e250b06d8bc83c43e226e0c1c9cfa9edb510f 27-Jan-2016 Marie Janssen <jamuraa@google.com> Merge "Remove IBluetooth.dump(), dumpsys arguments"
am: 85fef74108

* commit '85fef74108ac3671ae2d4b230942b2ee6e7fd0f1':
Remove IBluetooth.dump(), dumpsys arguments
51e9ef3ca2d4cd93adf79fb98ab829163b286472 12-Jan-2016 Marie Janssen <jamuraa@google.com> Remove IBluetooth.dump(), dumpsys arguments

Move the majority of dumpsys into the AdapterService so we don't need
IBluetooth.dump(), and update the JNI interface for dumpsys arguments.

Change-Id: I481f147d913e0f4e1b85b8e4b027dbc349372ce5
tservice/AdapterService.java
44f6d970c611bb13000f4eae052a6de316191fa4 16-Jan-2016 Adam Lesinski <adamlesinski@google.com> Use the incoming WorkSource to notify batterystats of BLE scans

BatteryStats is going to start tracking bluetooth scanning, so
we start by passing along the WorkSource we were given (or we created
if none was specified).

This is only done for BLE scanning at the moment, and only for regular scans.
Batched scans will also need to be considered.
Bug:22718669

Change-Id: I3ff042d6c344f13b600602c5966aef60b4587916
att/GattService.java
att/ScanClient.java
att/ScanManager.java
d8f88f77836e24c20b67cd872105eb7700f59942 25-Jan-2016 Shishir Agrawal <shishir@google.com> Unhiding MSIM APIs.

1. Unhide MSIM APIs in TelephonyManager that already have non-MSIM equivalent
APIs public.
2. Make MSIM API naming consistent (overloaded, no suffix).
3. Unhide APIs in SubscriptionManager that are necessary for MSIM.

Bug: 26772894
Change-Id: I823ee075e8f77b459977b7546b27e1b373633c53
fp/HeadsetPhoneState.java
407f11ca439f338f84b51e15830446ecd3ae488f 12-Jan-2016 Marie Janssen <jamuraa@google.com> Remove IBluetooth.dump(), dumpsys arguments

Move the majority of dumpsys into the AdapterService so we don't need
IBluetooth.dump(), and update the JNI interface for dumpsys arguments.

Change-Id: I481f147d913e0f4e1b85b8e4b027dbc349372ce5
(cherry picked from commit 48131cd77d2a1fd7d6112eee388a90a1fdbe0c6c)
tservice/AdapterService.java
d38ba29ff12eea818f2fd502ee9d5a4f1bfb278e 23-Jan-2016 Sanket Agarwal <sanketa@google.com> Synchronize HF and AG volume.

Use normalization where required to convert from Android volume range to
HF volume range.

Bug: b/26714956

Change-Id: Ia90ec6aba41d6f66ca2e34ecc877c52c80cd7a0c
fpclient/HeadsetClientStateMachine.java
847fcb35baaa8083d191d5a616a5581684bbe2ff 21-Jan-2016 Adam Lesinski <adamlesinski@google.com> Merge "Add traffic accounting to Bluetooth App."
am: d23eaab475

* commit 'd23eaab4755da60af6b669b865fdbf0e07c8ab5a':
Add traffic accounting to Bluetooth App.
053048d9ab4f56415ad97a04e94d1b2fbb9d93e7 21-Jan-2016 Adam Lesinski <adamlesinski@google.com> Merge "Add traffic accounting to Bluetooth App."
15d43d60be04035c107211fa8fc10956b41637be 21-Jan-2016 Ajay Panicker <apanicke@google.com> Merge "Add extra logging for BLE scans"
am: e9b5054375

* commit 'e9b505437574d21b7648ee18789f1124939df536':
Add extra logging for BLE scans
cbe581021ff654f7450d1403d8896f5d1203c8b6 04-Dec-2015 Adam Lesinski <adamlesinski@google.com> Add traffic accounting to Bluetooth App.

Update the Bluetooth app to build against the new Bluetooth HAL,
which expects to be given a calling UID when opening sockets and
expects a callback for energy info that accepts uid_traffic_t data.

Bug:26039657
Change-Id: I23ffbe39041f11706376acfc6aba33ba661a6ef1
tservice/AdapterService.java
b488ef885e5690c3f6085ccf35e213e0f7eb7597 04-Dec-2015 Adam Lesinski <adamlesinski@google.com> Add traffic accounting to Bluetooth App.

Update the Bluetooth app to build against the new Bluetooth HAL,
which expects to be given a calling UID when opening sockets and
expects a callback for energy info that accepts uid_traffic_t data.

Bug:26039657
Change-Id: I23ffbe39041f11706376acfc6aba33ba661a6ef1
tservice/AdapterService.java
e9b505437574d21b7648ee18789f1124939df536 21-Jan-2016 Ajay Panicker <apanicke@google.com> Merge "Add extra logging for BLE scans"
9fa95f7c39df16aa059391a637b4469f97e7d987 15-Jan-2016 Ajay Panicker <apanicke@google.com> Add extra logging for BLE scans

Added logging for application name, number of scans, and scan times
for each application that uses gatt scanning.

Example output:
GATT Client Map
Entries: 1

Application Name: com.broadcom.app.leexplorer (Registered)
LE scans (started/stopped) : 4 / 4
Scan time in ms (min/max/avg) : 6 / 7321 / 2744
Time since last scan ended in ms : 3522
Last 4 scans in ms (oldest first): 763 6 7321 2887
Application ID : 5
UUID : f69badb3-212b-40b5-b5b3-3bf9214310f9
Connections: 1
5: 6B:1F:6C:45:3D:DC

Bug: 26463429
Change-Id: I52376541a5b5874d0e40978990149a1283fd9c6a
att/ContextMap.java
att/GattService.java
8a0bc0a61e97f8923cb362e1dbb7ff66ffe51507 15-Jan-2016 Ajay Panicker <apanicke@google.com> Add extra logging for BLE scans

Added logging for application name, number of scans, and scan times
for each application that uses gatt scanning.

Example output:
GATT Client Map
Entries: 1

Application Name: com.broadcom.app.leexplorer (Registered)
LE scans (started/stopped) : 4 / 4
Scan time in ms (min/max/avg) : 6 / 7321 / 2744
Time since last scan ended in ms : 3522
Last 4 scans in ms (oldest first): 763 6 7321 2887
Application ID : 5
UUID : f69badb3-212b-40b5-b5b3-3bf9214310f9
Connections: 1
5: 6B:1F:6C:45:3D:DC

Bug: 26463429
Change-Id: I52376541a5b5874d0e40978990149a1283fd9c6a
att/ContextMap.java
att/GattService.java
f648ebe608f62462c90f84235df774abbcf2ad47 20-Jan-2016 Sanket Agarwal <sanketa@google.com> Merge "A2DP Sink:Audio Rendering patch and AutoConnect Functionality"
am: a22d9acc77

* commit 'a22d9acc77d60cfad31ecfe67cef806657406725':
A2DP Sink:Audio Rendering patch and AutoConnect Functionality
09e4252d1ba0a186808787be9a08de346ed70a25 22-Dec-2015 Sanket Agarwal <sanketa@google.com> A2DP Sink:Audio Rendering patch and AutoConnect Functionality

- Add autoconnect functionality for A2DP Sink
- Use AudioPatch mechanism for sink playback
- AudioFocus approach to manage concurrencies

A2DP Sink: Support for AudioTrack

- add support for audiotrack to render audio data
- add support for AVRCP State to trigger audio
rendering

AVRCP_CTRL: add support for AVRCP 1.3 Controller

- fill placeholder function for AVRCP 1.3
- add supporting classes to handle AVRCP Commands

AVRCP Controller: Support for retaining volume level and blocking streaming from remote.

- retain volume level on new connection request
- block streaming from remote.

Change-Id: I8c31fd1779b196ced0fb0870855b93263ea331ec
2dp/A2dpSinkService.java
2dp/A2dpSinkStateMachine.java
vrcp/AvrcpControllerClasses.java
vrcp/AvrcpControllerConstants.java
vrcp/AvrcpControllerService.java
vrcp/NowPlaying.java
vrcp/RemoteMediaPlayers.java
tservice/AdapterService.java
914484bd8562ae75b062a669c89020773c8529b5 29-Dec-2015 Jakub Pawlowski <jpawlowski@google.com> Implement createBondOutOfBand

This patch implements out of band pairing that uses optional data.
Currently it works only for LE transport, using Temporary Key value.
In future fields might be added to OOBData to support other options for
optional data.

Change-Id: I1b4942e656be7b5d1ae5a4bf9d867ffd74753798
tservice/AdapterService.java
tservice/BondStateMachine.java
de00ed882cf20e5c136e349ae5e40ad35c5a74ee 22-Dec-2015 Sanket Agarwal <sanketa@google.com> A2DP Sink:Audio Rendering patch and AutoConnect Functionality

- Add autoconnect functionality for A2DP Sink
- Use AudioPatch mechanism for sink playback
- AudioFocus approach to manage concurrencies

A2DP Sink: Support for AudioTrack

- add support for audiotrack to render audio data
- add support for AVRCP State to trigger audio
rendering

AVRCP_CTRL: add support for AVRCP 1.3 Controller

- fill placeholder function for AVRCP 1.3
- add supporting classes to handle AVRCP Commands

AVRCP Controller: Support for retaining volume level and blocking streaming from remote.

- retain volume level on new connection request
- block streaming from remote.

Change-Id: I8c31fd1779b196ced0fb0870855b93263ea331ec
2dp/A2dpSinkService.java
2dp/A2dpSinkStateMachine.java
vrcp/AvrcpControllerClasses.java
vrcp/AvrcpControllerConstants.java
vrcp/AvrcpControllerService.java
vrcp/NowPlaying.java
vrcp/RemoteMediaPlayers.java
tservice/AdapterService.java
e005c18fa8fd19ef68580c57760e91735e66a48b 12-Jan-2016 Ashwini Munigala <AshwiniM@codeaurora.org> DO NOT MERGE Fix SMS delivered successfully but stuck SENDING issue am: f81566bb85
am: ff7beb91be

* commit 'ff7beb91bee0db50b4ce03aba1b39a3362f767c6':
DO NOT MERGE Fix SMS delivered successfully but stuck SENDING issue
ff7beb91bee0db50b4ce03aba1b39a3362f767c6 12-Jan-2016 Ashwini Munigala <AshwiniM@codeaurora.org> DO NOT MERGE Fix SMS delivered successfully but stuck SENDING issue
am: f81566bb85

* commit 'f81566bb85a1d0388b738dc5553d096591fc9030':
DO NOT MERGE Fix SMS delivered successfully but stuck SENDING issue
352e218bcaa0f4c47636f8aeef02eef543aeb131 09-Jan-2016 Jeff Sharkey <jsharkey@android.com> Follow AIDL refactoring.

Bug: 26471205
Change-Id: I20aa94fb599eda9ee4b1d0b8de208aecb9e560e7
tils.java
e7bdb9a333e9610bb654cce8858d8f8aadbb629d 07-Jan-2016 Ashwini Munigala <AshwiniM@codeaurora.org> DO NOT MERGE Fix SMS delivered successfully but stuck SENDING issue
am: 1983bccf61

* commit '1983bccf614d61dfcf20ba3cbf14f4ebf7f49943':
DO NOT MERGE Fix SMS delivered successfully but stuck SENDING issue
1983bccf614d61dfcf20ba3cbf14f4ebf7f49943 07-Sep-2015 Ashwini Munigala <AshwiniM@codeaurora.org> DO NOT MERGE Fix SMS delivered successfully but stuck SENDING issue

Receive and handle ACTION_MESSAGE_SENT intent for SMS type
message to move it to SENT folder when pushMessage request
from MCE is processed and SMS delivered successfully.

Bug: 22343270
CRs-Fixed: 903561
Change-Id: I337fb1fb870873bf9f1add58d6d898465fc003c8
ap/BluetoothMapContentObserver.java
b145f33f93ad319ce11e541f5ae48888f07de719 06-Jan-2016 Andre Eisenbach <eisenbach@google.com> Merge "Enforce BLUETOOTH_PRIVILEGED permission for FIDO U2F over GATT"
am: 28ca6b2d79

* commit '28ca6b2d791358a1938c5ab1693f01522c4338f4':
Enforce BLUETOOTH_PRIVILEGED permission for FIDO U2F over GATT
717eb278a0deefdb6f43b97f40986641a8ac170b 22-Dec-2015 Alexei Czeskis <aczeskis@google.com> Enforce BLUETOOTH_PRIVILEGED permission for FIDO U2F over GATT

All access to external Bluetooth U2F devices must go through system
APIs so that calling apps cannot spoof their idenity. This change
blocks the whole FIDO U2F service from being accessed.

Change-Id: I122849452c09fb8bc3bff9ead2db1edf64ddfabc
att/GattService.java
f81566bb85a1d0388b738dc5553d096591fc9030 07-Sep-2015 Ashwini Munigala <AshwiniM@codeaurora.org> DO NOT MERGE Fix SMS delivered successfully but stuck SENDING issue

Receive and handle ACTION_MESSAGE_SENT intent for SMS type
message to move it to SENT folder when pushMessage request
from MCE is processed and SMS delivered successfully.

Bug: 22343270
CRs-Fixed: 903561
Change-Id: I9dafffc737a34233ede2d10e22cd969f520a12cf
ap/BluetoothMapContentObserver.java
a6ebe46992bcdf60bfc40cbb78974425b8901449 22-Dec-2015 Alexei Czeskis <aczeskis@google.com> Enforce BLUETOOTH_PRIVILEGED permission for FIDO U2F over GATT

All access to external Bluetooth U2F devices must go through system
APIs so that calling apps cannot spoof their idenity. This change
blocks the whole FIDO U2F service from being accessed.

Change-Id: I122849452c09fb8bc3bff9ead2db1edf64ddfabc
att/GattService.java
4f341a3ac7cdfd7c976a9eb59117542d50458398 07-Sep-2015 Ashwini Munigala <AshwiniM@codeaurora.org> Fix SMS delivered successfully but stuck SENDING issue

Receive and handle ACTION_MESSAGE_SENT intent for SMS type
message to move it to SENT folder when pushMessage request
from MCE is processed and SMS delivered successfully.

Change-Id: I9dafffc737a34233ede2d10e22cd969f520a12cf
CRs-Fixed: 903561
ap/BluetoothMapContentObserver.java
146e0f4edc2e93f686c7db901ced096d0c507ded 19-Dec-2015 Bryce Lee <brycelee@google.com> Map Bluetooth profiles correctly in isProfileDisabled helper function. am: 0a9659da81 am: c88e96d906
am: 15446e898b

* commit '15446e898b8f832b46be44249058cbd2b9a1a7d5':
Map Bluetooth profiles correctly in isProfileDisabled helper function.
15446e898b8f832b46be44249058cbd2b9a1a7d5 19-Dec-2015 Bryce Lee <brycelee@google.com> Map Bluetooth profiles correctly in isProfileDisabled helper function. am: 0a9659da81
am: c88e96d906

* commit 'c88e96d90674d9b19e8bc904efc05bd64a268853':
Map Bluetooth profiles correctly in isProfileDisabled helper function.
0a9659da81c1367bf40a8340ecdff4227f88203b 18-Dec-2015 Bryce Lee <brycelee@google.com> Map Bluetooth profiles correctly in isProfileDisabled helper function.

Change-Id: Ic38736a653e6413f1f3bb41c8dfe049abe8883f0
tservice/Config.java
84b5aa423870a750872d999663df543a52b568f6 18-Dec-2015 Bryce Lee <brycelee@google.com> Monitor disabled profile setting and enable/disable profiles on change. am: 3602a64c6b am: 14675b24f4
am: 7504ddeec9

* commit '7504ddeec934d6107b251fb45fefcddb8259e0ae':
Monitor disabled profile setting and enable/disable profiles on change.
7504ddeec934d6107b251fb45fefcddb8259e0ae 17-Dec-2015 Bryce Lee <brycelee@google.com> Monitor disabled profile setting and enable/disable profiles on change. am: 3602a64c6b
am: 14675b24f4

* commit '14675b24f4c1bf1800ecd243a71fcdd96c9818af':
Monitor disabled profile setting and enable/disable profiles on change.
3602a64c6bbe46775cba67f064af39c89d888c5c 17-Dec-2015 Bryce Lee <brycelee@google.com> Monitor disabled profile setting and enable/disable profiles on change.

Bug: 25900899
Change-Id: Id98ae58ada8eecd33a2c86970d9d20ae061680be
tservice/AdapterService.java
tservice/Config.java
tservice/ProfileObserver.java
0156b38a345f9ddecae09d90737c31435f5ff911 15-Dec-2015 Andre Eisenbach <eisenbach@google.com> Merge "Fix race condition when doing GATT discovery" am: 82e316efe6
am: 9ff4e56e2b

* commit '9ff4e56e2b6ade75aba3c48ed26eab06290bbf61':
Fix race condition when doing GATT discovery
9ff4e56e2b6ade75aba3c48ed26eab06290bbf61 15-Dec-2015 Andre Eisenbach <eisenbach@google.com> Merge "Fix race condition when doing GATT discovery"
am: 82e316efe6

* commit '82e316efe6568d498a9bca1477745c429ac287d1':
Fix race condition when doing GATT discovery
bac1f06eeded99fa43e00ac4114846a96c22e03c 12-Dec-2015 Jakub Pawlowski <jpawlowski@google.com> Fix race condition when doing GATT discovery

Right now if discovery to multiple GATT clients is happening
simultaneously, onSearchComplete will be run only for device that
finishes discovery last, while it should be run for each device.

mSearchQueue is one for all discovery sessions. Instead of checking if
it's empty, we must check if there are no elements for given connId.

Bug: 26038939
Change-Id: I9417cd7be8cab4b808ce7f045861e1adc2055629
att/GattService.java
att/SearchQueue.java
3076d2acccf5c3db0db19b622f062e259be39f3a 02-Dec-2015 Sanket Agarwal <sanketa@google.com> Delegate HFP Audio focus (HF) to entity controlling the actual phone call.

HF role currently handles audio focus itself although the idea is to
have telecom stack do it (it already does in ConnectionService and
CallAudioManager). We rip out the Audio focus management and ringer
control from the state machine and only leave the audio routing and
volume control here.

SCO routing and volume control is currently still handled by Hfp Client
since audio manager does not yet support HF responsibilities.

Bug: b/25261431

Change-Id: I893654de2427cf031c7cddda888ed3694b0001be
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
128616129f2ed5525c2b9655e4fc112ab239b5c1 17-Nov-2015 Bryce Lee <brycelee@google.com> Allow for automatic routing on HF AG to be disabled. am: 9e1b34b2a5
am: e58438d821

* commit 'e58438d821210e57c2240befdaa99e4ab996c51c':
Allow for automatic routing on HF AG to be disabled.
9e1b34b2a5a80c9b16cfc9e71fd4ff015086ab16 16-Nov-2015 Bryce Lee <brycelee@google.com> Allow for automatic routing on HF AG to be disabled.

Bug: 25485578
Change-Id: Iefe06f9df811311040f154ddf8f578893b275ef4
fp/HeadsetService.java
fp/HeadsetStateMachine.java
bba0a48e032a216f22722baadbe39f7e43fd124a 10-Nov-2015 Jean-Michel Trivi <jmtrivi@google.com> Remove useless imports

Change-Id: I306df32b76612d5de2b8741e858298fd7aae5c36
vrcp/Avrcp.java
ba117eea73260a9f7a908eb64b61a2851fa92711 29-Oct-2015 Bryce Lee <brycelee@google.com> Implement setting/getting whether audio can be routed to the HFP HF device. am: 22bb394443 am: c3da0f7bb3
am: 80ebb2a7df

* commit '80ebb2a7dfb1aa1cd44f06d989801b628e138f98':
Implement setting/getting whether audio can be routed to the HFP HF device.
770dfc79291eb3a9de78b1756243ba18fd124aa5 29-Oct-2015 Bryce Lee <brycelee@google.com> Revert "Allow HFP HF implementations to specify a client controller." am: 84d1aab871 am: 4af80a65ff
am: d6dfef0fc5

* commit 'd6dfef0fc53f2cf6f36246411af5fabf360f22a0':
Revert "Allow HFP HF implementations to specify a client controller."
3a870c1c83340c45aa08d4ee9787fde947c16d01 29-Oct-2015 Bryce Lee <brycelee@google.com> Allow HFP HF implementations to specify a client controller. am: 8843d8a825 am: 13a0edb5e7
am: 831b78a467

* commit '831b78a4678a209fa4e4b72929f033956881ec1b':
Allow HFP HF implementations to specify a client controller.
22bb39444356637fbcabd4acf04f2fdb9e3da177 29-Oct-2015 Bryce Lee <brycelee@google.com> Implement setting/getting whether audio can be routed to the HFP HF device.

Bug: 25332357
Change-Id: I2d37d082673255a165dad955aa1ca4b9f00d599e
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
84d1aab871b03d94dddce4ad2d17f3c2acb892b5 29-Oct-2015 Bryce Lee <brycelee@google.com> Revert "Allow HFP HF implementations to specify a client controller."

This reverts commit 8843d8a82571b0a2f1b003cad999bed595814257.

Change-Id: I5371e263fd92c6790558d38f19945492731e17f6
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
8843d8a82571b0a2f1b003cad999bed595814257 29-Oct-2015 Bryce Lee <brycelee@google.com> Allow HFP HF implementations to specify a client controller.

The client controller service is used by the HeadsetClientService to
determine conditions such as whether audio routing to device is permitted.

Bug: 25332357
Change-Id: I8971960f959084ed3969db7c8cdef11673a58994
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
1ad7934465e14f7b074ccd75dc57c1e3a1f2639a 28-Oct-2015 Tony Mak <tonymak@google.com> Merge "Proper fix of contact_id in bluetooth"
cdc0ae72094c96cc0f6715a8408e74056e9f8214 26-Oct-2015 Zach Johnson <zachoverflow@google.com> Remove receiver status foreground flag am: 65842bfe88 am: 4a894feccc
am: 8d8b8093f7

* commit '8d8b8093f727b552e0b5a3d9c4423b4a00e7dfcf':
Remove receiver status foreground flag
65842bfe88b3d91060cd05446024f14061524dcd 26-Oct-2015 Zach Johnson <zachoverflow@google.com> Remove receiver status foreground flag

Turns out this actually causes more problems than
it attempts to solve.

b/25116554
b/25256719

Change-Id: Ia30ab5bf0f6e794376eae85b2616bcdb0049ef76
fpclient/HeadsetClientStateMachine.java
194d11cd56eeacfb4507d25825a244ebc6cb004a 23-Oct-2015 Bryce Lee <brycelee@google.com> Allow for supported profiles to be reloaded on enable. am: 371e2047c4 am: ec7a8e9141
am: 51c261d7ba

* commit '51c261d7ba934072bd05acca51439c03af644b17':
Allow for supported profiles to be reloaded on enable.
371e2047c485f8f75c2b63a38b36a65b72c2fa42 23-Oct-2015 Bryce Lee <brycelee@google.com> Allow for supported profiles to be reloaded on enable.

Bug: 24977590
Change-Id: I2e5371d3333482cdd1cf18d48fe3c2e0f2229e42
tservice/AdapterService.java
8205c75067d22e6385db183b3352c0059eacb2af 23-Oct-2015 Ajay Panicker <apanicke@google.com> Remove Vcard filter for call-logs am: b211df6fcb am: d83da25118 am: afe7ca2198
am: eeb5647233

* commit 'eeb56472331cced520d7bc1fb492d2c828ba80f7':
Remove Vcard filter for call-logs
d83da25118e3b487df56f9e17f3c52bb60b25926 23-Oct-2015 Ajay Panicker <apanicke@google.com> Remove Vcard filter for call-logs
am: b211df6fcb

* commit 'b211df6fcbd7dcd055354b75afc2e68ea49a36d9':
Remove Vcard filter for call-logs
b211df6fcbd7dcd055354b75afc2e68ea49a36d9 22-Oct-2015 Ajay Panicker <apanicke@google.com> Remove Vcard filter for call-logs

Timestamps were being incorrectly filtered out of Vcards when sending
call-logs.

Bug: 25084927
Change-Id: Ied8912e7d2fdbcc6e6980c3773c4ec5a449842ec
bap/BluetoothPbapVcardManager.java
9d68ffa1079ca2e85a8ccf62bf8dca2f43f1ade3 21-Oct-2015 Tony Mak <tonymak@google.com> Proper fix of contact_id in bluetooth

Instead of checking null, explictly state which column(s) we need.

Change-Id: I9780930d8c3457cc8e11ae78cd448f3ffa724183
bap/BluetoothPbapVcardManager.java
601d924b0055dff62d42f5529f3ab2209700c506 21-Oct-2015 Ajay Panicker <apanicke@google.com> Fix file permissions for Bluetooth share am: 66d643091e am: 33e7f11a36 am: 3a7bd34e60
am: ec664957c6

* commit 'ec664957c66d277270de163a42f83ff04ffb316b':
Fix file permissions for Bluetooth share
33e7f11a36a8553285a1fd4c3cfff1e9458df842 21-Oct-2015 Ajay Panicker <apanicke@google.com> Fix file permissions for Bluetooth share
am: 66d643091e

* commit '66d643091edba75b4524483ea640273344533378':
Fix file permissions for Bluetooth share
66d643091edba75b4524483ea640273344533378 14-Oct-2015 Ajay Panicker <apanicke@google.com> Fix file permissions for Bluetooth share

Used a file provider to serve up URIs to allow
applications to access files in the external
Bluetooth directory.

Bug: 23367919
Change-Id: Iadcdcafb235f3eeb50a0e147f3ef982fc9ee38b3
pp/BluetoothOppUtility.java
5ad4cd0e052701eb5a19d43db41faf99c8748528 20-Oct-2015 Xiaohui Chen <xiaohuic@google.com> Clean up USER_OWNER in bluetooth

Bug: 25086442
Change-Id: Icac372ed39f549184f6c9e98e10e88a2510ae692
tils.java
3aea695dff7f2449d7f41e91176d647f9131e1c8 18-Oct-2015 Zach Johnson <zachoverflow@google.com> am 774d31b9: am 264d46d6: am 5040e76e: Only apply foreground flag for audio state connected

* commit '774d31b9d4b0a7bf13f81ee5faa992944782f25e':
Only apply foreground flag for audio state connected
2fe4c32e0bc3bb9f67550439e1058be0a7d91cbd 18-Oct-2015 Zach Johnson <zachoverflow@google.com> am 178b204b: am 8fe21aec: am 5d0f2973: Add FLAG_RECEIVER_FOREGROUND to audio state broadcasts

* commit '178b204bd6e5a557018aef3c56a8fbbdd7d1ddad':
Add FLAG_RECEIVER_FOREGROUND to audio state broadcasts
5040e76e2b2742a210e5e1ef29ae1b1779f12ee3 18-Oct-2015 Zach Johnson <zachoverflow@google.com> Only apply foreground flag for audio state connected

The other states aren't really that important, and
this reduces the chance of ANR.

Change-Id: Ie019b81a9fbfb9238cf8b6cce1308d0d7358cbf8
fpclient/HeadsetClientStateMachine.java
5d0f29737bfa7d9e2891b1e99c87e86fce434599 18-Oct-2015 Zach Johnson <zachoverflow@google.com> Add FLAG_RECEIVER_FOREGROUND to audio state broadcasts

This is important so audio can be rejected in a timely manner
when necessary.

Change-Id: I4a7789d262ac74c5014b34eb959d502a68217362
fpclient/HeadsetClientStateMachine.java
80a654ab3be8109bc427e27055b569127941215d 15-Oct-2015 Fyodor Kupolov <fkupolov@google.com> am 4a9f9b02: Fix foreground scans for pre-M apps when location is disabled

* commit '4a9f9b0253fde7341bf9e12c5bd0e6f29fced4fc':
Fix foreground scans for pre-M apps when location is disabled
4a9f9b0253fde7341bf9e12c5bd0e6f29fced4fc 19-Sep-2015 Fyodor Kupolov <fkupolov@google.com> Fix foreground scans for pre-M apps when location is disabled

Foreground scans were still broken even for L-or-earlier apps when the
location was disabled.

Bug: 24203266
Change-Id: Iaad8d7828a4b383b6cc0a033e94c7d2cd8c9328b
tils.java
att/GattService.java
att/ScanClient.java
2def42b73585bbb6590332544b91156b34496ce9 12-Oct-2015 Hemant Gupta <hemantg@codeaurora.org> am 07c7cfbc: am 7c2df255: am 836f7d38: am faf199e4: SAP: Fix missing connect response when call ongoing at connect

* commit '07c7cfbc93cddc5b87127aaf0800413e8081c950':
SAP: Fix missing connect response when call ongoing at connect
836f7d384eea45c1cc29ab671be798e6b26da519 11-Oct-2015 Hemant Gupta <hemantg@codeaurora.org> am faf199e4: SAP: Fix missing connect response when call ongoing at connect

* commit 'faf199e456dbb987f343c829c603c035df10add7':
SAP: Fix missing connect response when call ongoing at connect
faf199e456dbb987f343c829c603c035df10add7 29-Sep-2015 Hemant Gupta <hemantg@codeaurora.org> SAP: Fix missing connect response when call ongoing at connect

The CALL_ONGOING_STATE was set twice, causing the connect
response not to be sent to the peer device when there was an
ongoing call on DUT. This was violating the SAP Spec.

Bug: 24520367
Change-Id: I290d924870381a82a4abd8b6c42a6d0ebf55652f
ap/SapServer.java
e88f00de97d54518db844e03fbd1ef31239bb405 28-Sep-2015 Ajay Panicker <apanicke@google.com> Merge "NullPoiterException protection for mTelephonyManager"
83c9e07d8b1e7f07e875db70b9f85882d6f37fbc 28-Sep-2015 Ajay Panicker <apanicke@google.com> Merge "Prevent NullPointerException on AdapterService.mRemoteDevices"
6c5983e604a6c2f30717f110f046432b6f749238 27-Sep-2015 Sharvil Nanavati <sharvil@google.com> am a0dccfff: am 4310d139: am 7618faa5: Avoid NPE when dumping headset profile state.

* commit 'a0dccfff9c6093c6b6ab65997f5fde4df203f266':
Avoid NPE when dumping headset profile state.
7618faa5df18324c581ade91f75454e2e3d8ad49 27-Sep-2015 Sharvil Nanavati <sharvil@google.com> Avoid NPE when dumping headset profile state.

Change-Id: I91767bcc09d4e16a9bd5c8dbe2e662a96f9880a5
fpclient/HeadsetClientStateMachine.java
766b3209ac1702fd871d19cc9f7c7c114ed6e8b0 21-Sep-2015 Ajay Panicker <apanicke@google.com> NullPoiterException protection for mTelephonyManager

Protect against null pointer exceptions from occuring when
mTelephonyManager is null. This occures if a function using
the variable is called while the service is shutting down and
cleaning up.

Bug: 23793590
Change-Id: I0313880aa6953e54cb2d13d6fb1a06bcba9058c3
fp/HeadsetPhoneState.java
5b6d0339a47a730580efa6c4236eef365dbb5343 03-Sep-2015 Ajay Panicker <apanicke@google.com> Prevent NullPointerException on AdapterService.mRemoteDevices

Makes sure that mRemoteDevices is always initialized and not null
even if AdapterService functions are called while Ble is turned
off. Before this if some AdapterService functions were ever used
before Ble was turned on, mRemoteDevices wouldn't have been
initialized and a NPE would occur.

Bug: 21893759
Change-Id: Ia0f41c3d4fbfc6322d49431d1f5021857f018ff0
tservice/AdapterService.java
a072c9e05c551dba0a938e158cb3a650c18b4ded 19-Sep-2015 Fyodor Kupolov <fkupolov@google.com> Fix foreground scans for pre-M apps when location is disabled

Foreground scans were still broken even for L-or-earlier apps when the
location was disabled.

Bug: 24203266
Change-Id: Iaad8d7828a4b383b6cc0a033e94c7d2cd8c9328b
tils.java
att/GattService.java
att/ScanClient.java
31afac09a255a43b5f23b4736bffab4f5289c0c0 14-Sep-2015 Sharvil Nanavati <sharvil@google.com> am bd0b5870: am eddb5912: am 0e94b62d: Merge "Send the AUDIO_CONNECTED broadcast after switching to the AudioOn state." into cw-e-dev

* commit 'bd0b5870d3bb4f902473c9da976d6ea6d44bc12f':
Send the AUDIO_CONNECTED broadcast after switching to the AudioOn state.
0e94b62d60f3a729b03841a1891af3a889c9748f 14-Sep-2015 Sharvil Nanavati <sharvil@google.com> Merge "Send the AUDIO_CONNECTED broadcast after switching to the AudioOn state." into cw-e-dev
4247061147878788333e3fc2fa871bd555c0b5d6 14-Sep-2015 Sharvil Nanavati <sharvil@google.com> am b67ba1ba: am 98fbe6c1: am 93793893: Read connection intervals from config.xml so it can be overriden by device.

* commit 'b67ba1ba297fd7cc962f26f79b57f844e9613d8b':
Read connection intervals from config.xml so it can be overriden by device.
93793893b122e5eb3101899411fccaabc075dfaf 14-Sep-2015 Sharvil Nanavati <sharvil@google.com> Read connection intervals from config.xml so it can be overriden by device.

Wear needs the minimum possible connection interval for BLE connections
to support the Wear iOS companion app. This change simply moves the hard-
coded connection intervals to config.xml so they can be overriden for
Wear devices.

Bug: 23903184
Change-Id: I1f60772ef6a100ad5e4f02f629b5ca6e80fc207a
att/GattService.java
a27628d5cb96981b65daec4db798d06ba9d98ce2 13-Sep-2015 Sharvil Nanavati <sharvil@google.com> Send the AUDIO_CONNECTED broadcast after switching to the AudioOn state.

The broadcast is currently sent while the HFP client state machine is
in the Connected state. As a result, a broadcast receiver who wishes
to disconnect the incoming audio connection won't be able to successfully
call disconnectAudio. By changing the internal state first and then
broadcasting, receivers can immediately perform audio operations.

Bug: 23568208
Change-Id: I60de9775f9a0126774275d08ef999f082ae41747
fpclient/HeadsetClientStateMachine.java
1488545ab6b1736cd103e08b94a23260f2f9b667 11-Sep-2015 Ajay Panicker <apanicke@google.com> am 3b14189e: am 8df0d5da: am fb540d85: am 1c28582b: Allow senderAddressing on default filter for message Listing

* commit '3b14189e9f1387bae5318149dc651131a6f7b80b':
Allow senderAddressing on default filter for message Listing
fb540d85c3591020df3615101fbb9f788a27c139 11-Sep-2015 Ajay Panicker <apanicke@google.com> am 1c28582b: Allow senderAddressing on default filter for message Listing

* commit '1c28582b0e780eed2f8480e5c2dfbf0da745e4e8':
Allow senderAddressing on default filter for message Listing
1c28582b0e780eed2f8480e5c2dfbf0da745e4e8 11-Sep-2015 Ajay Panicker <apanicke@google.com> Allow senderAddressing on default filter for message Listing

Adjusted the PARAMETER_MASK_DEFAULT constant for when a
message listing request is recieved and a message filter isnt
provided. This new filter value causes the sender_address field
to be sent along with all the other default information.

Bug: 22163529
Change-Id: I49444cfb341d2e6cc72bdab55aa441d712b03f14
ap/BluetoothMapContent.java
47bdb24c2d9b5bef2b8c19133e5a79ceeceac8f5 10-Sep-2015 Ajay Panicker <apanicke@google.com> am 008abd13: am e462643f: am 4d5be8f0: am 0ebd4e58: Move SMS message to proper folder after sending

* commit '008abd13f97077d04dbecf132f53f463df4db06c':
Move SMS message to proper folder after sending
4d5be8f02eedfcdb9b49962a2d881d7db7adb273 10-Sep-2015 Ajay Panicker <apanicke@google.com> am 0ebd4e58: Move SMS message to proper folder after sending

* commit '0ebd4e58920add6114b1f345b7d95e0709096fe3':
Move SMS message to proper folder after sending
0ebd4e58920add6114b1f345b7d95e0709096fe3 09-Sep-2015 Ajay Panicker <apanicke@google.com> Move SMS message to proper folder after sending

Move a SMS message to the correct folder upon receiving an intent
detailing if the message was succesfully sent or not. If sent
successfully, move to the SENT folder, otherwise move it to
the FAILED folder.

Bug: 22992865
Change-Id: Ifdcfb7bb613844f507ef27460ead520c6573b89d
ap/BluetoothMapContentObserver.java
dd94daf8b6658427767660aa5509b29c8711a2fc 09-Sep-2015 Sungmin Choi <sungmin.choi@lge.com> am 809769be: am de79c722: am e48e8d0b: am 6385f5ec: Add NREC setting routine even after SCO connected

* commit '809769bef24a453e751eb3a1512f43d2bb4154b2':
Add NREC setting routine even after SCO connected
e48e8d0b7c5b9ce8c2310d68c836cac4444f09f8 09-Sep-2015 Sungmin Choi <sungmin.choi@lge.com> am 6385f5ec: Add NREC setting routine even after SCO connected

* commit '6385f5ec823dd1113708532d20729dba67d9beaa':
Add NREC setting routine even after SCO connected
6385f5ec823dd1113708532d20729dba67d9beaa 05-Sep-2015 Sungmin Choi <sungmin.choi@lge.com> Add NREC setting routine even after SCO connected

Bug: 23471393
Change-Id: I46264238e4810a7f280e656220bc68e76eb0cb37
Signed-off-by: koh.changseok <koh.changseok@lge.com>
Signed-off-by: Sungmin Choi <sungmin.choi@lge.com>
fp/HeadsetStateMachine.java
7f0d0742627c59cf327ddb5dc7a9c2efd762eaa7 08-Sep-2015 Casper Bonde <c.bonde@samsung.com> am 0306f7bd: am de4e03af: am 9ff028cc: am 471e023d: SAP: Fix missing attribute in disconnect_ind

* commit '0306f7bd124426a52b8101b80213107f9555b043':
SAP: Fix missing attribute in disconnect_ind
9ff028cca112cf2fb1ebc9a73f77f6a4033a644e 08-Sep-2015 Casper Bonde <c.bonde@samsung.com> am 471e023d: SAP: Fix missing attribute in disconnect_ind

* commit '471e023da5f39d21ebcb1d3fad43a591c15f6be3':
SAP: Fix missing attribute in disconnect_ind
471e023da5f39d21ebcb1d3fad43a591c15f6be3 28-Aug-2015 Casper Bonde <c.bonde@samsung.com> SAP: Fix missing attribute in disconnect_ind

The internal TEST flag was removing too much code.
To make it easier to run test, and avoid future issues
with removing needed code, the TEST flag is no longer used
to remove code.

This bug was noticed when running the PTS testcases without the
PTS_TEST flag set. It is assumed that this fix will make
TC_SERVER_DCN_BV_02_I work without the PTS flag, but unless PTS
have updated their test case to accept both a gracefull disconnect
and a forced disconnect, TC_SERVER_DCN_BV_03_I will still fail in
a production build. The SAP spec suggest to use a gracefull disconnect
when initiating a disconnect from a server, hence it is not a good
idea to expose a force disconnect option to the used without first
having tried a gracefull disconnect. Hence the PTS test case
implementation is in conflict with the intented use specified in
the SAP specification.

Without this fix a build with PTS_TEST=false will not work as
intented.

PTS_TEST replaced with system property bt.sap.pts. Set it to true
to enable the force disconnect button.

Bug: 23614694
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
Change-Id: I776a53d6e786c21000ef62094f9a9948ee5880b8
ap/SapMessage.java
ap/SapServer.java
ap/SapService.java
1bf0fac2d72158da006084b7adb911727d0601fe 04-Sep-2015 Casper Bonde <c.bonde@samsung.com> am 54c16c1d: am 50b1fd6a: am 2ecfab69: am e377aae9: SAP: Fix logic to skip padding bytes for requests received

* commit '54c16c1d01b44570de2e3089a55b559e0e761ebc':
SAP: Fix logic to skip padding bytes for requests received
2ecfab690d8a15de275f665008a3645dd71db95d 04-Sep-2015 Casper Bonde <c.bonde@samsung.com> am e377aae9: SAP: Fix logic to skip padding bytes for requests received

* commit 'e377aae948e58f974c3af14360d2f6ce09b868aa':
SAP: Fix logic to skip padding bytes for requests received
e377aae948e58f974c3af14360d2f6ce09b868aa 28-Aug-2015 Casper Bonde <c.bonde@samsung.com> SAP: Fix logic to skip padding bytes for requests received

As per SAP spec, padding bytes can be 0-3 bytes, but the current code
has incorrect logic, that would lead to calculation of padding bytes
as 4 in case the APDU length was multiple of 4, which would lead to
incorrect parsing logic in SAP Server and can lead to issues of no
response for APDU request from SAP Server as it keeps waiting for
reading more bytes from rfcomm which are not present.

Also check added in code not to send msg to RIL if socket is null to
prevent crash in BT Sap module.

Bug: 23024598
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
Change-Id: I24e4a6b850709c9c32b7e0992626a0219dacef03
ap/SapMessage.java
ap/SapServer.java
242decf575404c79de55d58a5b9b170a80b6fc37 01-Sep-2015 Andre Eisenbach <eisenbach@google.com> am a601d554: am af89c589: am fa60067c: am 08fba96f: am bf37a029: Fix column ID for PBAP name lookup

* commit 'a601d554265aa4191f9032192ec3cdb614bb536f':
Fix column ID for PBAP name lookup
fa60067ce39759fc2a3ae60127b02753c0dba162 01-Sep-2015 Andre Eisenbach <eisenbach@google.com> am 08fba96f: am bf37a029: Fix column ID for PBAP name lookup

* commit '08fba96fc3955528bc3a2761731876c1b03f9e4f':
Fix column ID for PBAP name lookup
08fba96fc3955528bc3a2761731876c1b03f9e4f 01-Sep-2015 Andre Eisenbach <eisenbach@google.com> am bf37a029: Fix column ID for PBAP name lookup

* commit 'bf37a0295d110b77b635ca2986172bbdd59331bb':
Fix column ID for PBAP name lookup
bf37a0295d110b77b635ca2986172bbdd59331bb 01-Sep-2015 Andre Eisenbach <eisenbach@google.com> Fix column ID for PBAP name lookup

When a phonebook lookup is performed to resolve a phone number into a
name, the wrong column ID is used to retrieve the value from the cursor,
causing an un-caught exception and a failed lookup.

Bug: 22953958
Change-Id: I1f826412916012382903fdf30d43d5cb3516432c
bap/BluetoothPbapVcardManager.java
db0ae0560dbbfdfc6ffd1d62ab3008b30bed10f3 31-Aug-2015 Ajay Panicker <apanicke@google.com> NPE protect AdapterService.getRemoteName()

Added an if statement to protect against null pointer exceptions
that could occur if mRemoteDevices is null. This is a bandaid
fix as the reason that this is happening is because
BleOnProcessStart() has yet to be called and this can cause
problems in the future.

Bug: 21893759
Change-Id: I20bc25cd7f1e48931b51c0ed9fa1120401f04784
tservice/AdapterService.java
547646cc155d3e6c12183ca623b3d61ffdb942f9 31-Aug-2015 Sunny Goyal <sunnygoyal@google.com> Merge "Updating incoming file notification > Notificaiton shows the file name, sender and file size > Quick action to accept or decline > Shows as heads-up, removed toast"
f6ae67403c20cec20bc8f906411fce4c9ea769f0 28-Aug-2015 Sunny Goyal <sunnygoyal@google.com> Updating incoming file notification
> Notificaiton shows the file name, sender and file size
> Quick action to accept or decline
> Shows as heads-up, removed toast

Bug: 23490378
Change-Id: I6a1b4110fbf0c0198a31f91b818df00914fa2da3
pp/BluetoothOppNotification.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppUtility.java
pp/BluetoothShare.java
pp/Constants.java
157a5b491ca74ecd8dde0400d3d6fc175d28165b 28-Aug-2015 Zach Johnson <zachoverflow@google.com> HFP should let the system handle ringtones

https://www.youtube.com/watch?v=NJVrTYbxwgA

First of all, it was choosing the sound in this order:

1. alarm sound
2. notification sound
3. ringtone sound

me: o_O

Second of all, it can't take custom ringtones
for contacts into account.

Change-Id: I16e04e69bdc9b190f8d12412dfd8365420f1da5b
fpclient/HeadsetClientStateMachine.java
38347a7e66a7c8a47767d8aad3d9534d95a0f070 27-Aug-2015 Ajay Panicker <apanicke@google.com> am d678c40f: am 9135d866: HFP/A2DP: Remove pending auto-connect messages when connected

* commit 'd678c40f35f18ef48bddbbf07934bd2b82f92400':
HFP/A2DP: Remove pending auto-connect messages when connected
d678c40f35f18ef48bddbbf07934bd2b82f92400 27-Aug-2015 Ajay Panicker <apanicke@google.com> am 9135d866: HFP/A2DP: Remove pending auto-connect messages when connected

* commit '9135d866b12ff019a4eae37e7a8c0df56a4383f2':
HFP/A2DP: Remove pending auto-connect messages when connected
9135d866b12ff019a4eae37e7a8c0df56a4383f2 26-Aug-2015 Ajay Panicker <apanicke@google.com> HFP/A2DP: Remove pending auto-connect messages when connected

Fixes a bug in which being paired with multiple headsets causes
previously connected headsets to disconnect. This fix removes
pending connect attemps once one device is successfully connected.

Bug: 23111466
Change-Id: Id471189d92643b9626e63197c00e76defd0a72bf
2dp/A2dpStateMachine.java
fp/HeadsetStateMachine.java
37604004520846495a5dba50d7c3afef05a9ecf9 25-Aug-2015 Sharvil Nanavati <sharvil@google.com> Fix low volume on Nemo devices after accepting incoming HFP call.

Bug: 23495386
Change-Id: I98c60188dd5d4aaf4bc5a7f212219918e1374989
fpclient/HeadsetClientStateMachine.java
8f1def75a6f57a04fd0e8a6423343a690d694154 20-Aug-2015 Sharvil Nanavati <sharvil@google.com> am 72ecb4ca: Make location enabled check configurable when returning scan results.

* commit '72ecb4caa630b63f66505ccb202a807b1af4e294':
Make location enabled check configurable when returning scan results.
72ecb4caa630b63f66505ccb202a807b1af4e294 19-Aug-2015 Sharvil Nanavati <sharvil@google.com> Make location enabled check configurable when returning scan results.

Some device classes (e.g. Wear) don't allow location to be enabled but
would still like to allow LE scanning to take place. This patch allows
the location enabled check to be bypassed if the platform is so configured.
Even if the location check is disabled, the calling app must still have
one of the location permissions.

Bug: 21852542
Change-Id: I206366ce262776d4668c0c42e066f0e20f5fdfeb
att/GattService.java
fe7270b5aee5b3345d5c60f161d866a0648dead9 14-Aug-2015 Vineeta Srivastava <vsrivastava@google.com> Merge "SAP: Do not send padding when packet size is mutiple of 4" into mnc-dr-dev
312e10ad5bcbb1e3d021c4798d55c40f99c7a6ef 10-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Block results if location is disabled in Settings

Apps holding PEERS_MAC_ADDRESS permission can still access scan results.

Bug: 21852542
Change-Id: I75fc289e8965df64efb7ff84fe5a4204904724ab
tils.java
att/GattService.java
att/ScanClient.java
fdb62835992e82681d2166dbf5716e26ab57d964 08-Aug-2015 Pavlin Radoslavov <pavlin@google.com> Revert "Bluetooth-OPP: Enable support to send same file multiple times"

This reverts commit 86449ac4bc7a8f4b2afeab4da420ae4f980c850a.

The revert is needed to address an issue that crashes Bluetooth.

Bug: 22836458
Change-Id: I8c8b51544637dd1c2250eb91e86cb2ca1bbc9fe7
pp/BluetoothOppManager.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppUtility.java
6eb32d5f7c30f04da45c3da0974bbb63725a0978 29-Jul-2015 Ajay Panicker <apanicke@google.com> Implement Bluetooth settings factory reset (1/5)

Implemented the factory reset function to be used to reset all bluetooth
settings on device to factory default

Bug: 16161518
tservice/AdapterService.java
d73503eb9d27edf6b942876f510d347e9c4a2970 22-Jul-2015 koh.changseok <koh.changseok@lge.com> SAP: Do not send padding when packet size is mutiple of 4

Bug: 22943799
Change-Id: I48d411f4e3a79a891360a9a855c4680bea19d748
ap/SapMessage.java
1dd20863cde3b61cea48d2e06d1814f5f9651691 31-Jul-2015 Dianne Hackborn <hackbod@google.com> Merge "Change MNC codename to just M." into mnc-dev
c16dd2fad8325f24f5099e9ab175894b247859ec 30-Jul-2015 Dianne Hackborn <hackbod@google.com> Change MNC codename to just M.

Change-Id: I1e5989dbc73f89bd292465142560952bc8e44f59
tils.java
1b1433ad9b4d769a1f9e37284c5d80fb021d31d7 29-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Legacy foreground apps should continue getting scan results

Pre-M apps running in the foreground now get scan results. For legacy apps
running in the background, no results are returned and the error is logged.

Bug: 21852542
Change-Id: Ic7a91f34c6718c26f0dae30dade6a436fe1061af
tils.java
edb6da171b8b7a6f9d4aa5a773d734a464f1ec66 20-Jul-2015 Miao Chou <mcchou@google.com> Fix security vulnerabilities in permission of deleting MMS/SMS

This CL adds permission and PID checks to avoid unauthorized deletion of any
MMS/SMS messages in BluetoothMapContentObserver.actionMessageSentDisconnected
function.

Bug: 22343270
Change-Id: I30254036309733be4d54db17a8ef17a571cd1c5a
ap/BluetoothMapContentObserver.java
e8e870c24930f9b687572dbb80614e5aad6fbdfa 03-Jul-2015 beryl hou <beryl_hou@asus.com> Return no track selected if no track is currently selected.

Fix to satisfy AVRCP 1.4 spec.
In EVENT_TRACK_CHANGED response request,
if a track is selected , then return 0x0 in the response.
if no track currently selected,then return 0xFFFFFFFFFFFFFFFF in the INTERIN response.

Bug: 22519285

Change-Id: Iaaae1d4acf918049d99c27d9ad98bde15242ade1
vrcp/Avrcp.java
ca8db07314e44453d807e6afeb8eb4eef303ee85 23-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Merge "Enforce location permission for apps targeting M" into mnc-dev
976a53f0f946e589aa2b5204ce3262abcf2afc55 24-Jun-2015 Hemant Gupta <hemantg@codeaurora.org> PBAP: Fixes for proper working of filter functionality.

The change consists of fixes required for the filter to work properly.

Without this change the API isFilteredOut() was basically removing those
attributes which are set in the filter while the expected behaviour is other
way round, so renamed the API to isFilteredIn().
This patch also adds provision for filtering call log date and time when
it is not been asked as per the filter since it is not a mandatory attribute
as per the PBAP specification.
This patch also renames "NOTES" to "NOTE" which was incorrect property for
vcards.

Bug: 20077258
Change-Id: Ifbe57706b86031cbb9656556843da1bab700ef5d
bap/BluetoothPbapVcardManager.java
586ba822a87a5cb0f58035ce0983825f5f23285d 22-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Enforce location permission for apps targeting M

Enforce location permission for apps targeting M, for legacy apps, log an
error.

Bug: 21852542
Change-Id: Ic406df1727eb0939531a22b76c2df9b13f03ec81
tils.java
51b7ab3d2d9a166e1fac22ff442ad3221a838c91 15-Jul-2015 Chenjie Luo <cjluo@google.com> Merge "Remove extra logging with privacy info" into mnc-dev
bdf33c0f7176de2bee64b6488a8327d837599fc8 14-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Require ACCESS_COARSE_LOCATION for ACTION_FOUND broadcast

Receivers of ACTION_FOUND intent are now required to have
ACCESS_COARSE_LOCATION permission.

Bug: 21852542
Change-Id: Ia3bca7e9cd117536a3eb4f4d1fe405604b2ff40f
tservice/RemoteDevices.java
69e5f6f65981c49c1723188469b79389841c9f2e 15-Jul-2015 Chenjie Luo <cjluo@google.com> Remove extra logging with privacy info

Bug: 22075764
Change-Id: Id2f1c0d1660abd0c18de46c64596fc1a17b974ce
fp/AtPhonebook.java
fpclient/HeadsetClientStateMachine.java
ff33061e763656438daea7249e45e38b8a174288 19-Feb-2014 kschulz <k.schulz@samsung.com> PBAP: New Missed calls parameter not set correctly

When a PCE pull the missed-calls-phonebook (mch.vcf) from the PSE, a parameter
stating the number of _new_ missed calls must be included in the reply.
Currently the parameter is included but it is always set to zero, which is
incorrect.
This fix corrects the variable used for new missed calls

Bug: 13022843
Change-Id: I6094c50a76711cfff9347596d70ac2300cfbb543
bap/BluetoothPbapObexServer.java
9e78435c8538516635e377720cabec0f2c0e1d71 09-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Merge "Do not return devices when caller has no location permission" into mnc-dev
a933175cbc1cdcbd0583642ba6eaf4555b3ed55c 09-Jul-2015 Sanket Padawe <sanketpadawe@google.com> Merge "Make string to plurals in BT inbound/outbound notification." into mnc-dev
cc8b02f2b8f8d820358a1b66b6ba138a4ab44642 09-Jul-2015 Sanket Padawe <sanketpadawe@google.com> Make string to plurals in BT inbound/outbound notification.

Bug: 22215773
Change-Id: I21d06ec7839fdb4e1ba9b5a70c6ac7791788eb4f
pp/BluetoothOppNotification.java
68cbac9663a8cac0416bc81968f5f543f88b741c 08-Jul-2015 Pavlin Radoslavov <pavlin@google.com> Set the Bluetooth state to OFF if there is disable timeout error

Previously, if there was "disable timeout" error during Bluetooth
shutdown, the Bluetooth state was set back to ON. However, the
internal Bluetooth stack runtime state was cleaned-up and
practically unusable.

The solution is not to re-enable Bluetooth if there is a
"disable timeout" error.

Bug: 21873347
Change-Id: I561683fa391f7bacbb1aa8f80d8f6583c7d3099c
tservice/AdapterState.java
391be75c27b6d36930a5645925ed7ab118fa634a 04-Sep-2013 Anubhav Gupta <anubhavg@codeaurora.org> Update UI properly in Connection race Conditions.

Broadcast connection state of incoming device in pending
state and update UI for disconnection of outgoing connection.
This change in conjunction with bluedroid change handles
race condition scenarios when incoming and outgoing A2dp
connections collides.

Bug: 22028876
Change-Id: Ibd80fc7010613887df74fb1903b16de73c77939a
2dp/A2dpStateMachine.java
d2fc8cbd87c7a742223e8742a442a48690d426ce 20-Jun-2015 Fyodor Kupolov <fkupolov@google.com> Do not return devices when caller has no location permission

In onScanResult, skip a device if calling process has no location
permission/appop

Bug: 21852542
Change-Id: I4e3511b33d69d94c1df6e1bf2f9a351303a90685
tils.java
att/GattService.java
att/ScanClient.java
53b1dc1c00aea1aabbdbc6efd7be0cba6bf397a2 24-Jun-2015 Andre Eisenbach <eisenbach@google.com> Send ACTION_ALIAS_CHANGED when remote device alias is changed

Bug: 20341903
Change-Id: I6e9dbeb1d05bdcce56fab63ccdd701138c99f5a0
tservice/AdapterService.java
tservice/RemoteDevices.java
3d10f5428e566355ce786e00201bef72d99fdc2a 31-Jan-2014 Subramanian Srinivasan <subrsrin@codeaurora.org> Sends bond state change intent for unbonding a device

When remove bond API is called from the stack layer,
the bond state change intent is not sent in the
upper layers to unbond a device.

Change-Id: I515bfaf3f1a575106b10e2f688b1e9de58770b87
tservice/BondStateMachine.java
b99a8af5a27318bb5ae3745531d5a2175370b892 28-Apr-2015 Hemant Gupta <hemantg@codeaurora.org> PBAP: Add support for PBAP 1.1.1 specification

This patch adds support for erratas to make the specification version
compatible to PBAP 1.1.1 specification.

Following errata needs to be supported to make the specification version
compatible to PBAP 1.1.1

https://www.bluetooth.org/errata/errata_view.cfm?errata_id=1824

Proposed modification to the text of the spec:
5.3.3 Name
This is the name of the folder to be retrieved. The value shall not include
any path information, since the PullvCardListing function uses relative paths.
An empty name header may be sent to retrieve the vCard Listing object of the
current folder. However, it is illegal to issue a PullvCardListing request with
an emtpy name header from the telecom/ folder.
Any such request shall be responded to with a "Not Found" error message.

Bug: 21896912
Change-Id: I0fb2c7d96b6e34d0bf83bb62901a8fd47c470fe6
bap/BluetoothPbapObexServer.java
db94389c30d5ad5555a922d28868b119e1c6f2e1 23-Jun-2015 Andre Eisenbach <eisenbach@google.com> Fix compile errors due to OPP merge

Change-Id: Ia07d99d58785c7e974b1fb32afaeb157ad337932
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
0f2f4d93c88a9d8fc5a2489cb51831b3caf178e1 29-Aug-2013 Pradeep Panigrahi <pradeepp@codeaurora.org> Display proper file name while cancelling transfer

Use Case:
1) Send files in batch from remote to DUT
2) Cancel the transfer in between from either side.
3) Check name of the files in failed tranfer message.

Failure:
Name shown in the failure message is different than actual file
name in batch

Fix:
Save names of all the selected files to be transferred even
before starting of client thread so that names remain intact
in the outbound information even when the batch is cancelled
from initiator.

Bug: 21896912
Change-Id: I42c98721365c4c8acb746d49ba9ceff5b0737b71
pp/BluetoothOppManager.java
00400c15a9a300419a6c50eaed1b50a2289c30d1 27-Jan-2015 Pradeep Panigrahi <pradeepp@codeaurora.org> Acquire the full wakelock only during user confirmation request

Use Case:
1. Create obex connection from remote to DUT.
2. Dont transfer any file and wait for the screentimeout.
3. Check if device goes to suspend.

Failure:
Device does not go to suspend mode if OPP connection is present.

Root Cause:
Acquire the full wakelock when user confirmation is required and
not during opp connection request.

Fix:
Obex server session will acquire the full wakelock only when user
confirmation is required. Otherwise, if session acquires the full
wakelock during connect request and did not receives the PUT
request from remote full wakelock will not be released. In this
scenario DUT will not go to suspend and cause battery drain.

Bug: 21896912
Change-Id: I17b90b206016c2a34d724393ac3b17a41983722c
pp/BluetoothOppObexServerSession.java
3aecf54308d60eea10fe10a5c18e4dff455aef66 05-Jun-2015 Pradeep Panigrahi <pradeepp@codeaurora.org> Use long as file size instead of int while using OPP.

Use Case:
1. Pair and connect to Dongle
2. Send a 2GB file from Dongle to DUT.

Failure:
File transfer failed in between.

Fix:
This patch fixes issue of problems in sending/receiving files
which cannot be accomodated in int type of Java. Instead of using
int, long data type is used, which can hold 64 bits data size in JAVA
which is suitable for storing file sizes in GB. Changes are done
in how updates are sent to progress bar which supports only int
by using the percentage of data transferred to update the progress.

Bug: 21896912
Change-Id: I49f9bf8a4a0e3668e32058d582a2700b0e6057e8
pp/BluetoothOppNotification.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppProvider.java
pp/BluetoothOppReceiveFileInfo.java
pp/BluetoothOppSendFileInfo.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppTransferInfo.java
pp/BluetoothOppUtility.java
ae8997b870d52d6701813e6f3ff9d87a5a083bf3 29-Aug-2013 Pradeep Panigrahi <pradeepp@codeaurora.org> Mark proper file transfer status upon OBEX response timeout

Use Case:
1) Pair with remote dongle and send a file over OPP.
2) Reset dongle such that there is obex response timeout.

Failure:
File transfer status is not marked a failed and hence cannot be retried

Fix:
This patch will handle the scenario of obex timeout which occurs due
to cancelling the transfer in between and trying sending again.

Bug: 21896912
Change-Id: Ide1a64e5874bda2c5cf71531f5971bc8bebf5e9f
pp/BluetoothOppObexClientSession.java
fbe0089395f9f81c1143cffe0674d0e406dfb983 29-Jan-2014 Pradeep Panigrahi <pradeepp@codeaurora.org> Avoid sending TRANSFER_COMPLETED_ACTION intent multiple times.

Use Case:
1. Share a picture through Bluetooth, select partner devices.
2. The partner devices do not confirm to receive the file.
3. Check the transfer status on the DUT.

Failure:
Failure Notification pops up twice when the shared files not
received by the partner phone

Fix:
This change ensure that TRANSFER_COMPLETED_ACTION intent will not
sent to receiver if there is any exception occurred during OPP
operation because this intent is already sent to receiver from message
handler.

Bug: 22028876
Change-Id: I3ad2f24be185c37355dff43009a5236bede0106a
pp/BluetoothOppObexClientSession.java
77b75f59e3285a9b1b2b25f769456781b0806926 02-Feb-2015 Anubhav Gupta <anubhavg@codeaurora.org> Check for AVRCP handler validity before cleanup

In stress testing of BT on-off usecase, crash was observed
due to triggering double clean-up. This fix introduces
additional Check for handler validity while clean-up to
avoid the crash.

Bug: 21896912
Change-Id: I14b1c35d1fa0345c59d61682d92795aa617436b5
vrcp/AvrcpControllerService.java
dc68435fca66933c844700040b2497eaf08b0fb9 20-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #20494208: Go out of device idle when headset button is pressed

We tell the device idle controller to go out of idle before
starting the voice command activity.

Change-Id: I41900518af61f0cb477ec56eaebfe798c69512f9
fp/HeadsetStateMachine.java
113ae3c3e7a3755dd984b97033f6d1a91122cccb 16-Jun-2015 Wei Wang <weiwa@google.com> Merge "Make address type agnostic in mac address scan filtering." into mnc-dev
7db26994f395a6ef053fe341011d25dd5b49d584 16-Jun-2015 Adam Lesinski <adamlesinski@google.com> Fix overflow in energy calculation

The energy value can get quite high, so use longs.

Change-Id: Ib03c07160339c82a834ea94fe155a65f0efb03d2
tservice/AdapterService.java
14929a82d56b94b9b75e2aefeb9c6ef29482eed0 13-Jun-2015 Wei Wang <weiwa@google.com> Make address type agnostic in mac address scan filtering.

b/20187218

Change-Id: I2349c9ca2cd1186ceff98f3eb42b6ecba9da002e
att/ScanFilterQueue.java
att/ScanManager.java
8f3a54a0ed8591f4844ee7b47e37bd6451650783 12-Jun-2015 Wei Wang <weiwa@google.com> Merge "Enforce permission check in BLE scan only mode." into mnc-dev
f6d53a6dcdd7cfa4065cc762c87fafdb7f491bf7 12-Jun-2015 Wei Wang <weiwa@google.com> Enforce permission check in BLE scan only mode.

Bug:21494402
Change-Id: I3d5d6e87bb8aef8760aa4087559abfeebabb42b1
att/GattService.java
3c81700fa6a57cdceb256e03d942f71842d75878 08-Jun-2015 Kim Schulz <k.schulz@samsung.com> SAP: turn debugging and test flags off

Currently DEBUG, VERBOSE and PTS_TEST_MODE is on as a default.
There is no reason for that in production code (except for during test
where the code needs to go through PTS test)

Bug: 21692162
Change-Id: Id092a79959fa38608d06755cc43148eee9ec3e00
ap/SapService.java
244e9c62a85a4b94e21bf1a8dee456e22bc767c4 08-May-2015 Casper Bonde <c.bonde@samsung.com> SAP: Make it possible to enforce a 16-digit pin code (3/5)

This change enable the posibility to enforce using a
16-digit pin or MITM for a RFCOMM or L2CAP connection.

This is needed for the SIM access profile.

Change-Id: I42ada9b36d24d43697a2010eccbc0103f15af77d
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
tservice/AdapterService.java
tservice/BondStateMachine.java
tservice/JniCallbacks.java
ap/SapService.java
acc99899ec1c747365d7568a2fe53f53dfc3593f 04-Jun-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Handle SLC in MultiHFPending state

Use case:
Connect 2 headsets one after another in quick
succession.

Failure:
SLC for first headset is not happening.

Root cause:
SLC for first headset is not handled when second
headset is connecting.

Fix:
Add handling for SLC event for HS1 in MultiHFPending state.

Change-Id: If0c2553c28e233bea4622fca10c94fddd913afa7
fp/HeadsetStateMachine.java
6455f2788e2d67c7a7ffa79b94269af06473bc0b 02-Apr-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Add null checks

Added null checks identified by static analysis tool.

Change-Id: I5ff04775313b06d549c5ae97e497dd44e9231b04
fp/HeadsetStateMachine.java
c924fea547063adc907a3a25044588aa58ac8879 04-Jun-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Handle SCO volume change in multihfpending state.

Use case:
1. Connect one headset.
2. Make MO/MT call.
3. While connecting second headset, change
call volume on the phone.

Failure:
SCO volume changed is not updated to first headset.

Root cause:
Volume change is not handled in MultHFPending state.

Fix:
Added handling volume change in MultiHFPending state.

Change-Id: I6ac3cb2968b99de194fa7c0114d45f9d81dcb663
fp/HeadsetStateMachine.java
8e79653c4d093d6f6696312f668429feb6d62bf3 22-May-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Handle multiple BLDN commands from headset

When multiple AT+BLDN commands are received
from headset, return ERROR if dialling process
is started for the first AT+BLDN.

Change-Id: I603eb5c5ccdd5f8606a355e5d464e6493d1e7fd9
fp/HeadsetStateMachine.java
e316dfc9b3f648ad3d7b2691927758ea885043c0 17-Sep-2013 Anubhav Gupta <anubhavg@codeaurora.org> Check for A2dp SNK UUID supported by remote

Check for A2dp sNK UUID supported by remote before proceeding
with A2dp SNK connection when DUT acts as A2dp SRC.
This change addresses the issue where Host being A2dp SRC is
seen trying connecting to other A2dp SRC repeatedly.
This will ensure that DUT being A2dp SRC does not try to connect
to A2dp SRC only peers.

Change-Id: I0200582a69b3d4e9b7f92516ba92f34054a1f4dc

(cherry picked from commit 5b7325d795331a249a70fdfd20a9f29bed388f1d)
(cherry picked from commit 27f0077dde25b69442aff316e5c60d32f2275a65)
(cherry picked from commit c5b6b44414be53bbb75e064412a7d2d49ffe871f)
2dp/A2dpService.java
6ddb5d5b31b3e4e21b57bbe0457692fdbcc97eba 05-Sep-2013 Anubhav Gupta <anubhavg@codeaurora.org> Move A2dp State to Disconnected when BT is Turned OFF

A2dp State gets Stuck in Connecting state If User tries to connect to
other paired device when device is already connected to one, and before
connection swap succeeds, power-cycles BT.
This change allows the state to move properly to disconnected for the
device pending connect when BT is turned off.

Change-Id: I17bc620551bf735f39327eff59102c14551bcf26

(cherry picked from commit 0ce6816d43761b838b65adbf1e636630e1047fcf)
(cherry picked from commit 51c4d0f1df682f3874915f99ef49ec5c3d9e74ed)
(cherry picked from commit 6583fca29318b3c8bc0b16d588fc939ffdde6142)
2dp/A2dpStateMachine.java
1f7879f020043ee2f255ec3c04804b9b9c2ff869 04-Jun-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Do not accept SCO without any active listener.

Use case:
1. Connect to Motorola s305 headset.
2. start playing music on Phone.
3. Make an MO call for last dialled number from headset.
4. Accept and end the call from remote phone.

Failure:
After call ends, music resumes on headset for 1-2secs and
routed to speaker.

Root cause:
Headset is re-connecting SCO after call disconnection.

Fix:
- Some HS re-connect SCO after call disconnection.
Do not accept such incoming SCO connection requests.
- Check for valid SCO listener(active CS or VOIP call, VR started)
before accepting incoming SCO connection requests.

Change-Id: Ifcb1f760b3eabf52d9b507c5d25021b90bfec561
fp/HeadsetStateMachine.java
0fb10ac5e193a87c0d6c09ef8719a0296589d9e6 17-Sep-2014 Mallikarjuna GB <gbmalli@codeaurora.org> Handle startScoUsingVirtualVoiceCall in HeadsetService

Use case:
Connect headset while in VOIP call

Failure:
SCO is not established with headset

Root cause:
When HS is connected while in VOIP call, sometimes
startScoUsingVirtualVoiceCall() is called even before HSM is
transitioning from Disconnected/Pending to Connected state.

Fix:
Do not ignore startScoUsingVirtualVoiceCall in HeadsetService
if HeadsetStateMachine is still in process of transition to
Connected state.

Change-Id: I8a6c7f3e08b8a9dfc4c4efc6d1d041149874eab0
fp/HeadsetService.java
303898f623aa134fac30f9ddcbc1523a3538d231 04-Jun-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Set correct callState for MT/MO call while in Voip Call.

Use case:
Start MO/MT call during VOIP call.

Failure:
Incorrect response sent to AT+CIND? to headset

Root cause:
terminateScoUsingVirtualVoiceCall() resets callState
from INCOMING/DIALING to IDLE. At the same time, if HS sends AT+CIND?
to read call indicators, it will get wrong value of callsetup. This case
is hit only when SCO for VOIP call is not terminated via SDK API call.

Fix:
When VOIP is ended, save current MO/MT call state to
HeadsetPhoneState class to be able to respond with
proper call states when queried by headset.

Change-Id: Ia3a0a2d67dbfffef474de48cab6ee63b82fa4572
fp/HeadsetStateMachine.java
103e4f404bcd3c82f98cd125e53a5fd197232a6d 04-Jun-2015 Andre Eisenbach <eisenbach@google.com> Merge "Update the roam status to headset" into mnc-dev
e6a27a58d8b8f9424579d9f6105185d4a2683b79 22-May-2015 Mallikarjuna GB <gbmalli@codeaurora.org> Update the roam status to headset

This change makes sure that roam status
change is updated to headset immediately
as soon as it is changed. With this, we will
not wait to update the roam status till network
service state changed.

This fixes a PTS test case. Notmally a roaming
state change would be accompanied by a service
state change.

Change-Id: Ib30a69e58ee81e67986ffde52093e5f37315f814
fp/HeadsetPhoneState.java
22fa8a39e020ff8f74b7d8ac052bddd8328cadc5 28-Apr-2015 Casper Bonde <c.bonde@samsung.com> SAP: Correct ResultCode for setTransportProtocolResp

Changed to respond with "Error, not supported" according to
the SAP specification, to pass PTS tests.

Change-Id: If4f3ddf27468d13f1162c19ab6c0a712fc81fd92
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
ap/SapMessage.java
b6791189b3c8be04b521b8520aed006f012304d1 27-Apr-2015 Casper Bonde <c.bonde@samsung.com> SAP: Shorten long lines

Change-Id: I89d5bf6d68b8aba9d9e86e891bfb1b79eb241432
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
ap/SapMessage.java
ap/SapServer.java
a49b4e45faf378e3848c4f6eb468e0a14565aa6c 17-Apr-2015 Casper Bonde <c.bonde@samsung.com> SAP: Fix exception at shutdown

Restructures the disconnect/shutdown code, to avoid exception.
Also ensure cleanup of notifications and profile public state.
This also fixes the bug introduced when handling ACL_disconnect
intent, where the rfcomm-listener was not restarted.

Change-Id: I3b4561f610abc77011689b7cfb67a4b54c41500c
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
ap/SapRilReceiver.java
ap/SapServer.java
ap/SapService.java
bbb071e6d73df46230ec654e3066a46f6e35a88d 22-Apr-2015 Casper Bonde <c.bonde@samsung.com> SAP: Dynamic use of wake locks

This changes the way wake locks are used for SAP from acquiring
wake lock at connect, and releasint at disconnect to acquiting
a wake lock each time activity is detected, either between
Bluetooth and the RIL or between Bluetooth and the client.
The wake lock is released when there has been no activity for
one second.

This is the same scheme as for MAP, except using a lower timeout
value, based on analysis of the traffic when connected to a
Nokia 616 car-kit.

Change-Id: Ie4bcf7e991d81e88b64dc4ba20fa74b327fde3c6
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
ap/SapRilReceiver.java
ap/SapServer.java
ap/SapService.java
f98ad52d9b979273b01fb97466f2e077dc7b6bd6 21-Apr-2015 Casper Bonde <c.bonde@samsung.com> Add support for MITM for BluetoothSockets (2/4)

This change enables use of the option to enforce Man-in-the-middle protection
for the authentication process for the Sim Acces Profile.

Change-Id: I98244d5e822c25f3f8f51833f38c79e13bb60e63
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
ap/SapService.java
1f1103e93ba7ebd48c57c9627dc7b262c6f01c77 16-Apr-2015 Casper Bonde <c.bonde@samsung.com> SAP: Change to use new SDP Api (2/4)

Added support for Sim Access Profile (SAP) in the SDPManager.
To make it easier to test, both SDP record creation and seach
is added.

Change-Id: I871eb762389e3717b8bd6bc37a8ffc09fff6f589
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
ap/SapService.java
dp/SdpManager.java
7ac99a6ff9b5389948eec70d2afa96bb255feedd 15-Oct-2014 Hemant Gupta <hemantg@codeaurora.org> Add null checks in PanService

This patch fixes issues identified by static analysis tool
in Bluetooth apk wrt PAN.

Change-Id: Icd65c87450c8a3c3e745b2820bfca1d1f49b98db
an/PanService.java
686377aa851b5cb6d5c32234dd340089b7959b49 01-Jun-2015 Tony Mak <tonymak@google.com> Merge "Add unit test for commit "Support work contacts in HFP, PBAP, MAP"" into mnc-dev
0ff315d60bb44c5cc4223abff48e086defaec8ad 01-Jun-2015 Tony Mak <tonymak@google.com> Add unit test for commit "Support work contacts in HFP, PBAP, MAP"

1. In ag/674009, entire bluetooth is diabled temporarily.
This commits enable the test and just comment out test case that need the removed dependency.

2. Fixed a potential NPE in composeAndSendPhonebookOneVcard

3. Refactor the code a bit to allow testing

Bug: 19551175
Change-Id: I20e17d38cebdccc39c14e960503ac7d23a9bd928
bap/BluetoothPbapVcardManager.java
534bbd9a2347141644a684ce179b2cedf20541b4 09-May-2015 Pavlin Radoslavov <pavlin@google.com> Add a missing check for a null pointer when processing an Intent

This fixes Low severity vulnerability in Bluetooth: Denial of Service

Bug: 20952998
Change-Id: Ifec45568f0e7e158b96a2557a7e1eefcee5bb6f5
bap/BluetoothPbapService.java
35e1ec3c673b81022339978a37f191b5ed67f065 27-May-2015 Prerepa Viswanadham <dham@google.com> Increase the min LE connection interval to 11.25ms

To reduce audio choppiness, increase the min LE connection interval
to 11.25ms from 7.5ms

Bug: 18776956
Change-Id: I4722a85f0d3204ec741f6a88142907a29bffe0bf
att/GattService.java
cd72c4dfe4db77c6df24db94f8d9a04efff7ab1d 12-May-2015 Hemant Gupta <hemantg@codeaurora.org> MAP: Fix MAP server inter-op issues

- Fix no recipient address info available when GETMessage
and MessagesListing requested on Draft folder. Fetch
Draft recipient address from "canonical_address" table
based on threadId when no address available from regular
"sms" table in telephony database.
- Avoid dummy entry in sms database when requested to push a
empty message. Reject empty SMS body and handle a possible
exception from telephony stack for invalid message body.
- Send MMS complete "size" as attachment size fetched from
database and subject or text length available.
- Donot include "old_folder" info in MessageDeleted MNS event.
As per Spec, only MessageShift event should use the later info.
- Handle possible exception while processing message listing.
A case where message is saved in draft with no recipeint name,
when we try to fetch contact name during messagelisting, null
number passed to ContactsProvider would cause IllegalArgumentException.
Add null and empty check before quering contact provider.

Change-Id: I5f2234ae7e50ed719a31f463e372d2026988539c
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
f48c0b98b5d1823fbb0fc3e4eba7d5054d9385fa 27-Apr-2015 Casper Bonde <c.bonde@samsung.com> MAP: Restart MAS servers after ACL disconnect

Code was introduced to remove MAP Access Request early at
ACL disconnect. By removing the notification as wall as the
UserTimeout timer caused the MAS instances not to be restarted,
to be able to accept a new conection. Hence if this occured
no connection to MAP was possible untill the phone or Bluetooth
was power cycled.

This fix causes the MAS instances to be restarted in
the event of a ACL disconnect before user accepts MAP req.

Also, applied some updates to the log messages:
- Changed the VERBOSE flag to false
- Changed some DEBUG messages to VERBOSE (for privacy reason)
- Updated the message priorities to match their purpose. E.g.,
"if (VERBOSE) Log.i(...)" -> "if (VERBOSE) Log.v(...)"

Bug: 19239028

Change-Id: Icf6d065a7a48c70a9bbc1593267f6a3605433af2
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
ap/BluetoothMapService.java
72014e2b0523c72ba34ca43d91bc4e8be104d95a 12-May-2015 Pavlin Radoslavov <pavlin@google.com> Catch an exception when updating incoming message status

Note: this change does not fix the root cause for Bug 16042763,
but addresses an issue that could be triggered within the
same context as Bug 16042763.

Bug: 16042763
Change-Id: Ib56894f3fa3b7754d1d3f3214a923d9d0a23eb80
ap/BluetoothMapObexServer.java
7769a12fc51ed9ac3c61b60ea0df26706561bcb0 04-May-2015 Casper Bonde <c.bonde@samsung.com> MAP: Fix of cursor closed too early

A cursor variable was reused for a new query, which lead to
the cursor being closed too early.
This fix introduces a second cursor variable and appropriate
close calls.

Bug: 20227071
Bug: 20565456

Change-Id: I1fa271497a9eb37bb3e435b61dc5daa2b9727af4
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
ap/BluetoothMapContent.java
f5f90873574eefe5f50a7b383fcd8fefb961f66c 05-Dec-2014 Andre Eisenbach <eisenbach@google.com> Bluetooth native dumpsys logging support (4/5)

Bug: 18508263
Change-Id: Ib9546ff2cf64d2e085e27e691032749e869e0795
tservice/AdapterService.java
tservice/ProfileService.java
f6154624f5d94ee078d4208340411630e9e50bf3 30-Apr-2015 Nitin Arora <niarora@codeaurora.org> Cancel inquiry during the transition from Bluetooth off to LE on state

This change cancels any inquiry or device discovery that is ongoing
while Bluetooth transitions from BT_ON state to BLE_ON state, before
disabling all core services.

Change-Id: I3f14b6a1f6629c60c897ab39e49c44516400d737
tservice/AdapterProperties.java
57be75cbd210c54f9a20acb87e044cb80d46972d 06-May-2015 Wei Wang <weiwa@google.com> Workaround to increase onLost timeout.

Change-Id: I9dfc24198be436f489b7c2f2051a7448478f6762
att/ScanManager.java
1155fc94f0e26f33ab0059e1aa10544e3caa7077 05-May-2015 Prerepa Viswanadham <dham@google.com> Merge "Merge commit '4626db5' into master_merge" into mnc-dev
6ff33c6c221899b0a6f1f81cf8cab1e42e8d1a70 01-May-2015 Prerepa Viswanadham <dham@google.com> Tune onfound/onlost timeouts for platform

Change-Id: Ieefcc7cbd94f698aabf8497b6db7182d28bde8e4
att/ScanManager.java
9d5707fc9ffbcb0b3a6b9112d0c6df4a8211d51e 01-May-2015 Prerepa Viswanadham <dham@google.com> Merge commit '4626db5' into master_merge
6c97deb7ff61f29b0d5957baf5df72c0d49f8724 01-May-2015 Wei Wang <weiwa@google.com> Revert "Fix no resource tracking available for more than 2 filters."

This reverts commit d5a562fbd16db8b10daf3f4920166659f3ceaf03.

Revert the temp hack. We should think of a better solution.

Change-Id: Ibee3a060ca9ec21e91ceb0cc0e612d08745a9376
att/ScanManager.java
d5a562fbd16db8b10daf3f4920166659f3ceaf03 30-Apr-2015 Wei Wang <weiwa@google.com> Fix no resource tracking available for more than 2 filters.

Change-Id: I29ddbe348134c673b6cce754033df165d6d40743
att/ScanManager.java
12adb6a704e8f484cdd0004edd44edeed2c37890 30-Apr-2015 Wei Wang <weiwa@google.com> Workaround to fix Bluetooth crash when using onFound/onLost.

Bug:20694614
Change-Id: I87b9f58af53551f7b919e6db76ada516eac33176
att/ScanManager.java
4626db541e2eb7d910fd0d79c75341f948a11d41 30-Apr-2015 Prerepa Viswanadham <dham@google.com> Take out TBD comments.

Change-Id: I5e02b4874b6cbc25f2361226e48e4c879698d0c8
tservice/AdapterProperties.java
att/GattService.java
att/ScanManager.java
ecbac5b723ac906c46271c2b740a52ccef625c57 31-Mar-2015 Satya Calloji <satyac@broadcom.com> LE low power scan feature

LE low power extended scan feature JNI changes
based on Google spec v0.95

Bug: 20029342
Change-Id: I5efd7ee3c644a51371bf250fca535e06c466640e
tservice/AdapterProperties.java
att/GattService.java
att/ScanManager.java
2e7dd83a6b3b4bf15e0dec6aad9ab826e6e2531b 22-Apr-2015 Hemant Gupta <hemantg@codeaurora.org> MAP: Fix possible NullPointerException while GetMessagesListing

Fix possible NullPointerException while processing GetMessagesListing
on a MSE without a valid SIM , case wherein invalid messageType value
occurs on MAP SMS/MMS Instance. Now by default SMS type is set to GSM.

Following basic PTS test cases and also other PTS cases dependent on
GetMessagesListing functionality fail without this fix:
TC_MSE_MMB_BV_11_I
TC_MSE_MMB_BV_20_I
TC_MSE_MMU_BV_02_I

Change-Id: I8ed0a2787534159342af88ec413a1c0407961d91
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapMessageListingElement.java
ap/BluetoothMapUtils.java
cd152eb16444369d9fbdb642fbb8560fed96b83a 28-Apr-2015 Wei Wang <weiwa@google.com> Fix crashes when calling numHwTrackFiltersAvailable.

Initialize curUsedTrackableAdvertisements in constructor. Also remove
BLUETOOTH_PRIVILEGED permission check on onFound/onLost APIs.

Bug:20643021

Change-Id: I2de6afd31d7af6cb927bc532f6cd855e1a7f46a4
att/GattService.java
att/ScanManager.java
6649a9dfaa405b240f5ef680fd8d7f4c279afcf1 26-Apr-2015 Elliott Hughes <enh@google.com> am 82431cec: am 2bc6e65d: Merge "Add hwp MIME type to transfer/receive over bluetooth"

* commit '82431cecda9c1e68c58028ea49f0059aef0dab21':
Add hwp MIME type to transfer/receive over bluetooth
82431cecda9c1e68c58028ea49f0059aef0dab21 26-Apr-2015 Elliott Hughes <enh@google.com> am 2bc6e65d: Merge "Add hwp MIME type to transfer/receive over bluetooth"

* commit '2bc6e65d7ac443ac976aa7aac8c84bf601f85eaa':
Add hwp MIME type to transfer/receive over bluetooth
300a402ccd4d827d148a3ecf28dc06b0f2529259 24-Apr-2015 Etan Cohen <etancohen@google.com> Merge commit 'ee92804' into merge2
282b4f24d83db944f432222cef8e6a938cfcc378 23-Apr-2015 Andre Eisenbach <eisenbach@google.com> Fix compile error due to extra brace

Change-Id: I467dcd31b97ed93e1a0f079ac02ee951c67ccac6
tservice/AdapterService.java
2e8302083499fdf5bb391d055e54c3402b0dc556 23-Apr-2015 Andre Eisenbach <eisenbach@google.com> Reduce AdaperService and HeadsetStateMachine log levels

Bug: 20460314
Change-Id: I6d1750845ccd0995800a8f82d2122cb1f3bc108d
tservice/AdapterService.java
fp/HeadsetStateMachine.java
ee928044471477ddcecd4e32aa6efe292d892464 22-Apr-2015 Prerepa Viswanadham <dham@google.com> Fix some nit's in previous comments

Change-Id: I47fe325daff6dd2dbe83a7491fedf06daa19f18f
att/GattService.java
att/ScanManager.java
871ab55f8460ecc0cbff29904c312528fb7bbc63 10-Apr-2015 Prerepa Viswanadham <dham@google.com> Manage onfound/lost resources (2/2)

Provide error callback to app if advertisement tracking resources
can't be reserved

Change-Id: Iff545591b919bcf7ca6615072e942be3e56938c2
tservice/AdapterProperties.java
tservice/AdapterService.java
att/GattService.java
att/ScanManager.java
cee0d1b1f13b4401a895be650605fa307e70bdb6 19-Mar-2015 Casper Bonde <c.bonde@samsung.com> Add support for Bluetooth Sim Access Profile (3/4)

Server side of the Sim Access Profile. Enables a Bluetooth device
to take over control of the SIM. This is usefull in cars where the
internal antenna in the phone can have a low signal level.

For this profile to work, the RIL driver must allow for this feature
to be used, and it must provide the API needed. The API is based on
protoBuf.

This change includes some SAP test cases.

Change-Id: Ia46493383efed6b8a89ca270bdafa60fc1a150c1
tservice/AdapterService.java
tservice/BondStateMachine.java
tservice/Config.java
ap/SapMessage.java
ap/SapRilReceiver.java
ap/SapServer.java
ap/SapService.java
f19f1ac64a5fefb248ab15b918d009b926c99dde 11-Mar-2015 Nitin Arora <niarora@codeaurora.org> Bluetooth LE background operation mode (1/2)

Changes to BluetoothAdapter state machine for handling new
states BLE_STATE_ON and intermediate states BLE_TURNING_ON
and BLE_TURNING_OFF. Also includes the actions required
while migrating in and out of these states including
start and stop of GATT services and other profiles.

Change-Id: I08d6ff05c2cefe559d5bb5789a1a488afefbe544
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/ProfileService.java
tservice/RemoteDevices.java
att/ContextMap.java
att/GattService.java
id/HidService.java
dbe4c2517804b3e32587310b76f1c977b8749d8b 06-Mar-2015 kschulz <k.schulz@samsung.com> MAP: Change MMS to use new API to send message

Removed the send MMS message intent, and replaced by
SmsManager.sendMultimediaMessage()

Change-Id: I226b7b0e8fdb101ab160563937ae6e7a1a13be41
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
ap/BluetoothMapContentObserver.java
ap/BluetoothMapUtils.java
ap/MmsFileProvider.java
24181aba0a5a45ab554c9fcc9bfa97981bcf75a2 19-Mar-2015 Casper Bonde <c.bonde@samsung.com> Add support for Bluetooth Sim Access Profile (3/4)

Server side of the Sim Access Profile. Enables a Bluetooth device
to take over control of the SIM. This is usefull in cars where the
internal antenna in the phone can have a low signal level.

For this profile to work, the RIL driver must allow for this feature
to be used, and it must provide the API needed. The API is based on
protoBuf.

This change includes some SAP test cases.

Change-Id: Ia46493383efed6b8a89ca270bdafa60fc1a150c1
tservice/AdapterService.java
tservice/BondStateMachine.java
tservice/Config.java
ap/SapMessage.java
ap/SapRilReceiver.java
ap/SapServer.java
ap/SapService.java
83557a8324f0d1c2ae6ff416fbc122d7b6c64fe3 11-Mar-2015 Nitin Arora <niarora@codeaurora.org> Bluetooth LE background operation mode (1/2)

Changes to BluetoothAdapter state machine for handling new
states BLE_STATE_ON and intermediate states BLE_TURNING_ON
and BLE_TURNING_OFF. Also includes the actions required
while migrating in and out of these states including
start and stop of GATT services and other profiles.

Change-Id: I08d6ff05c2cefe559d5bb5789a1a488afefbe544
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/ProfileService.java
tservice/RemoteDevices.java
att/ContextMap.java
att/GattService.java
id/HidService.java
5e1d6f595461e27acab14c5c5931d32025c1c18d 15-Apr-2015 Vinit Deshpande <vinitd@google.com> am bbb4110..165d7fa from mirror-m-wireless-internal-release

165d7fa MAP: Errata service release 8 changes
5a60e47 Update to Bluetooth MAP 1.2 (server)
0dcecb2 MAP: fix exception when Email in SMS list request
a8873ca Merge "Handle response to AT+NREC command" into m-wireless-dev
345f1ee Add UUIDs to SDP JNI
d1fadc3 Handle response to AT+NREC command

Change-Id: If24e414fe3fd0c2f47147f2535296b92e8066d76
ed70219e41ba68196798dcbf75b782d13fb88603 06-Mar-2015 kschulz <k.schulz@samsung.com> MAP: Change MMS to use new API to send message

Removed the send MMS message intent, and replaced by
SmsManager.sendMultimediaMessage()

Change-Id: I226b7b0e8fdb101ab160563937ae6e7a1a13be41
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
ap/BluetoothMapContentObserver.java
ap/BluetoothMapUtils.java
ap/MmsFileProvider.java
3178b08c6823899dbb58513673bf2a80f637be7c 27-Mar-2015 Ricky Wai <rickywai@google.com> Add contact sharing policy checking

Bug: 19990833

Change-Id: Ic9344cc78679930a388272165ee8db0ec56cbced
fp/AtPhonebook.java
bap/BluetoothPbapVcardManager.java
til/DevicePolicyUtils.java
165d7facb456fe3c15a07692a70723fda1ad135f 06-Mar-2015 kschulz <k.schulz@samsung.com> MAP: Errata service release 8 changes

- Exclude folderListingSize for requests MaxListCount != 0
- Exclude body-header for MaxListCount == 0
- Removing 'old_folder' from delete message event and place folder from
which message has been delete in 'folder' attribute

Signed-off-by: Casper Bonde <c.bonde@samsung.com>
Signed-off-by: Trine Jensen <trine.jensen@samsung.com>
Change-Id: I5bf6d50e0a078bb8a9d261d81efd4a9272bcb226
ap/BluetoothMapObexServer.java
5a60e47497f21f64e6d79420dc4c56c1907df22a 17-Mar-2015 kschulz <k.schulz@samsung.com> Update to Bluetooth MAP 1.2 (server)

- Change folder name lookup to a map
Replaced the arrays used to convert mailbox ID/msg type to a folder name with a static map.
This is to avoid null pointer exception for unknown values, and to catch any changes in
the ID/type values at compile time in stead of runtime.
Bug-id:16874441
- Added Instance Information support and Extended Event support.
Still missing integration wiht SDP MAP feature bit mask support
- Adding Abstract implementation to support conversations
- added IM account handling, IM type definition, Application paramenters.
- addedgetConversactionList functionality
- added method to strip encoding in headers
- Fixed messagelist showing both email address and name in the name fields.
- Fixed Index out of bounds exception was hit when the subject contained invalid chars.
- Added functionality to support the getConversationListReq
Works for SMS/MMS, Email and IM
For Email/IM it depends on the convoContact table in the contract.
For SMS/MMS it uses the contact number+ name if available in contact database.
- Added new parameters to msgListing also in contract class
- Added Test framework for "near system level" tests
Currently only includes an entry point for single device tests.
- Added support for setOwnerStatus
- Added support for vcard type X-BT-UID
- Introduced type SignedLongLong to handle 128 bit values which needs to be handled as hex-strings.
- Added convocontact notification events for IM
- Added support for IM getMessage
- Added setEventFilter function.
- Added event filtering before enquing an event to be send.
- Added selective observers, depending on the active filter.
- Fixed timestamp to be from seconds to seconds (not from milisec)
- Fixed version number in bMessage if remote featurebit is set for v 1.1
- Added content encoding to QP for text that are not USACII
- Corrected the addresses in to/from for IM messages
- Added btuid and btuci to vcard
- Fixed (some) longlines
- Added extendedData support (empty when sending, just logging when receiving)
- Fixed Email folderName compairison changed to ignore case
- Fixed problem with names containing "null"
- BluetoothMapbMessageMms changed to BluetoothMapbMessageMime
- Fixrf addOriginator in getMessage request
- Add missing subjects in events for SMS
- Don't send ReadStatusChanged when pushing a message
- Temp way of adding names/uci to IM msg listing
- Added messageHandle filtering in msgListing
- Convolisting parameter mask support
- Added support for using handle when filtering in root folder during msgLising
- Added subject to event in sms
- Fixed so attribute_mime_type is only sent when parameter is requested
- Fixed feature bit check to messageListing version
- Fixed leaking cursors
- Added support for database identifier
- Added folder and conversation version counters

Change-Id: I4d2954b795aa7ed2a41dd034384da30f240b518f
luetoothObexTransport.java
ignedLongLong.java
tservice/AdapterService.java
tservice/RemoteDevices.java
ap/BluetoothMapAccountItem.java
ap/BluetoothMapAccountLoader.java
ap/BluetoothMapAppObserver.java
ap/BluetoothMapAppParams.java
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapConvoContactElement.java
ap/BluetoothMapConvoListing.java
ap/BluetoothMapConvoListingElement.java
ap/BluetoothMapEmailAppObserver.java
ap/BluetoothMapEmailSettings.java
ap/BluetoothMapEmailSettingsAdapter.java
ap/BluetoothMapEmailSettingsDataHolder.java
ap/BluetoothMapEmailSettingsItem.java
ap/BluetoothMapEmailSettingsLoader.java
ap/BluetoothMapFolderElement.java
ap/BluetoothMapMasInstance.java
ap/BluetoothMapMessageListing.java
ap/BluetoothMapMessageListingElement.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapService.java
ap/BluetoothMapSettings.java
ap/BluetoothMapSettingsAdapter.java
ap/BluetoothMapSettingsDataHolder.java
ap/BluetoothMapUtils.java
ap/BluetoothMapbMessage.java
ap/BluetoothMapbMessageMime.java
ap/BluetoothMapbMessageMms.java
ap/BluetoothMnsObexClient.java
ap/MapContact.java
ap/SmsMmsContacts.java
0dcecb2cfd921916ed586183d64ec9fd250a6e4c 06-Mar-2015 kschulz <k.schulz@samsung.com> MAP: fix exception when Email in SMS list request

Fixed problem where an exception was thrown if the
client requests to get email listed on a MAS instance that only contains
SMS/MMS.

Bug: SD-4355
Change-Id: Id0e7f627424cc1f6f2047ec8564479288bf84d77
ap/BluetoothMapFolderElement.java
a8873ca26b4bf9bf9a6cc13f1f3a81a6bc8deea5 11-Apr-2015 Andre Eisenbach <eisenbach@google.com> Merge "Handle response to AT+NREC command" into m-wireless-dev
d1fadc3b23a03cbf028bfbdca9fd64640d7a05bd 03-Apr-2015 David Stevens <stevensd@google.com> Handle response to AT+NREC command

The AG will send either an OK or an ERROR in response to AT+NREC.
Not expecting a response to that command was skewing the responses
received for later commands.

Bug: 20157416
Change-Id: I992320403da7aabdc09f0315376e85ce905ecaf2
fpclient/HeadsetClientStateMachine.java
7c568e681511b992aa72838082b5dfa5e1ec6c10 10-Apr-2015 Prerepa Viswanadham <dham@google.com> Merge commit '2e85ea37c1ba495d3f0fd702f0a3920f3faf2848' into merge_work
bbb4110b455b3aa29106d5b4f0a37e1be8e09475 09-Apr-2015 Casper Bonde <c.bonde@samsung.com> Obex over L2CAP + SDP search API

Each profile had its own implementation of ObexTransport.
These implementations were implemented very similar, and
could easily be merged into a common implementation.

Additionally it will make it easier to adopt the transport
to support L2CAP.

The SDP functionality is implemented in a way that is scalable,
hence adding new record types is easy.
Intents are currently used to distribute the SDP search results,
as we have observed that the new client side profiles have been
located outside the Bluetooth package.
We strongly recommend to keep all bluetooth profiles within the
Bluetooth package, to acoid the need for exposing all bluetooth
interfaces through the Android framework. For instance this new
SDP create API is internal to Bluetooth, hence cannot be used by
the external profiles - hence they cannot use OBEX over L2CAP.

The SDP search currently supports:
- MAP both sides
- OPP server (only the server needs an SDP record)
- PBAP server (only the server needs SDP record)

The SDP create record currently supports:
- MAP both sides
- OPP server
- PBAP server
The new l2cap sockets introduces a new wrapper class for a rfcomm
and an l2cap socket.
The wrapper design:
- Creates two accept threads running while bluetooth is
turned on.
- When a connection is accepted the owner is asked wether or not
to accept the connection if rejected, the connection will be
rejected at obex level, else it will be accepted and the state
is changed to busy.
- Any further connections will be rejected at Obex level, until
the state is changed back to idle.

Notes tor executing the test cases:
Test OBEX using local pipes(no BT) or two bluetooth enabled
devices.

Test SDP using two Bluetooth enabled devices

Start server testcase first on one device, then start
the matching client test on the other device.

You cannot run all tests in one go, as they need to run
on multiple devices.

Edit the test sequesce to add/remove/modify the sequence
of OBEX operations to perform.

Use the new SDP record create interface.

Change-Id: I3941793f9843abf4afa5ffbee40d1d01c118b29b
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
luetoothObexTransport.java
ObexConnectionHandler.java
bexRejectServer.java
bexServerSockets.java
tservice/AdapterService.java
tservice/JniCallbacks.java
tservice/RemoteDevices.java
ap/BluetoothMapMasInstance.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapRfcommTransport.java
ap/BluetoothMapService.java
ap/BluetoothMapUtils.java
ap/BluetoothMnsObexClient.java
ap/BluetoothMnsRfcommTransport.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppRfcommTransport.java
pp/BluetoothOppTransfer.java
pp/TestActivity.java
bap/BluetoothPbapRfcommTransport.java
bap/BluetoothPbapService.java
dp/SdpManager.java
2e85ea37c1ba495d3f0fd702f0a3920f3faf2848 04-Apr-2015 Prerepa Viswanadham <dham@google.com> Onlost onfound feature

Change-Id: I7ceace5f14ed1cbdb8b66267ced318741febee73
tservice/AdapterService.java
att/AdvtFilterOnFoundOnLostInfo.java
att/GattService.java
att/ScanManager.java
f0026eb09f5def1252fde42040861fc2252c29a9 20-Mar-2015 Prerepa Viswanadham <dham@google.com> Fix file format.

Change-Id: I780adcab6bb8622b1be15aa2a97b84fb724d7bc9
att/AdvtFilterOnFoundOnLostInfo.java
att/FilterParams.java
ced9530661c9591eadc712e83b870b9f94f7ec43 07-Apr-2015 Ricky Wai <rickywai@google.com> Merge "Support work contacts in HFP, PBAP, MAP"
2bc6e65d7ac443ac976aa7aac8c84bf601f85eaa 02-Apr-2015 Elliott Hughes <enh@google.com> Merge "Add hwp MIME type to transfer/receive over bluetooth"
655434047df38242c1848eee283f134cfd299fd1 10-Feb-2015 Satya Calloji <satyac@broadcom.com> OnFound/OnLost feature JNI changes based on BLE spec v0.90.

Bug: 19609671
Change-Id: I2ac0687ea53616287d82fe47f256686619c0998a
tservice/AdapterProperties.java
att/AdvtFilterOnFoundOnLostInfo.java
att/FilterParams.java
att/GattService.java
att/ScanManager.java
5006c8597521a7652eafa89a6fb5483b5cb567b6 19-Feb-2015 Ricky Wai <rickywai@google.com> Support work contacts in HFP, PBAP, MAP

Change-Id: Iac752d75cf93c4d197f57bca0b209f3d5400f485
fp/AtPhonebook.java
ap/BluetoothMapContent.java
bap/BluetoothPbapVcardManager.java
dea3455df17f60987c982a2a55f8604ba9186434 24-Mar-2015 Prerepa Viswanadham <dham@google.com> Merge remote-tracking branch 'goog/mirror-m-wireless-internal-release' into master_merge
6c53637d2d9afebe66195754be864fa354fba9ab 18-Mar-2015 Paul Jensen <pauljensen@google.com> Remove dead code, mostly DataStateTracker.

(cherry picked from AOSP commit 6dbd9366698ea1a6139ace0c47c9175f42b8c60a)

Change-Id: I18c44cd08dfb51e02a96d0b726e9af1db21e3058
an/BluetoothTetheringNetworkFactory.java
f0af155794693099bf536be79c5ceecae1522ffb 09-Jan-2015 Wei Wang <weiwa@google.com> Add opportunistic ble scan mode. (2/2)

Bug:19003667
Change-Id: I51c609cf9941143637f0a5b4060705adc50ace72
(cherry picked from commit e90cdc4a5d2ea50178931e459c0e57e4116b55be)
att/ScanManager.java
b4d40f9e98362bc49ec660cc87a61322536b2196 03-Mar-2015 Sunny Goyal <sunnygoyal@google.com> Removing deprecated live_folders creation support

> live_folders are no longer supported by launcher

Change-Id: I08aed20b22f57cccdfce1cb193d6e03de494bc76
pp/BluetoothOppLiveFolder.java
pp/BluetoothOppProvider.java
6797e50e9bd5f979a0f4751da857e8b97843edb4 05-Feb-2015 Prerepa Viswanadham <dham@google.com> Use overlay values for computing the energy used.

Change-Id: Ifddeccbb555e5db19434b13b69f9a7b0c139332e
tservice/AdapterService.java
cafa35bd3b5f2309111fd3136553a1dd33f30458 12-Mar-2015 Lorenzo Colitti <lorenzo@google.com> am 0001d4fb: am c73c92b4: Merge "Remove dead code, mostly DataStateTracker."

* commit '0001d4fbaf09de60e550699e739cf27cac70280e':
Remove dead code, mostly DataStateTracker.
0001d4fbaf09de60e550699e739cf27cac70280e 11-Mar-2015 Lorenzo Colitti <lorenzo@google.com> am c73c92b4: Merge "Remove dead code, mostly DataStateTracker."

* commit 'c73c92b49cc7b974b31e933bbd15ee2e20771a5f':
Remove dead code, mostly DataStateTracker.
6dbd9366698ea1a6139ace0c47c9175f42b8c60a 21-Nov-2014 Paul Jensen <pauljensen@google.com> Remove dead code, mostly DataStateTracker.

Change-Id: I1433937bffdb29bd42fb1adbfcf0a50ceffac7dd
an/BluetoothTetheringNetworkFactory.java
c01407c7241590067a38147ad58c3954d82a3675 09-Feb-2015 Adam Lesinski <adamlesinski@google.com> Pass in time at which the energy info sample was collected

This is relies on a change in frameworks/base.

Change-Id: I78fc1ff8d954c58e58cd7f1a458f7d54cee1ce11
tservice/AdapterService.java
85fcb73115478754b9abaa8d43fcce9d7cfd60b3 19-Feb-2015 Amit Mahajan <amitmahajan@google.com> am 944d9882: am f53939e3: am 15354c93: am a1c94c68: Adding a new param to calculateLength for SMS to indicate if called for a segment of multipart msg.

* commit '944d98822fc53a15cc68cfdb855fabb448ed7632':
Adding a new param to calculateLength for SMS to indicate if called for a segment of multipart msg.
944d98822fc53a15cc68cfdb855fabb448ed7632 19-Feb-2015 Amit Mahajan <amitmahajan@google.com> am f53939e3: am 15354c93: am a1c94c68: Adding a new param to calculateLength for SMS to indicate if called for a segment of multipart msg.

* commit 'f53939e3c742e4bdba81ff2796312aa9904530ca':
Adding a new param to calculateLength for SMS to indicate if called for a segment of multipart msg.
a1c94c681b7064a22ba7d6331af62e175767695c 19-Feb-2015 Amit Mahajan <amitmahajan@google.com> Adding a new param to calculateLength for SMS to indicate if called for a
segment of multipart msg.

Encoding type is calculated separately for entire msg vs individual
segments. Change is to avoid overwriting the calculated value for
individual segment based.

Bug: 19399335
Change-Id: I8e89b7596e9c7440ace0486eceb1252094c373fa
ap/BluetoothMapSmsPdu.java
bb1fcdc55f2287009a1b18da9c3d46c163b0d0a4 10-Feb-2015 Andre Eisenbach <eisenbach@google.com> am 6c384c59: am c9d93376: am 1e3e1ddf: Add API to check if a Bluetooth connection is encrypted (2/2)

* commit '6c384c5927aa0f02c5bda611fc31225447f710e2':
Add API to check if a Bluetooth connection is encrypted (2/2)
6c384c5927aa0f02c5bda611fc31225447f710e2 10-Feb-2015 Andre Eisenbach <eisenbach@google.com> am c9d93376: am 1e3e1ddf: Add API to check if a Bluetooth connection is encrypted (2/2)

* commit 'c9d93376d13cb682c30fbfd7c2ad2c725d96b41d':
Add API to check if a Bluetooth connection is encrypted (2/2)
1e3e1ddf939bf71616245e1e100964568053d665 06-Feb-2015 Andre Eisenbach <eisenbach@google.com> Add API to check if a Bluetooth connection is encrypted (2/2)

Bug: 19186961
Change-Id: Ied8dbe60995ebe8759c2a4ce21f373b597ed3afe
tservice/AdapterService.java
d81eaacffeb206e1acde0e6b4a2ab2c5abca838c 27-Jan-2015 Matthew Xie <mattx@google.com> am d85c4615: am 7c38b7f0: am 9b017745: Use LTE signal level when under LTE

* commit 'd85c46153b8bda2a9cd98387b31f2bdd1efb02b7':
Use LTE signal level when under LTE
d85c46153b8bda2a9cd98387b31f2bdd1efb02b7 27-Jan-2015 Matthew Xie <mattx@google.com> am 7c38b7f0: am 9b017745: Use LTE signal level when under LTE

* commit '7c38b7f0dddd18dd652866f5764b506be2f6f46f':
Use LTE signal level when under LTE
9b0177459ddc1412c4e9d44af53a1badb476bdd9 23-Jan-2015 Matthew Xie <mattx@google.com> Use LTE signal level when under LTE

Bug: 17898918
Change-Id: I9f3bb8d874e24440c2b8de85a6a0d7dbdadb3935
fp/HeadsetPhoneState.java
8f7e19cb0eaabfe620078b609f21b154e76d280b 21-Jan-2015 Andre Eisenbach <eisenbach@google.com> am 7b7e5b6e: am dc8fecc2: am 0e3af27d: Merge "Remove GATT context if client registration did not succeed" into lmp-mr1-dev

* commit '7b7e5b6ee51bae92a5fbe617aa3794518da729e5':
Remove GATT context if client registration did not succeed
7b7e5b6ee51bae92a5fbe617aa3794518da729e5 21-Jan-2015 Andre Eisenbach <eisenbach@google.com> am dc8fecc2: am 0e3af27d: Merge "Remove GATT context if client registration did not succeed" into lmp-mr1-dev

* commit 'dc8fecc2d6f3b43c9fcde39bfbd69ac2ff7539fc':
Remove GATT context if client registration did not succeed
0e3af27dd1acd8034efb9b53bdb824fc342e7c7b 21-Jan-2015 Andre Eisenbach <eisenbach@google.com> Merge "Remove GATT context if client registration did not succeed" into lmp-mr1-dev
3f8164cd8c4bcce5e79770ee7c02fe00ba9581d5 16-Jan-2015 Andre Eisenbach <eisenbach@google.com> Remove GATT context if client registration did not succeed

Bug: 19028495
Change-Id: I25827e365621fa9b3ef6e85ef9c103cf03654b7c
att/ContextMap.java
att/GattService.java
a606581cff733498b7b7624c1868831ed59a85d3 16-Jan-2015 Andre Eisenbach <eisenbach@google.com> am 998e9bfa: am e2aaf550: am 45f25f7b: Merge "Improve VCARD filter logic and reduce log spam" into lmp-mr1-dev

* commit '998e9bfad3268db0ea3c84ba10c96f155d6e0967':
Improve VCARD filter logic and reduce log spam
998e9bfad3268db0ea3c84ba10c96f155d6e0967 16-Jan-2015 Andre Eisenbach <eisenbach@google.com> am e2aaf550: am 45f25f7b: Merge "Improve VCARD filter logic and reduce log spam" into lmp-mr1-dev

* commit 'e2aaf5500f317bab75c0548610251d86a7ab3d6a':
Improve VCARD filter logic and reduce log spam
45f25f7ba5aca87e8709b4901ca7057dbb4a3ccf 16-Jan-2015 Andre Eisenbach <eisenbach@google.com> Merge "Improve VCARD filter logic and reduce log spam" into lmp-mr1-dev
b863e5f549a068e6ebdaeffd1ca7d2e6b346e207 13-Jan-2015 Wink Saville <wink@google.com> am 4ab90596: am c40ed4d7: am 8dae225b: Merge "Rename reg/unreg OnSubscriptionsChangedListener." into lmp-mr1-dev

* commit '4ab905968e6af0b181143fa85080cbfccbd43107':
Rename reg/unreg OnSubscriptionsChangedListener.
d35ffe7518beab32715992ce33d78d8f30ee6181 13-Jan-2015 Wei Wang <weiwa@google.com> am 68cd4586: am a9b2d01f: am a8f9e639: Fix Bluetooth crash when all filters are used.

* commit '68cd458645085d61a3b38ce63a035ce62106a942':
Fix Bluetooth crash when all filters are used.
4ab905968e6af0b181143fa85080cbfccbd43107 13-Jan-2015 Wink Saville <wink@google.com> am c40ed4d7: am 8dae225b: Merge "Rename reg/unreg OnSubscriptionsChangedListener." into lmp-mr1-dev

* commit 'c40ed4d76a7ce8b36e14ef00b25e2189f90c35f5':
Rename reg/unreg OnSubscriptionsChangedListener.
8dae225b378f250f7a0348e923bade61895171d6 13-Jan-2015 Wink Saville <wink@google.com> Merge "Rename reg/unreg OnSubscriptionsChangedListener." into lmp-mr1-dev
68cd458645085d61a3b38ce63a035ce62106a942 13-Jan-2015 Wei Wang <weiwa@google.com> am a9b2d01f: am a8f9e639: Fix Bluetooth crash when all filters are used.

* commit 'a9b2d01fbd0839d44c9505b84a6b00f1621e58b6':
Fix Bluetooth crash when all filters are used.
a93f4e21950d6edc2bfd68356ddefffa259a277c 13-Jan-2015 Wink Saville <wink@google.com> Rename reg/unreg OnSubscriptionsChangedListener.

To addOnSubscriptionsChangedListener and
removeOnSubscriptionsChangedListener.

Bug: 18984103
Change-Id: I6636905093812af89c1c3702840e44c8c5ea891f
fp/HeadsetPhoneState.java
5f659853fff6a50fd12e1f7956997cbef244f798 07-Jan-2015 Andre Eisenbach <eisenbach@google.com> Improve VCARD filter logic and reduce log spam

Remove a stray log message in VCardFilter.applyFilter() function that
leads to high-frequency log spam during phone book synchronization. Also
refactored the logic to avoid multiple loops & loop iterations causing
higher CPU load.

Bug: 18913091
Change-Id: I3c6d3c3373d4a74a930d182ee2641959461b0556
bap/BluetoothPbapVcardManager.java
a8f9e6399874fa392e12d82409281da04607d64d 09-Jan-2015 Wei Wang <weiwa@google.com> Fix Bluetooth crash when all filters are used.

Bug:18963121

Change-Id: Ia69ad697d5be5b0a5e076f33e513aa2698a7468c
att/ScanManager.java
0139e50ffe57661b9318c144ea4de44a41299432 19-Dec-2014 Andre Eisenbach <eisenbach@google.com> am 97f53797: am a4774d88: am cd1091ef: Merge "Add EventLog for configHciSnoopLog() security check" into lmp-mr1-dev

* commit '97f537976cab544a1533338938eaa0547350903e':
Add EventLog for configHciSnoopLog() security check
97f537976cab544a1533338938eaa0547350903e 18-Dec-2014 Andre Eisenbach <eisenbach@google.com> am a4774d88: am cd1091ef: Merge "Add EventLog for configHciSnoopLog() security check" into lmp-mr1-dev

* commit 'a4774d8857beabf477f5093060bda2ca0356632d':
Add EventLog for configHciSnoopLog() security check
cd1091ef948a708bd5ce83f6dc2921710a217684 18-Dec-2014 Andre Eisenbach <eisenbach@google.com> Merge "Add EventLog for configHciSnoopLog() security check" into lmp-mr1-dev
ab5a7206638a3b68207800687a606894d629291e 18-Dec-2014 Sungmin Choi <sungmin.choi@lge.com> Add hwp MIME type to transfer/receive over bluetooth

Bug: 18788282
Change-Id: I2f67cf7b492d3e22d09dbe002a2a93d653db7736
pp/Constants.java
9ab1d44d3d9cfd459b868879ba9a5eefe3ed0cbf 17-Dec-2014 Andre Eisenbach <eisenbach@google.com> Add EventLog for configHciSnoopLog() security check

Bug: 18643224
Change-Id: I9c3f5e0880310e02a187d88349c5624bdade42eb
tservice/AdapterService.java
6cc821c53da5a042fd80cbc80a63ad6064647037 17-Dec-2014 Andre Eisenbach <eisenbach@google.com> am 2cb62f86: am b8a3025b: am da70d245: Merge "Enforce BLUETOOTH_PRIVILEGED permission for HID-over-GATT" into lmp-mr1-dev

* commit '2cb62f8611ea63a0546fef97a86f664fe147dab2':
Enforce BLUETOOTH_PRIVILEGED permission for HID-over-GATT
2cb62f8611ea63a0546fef97a86f664fe147dab2 17-Dec-2014 Andre Eisenbach <eisenbach@google.com> am b8a3025b: am da70d245: Merge "Enforce BLUETOOTH_PRIVILEGED permission for HID-over-GATT" into lmp-mr1-dev

* commit 'b8a3025ba9c8bd166496e7683613402d302323e5':
Enforce BLUETOOTH_PRIVILEGED permission for HID-over-GATT
da70d245699bdf2d6c9ffcf409ce3213804de81a 17-Dec-2014 Andre Eisenbach <eisenbach@google.com> Merge "Enforce BLUETOOTH_PRIVILEGED permission for HID-over-GATT" into lmp-mr1-dev
6a6259b859cca9a5cc5b6ec42ab487a5d81f2119 17-Dec-2014 Santos Cordon <santoscordon@google.com> am f4e76824: am dd7ad56b: am 17adc53c: Merge "Allow system process to interact with Bluetooth across users." into lmp-mr1-dev

* commit 'f4e76824ca9c8b728680bd8159ee96cdfd354f79':
Allow system process to interact with Bluetooth across users.
f4e76824ca9c8b728680bd8159ee96cdfd354f79 17-Dec-2014 Santos Cordon <santoscordon@google.com> am dd7ad56b: am 17adc53c: Merge "Allow system process to interact with Bluetooth across users." into lmp-mr1-dev

* commit 'dd7ad56b9bd470c7312136e91d6d803287c3a3cc':
Allow system process to interact with Bluetooth across users.
17adc53c8583e7cadbdfbe39f6a989ff2b98c521 17-Dec-2014 Santos Cordon <santoscordon@google.com> Merge "Allow system process to interact with Bluetooth across users." into lmp-mr1-dev
02bebee111e2ff96ed1484a49bdabebe40137fb5 16-Dec-2014 Andre Eisenbach <eisenbach@google.com> Enforce BLUETOOTH_PRIVILEGED permission for HID-over-GATT

Bug: 18359172
Change-Id: I06ed22af9dab8129ba7668dadd5b988d63c8a527
att/GattService.java
8e6936eae2f949066dcc6e2e66a48ffa50450402 16-Dec-2014 Santos Cordon <santoscordon@google.com> Allow system process to interact with Bluetooth across users.

Bug: 18688307
Change-Id: If31703fbe515baa40c242f99a61479a1ec8152b1
tils.java
5464d3b93bb16dcfba2659363419c0061da605c1 16-Dec-2014 Andre Eisenbach <eisenbach@google.com> am af4453d7: am b8997ce7: am 561f8821: Merge "Prevent possible NullPointerException when service is destroyed" into lmp-mr1-dev

* commit 'af4453d7d169f94b8f561b226dbf767d76d9d28a':
Prevent possible NullPointerException when service is destroyed
af4453d7d169f94b8f561b226dbf767d76d9d28a 16-Dec-2014 Andre Eisenbach <eisenbach@google.com> am b8997ce7: am 561f8821: Merge "Prevent possible NullPointerException when service is destroyed" into lmp-mr1-dev

* commit 'b8997ce7ac3c917edf71a2880b68541678c5fec3':
Prevent possible NullPointerException when service is destroyed
561f8821e976cfcdd5503e1b645417ef6506a995 16-Dec-2014 Andre Eisenbach <eisenbach@google.com> Merge "Prevent possible NullPointerException when service is destroyed" into lmp-mr1-dev
a1772b03b58d2821a621b40b7e8d1dba1213a556 16-Dec-2014 Andre Eisenbach <eisenbach@google.com> Prevent possible NullPointerException when service is destroyed

Bug: 18757778
Change-Id: Iaf2c8e41a5733379d171f58a35d09c506080fe5d
tservice/ProfileService.java
da5ad59790c084cee112a7341d1bed0e748ed87e 16-Dec-2014 Andre Eisenbach <eisenbach@google.com> am 86111508: am 64c4e01e: am ff125cce: Merge "Prevent duplicate OPP permission request dialogs" into lmp-mr1-dev

* commit '86111508c9adddf8f26c4d1b05ba28d21c0033c2':
Prevent duplicate OPP permission request dialogs
a733b88ef9cf13463ec138ecbddf6c4e053f67fa 16-Dec-2014 Andre Eisenbach <eisenbach@google.com> am 3ef42ba6: am 8959f11b: am 79606a97: Prevent non-system users from enabling Bluetooth HCI logging

* commit '3ef42ba6d68aeda0c52b936da3196804365c4452':
Prevent non-system users from enabling Bluetooth HCI logging
86111508c9adddf8f26c4d1b05ba28d21c0033c2 16-Dec-2014 Andre Eisenbach <eisenbach@google.com> am 64c4e01e: am ff125cce: Merge "Prevent duplicate OPP permission request dialogs" into lmp-mr1-dev

* commit '64c4e01e7d4c0257f074ad03e149474a4f19d086':
Prevent duplicate OPP permission request dialogs
3ef42ba6d68aeda0c52b936da3196804365c4452 16-Dec-2014 Andre Eisenbach <eisenbach@google.com> am 8959f11b: am 79606a97: Prevent non-system users from enabling Bluetooth HCI logging

* commit '8959f11b523a4418f3ec2b46c7c50199c0d4de86':
Prevent non-system users from enabling Bluetooth HCI logging
ff125cce1a5689a64e0eb4810851c3ef4304a1d3 16-Dec-2014 Andre Eisenbach <eisenbach@google.com> Merge "Prevent duplicate OPP permission request dialogs" into lmp-mr1-dev
79606a976b1ba0399ef94798b82e180c8376ecaf 16-Dec-2014 Andre Eisenbach <eisenbach@google.com> Prevent non-system users from enabling Bluetooth HCI logging

Bug: 18643224
Change-Id: I990aa3dac478d332f565496d0353c9677ea85d46
tservice/AdapterService.java
0a7aa4ad09ec442621266bae8d1815afdcb0d3c4 15-Dec-2014 Narayan Kamath <narayan@google.com> am a4a61b09: Merge "Remove bogus apache-http dependency."

* commit 'a4a61b09975d8cefbc7baa7313376c87a585b476':
Remove bogus apache-http dependency.
9e86038fdfa10e96fb5193f2b2e572a47fea8f06 15-Dec-2014 Narayan Kamath <narayan@google.com> Merge "Remove bogus apache-http dependency."
4c890d1d51db9f70ce0e67e4d1c20bed9e03f6b8 12-Dec-2014 Narayan Kamath <narayan@google.com> Remove bogus apache-http dependency.

Wasn't really being used for much of anything.

bug: 18027885

(cherry picked from commit 74d126e2f790c5946c7be0e087cdcbabc22468d7)

Change-Id: I04c8eeb05bef98176b1c523dd255948b42184867
ap/BluetoothMapContent.java
01b3991ff968cbc8300fdaf42bbe3f5614ac4c56 14-Dec-2014 Andre Eisenbach <eisenbach@google.com> Prevent duplicate OPP permission request dialogs

When multiple files are sent in a single OPP session, the user should be
prompted to accept/reject only once.

Bug: 17770561
Change-Id: I438116915883c5fdc2d743f13456006f66511c0f
pp/BluetoothOppObexServerSession.java
46833e97a97c6feb614fb942a1e43451522850b9 12-Dec-2014 Wink Saville <wink@google.com> am 74904502: am fc659040: am 75f77e99: Merge "Rename isValidSubId to isValidSubscriptionid." into lmp-mr1-dev

* commit '74904502b34ebf7967a045ea6056bb664f0d4c45':
Rename isValidSubId to isValidSubscriptionid.
f959c5ec67faca63050e27e70901bdaa5db4d1a4 12-Dec-2014 Kim Schulz <k.schulz@samsung.com> am ac972c4f: am ac3708eb: am 28446a56: Prevent Cursor leakage in Bluetooth MAP

* commit 'ac972c4fef8edcf587976e469f7a8810a4985006':
Prevent Cursor leakage in Bluetooth MAP
74d126e2f790c5946c7be0e087cdcbabc22468d7 12-Dec-2014 Narayan Kamath <narayan@google.com> Remove bogus apache-http dependency.

Wasn't really being used for much of anything.

bug: 18027885
Change-Id: I714eaa0e066301c32a23fe46858a33f656106cfa
ap/BluetoothMapContent.java
74904502b34ebf7967a045ea6056bb664f0d4c45 12-Dec-2014 Wink Saville <wink@google.com> am fc659040: am 75f77e99: Merge "Rename isValidSubId to isValidSubscriptionid." into lmp-mr1-dev

* commit 'fc65904080390e0ce02f8c0cc2d4033ed0f61494':
Rename isValidSubId to isValidSubscriptionid.
ac972c4fef8edcf587976e469f7a8810a4985006 12-Dec-2014 Kim Schulz <k.schulz@samsung.com> am ac3708eb: am 28446a56: Prevent Cursor leakage in Bluetooth MAP

* commit 'ac3708eb8c12d68feac636487db01f06acaf7681':
Prevent Cursor leakage in Bluetooth MAP
75f77e9970a4b4492e025257fccefcce612bc501 12-Dec-2014 Wink Saville <wink@google.com> Merge "Rename isValidSubId to isValidSubscriptionid." into lmp-mr1-dev
28446a56718e80574ba7b81901fc5a1368bf5839 10-Dec-2014 Kim Schulz <k.schulz@samsung.com> Prevent Cursor leakage in Bluetooth MAP

Bug: 18415378
Change-Id: Id513ee848dd21c641d77be38bdc6be85b5ef87a8
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapEmailSettingsLoader.java
ap/BluetoothMapObexServer.java
02e4dd41f4f1e7c4c929df709a4e75cf4a469a4f 11-Dec-2014 Wink Saville <wink@google.com> Rename isValidSubId to isValidSubscriptionid.

Bug: 18668873
Change-Id: Ie709a62bbb74e0a767daeb9e3fb3aecd4c45df44
fp/HeadsetPhoneState.java
b61d88635795c88729c2e50820afb248b4e491a8 10-Dec-2014 Andre Eisenbach <eisenbach@google.com> am 1334c9c3: am 1c0e2f0a: am 95ada143: Merge "Remove missing object to avoid NPE" into lmp-mr1-dev

* commit '1334c9c374f1644a42be38402a67d103fd5774a3':
Remove missing object to avoid NPE
a98eb048a07b35461906df94a0fa0e1f46690c4c 10-Dec-2014 Wei Wang <weiwa@google.com> am 1b432543: am 4dd91650: am 4bb5e13f: Fix timestamp parsing issue for full scan results.

* commit '1b4325430a61fec066348beb943152d5ef30383b':
Fix timestamp parsing issue for full scan results.
83c509111b13efb605b53080ac8ff84be7a87367 10-Dec-2014 Jason Monk <jmonk@google.com> am e51e96d8: am 7d8cf021: am c493bf36: Merge "Allow SystemUI access to bluetooth from user 0" into lmp-mr1-dev

* commit 'e51e96d8abc5f64dcefc6a6acef043e74cac88b6':
Allow SystemUI access to bluetooth from user 0
2d7d3ec0224ad440c823264ee5c3c2645480edae 10-Dec-2014 Prem Kumar <premk@google.com> am f50894ec: am 608d17e9: am fa9d2030: Merge "Revert "Bluetooth: Added Shared Preferences to restore tethering preference"" into lmp-mr1-dev

* commit 'f50894ecea6c3eddb1c9994ad07122386f6dc29a':
Revert "Bluetooth: Added Shared Preferences to restore tethering preference"
1334c9c374f1644a42be38402a67d103fd5774a3 09-Dec-2014 Andre Eisenbach <eisenbach@google.com> am 1c0e2f0a: am 95ada143: Merge "Remove missing object to avoid NPE" into lmp-mr1-dev

* commit '1c0e2f0af82c2dedb4919e935e911edb9d0f6830':
Remove missing object to avoid NPE
95ada14315a8ed5650508342a673710b3504af7e 09-Dec-2014 Andre Eisenbach <eisenbach@google.com> Merge "Remove missing object to avoid NPE" into lmp-mr1-dev
1e1c2a09698292db272421e58afee79b3bffe2e4 09-Dec-2014 Benjamin Franz <bfranz@google.com> am 64e6c05f: am ebdd2435: am 42a756a0: Merge "Allow managed profile apps to use some bluetooth functionality." into lmp-mr1-dev

* commit '64e6c05fac01604ac12676118d6b111781fc55c8':
Allow managed profile apps to use some bluetooth functionality.
1b4325430a61fec066348beb943152d5ef30383b 09-Dec-2014 Wei Wang <weiwa@google.com> am 4dd91650: am 4bb5e13f: Fix timestamp parsing issue for full scan results.

* commit '4dd916507f692ca52a67fd9cc150d805e36055eb':
Fix timestamp parsing issue for full scan results.
e51e96d8abc5f64dcefc6a6acef043e74cac88b6 08-Dec-2014 Jason Monk <jmonk@google.com> am 7d8cf021: am c493bf36: Merge "Allow SystemUI access to bluetooth from user 0" into lmp-mr1-dev

* commit '7d8cf02125e4589270a2a6952ea068660e34e743':
Allow SystemUI access to bluetooth from user 0
f50894ecea6c3eddb1c9994ad07122386f6dc29a 08-Dec-2014 Prem Kumar <premk@google.com> am 608d17e9: am fa9d2030: Merge "Revert "Bluetooth: Added Shared Preferences to restore tethering preference"" into lmp-mr1-dev

* commit '608d17e9c62c36c900259cd16fe41e1b02e93664':
Revert "Bluetooth: Added Shared Preferences to restore tethering preference"
4bb5e13f2902dc78048ede782996e78e7314afd5 08-Dec-2014 Wei Wang <weiwa@google.com> Fix timestamp parsing issue for full scan results.

Bug:18663523
Change-Id: If0ba083125d75e857072519fc7d6226a4db0273a
att/GattService.java
64e6c05fac01604ac12676118d6b111781fc55c8 08-Dec-2014 Benjamin Franz <bfranz@google.com> am ebdd2435: am 42a756a0: Merge "Allow managed profile apps to use some bluetooth functionality." into lmp-mr1-dev

* commit 'ebdd243545cb732eda9a69e71ff2499c54467fb0':
Allow managed profile apps to use some bluetooth functionality.
c493bf3669d606a18604d201ac52617e65da4958 08-Dec-2014 Jason Monk <jmonk@google.com> Merge "Allow SystemUI access to bluetooth from user 0" into lmp-mr1-dev
fa9d203017d7d78d45b48ff4362a56cb1300521a 08-Dec-2014 Prem Kumar <premk@google.com> Merge "Revert "Bluetooth: Added Shared Preferences to restore tethering preference"" into lmp-mr1-dev
465bbd2160749d9e0a3f3aabeb4e20bb51573001 05-Dec-2014 Jason Monk <jmonk@google.com> Allow SystemUI access to bluetooth from user 0

SystemUI always runs in the owner user, so when a secondary user
if foreground we need a special case to allow it access to bluetooth.

Bug: 18151285
Change-Id: I555dc2e4b4ff4929f9796fb888dd845fd066b368
tils.java
42a756a0362820b268136d8357bc0ab3befea129 05-Dec-2014 Benjamin Franz <bfranz@google.com> Merge "Allow managed profile apps to use some bluetooth functionality." into lmp-mr1-dev
6600afba0efab1e786ebc64c2b4374a2caea2fa4 05-Dec-2014 Matthew Xie <mattx@google.com> am fc1b918c: am d854a3d9: am c7b57a32: Merge "Nullpointer check on mAdapterService in ProfileService#onCreate" into lmp-mr1-dev

* commit 'fc1b918c75994c90158ef169fda88c35bb9e43de':
Nullpointer check on mAdapterService in ProfileService#onCreate
fc1b918c75994c90158ef169fda88c35bb9e43de 04-Dec-2014 Matthew Xie <mattx@google.com> am d854a3d9: am c7b57a32: Merge "Nullpointer check on mAdapterService in ProfileService#onCreate" into lmp-mr1-dev

* commit 'd854a3d9f26d14e9238180ccc4441fdf13de2e61':
Nullpointer check on mAdapterService in ProfileService#onCreate
8d18ea6347e6ca1d6cce153be0f12dfe25524f6d 04-Dec-2014 Matthew Xie <mattx@google.com> am 76ef321b: am 08b0b7ac: am ee66ca5f: Merge "Turn off map debug verbose messages" into lmp-mr1-dev

* commit '76ef321b367cbf8e81fa31aad3a277f086effb2f':
Turn off map debug verbose messages
76ef321b367cbf8e81fa31aad3a277f086effb2f 04-Dec-2014 Matthew Xie <mattx@google.com> am 08b0b7ac: am ee66ca5f: Merge "Turn off map debug verbose messages" into lmp-mr1-dev

* commit '08b0b7ac225cb954c0767903d9568bc6d6b645d9':
Turn off map debug verbose messages
c7b57a322ddf96f5c7f5398a36f72700dc0081da 04-Dec-2014 Matthew Xie <mattx@google.com> Merge "Nullpointer check on mAdapterService in ProfileService#onCreate" into lmp-mr1-dev
abe1879f779481f9ee1a48b2de343097a6ddcf85 04-Dec-2014 Matthew Xie <mattx@google.com> Nullpointer check on mAdapterService in ProfileService#onCreate

Bug: 18595130
Change-Id: I02d588dab94e1dc6c24402259e5b8cea2a98b482
tservice/ProfileService.java
4b55d952e08f719b77270741b13e2dace90d2aa1 03-Dec-2014 Matthew Xie <mattx@google.com> Revert "Bluetooth: Added Shared Preferences to restore tethering preference"

This reverts commit cdd2da9489cdfcf35ffdc622eba6f2155f6d376e.
Bug 18452422
Change-Id: I6039ab98038773691dce7667c53256fa04c51df9
an/PanService.java
ee66ca5f8bc0f2b7ab26ff3a008f4fd7e30e1d44 03-Dec-2014 Matthew Xie <mattx@google.com> Merge "Turn off map debug verbose messages" into lmp-mr1-dev
9c031dab027f0e0e5400437fa4ce8be9491a34e7 31-Oct-2014 Michal Labedzki <michal.labedzki@sonymobile.com> Remove missing object to avoid NPE

Initialization of mContentView was removed in commit
addfd25b639047e8463772b14f249758bdb20fbc, but is still
referenced during timeout causing NPE. Remove reference
as it is not needed.

Bug: 18309654
Change-Id: Id42810a97d638fd761a32069b591fc2b647e3a67
pp/BluetoothOppIncomingFileConfirmActivity.java
e73166fc402f8835646d7733a577bceb2753d7c7 03-Dec-2014 Andre Eisenbach <eisenbach@google.com> am 6c43243b: am f5610d22: am 888d015c: Merge "Add GATT debug information to dumpsys/bugreport" into lmp-mr1-dev

* commit '6c43243b30211ca71811d3ace639010c732fc141':
Add GATT debug information to dumpsys/bugreport
6c43243b30211ca71811d3ace639010c732fc141 02-Dec-2014 Andre Eisenbach <eisenbach@google.com> am f5610d22: am 888d015c: Merge "Add GATT debug information to dumpsys/bugreport" into lmp-mr1-dev

* commit 'f5610d223b65142730fae0112187eef9dee3bb4c':
Add GATT debug information to dumpsys/bugreport
888d015c7d6f2c98ff963cb78414cf86611bd84b 02-Dec-2014 Andre Eisenbach <eisenbach@google.com> Merge "Add GATT debug information to dumpsys/bugreport" into lmp-mr1-dev
a02de6484f9b6cac6b8c811edae11be55746b555 02-Dec-2014 Andre Eisenbach <eisenbach@google.com> Add GATT debug information to dumpsys/bugreport

Bug: 17894347
Change-Id: I70a2e237e4aa6a1057e5ff519f3f6148a27b3a98
att/ContextMap.java
att/GattDebugUtils.java
att/GattService.java
att/HandleMap.java
2287bc2b01df774378123fe7bc7bca14fee549f7 05-Nov-2014 Benjamin Franz <bfranz@google.com> Allow managed profile apps to use some bluetooth functionality.

Adding a function that checks whether the calling user is the foreground
user or a managed profile associated to this user. This function is
deployed in selected spots to give managed profile apps access to some
part of the bluetooth functionality including the HeadsetService.

Bug: 16968338
Change-Id: Ib0db0847cf361b449484195553725c38ede3b618
tils.java
tservice/AdapterService.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
013ed2ea8e6a67c1b6b637aa75d4302d56b48688 02-Dec-2014 Andre Eisenbach <eisenbach@google.com> am a9993c9f: am 657b88c6: am 63fce3b9: Merge "Add server-side callback for change in MTU (3/4)" into lmp-mr1-dev

* commit 'a9993c9fa5a4ba5ddcf9c918013712799f96379a':
Add server-side callback for change in MTU (3/4)
a9993c9fa5a4ba5ddcf9c918013712799f96379a 02-Dec-2014 Andre Eisenbach <eisenbach@google.com> am 657b88c6: am 63fce3b9: Merge "Add server-side callback for change in MTU (3/4)" into lmp-mr1-dev

* commit '657b88c6cb0fd51bd6309e1f80af9743f8d3ebc4':
Add server-side callback for change in MTU (3/4)
ec8c0726bf056f79c1ad070ea1db2ed2910f2ef0 01-Dec-2014 Matthew Xie <mattx@google.com> Turn off map debug verbose messages

Still leave the debug messages on to provide some basic debug info
Bug: 18486776

Change-Id: I08fc5c69d9a128ec5ddc97203d02b82ced255262
ap/BluetoothMapService.java
e632e4bb8c873f102cac7d6f39585ea06f34c082 26-Nov-2014 Andre Eisenbach <eisenbach@google.com> Add server-side callback for change in MTU (3/4)

When a client requests to update the LE transport MTU, the server
currently does not get notified and can therefor not properly size
notifications appropriate to the current MTU.

Bug: 18388114
Change-Id: Ie075871cbc643bd3840e9ab472706f1565b74467
att/GattService.java
e5c5677d15aea04acc475bba18c7bfd26ec0eff4 26-Nov-2014 Matthew Xie <mattx@google.com> am 328357fa: am 317f4e89: am fcd9bd0d: DO NOT MERGE Move wake alarm setting and releasing into AdapterService\'s handler

* commit '328357faf9d72738c0fe39b041e0cd98ccc383e1':
DO NOT MERGE Move wake alarm setting and releasing into AdapterService's handler
317f4e8911fee285fb313db47529a898e60f4da0 26-Nov-2014 Matthew Xie <mattx@google.com> am fcd9bd0d: DO NOT MERGE Move wake alarm setting and releasing into AdapterService\'s handler

* commit 'fcd9bd0d130f1050aa7e68c65f1595ef8fc24e68':
DO NOT MERGE Move wake alarm setting and releasing into AdapterService's handler
fcd9bd0d130f1050aa7e68c65f1595ef8fc24e68 26-Nov-2014 Matthew Xie <mattx@google.com> DO NOT MERGE Move wake alarm setting and releasing into AdapterService's handler

The setting and firing of the alarm wake lock came from different thread
and cause deadlock.

Note: not merging down into MR1 so that further testing can be done.

Bug: 18511282
Change-Id: I32b18cb21d503f10a8e49b1e86c949ebe96b3482
tservice/AdapterService.java
ee8eff192b824a5666b99ce513c404976d3be9f5 25-Nov-2014 Matthew Xie <mattx@google.com> am c6001f91: am be875574: am 51d409fd: Merge "Check previous user confirmation before auto-confirm put request" into lmp-mr1-dev

* commit 'c6001f91a1d92b68273b22035922f82341b6c5fc':
Check previous user confirmation before auto-confirm put request
c6001f91a1d92b68273b22035922f82341b6c5fc 25-Nov-2014 Matthew Xie <mattx@google.com> am be875574: am 51d409fd: Merge "Check previous user confirmation before auto-confirm put request" into lmp-mr1-dev

* commit 'be875574c2f3f797732814ee41c7ffbb10c14f6c':
Check previous user confirmation before auto-confirm put request
2f65cee9a3058a183c67f95571aa1dda7077112f 25-Nov-2014 Matthew Xie <mattx@google.com> am 38a952fe: am b16b868d: am d4a6ad3a: am d981ab06: Check previous user confirmation before auto-confirm put request

* commit '38a952fe66d78602095ab65ef36f321e99c295a6':
Check previous user confirmation before auto-confirm put request
38a952fe66d78602095ab65ef36f321e99c295a6 25-Nov-2014 Matthew Xie <mattx@google.com> am b16b868d: am d4a6ad3a: am d981ab06: Check previous user confirmation before auto-confirm put request

* commit 'b16b868dc8df463e688069870d6f53ae17ecdaa8':
Check previous user confirmation before auto-confirm put request
b16b868dc8df463e688069870d6f53ae17ecdaa8 25-Nov-2014 Matthew Xie <mattx@google.com> am d4a6ad3a: am d981ab06: Check previous user confirmation before auto-confirm put request

* commit 'd4a6ad3a5f5d12ee6901b7a83260267c83dabd76':
Check previous user confirmation before auto-confirm put request
d981ab06c6844ef345cd0a1d3077c4840f978989 17-Nov-2014 Matthew Xie <mattx@google.com> Check previous user confirmation before auto-confirm put request

Also correct a confirm status change check in updateShare.
Bug: 17770561, 18343032

Change-Id: I8e7d10e73604c0bf1c88801a1caef7d579fbd1eb
(cherry picked from commit e93cc4d347fd5d263d7740ad85f7f99b64651126)
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
51d409fd2f9f594afea03463e45f28a67b010ed2 24-Nov-2014 Matthew Xie <mattx@google.com> Merge "Check previous user confirmation before auto-confirm put request" into lmp-mr1-dev
20bf4cb367b5258070d381b10212176b2decb985 24-Nov-2014 Wink Saville <wink@google.com> am cfc6bc9d: am 0f21f326: am 3eacacc7: Additional changes to SubscriptionManager API as per API council.

* commit 'cfc6bc9d9d197ab01da6fca8d80858a0934af222':
Additional changes to SubscriptionManager API as per API council.
cfc6bc9d9d197ab01da6fca8d80858a0934af222 24-Nov-2014 Wink Saville <wink@google.com> am 0f21f326: am 3eacacc7: Additional changes to SubscriptionManager API as per API council.

* commit '0f21f326ddcd76460fd18f1532a7d00981c08003':
Additional changes to SubscriptionManager API as per API council.
7b679c99b585e6070eda3716e0eb8df7e265655e 21-Nov-2014 Wink Saville <wink@google.com> am 0a037333: am da689e99: am 5532bb8c: Revert "Additional changes to SubscriptionManager API as per API council."

* commit '0a03733338043fb9e23426dbc39125def3a37db9':
Revert "Additional changes to SubscriptionManager API as per API council."
3de2ab0fea4111574dc80ecb3b9ed37bbddc6fbb 21-Nov-2014 Wink Saville <wink@google.com> am 864dcfa8: am 7a4b67f7: am 13e1a71b: Additional changes to SubscriptionManager API as per API council.

* commit '864dcfa845bfe8e900bd37689d17de30cfd37255':
Additional changes to SubscriptionManager API as per API council.
0a03733338043fb9e23426dbc39125def3a37db9 21-Nov-2014 Wink Saville <wink@google.com> am da689e99: am 5532bb8c: Revert "Additional changes to SubscriptionManager API as per API council."

* commit 'da689e99b43d46926525229536bc2d7579ed25d5':
Revert "Additional changes to SubscriptionManager API as per API council."
864dcfa845bfe8e900bd37689d17de30cfd37255 21-Nov-2014 Wink Saville <wink@google.com> am 7a4b67f7: am 13e1a71b: Additional changes to SubscriptionManager API as per API council.

* commit '7a4b67f70896bc9743bea465332da07564f6edcb':
Additional changes to SubscriptionManager API as per API council.
3eacacc7fd744658af7a862eb91172a6ae1ffba5 20-Nov-2014 Wink Saville <wink@google.com> Additional changes to SubscriptionManager API as per API council.

bug: 17575308
Change-Id: Idd98aa46c15a9219ccf28091c62602ac8bf16c62
fp/HeadsetPhoneState.java
5532bb8c2dd4a785951df8baffe8b7a07f3a4b01 20-Nov-2014 Wink Saville <wink@google.com> Revert "Additional changes to SubscriptionManager API as per API council."

This reverts commit 13e1a71bf0cf955ac39390fd96fd3f04e1954ef6.

Change-Id: Ib22d745d17dcf6dca3567e903670ca7cc323138b
fp/HeadsetPhoneState.java
13e1a71bf0cf955ac39390fd96fd3f04e1954ef6 18-Nov-2014 Wink Saville <wink@google.com> Additional changes to SubscriptionManager API as per API council.

bug: 17575308
Change-Id: I7773965094510999bfce8fc6b2b31ba6ce496653
fp/HeadsetPhoneState.java
e93cc4d347fd5d263d7740ad85f7f99b64651126 17-Nov-2014 Matthew Xie <mattx@google.com> Check previous user confirmation before auto-confirm put request

Also correct a confirm status change check in updateShare.
Bug: 17770561, 18343032

Change-Id: I8e7d10e73604c0bf1c88801a1caef7d579fbd1eb
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
318e34c3f0d60e3373dab8026aacea6880b5f448 12-Nov-2014 Wink Saville <wink@google.com> am cea09836: am a49560c0: am cf496e42: Update SubscriptionManager API as per API council.

* commit 'cea09836d12a0aa1ab6748fb5328defedbebd958':
Update SubscriptionManager API as per API council.
cea09836d12a0aa1ab6748fb5328defedbebd958 12-Nov-2014 Wink Saville <wink@google.com> am a49560c0: am cf496e42: Update SubscriptionManager API as per API council.

* commit 'a49560c0d801f35b02b86d63bbadefc912147de3':
Update SubscriptionManager API as per API council.
cf496e4230a5067a19e067115502b3961c9bf220 11-Nov-2014 Wink Saville <wink@google.com> Update SubscriptionManager API as per API council.

bug: 17575308
Change-Id: Ib39a60e4f75981a466e9d606ec627756efad018d
fp/HeadsetPhoneState.java
5c48b66a94a8129824e741c06356dfad766f52f7 08-Nov-2014 Mike Lockwood <lockwood@google.com> am a8855e56: am fa46a2f6: am cc633970: Merge "Add dumpsys support for bluetooth" into lmp-mr1-dev

* commit 'a8855e560a20888731234a26a4753d902e6a11fe':
Add dumpsys support for bluetooth
a8855e560a20888731234a26a4753d902e6a11fe 08-Nov-2014 Mike Lockwood <lockwood@google.com> am fa46a2f6: am cc633970: Merge "Add dumpsys support for bluetooth" into lmp-mr1-dev

* commit 'fa46a2f6087f21c9cc6f7148900c99442fae9589':
Add dumpsys support for bluetooth
cc633970b1fc16db030da1634a0c92fa3548a465 08-Nov-2014 Mike Lockwood <lockwood@google.com> Merge "Add dumpsys support for bluetooth" into lmp-mr1-dev
2f9187a2c99f49a07d6c12e2bb4636b68f820ea6 07-Nov-2014 Matthew Xie <mattx@google.com> am 558571ba: am 5a8e9b03: am a75e97e7: am 6c32875f: am b81ccaea: am 964a72ae: updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it

* commit '558571bac3e21acce0056fed8873b23e0309078a':
updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it
558571bac3e21acce0056fed8873b23e0309078a 07-Nov-2014 Matthew Xie <mattx@google.com> am 5a8e9b03: am a75e97e7: am 6c32875f: am b81ccaea: am 964a72ae: updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it

* commit '5a8e9b03c2a3333a23bc143aa1e036c4556bbe7b':
updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it
5a8e9b03c2a3333a23bc143aa1e036c4556bbe7b 07-Nov-2014 Matthew Xie <mattx@google.com> am a75e97e7: am 6c32875f: am b81ccaea: am 964a72ae: updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it

* commit 'a75e97e7e56415d4b4d580cf7c780bcf1659e2af':
updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it
6c32875f190e8d04f425ef142416a8f2a535a3df 07-Nov-2014 Matthew Xie <mattx@google.com> am b81ccaea: am 964a72ae: updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it

* commit 'b81ccaea320de5e4fc19d5bc5d81874e9e68ead1':
updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it
964a72ae9eebe882aebcab4b5326afb6cc06f595 23-Oct-2014 Matthew Xie <mattx@google.com> updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it

bug 17770561
Change-Id: I34fb018d9787b4deef8592c71f5539778e76e325
(cherry picked from commit 70743aa46fa95bd252acea614bfde8cc65e03890)
pp/BluetoothOppService.java
0301badedb14c68fe1c0e46efc14eb24411e333c 22-Aug-2014 Mike Lockwood <lockwood@google.com> Add BluetoothDevice field to BluetoothHeadsetClientCall

Change-Id: I07134da3b93e1db087ebbb9b97b7a31dbae37272
fpclient/HeadsetClientStateMachine.java
7bf6f95f4f94ccd4c1d17c0606a497168b36312a 31-Oct-2014 Wei Wang <weiwa@google.com> am 0ce8246c: am cbc5d0ef: am ac67c808: Fix batch timestamp parsing error.

* commit '0ce8246cb73ba67ae1dab6854a3583c10e7c5117':
Fix batch timestamp parsing error.
a466ac649e0441327960619788be930a0a8651ba 31-Oct-2014 Matthew Xie <mattx@google.com> am ab21da70: am 4e6ac48c: Merge "updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it" into lmp-mr1-dev

* commit 'ab21da70380aeb912863ef5a0028b4bb7797708a':
updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it
cbc5d0efdcc51f6ca83175a69074371d07203781 30-Oct-2014 Wei Wang <weiwa@google.com> am ac67c808: Fix batch timestamp parsing error.

* commit 'ac67c808d9c8072da9f36c1a964ee78135f42edb':
Fix batch timestamp parsing error.
ac67c808d9c8072da9f36c1a964ee78135f42edb 29-Oct-2014 Wei Wang <weiwa@google.com> Fix batch timestamp parsing error.

Bug:18166784
Change-Id: I4817a1410c570bd1fa59425c257fb4a3d96e9e1f
att/GattService.java
til/NumberUtils.java
4e6ac48c933b3ac8666fbc2dc1d3021689847067 29-Oct-2014 Matthew Xie <mattx@google.com> Merge "updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it" into lmp-mr1-dev
838949d46a4cc054985a8cfd682004f8dd6d3bbb 28-Oct-2014 Mike Lockwood <lockwood@google.com> Add dumpsys support for bluetooth

Bug: 18159457
Change-Id: I807a7d921b6e5baf111d0f0e3e182c6633a93b7c
2dp/A2dpService.java
2dp/A2dpSinkService.java
2dp/A2dpSinkStateMachine.java
2dp/A2dpStateMachine.java
vrcp/Avrcp.java
vrcp/AvrcpControllerService.java
tservice/AdapterService.java
tservice/ProfileService.java
att/GattService.java
dp/HealthService.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
id/HidService.java
ap/BluetoothMapService.java
an/PanService.java
6879cbf4c4550615a3e07edebfe6e259e4915f04 28-Oct-2014 Wink Saville <wink@google.com> am 22017f4e: am 9b95221e: Merge "Change subId to int from long" into lmp-mr1-dev

* commit '22017f4edcadedece774b1b4de97fd91ba09033a':
Change subId to int from long
9b95221e5d4efc1678f3342a15c05f293cc79a05 27-Oct-2014 Wink Saville <wink@google.com> Merge "Change subId to int from long" into lmp-mr1-dev
eb1cfb15a9bd8bed9f44be96bccac1c43ad77367 25-Oct-2014 Matthew Xie <mattx@google.com> am 056ba3b9: am 050d2d9e: am e60b413f: am 739fb187: When local device originated connection to hid device, move out of quiet mode

* commit '056ba3b9a92f73c63c9ab1de9f88510c7b5d6889':
When local device originated connection to hid device, move out of quiet mode
e60b413fa9920c2210cf4a31c8b660593b4d4415 25-Oct-2014 Matthew Xie <mattx@google.com> am 739fb187: When local device originated connection to hid device, move out of quiet mode

* commit '739fb187689df1113f8403ef22da811aa614193d':
When local device originated connection to hid device, move out of quiet mode
739fb187689df1113f8403ef22da811aa614193d 24-Oct-2014 Matthew Xie <mattx@google.com> When local device originated connection to hid device, move out of quiet mode

bug 17480992

Change-Id: Ia3f5ef4886dfde370abe5b35a80ab80a4f030f37
id/HidService.java
70743aa46fa95bd252acea614bfde8cc65e03890 23-Oct-2014 Matthew Xie <mattx@google.com> updateshare confirm logic missed cases like CONFIRMATION_DENIED, TIMEOUT. fix it

bug 17770561
Change-Id: I34fb018d9787b4deef8592c71f5539778e76e325
pp/BluetoothOppService.java
7d05ab1e4565d883f26b1831b470d5f5baede45f 23-Oct-2014 Wink Saville <wink@google.com> Change subId to int from long

Change-Id: Idae6335e63e7b1e4e714bc17e71b1a4705e38474
fp/HeadsetPhoneState.java
1a74c7ed4d038c84d107e99bf7b2bc5ed4f3865d 20-Oct-2014 Wei Wang <weiwa@google.com> am 2fd9e483: am e8feb437: am e12e03fa: Merge "Remove spammy log information for BLE scan." into lmp-sprout-dev

* commit '2fd9e4837d7a36e52530152fdb66392b019798f0':
Remove spammy log information for BLE scan.
f7a5598424273fe514ce3293cb11ad6c31ad6f17 18-Oct-2014 Wei Wang <weiwa@google.com> Remove spammy log information for BLE scan.

Bug:17574681
Change-Id: I44a9725aa4103734418411e6dac9c2e6ec564c4d
att/GattService.java
fc6d6d6db59e2f39b04abde6eafa3e5f37faf40e 15-Oct-2014 Matthew Xie <mattx@google.com> am 17771285: Merge "ignore telephony call state if telephony mgr state is idle"

* commit '177712858d5897db18e2adf689c8e75f81f05c87':
ignore telephony call state if telephony mgr state is idle
c10981d2a7e1d477c78e375d3d876fbafd3a02f2 15-Oct-2014 Matthew Xie <mattx@google.com> am 17771285: Merge "ignore telephony call state if telephony mgr state is idle"

* commit '177712858d5897db18e2adf689c8e75f81f05c87':
ignore telephony call state if telephony mgr state is idle
1cecad2692a0b0a8e81e5eb5ed8206b0d98edb38 15-Oct-2014 Matthew Xie <mattx@google.com> am 7a306fb7: Merge "Update AVRCP play status only if music is streaming" into lmp-dev

* commit '7a306fb7b52cdf99411aaef4c7b44f51a14dc559':
Update AVRCP play status only if music is streaming
7a306fb7b52cdf99411aaef4c7b44f51a14dc559 15-Oct-2014 Matthew Xie <mattx@google.com> Merge "Update AVRCP play status only if music is streaming" into lmp-dev
671e9ea90eb85e1a993ff2d56e02d1014a1b8f39 14-Oct-2014 Wei Wang <weiwa@google.com> Merge "Add support of advertising through standard instance.(2/4)" into lmp-sprout-dev
10260dc85133bbfbc51c53f06ba8992e00d9b67a 04-Aug-2014 jbelloua <jean-marie.bellouard@intel.com> ignore telephony call state if telephony mgr state is idle

When re-connecting a BT headset, the headset state machine requests
telephony stack call state (through queryPhoneState) once
SLC is established. The answer is received asynchronously.

If there is a virtual call (e.g. voip/hang out/skype) ongoing while
connecting BT headset, the audio will be switched automatically to BT SCO
path once connected.

Issue: if the call state from telephony is received while the BT headset
is being used for a virtual call, then the virtual call is stopped,
even if there is no call ongoing, and audio will be routed back to primary
device (speaker/headset).

Proposal: ignore the telephony state in case there is a virtual
call ongoing, but no CSV call, and keep audio routed to the BT
SCO path.

Change-Id: If0ebe8c5cd08f48dd56a593e37f3f05a4fccfc97
jean-marie.bellouard <jean-marie.bellouard@intel.com>
fp/HeadsetStateMachine.java
93e837dba1f1e976fe827466e2b2c3bd6f1d6ada 10-Oct-2014 Tyler Gunn <tgunn@google.com> am a40ac96c: Issue: turning on bluetooth headset in call doesn\'t change route (2/2).

* commit 'a40ac96c186b6f2105906bb07be45fc8d2ce1436':
Issue: turning on bluetooth headset in call doesn't change route (2/2).
a40ac96c186b6f2105906bb07be45fc8d2ce1436 10-Oct-2014 Tyler Gunn <tgunn@google.com> Issue: turning on bluetooth headset in call doesn't change route (2/2).

In addition to a failure to report CallState from Telecom, the broadcast
of the state change was happening before the active device was set,
causing Telecom to receive the broadcast indicating the audio state has
changed, only to have the Bluetooth service report that bluetooth audio
is not connected yet.

Bug: 17933664
Change-Id: Id4e7c6d4085f5ee990a8d19da8c089399ee60c6d
fp/HeadsetStateMachine.java
22bad7047263a6924423d12718738fdcc7b0352c 09-Oct-2014 Ravi Nagarajan <nravi@broadcom.com> Update AVRCP play status only if music is streaming

AVRCP play status was updated based on AVDTP stream state. Enhanced this
logic to update the status only when music is streaming
bug 12099469

Change-Id: Idef0180cd0d0b78fa392a5354320440fce9b81a7
vrcp/Avrcp.java
5907b58808823e6b1c8835588c4eb65d2f00ba69 09-Oct-2014 Tyler Gunn <tgunn@google.com> am fbb1fe1e: Moving STATE_DISCONNECTED broadcast.

* commit 'fbb1fe1efa8459f932aed161fbcc0b5e4d52c2d5':
Moving STATE_DISCONNECTED broadcast.
a1664d61821a59145f8095a75373403a0c54244e 23-Sep-2014 Wei Wang <weiwa@google.com> Add support of advertising through standard instance.(2/4)

Use standard advertising instance if peripheral mode is support but multi adv is not.

Bug: 17552672
Change-Id: I21044665d0ac38f84abb95bfe1348d7bf83bfd2a
tservice/AdapterService.java
att/AdvertiseManager.java
att/GattService.java
fbb1fe1efa8459f932aed161fbcc0b5e4d52c2d5 08-Oct-2014 Tyler Gunn <tgunn@google.com> Moving STATE_DISCONNECTED broadcast.

In Telecom we were seeing a bug where we received an
ACTION_CONNECTION_STATE_CHANGEDSTATE intent indicating the disconnection
of a bluetooth headset. The BluetoothManager in Telecom would then
query the Bluetooth service to see if there are any devices. Despite
being informed that the device in use was disconnected, it still showed
up as connected.

To fix this, I moved the state broadcast AFTER the disconnected device is
removed from the headset state machine. Looking through all other
disconnect broadcasts in that file, the disconnection happens AFTER in
all other cases as well.

Bug: 17899941
Change-Id: Ice4b2a5b1093e04ffe4c3241a3379aba56898792
fp/HeadsetStateMachine.java
b5f209a8886cb6ee47535f4f3878b6eff9c80709 02-Oct-2014 Matthew Xie <mattx@google.com> am 3d4a5452: Merge "MAP: Return OBEX_HTTP_NOT_IMPLEMENTED for msgUpdate for sms/mms" into lmp-dev

* commit '3d4a54529dd6033c082113b600d945531b759492':
MAP: Return OBEX_HTTP_NOT_IMPLEMENTED for msgUpdate for sms/mms
3d4a54529dd6033c082113b600d945531b759492 02-Oct-2014 Matthew Xie <mattx@google.com> Merge "MAP: Return OBEX_HTTP_NOT_IMPLEMENTED for msgUpdate for sms/mms" into lmp-dev
2d97e3bd45542e6e0289151fa0606e54247ddfd3 02-Oct-2014 Prem Kumar <premk@google.com> am 0bdf4df1: Merge "Add HOGP as hid profile when the remote device contain HOGP service" into lmp-dev

* commit '0bdf4df10c03602f609a1eb23aabe1fe772a89fd':
Add HOGP as hid profile when the remote device contain HOGP service
0bdf4df10c03602f609a1eb23aabe1fe772a89fd 02-Oct-2014 Prem Kumar <premk@google.com> Merge "Add HOGP as hid profile when the remote device contain HOGP service" into lmp-dev
ba4b2f5b1e32e742a130f79ee1a1d0509390c6b3 01-Oct-2014 Matthew Xie <mattx@google.com> MAP: Return OBEX_HTTP_NOT_IMPLEMENTED for msgUpdate for sms/mms

In MAP profile message update is not implemented for sms/mms.
bug 17723738

Change-Id: I6c7baaf9e6f54e7af1b6c8458a6a458239da7d10
ap/BluetoothMapObexServer.java
99f9e9b58a4214280d3ef678d098c2062c890815 01-Oct-2014 PauloftheWest <paulofthewest@google.com> am 335b2b8f: Fixed a Bluetooth MAP bug.

* commit '335b2b8f6f17c93a4c2b192c8e1b629e48b230b3':
Fixed a Bluetooth MAP bug.
d523f01c8adda96876ffc019c9bb8b78e1372be0 30-Sep-2014 Matthew Xie <mattx@google.com> Add HOGP as hid profile when the remote device contain HOGP service

bug 17409862

Change-Id: I018f12facefa7fb7bf2c3b46e639c40a8a67eae4
tservice/AdapterService.java
335b2b8f6f17c93a4c2b192c8e1b629e48b230b3 29-Sep-2014 PauloftheWest <paulofthewest@google.com> Fixed a Bluetooth MAP bug.

+ Beforehand, if a user disabled MAP and then unpaired the device, then
Settings would automatically deny future MAP requests from the device.

Bug: 17391677
Change-Id: I068f37426ed6a044ed2b5e9391cd9dd00908f867
ap/BluetoothMapService.java
01e6b152e182721e5d5dc28d9ae3e15d1c88eb7d 29-Sep-2014 Matthew Xie <mattx@google.com> am acb400b0: Merge "BT MAP: fix problem with fetching CDMA messages" into lmp-dev

* commit 'acb400b0598107c0427e3fb07b0a4a8fade5481e':
BT MAP: fix problem with fetching CDMA messages
acb400b0598107c0427e3fb07b0a4a8fade5481e 28-Sep-2014 Matthew Xie <mattx@google.com> Merge "BT MAP: fix problem with fetching CDMA messages" into lmp-dev
e796818505a0b57b225c3aeffc53f580c1e0c66e 25-Sep-2014 kschulz <k.schulz@samsung.com> BT MAP: fix problem with fetching CDMA messages

A bug in Java makes the Long.parse() function throw and exception when message
handles start to become negative (which happens for CDMA SMS messages).
Fix simply shifts the handle masks on byte down in order to get around
the bug.

Bug: 17627572
Change-Id: Ie41aef589dc9d3ecb8bc7167472218e57a52fa33
ap/BluetoothMapUtils.java
f83ecae321db18c40a867f4079a04e521ee2e472 25-Sep-2014 Andre Eisenbach <eisenbach@google.com> am b5b51ca8: Merge "Defer callbacks if the transport is congested" into lmp-dev

* commit 'b5b51ca82e3db31705e54687f998b1ea1787396a':
Defer callbacks if the transport is congested
b5b51ca82e3db31705e54687f998b1ea1787396a 25-Sep-2014 Andre Eisenbach <eisenbach@google.com> Merge "Defer callbacks if the transport is congested" into lmp-dev
09bd88fce8737161cbb577793bf193eeef26cf2c 24-Sep-2014 Ariel Gertzenstein <agertzen@google.com> am a51c13ae: Set FLAG_RECEIVER_FOREGROUND when broadcasting ACTION_PAIRING_REQUEST.

* commit 'a51c13ae7e6ce56922316a979aef570abafc9f3f':
Set FLAG_RECEIVER_FOREGROUND when broadcasting ACTION_PAIRING_REQUEST.
934dee789c0c68607a704c5c31ae2e4b956dc227 19-Sep-2014 Prerepa Viswanadham <dham@google.com> Defer callbacks if the transport is congested

Hold client characteristic write callbacks and server notification
callbacks if the transport is congested. When the congestion clears up,
all queued callbacks are sent to the application.

Bug: 17289507
Change-Id: Ib22d7857ac3990fd3cc922aedd4258013e1af54c
att/CallbackInfo.java
att/ContextMap.java
att/GattService.java
a51c13ae7e6ce56922316a979aef570abafc9f3f 23-Sep-2014 Ariel Gertzenstein <agertzen@google.com> Set FLAG_RECEIVER_FOREGROUND when broadcasting
ACTION_PAIRING_REQUEST.

Bug: 17590080

Change-Id: I0a7cde5953f706a2b41b02878f0fdbd2d9e8ae35
tservice/BondStateMachine.java
69cf1e5bd33a030780112b8fb221c7cce73df3ce 19-Sep-2014 Matthew Xie <mattx@google.com> am 94023bd8: Merge "Save alias in RemoteDevice property before passing it to native layer" into lmp-dev

* commit '94023bd851cb80966d8f8006702d318057c83f09':
Save alias in RemoteDevice property before passing it to native layer
94023bd851cb80966d8f8006702d318057c83f09 19-Sep-2014 Matthew Xie <mattx@google.com> Merge "Save alias in RemoteDevice property before passing it to native layer" into lmp-dev
74277677d2a51d7c8ff60a778889f71e69763c21 18-Sep-2014 Matthew Xie <mattx@google.com> Save alias in RemoteDevice property before passing it to native layer

bug 17287682

Change-Id: Id7da194f66cf44d41e60f35665dfb1b279cac28f
tservice/RemoteDevices.java
b821c49e043a7b34ce533d41406b8b2de20eaba4 18-Sep-2014 Robert Greenwalt <rgreenwalt@google.com> am 00ab61e2: Merge "Use unified Tethering Permission Check" into lmp-dev

* commit '00ab61e21fd553620a466389907cb4dc089bb221':
Use unified Tethering Permission Check
00ab61e21fd553620a466389907cb4dc089bb221 18-Sep-2014 Robert Greenwalt <rgreenwalt@google.com> Merge "Use unified Tethering Permission Check" into lmp-dev
6a1885b17a039055a19a387c38e176a296a92f7f 17-Sep-2014 Wei Wang <weiwa@google.com> am e08a0eeb: Fix a typo that compares scanMode with callback types.

* commit 'e08a0eeb9cbf0ee732171d1c1d353aecdad0a7d2':
Fix a typo that compares scanMode with callback types.
e08a0eeb9cbf0ee732171d1c1d353aecdad0a7d2 17-Sep-2014 Wei Wang <weiwa@google.com> Fix a typo that compares scanMode with callback types.

Bug: 17187159
Change-Id: Ieca583e7cf02d63b9eceda7872511c9db280c04a
att/GattService.java
b530067f2b3a212297560e8d3af19698eb4b20e9 17-Sep-2014 Rakesh Iyer <rni@google.com> am 620ff342: Merge "Don\'t leak PII into the logs." into lmp-dev

* commit '620ff342d30c30306d1aa73ec65e209dd3141ff0':
Don't leak PII into the logs.
620ff342d30c30306d1aa73ec65e209dd3141ff0 17-Sep-2014 Rakesh Iyer <rni@google.com> Merge "Don't leak PII into the logs." into lmp-dev
ec1d4bc6e702d180f3871f01c6b4884832f77d4e 17-Sep-2014 Wei Wang <weiwa@google.com> am 33a06059: Merge "Enforce permissions for BLE hidden APIs." into lmp-dev

* commit '33a06059be8506003003e41ec020bdce273da1a1':
Enforce permissions for BLE hidden APIs.
33a06059be8506003003e41ec020bdce273da1a1 17-Sep-2014 Wei Wang <weiwa@google.com> Merge "Enforce permissions for BLE hidden APIs." into lmp-dev
8e6c4bcf8f2275db33c7886b34eea0a6da427d08 17-Sep-2014 Robert Greenwalt <rgreenwalt@google.com> Use unified Tethering Permission Check

The BT and Wifi mechanisms for enabling Tethering did their own
permission checks. This set of changes unifies the check into
a ConnectivityManager function so they can be kept in sync.

bug:17435527
Change-Id: I8c157a5acf56ffbddd349cb6a45160ae7be8541b
an/PanService.java
02fc1acb99dbf3ae0a710ee7e4b6de8dd779e84e 17-Sep-2014 Rakesh Iyer <rni@google.com> Don't leak PII into the logs.

Guard a couple of the Log.v statements with the if (V) guard that
is used everywhere else in the file.

Bug: 17531755
Change-Id: I7ea06333132c400fca225d0c92cfca0d6c3024ab
bap/BluetoothPbapVcardManager.java
aee8955c63b2ff42e5655c89fe4cf4b212c25b36 17-Sep-2014 Stuart Scott <stuartscott@google.com> Merge topic 'ksd-to-lmp-sprout-dev' into lmp-sprout-dev

* changes:
[DS] Response fail instead of not response at all
Bluetooth sub selection
7808540749a98ff5f238b5d801a45d34d4f550ce 17-Sep-2014 Stuart Scott <stuartscott@google.com> Merge "[DS] Call cannot call out from Car kit" into lmp-sprout-dev
699bc55e42eddd29889ab0e45d795c9a91a67662 16-Sep-2014 Edward Jee <edjee@google.com> Merge "Migrates PBAP and MAP access permission data from Settings to Bluetooth." into lmp-dev
901fc26af77bd2d0a82fe7b8e47a2fafb622811e 15-Sep-2014 PauloftheWest <paulofthewest@google.com> Bluetooth now properly saves A2DP status.

Bug: 17115629
Change-Id: I5e9bc4d492a9714a87b15d131b25cf9a5a0aeecd
tservice/AdapterService.java
fc9bed1b79edf77082f5baa21aa68d791a102ea4 05-Sep-2014 Edward Jee <edjee@google.com> Migrates PBAP and MAP access permission data from Settings to Bluetooth.

Currently, users' preference in phonebook and call history or message
access per each Bluetooth-paired device is stored in Settings application's
shared preferences.

However, some privileged applications other than Settings need to access
such data. So we decided to migrate the data from Settings application's
shared preferences to Bluetooth application's.

Bug: 17158953
Change-Id: I3808891cdcce84aa0d4df31f998c9f1240159d95
tservice/AdapterService.java
tservice/BondStateMachine.java
fp/AtPhonebook.java
fp/HeadsetStateMachine.java
ap/BluetoothMapService.java
bap/BluetoothPbapService.java
1cd7be76ea6af37476df0cc28e19248d94be4bfa 13-Sep-2014 Wei Wang <weiwa@google.com> Merge "Do not reuse all pass filter index." into lmp-dev
6ef76fa25c1de11cbb5ae35d645c68584f680ac8 12-Sep-2014 Wei Wang <weiwa@google.com> Enforce permissions for BLE hidden APIs.

Bug:17187159
Change-Id: Ibe467fa52fdead036a80922947cc295257221530
att/GattService.java
8b17c7f2f98bbea105a41a0bb962a4581b7cce5c 10-Sep-2014 Casper Bonde <c.bonde@samsung.com> MAP: Workaround for missing size values in message data base

Not all messages in the MMS/Email message data bases have
the size/attachment size attribute set.

This causes MAP clients to behave wrongly, e.g. they
request to exclude attachments if the attachments size
is 0. Even for messages which actually have attachments.

The attachment size is the only way for MAP clients to
know if attachments are present, hence the behavior of
the client is not wrong.
bug 17389452

Change-Id: I82cd76bc044601eb6e8b190d0c6fc41b51410a93
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
ap/BluetoothMapContent.java
e25106a23565dfc7feeba707a2826ba2394d71e2 26-Jun-2014 Legler Wu <legler.wu@mediatek.com> [DS] Response fail instead of not response at all

when not able to get subscriber number (return null),
HFP shall response to remote devie with Error instead of
not responding at all.

Change-Id: I4dd90071b72d33de14c69f98a1360a4f53a8bb3f

Conflicts:
src/com/android/bluetooth/hfp/HeadsetStateMachine.java
fp/HeadsetStateMachine.java
6ea139153681007ccf5d7b206296fb3c7d172ace 26-Jun-2014 Stuart Scott <stuartscott@google.com> Bluetooth sub selection

Change-Id: I181d4f8b206a4a46f1ae2305e22277f70eb24e69
fp/HeadsetPhoneState.java
2ca3331f43b767c108166dee9036b670cf126b88 11-Jun-2014 Legler Wu <legler.wu@mediatek.com> [DS] Call cannot call out from Car kit

The original code can not work since the subscription is wrong.
So BT can not correctly get the service / signal strength and update
to remote device. Thus some IOT issue happened.

Using the new interface to correctly register.

Change-Id: I2976eb12e44f78d896a04ef01a1a6ebb848f62f0

Conflicts:
src/com/android/bluetooth/hfp/HeadsetPhoneState.java
fp/HeadsetPhoneState.java
7ac43d2e29e3405b4df2e9ebd947ae7a9d10e8a0 11-Sep-2014 PauloftheWest <paulofthewest@google.com> Merge "Applied Material theme to Bluetooth file acceptance dialog." into lmp-dev
711d604b79f811f2fdeaae57bd4d5e31f3052747 11-Sep-2014 Ang Li <angli@google.com> Merge "Change broadcast ACTION_CONNECTION_ACCESS_REQUEST to be ordered." into lmp-dev
addfd25b639047e8463772b14f249758bdb20fbc 10-Sep-2014 PauloftheWest <paulofthewest@google.com> Applied Material theme to Bluetooth file acceptance dialog.

Bug: 17334507
Change-Id: I36d3ef5575ad84a27cda415c1d0e262f097e98a7
pp/BluetoothOppIncomingFileConfirmActivity.java
af5df2070741a4720abf61821fc217995b29101a 10-Sep-2014 Andre Eisenbach <eisenbach@google.com> Merge "Pairing failed after 50 attempts" into lmp-dev
44050ef0ada13303fc7d37f157b1afcf1c1da573 05-Sep-2014 Nitin Arora <niarora@codeaurora.org> BT-HF: Disable Multi HF feature.

Disable Multi HF feature by allowing max hf connections = 1
in HeadsetStateMachine.
bug 17321509

Change-Id: Ia477c728bfb1457def7f302d5533ce63446dffc7
fp/HeadsetStateMachine.java
11b41d8123241ba8e693e21c4db308bacff23f57 29-Jul-2014 Mudumba Ananth <ananthm@broadcom.com> Pairing failed after 50 attempts

-> The issue was caused due to delayed message sent for
bond_state_changed_callback in BondStateMachine and RemoteDevices
was sending the pairing request(sspRequestcallback) intent to the Settings APP
before even the bond state is changed.
-> Moved the SSPRequestCallback and PinRequestCallback to BondStateMachine
to synchronize the above two callbacks using a single message
queue in the BondStateMachine message handler.
-> Changed the pending command state to accept the SSP_REQUEST
and PIN_REQUEST messages and send the intents.

Bug: 16560957
Change-Id: I8372bdd2e96aa09215f2f1e98d6eed4e892637e6
tservice/BondStateMachine.java
tservice/JniCallbacks.java
tservice/RemoteDevices.java
beb0497605ef61062d0565d85897f4c842845a8f 09-Sep-2014 Ang Li <angli@google.com> Change broadcast ACTION_CONNECTION_ACCESS_REQUEST to be ordered.

Making this broadcast ordered makes it possible to be intercepted
before Settings get it. This is cruicial to Android Audo's use case
and test automation.

The previous change we put in:
https://googleplex-android-review.git.corp.google.com/#/c/499135
was accidentally overwritten by
https://googleplex-android-review.git.corp.google.com/#/c/503267

We are putting this change back in, and making similar changes for
PBAP and HFP.

Change-Id: Ia9b4c22a05d0c9beb1485b53ddf04c45fa210526
fp/AtPhonebook.java
ap/BluetoothMapService.java
bap/BluetoothPbapService.java
2b9ac142e56cf6a6cc0572fb75f8a5ce40894f8b 05-Sep-2014 Wei Wang <weiwa@google.com> Do not reuse all pass filter index.

Bug:17425379
Change-Id: Iba4c40f8822b182718db060c3f2eeff7aabdb286
att/ScanManager.java
5ca43226937e098a2404d61de3f991af5c6a2689 05-Sep-2014 Wei Wang <weiwa@google.com> Merge "Fixed batch scan returning status 12 when restarted." into lmp-dev
96509d5ff7109bc42a4c25143f70ec41a127d109 03-Sep-2014 Wei Wang <weiwa@google.com> Fixed batch scan returning status 12 when restarted.

Also fixed no batch scan results when both truncated and
full batch are enabled.

Added a BatchScanParams to hold parameters for batch scan.

Bug:16850169
Bug:17213118
Change-Id: Ib3bb7442aa2657912ef4377f825388ac8e1010bb
tils.java
att/AdvertiseManager.java
att/GattService.java
att/ScanManager.java
ab10811e960ed0a5c6098467b2184895831f33ac 05-Sep-2014 Prerepa Viswanadham <dham@google.com> Return right connection status when connection failed

bug: 17326529
Change-Id: I57abf2f6a98c469248613ea386f0fa2ffaf5eac4
att/GattService.java
76b4771991363ff69a099f483362805e4df63836 29-Aug-2014 Andre Eisenbach <eisenbach@google.com> Merge "redirect the ff/rw key event to ff/rw enabled player" into lmp-dev
b8bc0231e0074d923d7d961548d407babd41eb79 29-Aug-2014 Wei Wang <weiwa@google.com> Merge "More precise control of batch alarm." into lmp-dev
b4326c19eafb1d4437a82973b9019274e1e07aed 28-Aug-2014 Selim Cinek <cinek@google.com> Merge "Colored notifications" into lmp-dev
efbb85824de09776725d264cd872ccbedcc8b42b 28-Aug-2014 Matthew Xie <mattx@google.com> Merge "Listen for phone state on connect instead of SLC" into lmp-dev
3bfba36385f686ef63445dbecb627030573a04fd 21-Aug-2014 Wei Wang <weiwa@google.com> More precise control of batch alarm.

Use setWindow instead of setRepeating for alarms.
SetRepeating is inexact and the alarm can be triggered quite randomly,
while setWindow gives more precise control of trigger time.

Also unregister alarmReceiver during cleanup to avoid leak of
IntentReceiver.

Bug: 16689485, Bug:16826684
Change-Id: I5245e1424aad3c11ab5ce8a7393031e9d4f1dd03
att/ScanManager.java
881675b362bde18acbbcf69c513175addca4a8ba 27-Aug-2014 Zhenye Zhu <zhenye@broadcom.com> redirect the ff/rw key event to ff/rw enabled player

Added code to cleanup the forward/rewind
event queue and redirect the key event to
the ff/rw enabled player
Bug 16890205

Change-Id: If09c0693621d9f36fb7dc14177597e30450b87b6
vrcp/Avrcp.java
0ce48bf302e010af811c903f8a986df567562ecf 27-Aug-2014 Selim Cinek <cinek@google.com> Colored notifications

Bug: 17128331
Change-Id: Ic1a4d9803790cc0f3e8003ede4da8cc8f26729cf
pp/BluetoothOppNotification.java
bap/BluetoothPbapService.java
7c405bac41fc4ebb5c9cc7b5c896b023f7b1e9fc 25-Aug-2014 Prerepa Viswanadham <dham@google.com> Set batch scan params based on scan settings.

bug 17134263

Change-Id: Id0d314ad1c14ad20e32830ae2c8ad5f80765b28b
att/GattService.java
att/ScanManager.java
8e00c15a0c32c9bc7dab5038edf24bb418f181ef 19-Apr-2013 Ravi Nagarajan <nravi@broadcom.com> Listen for phone state on connect instead of SLC

Phone state listener changed to start on connect. This gaurantees
that the CIND response as part of SLC reflects the right indicator
values
bug 17020870

Change-Id: I47989643600edfa4d4e422998c3a644a7f7556b9
fp/HeadsetStateMachine.java
d54785926fc0150661b6e70d5d0dabef87be3d73 25-Aug-2014 Wei Wang <weiwa@google.com> Merge "Fix API council review comments. Also hide certain APIs(2/3)." into lmp-dev
24cb4d5082f4568074e5d1f375027a219aa40be7 24-Aug-2014 Wei Wang <weiwa@google.com> Merge "Fix race condition when advertising app dies." into lmp-dev
f9a51c08a1acf9a70a3e49f89f543b309822bd97 21-Aug-2014 Andre Eisenbach <eisenbach@google.com> Merge "LE: Rename new MTU and connection paramter update APIs" into lmp-dev
039bf1606bddb3794fd6aa9adee704733f89544f 12-Aug-2014 Wei Wang <weiwa@google.com> Fix race condition when advertising app dies.

Bug: 16565960
Change-Id: Ica801a1186e62fcba666deabe5989dd47d404b68
att/AdvertiseClient.java
att/AdvertiseManager.java
att/GattService.java
att/ScanClient.java
att/ScanManager.java
1dc1aab071533430ff1a0cfe1aa49e5f954f3518 20-Aug-2014 Andre Eisenbach <eisenbach@google.com> LE: Rename new MTU and connection paramter update APIs

bug 17005342
Change-Id: Ic773b5c4bb3da9777613c8094ad21ea6f720110d
att/GattService.java
ecbfd7771dd2ee7665f7fc18bf869e480c6f5449 12-Aug-2014 Lorenzo Colitti <lorenzo@google.com> Stop using LinkProperties for static configuration.

Bug: 16114392
Bug: 16893413
Change-Id: Ib33f35c004e30b6067bb20235ffa43c247d174df
an/BluetoothTetheringNetworkFactory.java
db0920ed7d9ef5385e36dfa922f351e4e6556a3e 15-Aug-2014 Wei Wang <weiwa@google.com> Fix API council review comments. Also hide certain APIs(2/3).

b/17006825

Change-Id: I6c0e739e44f8a9d26f3f2b03937b38d4dec893e7
att/AdvertiseManager.java
03f23ee7d3868e97ec7ed1a3d81c149b5b0ebd69 13-Aug-2014 Wei Wang <weiwa@google.com> Add protection before cleaning up adv and scan manager.

b/16845251

Apparently for GattService stop and cleanup could be called before start
is even called.

Change-Id: Id0ac2e68da504f79160264012a0cdf5127eccfc7
att/GattService.java
55a7eff213d57dd0ff948d441edb16f4a6ae2ea6 11-Aug-2014 Wei Wang <weiwa@google.com> Use nanos instead of micros in BLE scan.

Change-Id: Ifdaf101f92ae4c8d2bcecf62a1942961d6610151
att/GattService.java
0d8f1ae3e070d7a13f8e482895bcab428a6c8381 08-Aug-2014 Wei Wang <weiwa@google.com> Merge "fix build." into lmp-dev
c1d460a4ee15238f33e9c2a61b571965accf9838 08-Aug-2014 Wei Wang <weiwa@google.com> fix build.

Change-Id: I034cc118ea4dca67ed6240b700d4ac504562ddfc
att/GattService.java
att/ScanClient.java
c43ce5118eab93469e31d56ee30043e5e011fa89 07-Aug-2014 Wei Wang <weiwa@google.com> Fix build.

Change-Id: Ied3bd289b662cd342ba05f5038175007d3211a63
att/GattService.java
50cc9194f72c040f04c2ae0f0322246a570e8bfa 07-Aug-2014 Prerepa Viswanadham <dham@google.com> OnFound/Lost reporting: s/w detects the first match and
hw signal is used to report onlost.

Bug 16733710

Change-Id: I4d1d0320b6894fe1af59192eb56a4a801609049a
att/GattService.java
att/ScanClient.java
att/ScanManager.java
755ef770144daf1a0fbbabaa310bc300190dfd9c 08-Aug-2014 Andre Eisenbach <eisenbach@google.com> Merge "LE: Add limited advertising duration capability (3/3)" into lmp-dev
c1512abbe9bb60c94c5f46e90918983d1514c8e3 08-Aug-2014 Andre Eisenbach <eisenbach@google.com> LE: Add limited advertising duration capability (3/3)

Change-Id: Ib025d8a10cce07e8f731c005d963245aa988be73
att/AdvertiseManager.java
5f8b46c673e2b862ab7ff7280915e89578bbd06e 07-Aug-2014 Wei Wang <weiwa@google.com> Merge "Clear pending data and allow all filter when batch stopped." into lmp-dev
00975169ba4eb5251397a66532ee9a3288c0f137 05-Aug-2014 Wei Wang <weiwa@google.com> Clear pending data and allow all filter when batch stopped.

Also send batch data to multiple clients for full batch.

b/16802098

Change-Id: Ife1723b818531fcf2cff897686f33f6b0a1d0aaa
att/AdvertiseManager.java
att/GattService.java
att/ScanManager.java
326b5e610063ac24c0ba467ac585bd4c7f618a67 24-Jul-2014 Casper Bonde <c.bonde@samsung.com> BT MAP: added support for email sharing over BT

- added support for Emails
- added activity to do setup of the email accounts to share
- added improved handling of MMS, SMS and Email
- Many optimizations to speed (especially getMessageListing)
- fixed wakelock problem
- fixed user timeout problem when user do not react to msg access request
- added missing privileges
- support for Quoted Printable format
- added accountId in test case URIs
- fixed problem with service numbers being strings
- fixed problem with read flag in getMessage
- added support for transparent flag in Email Push
- added missing send-event for non-imap accounts
- set attachment size to 0 if text-only message
- fixed double send for sms messages with retry
- removed secondary phone numbers from recipient/originator
- removed insert-address-token in MMS messages
- fixed null-pointer exception in settings (missing extra in intent)
- send text-only mms as sms (workaround to make it cheaper)
- fixed rejection of native and fraction requests
- better handling of unknown message types in push
- fixed problem with possible illigal xml chars in message listing
- added missing WRITE_APN_SETTINGS permission to manifest
- fixed problem with notifications when pushing to folders other than OUTBOX
- removed debugging code
- added support for threadId
- fixed permission problems
- changed to use ContentProviderClients for Email app access
- fixed names for member vars

UPDATE: Moved the MAP E-mail API to the bluetooth package.

UPDATE: Added check for the presense of MMS parts.
This is needed due to a change in the MMS app/subsystem,
where deleted messages gets corrupted.

Signed-off-by: Casper Bonde <c.bonde@samsung.com>
Change-Id: Ib5dbe7c2d5c0ba8d978ae843d840028592e3cab4
ap/BluetoothMapAppParams.java
ap/BluetoothMapAuthenticator.java
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapEmailAppObserver.java
ap/BluetoothMapEmailSettings.java
ap/BluetoothMapEmailSettingsAdapter.java
ap/BluetoothMapEmailSettingsDataHolder.java
ap/BluetoothMapEmailSettingsItem.java
ap/BluetoothMapEmailSettingsLoader.java
ap/BluetoothMapFolderElement.java
ap/BluetoothMapMasInstance.java
ap/BluetoothMapMessageListing.java
ap/BluetoothMapMessageListingElement.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapService.java
ap/BluetoothMapSmsPdu.java
ap/BluetoothMapUtils.java
ap/BluetoothMapbMessage.java
ap/BluetoothMapbMessageEmail.java
ap/BluetoothMapbMessageMms.java
ap/BluetoothMapbMessageMmsEmail.java
ap/BluetoothMapbMessageSms.java
ap/BluetoothMnsObexClient.java
475a4f7727a082ccf289ce406e75c463750a515c 05-Aug-2014 Wei Wang <weiwa@google.com> Workaround for reversed mac addresses in batch scan.

b/16803363

Change-Id: I47299ed2a6191e7f05c229feb1f1f0424e486907
att/GattService.java
att/ScanManager.java
f021c4ee6ba53c8512807c1469b2432278cf6cca 05-Aug-2014 Andre Eisenbach <eisenbach@google.com> Merge "Add transport parameter to createBond() function (3/4)" into lmp-dev
db681f3973bd8a088a878fd6f41d4330cdbc5522 05-Aug-2014 Andre Eisenbach <eisenbach@google.com> Add transport parameter to createBond() function (3/4)

Change-Id: Id3c59bcc8f9efb20fffdebaff34d6b2593f5e5ca
tservice/AdapterService.java
tservice/BondStateMachine.java
62fb56f2ba7d998e3e7416fc19d25ea91cc85111 04-Aug-2014 Matthew Xie <mattx@google.com> Check null mHandler condition before invoking method on it

There is a path that clean up is called before stop call on HealthService
mHandler could be set to null
bug 16784750

Change-Id: Ie931fa502cf82d21c6bf97a8dc7035e5a1ed4b2e
dp/HealthService.java
a08ff547783c43175c90ed8bd3e4db53482b3dde 30-Jul-2014 Nitin Srivastava <nitinsr@codeaurora.org> MHF: Return the correct connection state for headset.

When more than 1 headset is connected, return the correct
connection state for a headset other than latest connected
headset.
bug 16514538
Change-Id: Id07165f2c023959b7a457a1c1c0ed5c227838973
fp/HeadsetStateMachine.java
97600f2df10fbbe1810141e1c4ef7091a6a55abe 03-Aug-2014 Wei Wang <weiwa@google.com> Change discard rule.

Change-Id: Icfc43371acb0e901a7f67a4c32c5dd2e63de49c3
att/ScanManager.java
18999c2cfd477050de0ca88c3a73458235d82656 30-Jul-2014 Wei Wang <weiwa@google.com> Add a default impelementation of IBluetoothGattCallback(2/2).

b/16636127 Explicitly use UTF-8 for ScanRecord's local name

Change-Id: Ib152239cdee0becf3f49f1b610dfe1c2296c3647
att/AdvertiseManager.java
att/GattService.java
7dca73a9bdbdbbea93bb0b6150702d21c533b229 01-Aug-2014 Wei Wang <weiwa@google.com> Merge "Change service data and manufacturer data to be repeated." into lmp-dev
e34b91565499994a4b04a1014432c8f90678972a 30-Jul-2014 Wei Wang <weiwa@google.com> Change service data and manufacturer data to be repeated.

Change-Id: Ie45ca40d3d84d192d65003ea3ac9ad428b281f94
att/AdvertiseManager.java
att/ScanManager.java
5a95154a384076ae9ff43e79ae30085327e53cec 31-Jul-2014 Yicheng Fan <yichengfan@google.com> Merge "Remove client from advertiseManager correctly" into lmp-dev
61b76fd94c45ee1909cde1d08a643fc031ef287f 31-Jul-2014 Yicheng Fan <yichengfan@google.com> Remove client from advertiseManager correctly

Bug: 16711409
Change-Id: I3881593818edcf822ec07353da4a5ea6970f5d7c
att/AdvertiseManager.java
3548bc374efdb3cc93d6856e71353291a90fd4a7 31-Jul-2014 Prerepa Viswanadham <dham@google.com> Reduce batch supported threshold to 1024 bytes

b/16680086

Change-Id: I671abd7dba321ab111280d1a1cb27aa93635a6d1
tservice/AdapterService.java
f2f2e89a583d764066c4a84b3d5de5201310202b 31-Jul-2014 Prerepa Viswanadham <dham@google.com> Incorrect data type
bt_local_le_features_t of wrong size

b/16653133

Change-Id: Ifade7add084fcfbef60abb7d8e5d47e619b0e812
tservice/AdapterProperties.java
f254208ae7231d227f4dd9f361d38d161bbecb97 29-Jul-2014 Wei Wang <weiwa@google.com> Merge "Combine manu id and data before setting to stack." into lmp-dev
5b79bdb4b17c09a17db7634d15e1d6b56bca6c48 29-Jul-2014 Prerepa Viswanadham <dham@google.com> Bug 16630976 - Fix for LE Scan not working

Change-Id: I287ff92b699bc798a7d208deed67bc4dce8e1af7
att/ScanManager.java
a1feac750a78ef35ff83e381ca421d9c68c49673 28-Jul-2014 Wei Wang <weiwa@google.com> Fix build due to removal of configureScanParams.

Change-Id: If3458b47bb9dfc508e630fe1fb608f01c44284a9
att/GattService.java
e0a211b1c15672734e329390cb2f04ca006b59bd 26-Jul-2014 Prerepa Viswanadham <dham@google.com> Refactor configuring scan params to scan manager

Change-Id: I8c60f0fa4307c2833bc5da6cd080515c5b16b652
att/GattService.java
att/ScanManager.java
466e67f34a72bbb43fa03aae7ad96cb41f02451d 27-Jul-2014 Wei Wang <weiwa@google.com> Fix service data filter and report delay issue.

Change-Id: I1e4dd400c94f8740e4e950c42be6beac858f3ab8
att/GattService.java
att/ScanFilterQueue.java
att/ScanManager.java
bebb0fe84fe06a47bd88cdfb9cba8ffe4d2c463a 26-Jul-2014 Wei Wang <weiwa@google.com> Combine manu id and data before setting to stack.

Change-Id: Idef33daa87939a0533dae37dad53a827155d79ca
att/AdvertiseManager.java
be3bd22d6f96ddce0e5d42bf25d1c8acf35addfe 25-Jul-2014 Wei Wang <weiwa@google.com> Merge "Use scanner for lagacy LE scan (2/2)." into lmp-dev
2609a11670563837625f7dde2192deaba7417e46 24-Jul-2014 Andre Eisenbach <eisenbach@google.com> Fix A2dp crash when re-starting Bluetooth services

When the Bluetooth process has died, the services will be restarted to
recover from a crash. This could cause an exception in the A2dp service
because the service maybe stopped without having successfully been
started before. Added null-check to prevent an exception during the
restart.

Bug: 16529242
Change-Id: I57c99ec72c0ba09c6c5325b262e83618aacb3e39
2dp/A2dpService.java
86c292ab0f0fed25345a2eaef0fd92ff9c72a9e5 24-Jul-2014 Wei Wang <weiwa@google.com> Use scanner for lagacy LE scan (2/2).

Change-Id: I273e7a2b6687f38d051c3264ff1bbb0025507820
att/AdvertiseManager.java
att/GattService.java
att/ScanManager.java
d981566d5912bfd66fc265508e5b0c43dce76f82 23-Jul-2014 Prerepa Viswanadham <dham@google.com> Bug 15564216: Report Bluetooth tx/rx/idle activity info and energy reporting

Change-Id: Icff519c6e91d7a9a2fb5bd462daddb6a79f9bb46
tservice/AdapterProperties.java
tservice/AdapterService.java
f6eff2b71e9bc206f995e847e384507fb1c3e239 19-Jul-2014 Prerepa Viswanadham <dham@google.com> LE energy info feature

Java and JNI changes for energy info feature

Change-Id: Ifdc7b7253aea8c610b2dac90f2b3f525b5e2d73f
tservice/AdapterProperties.java
tservice/AdapterService.java
9c24a0ef159f3332a2e66648d8d3c7dfac26cbc8 22-Jul-2014 Wei Wang <weiwa@google.com> Add a ScanManager that handles Scan related operations. Remove
GattServiceStateMachine.

Change-Id: I03afefaa4ba534abbf8e2bd38b4888020764cb22
att/GattService.java
att/GattServiceStateMachine.java
att/ScanClient.java
att/ScanManager.java
f206ddd8115bdcb66ecee0c6feac35b3dc8d4da2 19-Jul-2014 Wei Wang <weiwa@google.com> Fix build

Change-Id: I0e4f8ffec53f606c75dbfae0db50da51118d8ddf
att/AdvertiseManager.java
cdc69a341eae90f177ced91931bc744ee0d34c9d 17-Jul-2014 Wei Wang <weiwa@google.com> More API modification of BLE APIs (2/2)

Change-Id: I65085fa0fa5d02a9163f66555a1c7ba339b454af
att/GattService.java
att/GattServiceStateMachine.java
cfda60b6b204f6e97bc961d1ac43ef7c43ac26a8 19-Jul-2014 Andre Eisenbach <eisenbach@google.com> Merge "Reduce GATT logging output" into lmp-dev
cae2bfe10d59a759596136a4ff07750fe6176351 18-Jul-2014 Andre Eisenbach <eisenbach@google.com> Reduce GATT logging output

Change-Id: I85e9191065083f11056de44202a8e5a0cba1d2c8
att/GattService.java
att/GattServiceConfig.java
fbe63484114cf9b7a79043e0bc5bb74504cf5730 17-Jul-2014 Andre Eisenbach <eisenbach@google.com> LE: Add connection parameter update request API (3/4)

Change-Id: I1be7d530d4db27473086ee8734cdb6aa5e63667c
att/GattService.java
87dfc410a3bc99ddf1dd30114500d2a7970075c0 18-Jul-2014 Wei Wang <weiwa@google.com> Merge "Add an AdvertiseManager for LE advertise operations." into lmp-dev
27bd5f277ccf471f2fa9cd9151a2a226b51bc825 16-Jul-2014 Wei Wang <weiwa@google.com> Add an AdvertiseManager for LE advertise operations.

Move all advertise logic out of GattServiceStateMachine.

Change-Id: I9bc9be29372e79e863fc6a0b16d4808918bfb404
tils.java
att/AdvertiseClient.java
att/AdvertiseManager.java
att/GattService.java
att/GattServiceStateMachine.java
411ad52f79b7390a5831e30d3e3742c129c6bb6a 14-Jul-2014 Sharvil Nanavati <sharvil@google.com> Fix bug b/16119342 by synchronizing the access of mWakeLock in release().

Change-Id: Ie0fb5d2c5805f854a886729f539adf2ae865bc17
tservice/AdapterService.java
55a038663154f47fb899d4e8576ed0c440ad6335 15-Jul-2014 Wei Wang <weiwa@google.com> Add ALLOW_ALL filter logic to scan filters. Note filter index 1 is
reserved for ALLOW_ALL filter now.

Change-Id: Ie8b2f94a0112f95bc88323a8319f94fb780790a2
att/GattServiceStateMachine.java
2626af8b78e7f42e5e0807d58ca14a4b8f6161b5 11-Jul-2014 Wei Wang <weiwa@google.com> Remove MR2 BLE Advertising hidden API from L codebase (2/2)

Change-Id: I1430cef859544fc97b7c39ead42dcb184707aa5f
att/GattService.java
5b4e66228f799c1187c28be59843e70974243e16 12-Jul-2014 Matthew Xie <mattx@google.com> am 24b52ce7: Merge "Revert "Bluetooth: MAP: Do not set body header if maxlist count is 0"" into klp-wireless-dev

* commit '24b52ce786d8c5fa4bf1c4294ec9fbfd3738754f':
Revert "Bluetooth: MAP: Do not set body header if maxlist count is 0"
878cb162c0d823d6bb4e64f6d5da3770df3fb526 12-Jul-2014 Matthew Xie <mattx@google.com> am c73bd48e: Merge "Bluetooth: MAP: Do not set body header if maxlist count is 0" into klp-wireless-dev

* commit 'c73bd48e5351a12103cb58a15fa9fc33825c9b07':
Bluetooth: MAP: Do not set body header if maxlist count is 0
44499c6ba795ab59ad6387fa00e20537b3c5064e 12-Jul-2014 Matthew Xie <mattx@google.com> am 5693ce1f: Merge "Bluetooth-OPP: Avoid IndexOutOfBoundsException if share is zero" into klp-wireless-dev

* commit '5693ce1fb60f7ebf858b4e35750a9335ebe47c72':
Bluetooth-OPP: Avoid IndexOutOfBoundsException if share is zero
361e580eb6c07759cdd775ed57902839ff4bfe90 11-Jul-2014 Andre Eisenbach <eisenbach@google.com> Unhide Bluetooth batch APIs. Deprecate BluetoothAdpater scan APIs. (2/2)

Change-Id: If29034da523a4f2a0ce9807226363f038f0360cd
att/AdvertiseClient.java
att/GattService.java
att/GattServiceStateMachine.java
att/ScanFilterQueue.java
c73bd48e5351a12103cb58a15fa9fc33825c9b07 12-Jul-2014 Matthew Xie <mattx@google.com> Merge "Bluetooth: MAP: Do not set body header if maxlist count is 0" into klp-wireless-dev
7f25f97c92b970ef5d58b36f963e7233efd5bf2a 18-Dec-2013 Pradeep Panigrahi <pradeepp@codeaurora.org> Bluetooth: MAP: Do not set body header if maxlist count is 0

As per MAP profile spec when message listing or folder
listing is done with 0 as max list count, then the response
should not contain the body header. Hence add change for the
same

Change-Id: I09b44a07bb9d15f248c0657563da4927ce4b4996
ap/BluetoothMapObexServer.java
24b52ce786d8c5fa4bf1c4294ec9fbfd3738754f 12-Jul-2014 Matthew Xie <mattx@google.com> Merge "Revert "Bluetooth: MAP: Do not set body header if maxlist count is 0"" into klp-wireless-dev
dca114675305d931596e07bcf962aaa3c7515656 12-Jul-2014 Matthew Xie <mattx@google.com> Revert "Bluetooth: MAP: Do not set body header if maxlist count is 0"

This reverts commit 7f25f97c92b970ef5d58b36f963e7233efd5bf2a.

Change-Id: Ib07fd8439f07de8e6028e88eb0a9798c1aec61a0
ap/BluetoothMapObexServer.java
183b33edc8af0344f7651823fa2e622955d15005 10-Jul-2014 Wei Wang <weiwa@google.com> Fix filter index stack initialization issue caused by GattServiceStateMachine created before adapter property is filled.

Change-Id: I4f487378b332d3b33c8646fd78d9ccec41431975
att/GattService.java
att/GattServiceStateMachine.java
8e8d9314d67618e5604059d3758c2c8a92ae361f 09-Jul-2014 Prerepa Viswanadham <dham@google.com> OnFound and Onlost found integration

Change-Id: Ia7bdcd180a318844ab390e23a1f61168e79c324b
att/GattService.java
750fd64e9e3724902190f74ebb2538a966a3e11e 04-Mar-2014 Juffin Alex Varghese <jalex@codeaurora.org> Bluetooth-OPP: Avoid IndexOutOfBoundsException if share is zero

This change will avoid IndexOutOfBoundsException if number of sharing
files are zero. Otherwise, Bluetooth application will force close itself
when exception encountered.

Change-Id: I42473c8ca2d9116c6d57707ab8f3c452d7027e67
pp/BluetoothOppService.java
f56c48057e5a9b1eae12068ab01d1e6fbb4c9e5d 09-Jul-2014 Wei Wang <weiwa@google.com> Fix a bug that swapped LOW_POWER AND LOW_LATENCY for advertising.

Change-Id: I21c95ef69c6f54f9d60395a9427d30b875e8e261
att/GattServiceStateMachine.java
bd061cd6801b84f4248f9cf32dbd294537495f7e 09-Jul-2014 Matthew Xie <mattx@google.com> Merge "resolved conflicts for merge of dc497463 to master"
9b05359927c9687bb601a2ac340be87c8a077342 09-Jul-2014 Matthew Xie <mattx@google.com> resolved conflicts for merge of dc497463 to master

Change-Id: I7bb1b91da3ae3b6e7e21b34a0cdfb5ed417135bc
e3ee0a6264913deb28c160f5c32cb3367e97ee45 09-Jul-2014 Ang Li <angli@google.com> Make ACTION_CONNECTION_ACCESS_REQUEST to be sent in ordered fashion.

The purpose of this change is to enable automated testing
to confirm incoming connection without involving human.
Remove .setClass so the intent is no longer only sent to Settings.
This is ok because the intent is still hidden and protected.
Remove unused imports.

Change-Id: I3be5df4ab440b299a75ec41d566f9eecb0ab3f31
ap/BluetoothMapService.java
dc497463ba2ab84a408faca6d7a9fd0013739d42 08-Jul-2014 Matthew Xie <mattx@google.com> am 7efa9db2: Merge "HFP: Fix missing OK for AT+CLCC in virtual call"

* commit '7efa9db2129c99475684a2e44c4fb89cce3134bc':
HFP: Fix missing OK for AT+CLCC in virtual call
7efa9db2129c99475684a2e44c4fb89cce3134bc 08-Jul-2014 Matthew Xie <mattx@google.com> Merge "HFP: Fix missing OK for AT+CLCC in virtual call"
544c8f08dfdef31604ec21318b08ebe8d5b98e92 08-Jul-2014 Nick Kralevich <nnk@google.com> Merge "Fix "Clone" call"
20e28abb314da5a052ee8cebd07308f1c3cab674 08-Jul-2014 Wei Wang <weiwa@google.com> Merge "Implementation of batch scan."
e84b9ab8ebca5e6d108d722fa84234fddf3685cd 02-Jul-2014 Wei Wang <weiwa@google.com> Implementation of batch scan.

Change-Id: I247a1676d20131ca05674da44a06d8c21785d71d
att/GattService.java
att/GattServiceStateMachine.java
3a91ac3eefe23a22aa0abc1a89ac253a2b0dbae9 05-Jul-2014 Nick Kralevich <nnk@google.com> Fix "Clone" call

The function name is "clone", not "Clone".

Also, add @Override so errors like this can be detected at
compile time.

Change-Id: Iaf5ec35cdfcd49dec786f14a72c1ebe42aa6bf05
tservice/AdapterProperties.java
tservice/JniCallbacks.java
tservice/RemoteDevices.java
c4b937588bb1a0b73071bbaa120906f5ff501059 02-Jul-2014 Prerepa Viswanadham <dham@google.com> am 40422f10: Obtain capabilities from BLE chipset for it\'s support of various features

* commit '40422f101e8ea8c852173a63d4faa1f01dcfa150':
Obtain capabilities from BLE chipset for it's support of various features
40422f101e8ea8c852173a63d4faa1f01dcfa150 02-Jul-2014 Prerepa Viswanadham <dham@google.com> Obtain capabilities from BLE chipset for it's support of various features

Change-Id: I594790bd837a22488c1e080e340cb1c66ed4367b
tservice/AdapterService.java
701d60eb4c53dafc4290ecaba13f719a945e38da 01-Jul-2014 Julia Reynolds <juliacr@google.com> Restrict bluetooth tethering with user restrictions.

Bug: 15852213
Change-Id: I641b03c3e5fa4018b382f5ed835218f4196ef7f7
an/PanService.java
2c0df0560ad5ae3fd6022b17b17a6a70143e216a 16-Aug-2013 Hemant Gupta <hemantg@codeaurora.org> Bluetooth: Support MAP Client role on Bluedroid.

Implementation changes to support Message Access Profile
client role in Bluetooth Apk.

Change-Id: I209909a2b18e43c7931571526b983453795f6c6b
tservice/AdapterService.java
tservice/JniCallbacks.java
tservice/RemoteDevices.java
ee7ff974b660d954ca2f188e54072d410f2b9c2f 01-Jul-2014 Wei Wang <weiwa@google.com> am f66efab4: fix build error on kwd

* commit 'f66efab444805947fd67c5ce1f8f0a592260fcf5':
fix build error on kwd
f66efab444805947fd67c5ce1f8f0a592260fcf5 01-Jul-2014 Wei Wang <weiwa@google.com> fix build error on kwd

Change-Id: I29debb4ea6a1bb33e2a5e182b86c066179f8ac92
att/GattServiceStateMachine.java
a61c69cd9e1fb148f56f16b1b768bed427b3b51d 28-Jun-2014 Wei Wang <weiwa@google.com> Phase 2 scan filter implementation. Also provides skeleton for batching and onFound/onLost integration.

DO NOT MERGE : Cherrypick from master to kwd.

Change-Id: I2e838296191ff6f55481fcde7d05d7cd6d4899dc
att/GattService.java
att/GattServiceStateMachine.java
att/ScanFilterQueue.java
ee8ad19e379e97582b58e3c9f87d587bae7e6ce3 01-Jul-2014 Todd Poynor <toddpoynor@google.com> Merge "Change some rule in Pbap to fix Test case issues"
dcec9008751b6c8865ad32dc338d5fee82d9db58 01-Jul-2014 Matthew Xie <mattx@google.com> am ecb463f9: Merge "[BT] Fix bug: MAP client can not get MessageListing for draft folder" into klp-wireless-dev

* commit 'ecb463f9e1974fa5980a69f1370275972107143f':
[BT] Fix bug: MAP client can not get MessageListing for draft folder
628b72197e389446ec59dc1219a0f2e11c202ae3 01-Jul-2014 Matthew Xie <mattx@google.com> am bf765c09: change bt_headset_wbs to bt_wbs

* commit 'bf765c090de4b973f4eede4f4248f5e422454c2d':
change bt_headset_wbs to bt_wbs
bf765c090de4b973f4eede4f4248f5e422454c2d 21-May-2014 Matthew Xie <mattx@google.com> change bt_headset_wbs to bt_wbs

Change-Id: I8942b29231e4df024bbf3b174abd83e8b5876c96
fp/HeadsetStateMachine.java
76dc9e2d09ea7f2655e557462c149a0c6b6dd771 20-Jun-2014 Mick Lin <Mick.Lin@mediatek.com> Change some rule in Pbap to fix Test case issues

Change-Id: Iec6db0c52cf05fd6fada40b7726b02768474181a
(cherry picked from commit e529b58896b2191eacbc6aa0f01f1f0341626d21)
bap/BluetoothPbapObexServer.java
76301c48d4f5edc78cc5c6b9d66f006052c97c6e 01-Jul-2014 Matthew Xie <mattx@google.com> am b6132733: Add WBS support on Bluedroid (5/6)

* commit 'b6132733b6e386cc8c93b5598c72ed8efe04bf3e':
Add WBS support on Bluedroid (5/6)
b6132733b6e386cc8c93b5598c72ed8efe04bf3e 28-Apr-2014 Matthew Xie <mattx@google.com> Add WBS support on Bluedroid (5/6)

Bug 13764086

Change-Id: Ib6c5d5f4321006ce1a35045907618abc417e6352
fp/HeadsetService.java
fp/HeadsetStateMachine.java
ecb463f9e1974fa5980a69f1370275972107143f 01-Jul-2014 Matthew Xie <mattx@google.com> Merge "[BT] Fix bug: MAP client can not get MessageListing for draft folder" into klp-wireless-dev
a308d4fcdb58a61afb18ad590800193a195db3ee 30-Jun-2014 Wei Wang <weiwa@google.com> Merge "Phase 2 scan filter implementation. Also provides skeleton for batching and onFound/onLost integration."
2b670d217c743a7a8082f1d72baf532ef66ba21c 28-Jun-2014 Wei Wang <weiwa@google.com> Phase 2 scan filter implementation. Also provides skeleton for batching and onFound/onLost integration.

Change-Id: I2e838296191ff6f55481fcde7d05d7cd6d4899dc
att/GattService.java
att/GattServiceStateMachine.java
att/ScanFilterQueue.java
74b2317d360f302c2cdd36e00b4b8e1a9d0674a4 29-Jun-2014 Hemant Gupta <hemantg@codeaurora.org> am 43b941ed: MAP: Remove pending MAP authorization pop up

* commit '43b941ed67f10876a3d730cc095ddb6589e9c1b6':
MAP: Remove pending MAP authorization pop up
b45cd4213217329ee1efb4499cccf0f38a293775 29-Jun-2014 Hemant Gupta <hemantg@codeaurora.org> am 5079ae05: MAP: Modify XML serializer to escape double quote

* commit '5079ae05a3fa7cf09d2d8e564b71382dfc70a1ae':
MAP: Modify XML serializer to escape double quote
75fdd3e0888d37e8f1b4997fd688e0da12b4bbbe 29-Jun-2014 Hemant Gupta <hemantg@codeaurora.org> am 5c397073: MAP: Return OBEX_HTTP_NOT_IMPLEMENTED response code for msgUpdate

* commit '5c3970730dee1da5d1f37bc03a595dc1e9c47152':
MAP: Return OBEX_HTTP_NOT_IMPLEMENTED response code for msgUpdate
27a4001f202fd55c8864216db9b7afe113d13b0d 29-Jun-2014 Hemant Gupta <hemantg@codeaurora.org> am c1f597b3: MAP: Set messageList element to proper size based on offset/count

* commit 'c1f597b3ec02ccc112f3c917fd079588034c3eac':
MAP: Set messageList element to proper size based on offset/count
ff0887813a704d9b1cca118499b8ed0a68682ef1 29-Jun-2014 Hemant Gupta <hemantg@codeaurora.org> am 0e7e1496: MAP: Fix MNS observer sync and sendevent exception issue.

* commit '0e7e149687b0b5e340991b20c9d8e5232e8d3e39':
MAP: Fix MNS observer sync and sendevent exception issue.
5dab95cba01eeea272f9e9e96faf3b11f84a4ad9 29-Jun-2014 Hemant Gupta <hemantg@codeaurora.org> am 400eaf87: MAP: Fix fatal exception due to missing looper for current thread

* commit '400eaf8761223196a18b84247b066f0201226c3b':
MAP: Fix fatal exception due to missing looper for current thread
d600b53f526a6fcb54ca8f7e347aafa72f9d3f4e 29-Jun-2014 Hemant Gupta <hemantg@codeaurora.org> am 6db8e703: PBAP: Add Filters support.

* commit '6db8e703719f301f75acdf4acacc3296cc1b5016':
PBAP: Add Filters support.
7de8acd090770cfd5d94b299b4f9c40f8970dcda 29-Jun-2014 Hemant Gupta <hemantg@codeaurora.org> am 29ab94a0: PBAP: Strip unwanted braces and spaces from telephone number.

* commit '29ab94a024ffce08229f1c2c6776d1e72d2a3f75':
PBAP: Strip unwanted braces and spaces from telephone number.
c76fe0ddf8dc1c469e17b3ca12127295f0d42371 29-Jun-2014 Hemant Gupta <hemantg@codeaurora.org> am 4216387d: PBAP: Remove the PBAP pop up in various scenarios

* commit '4216387d9887926cebd652f8d3807d780642fc87':
PBAP: Remove the PBAP pop up in various scenarios
43b941ed67f10876a3d730cc095ddb6589e9c1b6 26-Nov-2013 Hemant Gupta <hemantg@codeaurora.org> MAP: Remove pending MAP authorization pop up

- If USER turn off BT on DUT before accepting incoming
authorization request for MAP connection, then MAP
authorization pop up should be removed. Thsi was failing
as user time-out scenario was not handled currently,
where MAP OBEX session is stopped. So MAP OBEX session will
not get cleared till BT OFF. So MAP OBEX connection was failing
from next iteration onward. Queuing User time-out(30 seconds)
to disconnect MAP OBEX session to solve this issue.

-If ACL is disconnected by remote device before accepting
incoming authorization request for MAP connection, then MAP
authorization pop up should be removed.

Change-Id: Ib8068f793eb1b55a155d3ff657efefc40728233c
ap/BluetoothMapService.java
5079ae05a3fa7cf09d2d8e564b71382dfc70a1ae 30-Jan-2014 Hemant Gupta <hemantg@codeaurora.org> MAP: Modify XML serializer to escape double quote

Modify code to use FastXmlSerializer instead of XmlSerializer
to escape double quote character with &quot; and always enclose
XML attribute value within double quotes

Change-Id: I097e6d6de2e4cd44579a6d07842d0cffe26c0139
ap/BluetoothMapMessageListing.java
ap/BluetoothMapMessageListingElement.java
5c3970730dee1da5d1f37bc03a595dc1e9c47152 04-Dec-2013 Hemant Gupta <hemantg@codeaurora.org> MAP: Return OBEX_HTTP_NOT_IMPLEMENTED response code for msgUpdate

In MAP profile message update is not implemented for sms/mms, but
we are returning OBEX_HTTP_OK response code for message update put
request, which is causing PTS test case to fail. Hence returning
proper response code to pass pts.

Change-Id: I40a45cea2d85750583bb7ae205d1ff57fe806a4d
ap/BluetoothMapObexServer.java
c1f597b3ec02ccc112f3c917fd079588034c3eac 02-Jan-2014 Hemant Gupta <hemantg@codeaurora.org> MAP: Set messageList element to proper size based on offset/count

Handle all the cases based on offset and count to create message list
element when message listing is performed from car kit for any folder

Change-Id: Ibcc6f8ed24c47464e05f26a79b38b99d233ca58b
ap/BluetoothMapMessageListing.java
0e7e149687b0b5e340991b20c9d8e5232e8d3e39 08-Nov-2013 Hemant Gupta <hemantg@codeaurora.org> MAP: Fix MNS observer sync and sendevent exception issue.

Allow MNS Client sendEvent only when MNS Client is registered
and connected to fix NullPointer exceptions. Mark MNS disconnect
and observer registration as synchronized to handle synchronization
for operations from worker and main threads.

Change-Id: If34a6b67a1774f693ed42cfb6c871cd9563abe55
ap/BluetoothMapContentObserver.java
ap/BluetoothMnsObexClient.java
400eaf8761223196a18b84247b066f0201226c3b 23-Oct-2013 Hemant Gupta <hemantg@codeaurora.org> MAP: Fix fatal exception due to missing looper for current thread

While creating handler for the thread, there was fatal exception getting
thrown because the present thread does not have a looper. So passing the
applications looper to be used , while creating the handler to avoid this
exception.

Change-Id: Id8c121439d7a93af7592a15df67523e96a1312ff
ap/BluetoothMapContentObserver.java
6db8e703719f301f75acdf4acacc3296cc1b5016 13-May-2013 Hemant Gupta <hemantg@codeaurora.org> PBAP: Add Filters support.

This patch adds attribute filter support to PBAP. It will allow remote
devices to request the particular attributes.

Change-Id: Ia0a4f55f14925b0cf8d0553c64222d781edef2fd
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapVcardManager.java
29ab94a024ffce08229f1c2c6776d1e72d2a3f75 29-Aug-2013 Hemant Gupta <hemantg@codeaurora.org> PBAP: Strip unwanted braces and spaces from telephone number.

This patch removes unwanted spaces and braces from the telephone
number on vcard entry formation. Handsfree call was failing because
of these characters due to handling of only digits in utl_isdialstr
API in BD stack (external/bluetooth/bluedroid/bta/ag/bta_ag_cmd.c)

Change-Id: I2d63967059a9cb97f214b370fac17234f6e58f55
bap/BluetoothPbapVcardManager.java
4216387d9887926cebd652f8d3807d780642fc87 07-May-2014 Hemant Gupta <hemantg@codeaurora.org> PBAP: Remove the PBAP pop up in various scenarios

-If ACL is disconnected by remote device OR DUT(unbond from
the DUT) before accepting incoming authorization request for
PBAP connection. PBAP authorization pop up should be removed.

- If authorization is cancelled due to USER_TIMEOUT(30 second),
then PBAP authorization pop up should be removed.

Change-Id: I0a69f23c7882a43de9fe207c84926de91713c79b
bap/BluetoothPbapService.java
faec4b404f63184cddffd557a2d38d6a85459d94 29-Jun-2014 Matthew Xie <mattx@google.com> am 8f5a4787: Merge "PBAP: Check for spurious entries of searched contacts" into klp-wireless-dev

* commit '8f5a4787761ebdaa852c0b5d7c7b89c339e140b8':
PBAP: Check for spurious entries of searched contacts
8f5a4787761ebdaa852c0b5d7c7b89c339e140b8 29-Jun-2014 Matthew Xie <mattx@google.com> Merge "PBAP: Check for spurious entries of searched contacts" into klp-wireless-dev
1ebce7fb88348be7b984b1a778bd1bbeea20d6d7 18-Jun-2014 Andre Eisenbach <eisenbach@google.com> LE: Add is_connected() function (3/3)

Change-Id: I71f64ff59e4602d2834f1c177310a36320e70ead
tservice/AdapterService.java
tservice/RemoteDevices.java
a03c33b370420dc6ad688b217b5a37bfa43169cf 08-May-2014 Andre Eisenbach <eisenbach@google.com> Adding a method BluetoothDevice.isConnected()

Adding a new method to BluetoothDevice that lets callers know whether a remote device is
connected.

Original-patch-by: Jay Civelli <jcivelli@google.com>
Cherry-picked-from: master
Change-Id: Ia8ad2e3189d08b63832634bdf804656b8d013820
tservice/AdapterService.java
tservice/RemoteDevices.java
af471e1d5765aa9f1b15909ed488c6c9eb57090e 28-Mar-2014 Andre Eisenbach <eisenbach@google.com> LE: Add notification sent and congestion callbacks (4/4)

This change introduces two new callbacks for applications to better
handle LE notification flow control and transport congestion. The
notification callback is invoked when the remote platform confirms an
indication or when a local notification has been passed to the
controller. No new notifications should be sent until a callback is
received.

Congestion callbacks are triggered when a GATT operation cannot be sent
to the local Bluetooth controller. Repeatedly calling
writeCharacteristic() for example will eventually trigger a congestion
callback. Applications cannot send additional data until a further
callback is received, indicating that the congestion has cleared up.

Change-Id: I5feb555b4843bd25b1d40338651695ac082e1386
att/GattService.java
21492655012d6d3d521b8a49797366b434115bcf 28-Jun-2014 Matthew Xie <mattx@google.com> fix a merge error in PanService

Change-Id: I63734e44ca661166da9091fae622a9e54bd24431
an/PanService.java
3f9f111b47fb92c1453b564a45703bfe9638282e 28-Jun-2014 Hemant Gupta <hemantg@codeaurora.org> am 0d132248: PBAP: Change string search comparison from NULL to empty

* commit '0d1322483285ccc9ca7bedf515821c5c105a44e6':
PBAP: Change string search comparison from NULL to empty
7a566bbe24c3618e3b21d6b7170d94bfd2f03089 28-Jun-2014 Zhihai Xu <zhihaixu@google.com> am e40925fc: Bluetooth: Added Shared Preferences to restore tethering preference

* commit 'e40925fc889d7f9dfc2a12c8165086cc7c312cc6':
Bluetooth: Added Shared Preferences to restore tethering preference
afc04fcffad9713d5385894b41a1fb29c1d6ee96 28-Mar-2014 Andre Eisenbach <andre@broadcom.com> LE: Add notification sent and congestion callbacks (4/4)

This change introduces two new callbacks for applications to better
handle LE notification flow control and transport congestion. The
notification callback is invoked when the remote platform confirms an
indication or when a local notification has been passed to the
controller. No new notifications should be sent until a callback is
received.

Congestion callbacks are triggered when a GATT operation cannot be sent
to the local Bluetooth controller. Repeatedly calling
writeCharacteristic() for example will eventually trigger a congestion
callback. Applications cannot send additional data until a further
callback is received, indicating that the congestion has cleared up.

Change-Id: Ifa8de9c12d8d487e28fb5a1a5e05150a7fec90cb
att/GattService.java
83faa1c29215f8fcf69e2444f54d24ddaf6e2da5 26-Jun-2014 Matthew Xie <mattx@google.com> am e5c2a9d1: Merge "Add null pointer check in A2DPService"

* commit 'e5c2a9d12a29baa007e17dfe62f13b28a3aea637':
Add null pointer check in A2DPService
e5c2a9d12a29baa007e17dfe62f13b28a3aea637 26-Jun-2014 Matthew Xie <mattx@google.com> Merge "Add null pointer check in A2DPService"
d1d30b0340aa30982c85ba0d69f918ed127679ef 25-Jun-2014 Matthew Xie <mattx@google.com> am 663fb577: Merge "Use round() instead of ceil() in calculation of a2dp vol slider position"

* commit '663fb5771e20f117be2c14fe794b2594aabdc703':
Use round() instead of ceil() in calculation of a2dp vol slider position
663fb5771e20f117be2c14fe794b2594aabdc703 25-Jun-2014 Matthew Xie <mattx@google.com> Merge "Use round() instead of ceil() in calculation of a2dp vol slider position"
fb23c060031422c34aa8233cb3868d187f36a9dc 26-Jun-2014 Paul Jensen <pauljensen@google.com> Merge "Convert BluetoothTetheringDataTracker into a NetworkFactory."
689fb16c3dcca9a8d09a8572586a654b1ad38d7d 26-Jun-2014 Matthew Xie <mattx@google.com> am 83faa1c2: am e5c2a9d1: Merge "Add null pointer check in A2DPService"

* commit '83faa1c29215f8fcf69e2444f54d24ddaf6e2da5':
Add null pointer check in A2DPService
f3997eb0ef29986e9e27fb81f0667c2f19fae07f 26-Jun-2014 Andres Morales <anmorales@google.com> Merge "Making Bluetooth OPP file transfer intent generic"
9cf6c591c43c4dba90b5c2e26a5f93368682c9cc 25-Jun-2014 RoboErik <epastern@google.com> Merge "Disable debug messages that were left on"
8e0d927632cce4ad53df85fb7627b915c5fbd64b 24-Jun-2014 RoboErik <epastern@google.com> Disable debug messages that were left on

Forgot to disable with my last change.

Change-Id: I502e77071745bd5f9d98aa9ce963b927effc2d46
vrcp/Avrcp.java
7af55657d171df8336cbcce0687d1225fe0f5312 25-Jun-2014 Matthew Xie <mattx@google.com> am d1d30b03: am 663fb577: Merge "Use round() instead of ceil() in calculation of a2dp vol slider position"

* commit 'd1d30b0340aa30982c85ba0d69f918ed127679ef':
Use round() instead of ceil() in calculation of a2dp vol slider position
f08b93c4a2bdc3295163b11ddf8370071212feb1 23-Jun-2014 Matthew Xie <mattx@google.com> am ea10b480: am 7315070f: Merge "Fix signal strength indicator."

* commit 'ea10b480618028469d25bc6f4239ff74334a431a':
Fix signal strength indicator.
ea10b480618028469d25bc6f4239ff74334a431a 23-Jun-2014 Matthew Xie <mattx@google.com> am 7315070f: Merge "Fix signal strength indicator."

* commit '7315070f9513a498c915c06c9abed84cd14da11e':
Fix signal strength indicator.
04be19286d311ef51ca50841b6a15ea7994fd3a5 13-Dec-2013 Danny Baumann <dannybaumann@web.de> Fix signal strength indicator.

Some devices don't check the service indicator, but only the signal
indicator. Don't give the false impression that the network signal is ok
when we're actually out of service for those devices.

Change-Id: I2e24daf13593439cbc23254fb4539cd250dbae89
fp/HeadsetPhoneState.java
cf8a01eeb41fc6420283ed7c3d7d94a463745b1a 23-Jun-2014 Andre Eisenbach <eisenbach@google.com> Merge "Reduce log verbosity in AdapterService"
20de1a6601e8aea7bbc9b9a8219cc616ffddae25 21-Jun-2014 Andre Eisenbach <eisenbach@google.com> Reduce log verbosity in AdapterService

Cleaned up log messages and use existing log functions to control all
debug messages in one place. Also removes unhelpful repetitive message
spam in the Settings app Bluetooth activity.

Change-Id: I7bfd79e06daad60f50742a45ebcdab936077b93e
tservice/AdapterProperties.java
tservice/AdapterService.java
5a84c6974b024e28e15ae853bda2599ebe4d8e6e 21-Jun-2014 Andre Eisenbach <eisenbach@google.com> Merge "LE: Add is_connected() function (3/3)"
6e29e12add362546784126119f26f04fc760f021 19-Jun-2014 RoboErik <epastern@google.com> Update Avrcp to use RemoteController

Avrcp was using IRemoteControlDisplay directly. This converts it to
the public api instead.

Change-Id: I0740687ed20da69d3522e9e9e7dc55bb1f374ecc
vrcp/Avrcp.java
3636f3319fc403e3bf995b6de71dc5e3f2864661 18-Jun-2014 Andre Eisenbach <eisenbach@google.com> LE: Add is_connected() function (3/3)

Change-Id: I71f64ff59e4602d2834f1c177310a36320e70ead
tservice/AdapterService.java
tservice/RemoteDevices.java
6fb74b225ec5efc8caef0fec82692e33392b8ecb 04-Jun-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Fix issue with converting byte array into unsigned integers

Bug 15411439

Change-Id: I921bb3bab6cbd6e09c22786dd90dd0cfbca59265
tservice/AdapterProperties.java
58ff480f24ba9905edf86c98035f5e9ad76a453a 17-Jun-2014 Paul Jensen <pauljensen@google.com> Convert BluetoothTetheringDataTracker into a NetworkFactory.

bug:15407087

Change-Id: I0437ca52dedf73e8ec69ac82e46353f6fafc4a42
an/BluetoothTetheringNetworkFactory.java
an/PanService.java
1d203e2a24848d15dccb8ed1f7c0891c623125bd 18-Jun-2014 Andre Eisenbach <eisenbach@google.com> Merge "LE: Add ability to pass address type to GATT test command"
106b714a2e69fa9c0734d87a02ab7277c30f8960 04-Jun-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Fix issue with converting byte array into unsigned integers

Bug 15411439

Change-Id: I921bb3bab6cbd6e09c22786dd90dd0cfbca59265
tservice/AdapterProperties.java
066ad9e16a548218b139424f758b92db7af34af2 06-Jun-2014 Mike Lockwood <lockwood@google.com> Move AVRCP Controller support to new BluetoothAvrcpController profile

Change-Id: I865f77c85d971bf06dbc0643722abad7f6b94ab9
2dp/A2dpService.java
2dp/Avrcp.java
vrcp/Avrcp.java
vrcp/AvrcpControllerService.java
tservice/Config.java
5c86abdc7875a8fae28c57e3e36a0a8eaae5cb04 07-Feb-2014 Hemant Gupta <hemantg@codeaurora.org> [4/4] Add Support for AVRCP Controller Feature

- Provide support for AVRCP Controller CAT 1 and CAT 2
Passthrough commands.
- Fix bug in usage of percent volume change in absolute
volume case.

Change-Id: Ie753329a96c30343d92c421c5e0113ff3e624db6
2dp/A2dpService.java
2dp/Avrcp.java
c030f08f419d596c4aa216c9cca9867e7b5486f0 07-Jun-2014 Mike Lockwood <lockwood@google.com> A2DP Sink: Add support for BluetoothA2dpSink profile

Change-Id: If2c1b9b919c90e65a3808c9a55b554c0e899a9c2
2dp/A2dpSinkService.java
2dp/A2dpSinkStateMachine.java
2dp/A2dpStateMachine.java
tservice/Config.java
8d536f3db19e8ea7426e98e470dc15d10ecbae87 12-Jun-2014 Mike Lockwood <lockwood@google.com> Rename BluetoothHandsfreeClient to BluetoothHeadsetClient

This makes our terminology consistent with the existing BluetoothHeadset profile

Change-Id: I527977250cf9a34d55d01b357c5c438826e58156
tservice/Config.java
fpclient/HandsfreeClientHalConstants.java
fpclient/HandsfreeClientService.java
fpclient/HandsfreeClientStateMachine.java
fpclient/HeadsetClientHalConstants.java
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
c07f105ac5db80ae48a768223d1533daa7afb534 15-May-2014 Mike Lockwood <lockwood@google.com> Set HFP client profile off by default, enable via resource override rather than system property.

Change-Id: Ief080b21026c7b150835e044f800ccaf786bbd2c
tservice/Config.java
aebc726105204f8a7b977eb3556c14b5ba18a5ca 19-Aug-2013 Hemant Gupta <hemantg@codeaurora.org> Bluetooth: Add support for HFP Client role.

Implementation changes in Bluetooth App to support
HFP Client role.

Change-Id: I795f475c6a1548fd7cc68d0a02b22f30cf5a182b
tservice/Config.java
fpclient/HandsfreeClientHalConstants.java
fpclient/HandsfreeClientService.java
fpclient/HandsfreeClientStateMachine.java
b83d7c6016ccd2b95b5e3b08581f5e2b21d68905 12-Jun-2014 Mike Lockwood <lockwood@google.com> Rename BluetoothHandsfreeClient to BluetoothHeadsetClient

This makes our terminology consistent with the existing BluetoothHeadset profile

Change-Id: I527977250cf9a34d55d01b357c5c438826e58156
tservice/Config.java
fpclient/HandsfreeClientHalConstants.java
fpclient/HandsfreeClientService.java
fpclient/HandsfreeClientStateMachine.java
fpclient/HeadsetClientHalConstants.java
fpclient/HeadsetClientService.java
fpclient/HeadsetClientStateMachine.java
1e9f8a14e120e8786711abdd4a965236191c87ad 31-May-2014 Sharvil Nanavati <sharvil@google.com> Expose wake lock / wake alarm functionality to bluedroid.

Change-Id: I267ff1d19a0d1ef5ad9a290c7654d7e6ee3a9f15
tservice/AdapterService.java
a2be7670787cc4576386bf4a8baea4b88d35e90b 06-Jun-2014 Prerepa Viswanadham <dham@google.com> Refactor ScanClient scan settings to one place
Scan_mode_low_power 500ms/5000ms (10%)
scan_mode_balanced 2000ms/5000ms (40%)
scan_mode_low_latency 5000ms/5000ms (100%)

Change-Id: I5f24dc24fc86eba35c645a968e1c80934e3dd2d5
att/GattService.java
att/ScanClient.java
c145fd074dac20e6c9836ee6e900538f2cc7dd54 05-Jun-2014 Prerepa Viswanadham <dham@google.com> Use controller provided information about it BLE L feature capabilities

Change-Id: Ia3099c1df2664b79392b2a4f7e3e47d1507a9efe
tservice/AdapterProperties.java
tservice/AdapterService.java
att/GattService.java
att/GattServiceStateMachine.java
d0f1d36e653e1b91337743b92472ba4ea97c538b 22-May-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Add support for retrieving local LE features via get_adapter_properties

Change-Id: Iada59d0c7aa776f8b3aa25abec1a7612224a43bb
tservice/AbstractionLayer.java
tservice/AdapterProperties.java
6f1d727834316ee78c9c897965b254fa0316a065 07-Jan-2014 Hemant Gupta <hemantg@codeaurora.org> PBAP: Fix crash in com.android.bluetooth

This patch will add the changes to catch the
CursorWindowAllocationException at all the places where cursor
is used for quering operations. Without this patch, crash was
observed in com.android.bluetooth in stress test of BT On/off
multiple times.

FATAL EXCEPTION: main
android.database.CursorWindowAllocationException:
Cursor window could not be created from binder.
com.android.bluetooth.pbap.BluetoothPbapVcardManager.
getCallHistorySize(BluetoothPbapVcardManager.java)

Change-Id: I6a4fadb949969dca453cff0fe84a25d849063573
bap/BluetoothPbapUtils.java
bap/BluetoothPbapVcardManager.java
ddf1c3d66c38b6ad771608eda1c57656eee57332 11-Jun-2014 Andre Eisenbach <eisenbach@google.com> LE: Add ability to pass address type to GATT test command

Currently the GATT test command to connect a remote device assumes a
public Bluetooth device address. This patch adds the ability to pass in
the address type via the test command interface.

Change-Id: Ic892b7bf5f9b261152492778da0c78b184b5e9b2
att/GattDebugUtils.java
55d81a3828bc9d227b77ea840fa3dffcbc4262d2 10-Jun-2014 Benson Huang <benson.huang@mediatek.com> [BT] Fix bug: MAP client can not get MessageListing for draft folder

Currently c.getColumnIndex(Mms.PRIORITY) in setPriority method is returning
-1 which is causing c.getInt(-1) to throw a java.lang.IllegalStateException.

The fix is to add the column Mms.PRIORITY in MMS_PROJECTION

Bug 15069197 and 15071221

Change-Id: I9f296415efd5e10970d9f24652cab1022dad5efd
Signed-off-by: Benson Huang <benson.huang@mediatek.com>
ap/BluetoothMapContent.java
b824e2624524d039b12ce3b7de2747ff558bfe94 06-Jun-2014 Mike Lockwood <lockwood@google.com> Move AVRCP Controller support to new BluetoothAvrcpController profile

Change-Id: I865f77c85d971bf06dbc0643722abad7f6b94ab9
2dp/A2dpService.java
2dp/Avrcp.java
vrcp/Avrcp.java
vrcp/AvrcpControllerService.java
tservice/Config.java
9ebf7624eb97e76d34ceceebf4ab1558d73df246 07-Jun-2014 Mike Lockwood <lockwood@google.com> A2DP Sink: Add support for BluetoothA2dpSink profile

Change-Id: If2c1b9b919c90e65a3808c9a55b554c0e899a9c2
2dp/A2dpSinkService.java
2dp/A2dpSinkStateMachine.java
2dp/A2dpStateMachine.java
tservice/Config.java
67c06156691d30294547979559ffb49a9579463d 09-Jun-2014 Jay Civelli <jcivelli@google.com> Merge "Adding a method BluetoothDevice.isConnected()"
c453f0f533556d8ffbb7a87ca09d6b30e259978e 31-May-2014 Sharvil Nanavati <sharvil@google.com> Expose wake lock / wake alarm functionality to bluedroid.

Change-Id: I267ff1d19a0d1ef5ad9a290c7654d7e6ee3a9f15
tservice/AdapterService.java
32088854fd6a8bb5e570a4a1df4eaf2eb19d7ae3 06-Jun-2014 Prerepa Viswanadham <dham@google.com> Refactor ScanClient scan settings to one place
Scan_mode_low_power 500ms/5000ms (10%)
scan_mode_balanced 2000ms/5000ms (40%)
scan_mode_low_latency 5000ms/5000ms (100%)

Change-Id: I5f24dc24fc86eba35c645a968e1c80934e3dd2d5
att/GattService.java
att/ScanClient.java
e65500db39422398f3b87c4f340e66fdfec7e328 05-Jun-2014 Wei Wang <weiwa@google.com> Add missing licenses.

Change-Id: Ie07e3b8940e8caec985aad4aee5aaf283b5af37e
att/AdvertiseClient.java
att/GattServiceStateMachine.java
e74e332c8de3c5d2abd56868ba7662d68c797236 06-Jun-2014 Wei Wang <weiwa@google.com> am b5bdb625: Add device capability config for new BLE features(MA, scan filter).(2/3)

* commit 'b5bdb625226aca1650ba4c57fd94c8f9b4aa7750':
Add device capability config for new BLE features(MA, scan filter).(2/3)
0c80f016af7f313611b0bac77da6e3ee695c0c73 05-Jun-2014 Wei Wang <weiwa@google.com> Add missing licenses.

Change-Id: Ie07e3b8940e8caec985aad4aee5aaf283b5af37e
att/AdvertiseClient.java
att/GattServiceStateMachine.java
cefee9c44890a0943a9fd7c2891324fd81d50b28 05-Jun-2014 Prerepa Viswanadham <dham@google.com> Use controller provided information about it BLE L feature capabilities

Change-Id: Ia3099c1df2664b79392b2a4f7e3e47d1507a9efe
tservice/AdapterProperties.java
tservice/AdapterService.java
att/GattService.java
att/GattServiceStateMachine.java
7aa3a71e508e4f95a0a74f41ab8389979809191b 08-May-2014 Jay Civelli <jcivelli@google.com> Adding a method BluetoothDevice.isConnected()

Adding a new method to BluetoothDevice that lets callers know whether a remote device is
connected.

Change-Id: Ia8ad2e3189d08b63832634bdf804656b8d013820
tservice/AdapterService.java
tservice/RemoteDevices.java
cf7cb8478523185da2ff851bb0de96fe95b3e77c 31-May-2014 Wei Wang <weiwa@google.com> Fix build.

Change-Id: I92461859b65dac554650d7928bfddbfe9d80c2fe
att/ScanClient.java
8333a1b99994e9d8986dbca44989c943c219e36f 31-May-2014 Prerepa Viswanadham <dham@google.com> Set scan parameters in ScanClient based on BluetoothLeScanSettings
configuration

scan_mode scan_window_ms scan_interval_ms
SCAN_MODE_LOW_POWER 500 5000
SCAN_MODE_BALANCED 1000 5000
SCAN_MODE_LOW_LATENCY 2500 5000

Change-Id: I2382c7b584b102555f175a94206c4379141af3fa
att/ScanClient.java
ac4640647b4dfae61cc2a8c37d3d798bdc82a553 22-May-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Add support for retrieving local LE features via get_adapter_properties

Change-Id: Iada59d0c7aa776f8b3aa25abec1a7612224a43bb
tservice/AbstractionLayer.java
tservice/AdapterProperties.java
b5bdb625226aca1650ba4c57fd94c8f9b4aa7750 02-Jun-2014 Wei Wang <weiwa@google.com> Add device capability config for new BLE features(MA, scan filter).(2/3)

Fixes b/15387925.

Change-Id: I7cbcdd340fca7965f2be2c0d2a938e7646dc6849
att/GattService.java
att/GattServiceStateMachine.java
c92b13ad9671810e6f10bbfce3032d33765f0a15 02-Jun-2014 Wei Wang <weiwa@google.com> Add device capability config for new BLE features(MA, scan filter).(2/3)

Fixes b/15387925.

Change-Id: I7cbcdd340fca7965f2be2c0d2a938e7646dc6849
att/GattService.java
att/GattServiceStateMachine.java
8426b4392456869935f90bf51be68ce198a86c01 31-May-2014 Wei Wang <weiwa@google.com> Fix build.

Change-Id: I92461859b65dac554650d7928bfddbfe9d80c2fe
att/ScanClient.java
6e2fce02940bde40a2c8a48a725e9fa0157bde6c 31-May-2014 Prerepa Viswanadham <dham@google.com> Set scan parameters in ScanClient based on BluetoothLeScanSettings
configuration

scan_mode scan_window_ms scan_interval_ms
SCAN_MODE_LOW_POWER 500 5000
SCAN_MODE_BALANCED 1000 5000
SCAN_MODE_LOW_LATENCY 2500 5000

Change-Id: I2382c7b584b102555f175a94206c4379141af3fa
att/ScanClient.java
6c984a7012ef5dee09b4e1f6d17a6ddc3ae0bb11 31-May-2014 Wei Wang <weiwa@google.com> am 80780da9: Add protection for controller timeout/failure, maximum number of advertisers, filters etc.

* commit '80780da923f52a6b5a80f8619cf3e735970eaad9':
Add protection for controller timeout/failure, maximum number of advertisers, filters etc.
fa13d4471d52a5780eb4c4efcedff6778060f7fa 31-May-2014 Wei Wang <weiwa@google.com> Merge diffs from API review comments(2/2).

Change-Id: I7316ec4fe134268927b27c14e421e6e3fc31b59f
att/AdvertiseClient.java
att/GattService.java
att/GattServiceStateMachine.java
att/ScanClient.java
80780da923f52a6b5a80f8619cf3e735970eaad9 26-May-2014 Wei Wang <weiwa@google.com> Add protection for controller timeout/failure, maximum number of
advertisers, filters etc.

fixes b/15348260.

Change-Id: Ie5a460a7f042cdeba4c1e63498fd6db9dadbb66f
att/GattService.java
att/GattServiceStateMachine.java
att/ScanFilterQueue.java
1927f586b9e99411dace890fe3860b39140b1f66 30-May-2014 Wei Wang <weiwa@google.com> am 80e7d011: Changes due to addressing BLE API review comments

* commit '80e7d011fdb511a6583258458e97821176866baa':
Changes due to addressing BLE API review comments
1a1d5f652d44b98d3b8ec73e1bc5dc19b923eb42 22-May-2014 Wei Wang <weiwa@google.com> only stop ble scan when it's already started.

Fixes b/15174583

Change-Id: I3068254c576e8735ffb47d89f4bb8d5a719891c9
att/GattService.java
f3e3ade729080636d0a3e9224ee205183fe11fa0 26-May-2014 Wei Wang <weiwa@google.com> Add protection for controller timeout/failure, maximum number of
advertisers, filters etc.

Change-Id: I94b719ddc0d9943c1a3c304285969d4c80e50a69
att/GattService.java
att/GattServiceStateMachine.java
att/ScanFilterQueue.java
7a02049bb3835c66e4b26700b6606b0ca5db7c6e 29-May-2014 Mike Lockwood <lockwood@google.com> Fix arguments to AudioManager.setBluetoothA2dpDeviceConnectionState()

Change-Id: I2a9742bc2e1127f56fafed574794f81578872681
2dp/A2dpStateMachine.java
9537b0e4648a0c197392d3276b46681523d5f0bc 29-May-2014 Mike Lockwood <lockwood@google.com> Fix arguments to AudioManager.setBluetoothA2dpDeviceConnectionState()

Change-Id: I2a9742bc2e1127f56fafed574794f81578872681
2dp/A2dpStateMachine.java
80e7d011fdb511a6583258458e97821176866baa 21-May-2014 Wei Wang <weiwa@google.com> Changes due to addressing BLE API review comments

Change-Id: I27b94952a243bf4fdbebdc103e7d541ce23efa3f
att/AdvertiseClient.java
att/GattService.java
att/GattServiceStateMachine.java
att/ScanClient.java
att/ScanFilterQueue.java
233a9ce2117ae01d2ead214f0629b4aa1ff0ad85 21-May-2014 Wei Wang <weiwa@google.com> Changes due to addressing BLE API review comments

Change-Id: I27b94952a243bf4fdbebdc103e7d541ce23efa3f
att/AdvertiseClient.java
att/GattService.java
att/GattServiceStateMachine.java
att/ScanClient.java
att/ScanFilterQueue.java
bfb222069971808621cf0e1fd80584eca7372060 22-May-2014 Wei Wang <weiwa@google.com> only stop ble scan when it's already started.

Change-Id: I3068254c576e8735ffb47d89f4bb8d5a719891c9
att/GattService.java
d379f2dd23cf0d237c2a251279a1ff0d355f1ed7 22-May-2014 Wei Wang <weiwa@google.com> only stop ble scan when it's already started.

Change-Id: I3068254c576e8735ffb47d89f4bb8d5a719891c9
att/GattService.java
1321cd814a7406260ba6282d9c71e1a2d8925262 03-Oct-2013 Hemant Gupta <hemantg@codeaurora.org> PBAP: Check for spurious entries of searched contacts

This patch adds the check to limit the search if we already
have got the contact name by number so that same contact
will not be getting searched more than one number of time.

Change-Id: If4a26433e28cad90394833b51cc3ff0d0bcf7e36
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapVcardManager.java
d74ba4930e66087ecfe7e307f1a27e895df31d97 21-May-2014 Mike Lockwood <lockwood@google.com> Merge "[4/4] Add Support for AVRCP Controller Feature" into klp-wireless-dev
ccd5f131d51ef8019c87628b992bc67cbbcc2ea6 21-May-2014 Wei Wang <weiwa@google.com> Add scan response as an advertising parameter(2/2).

Change-Id: Ib0c86b81b9a2e0dd4110275c804e814451231966
att/AdvertiseClient.java
att/GattService.java
att/GattServiceStateMachine.java
b16d4b64de7643ba9c28fc62f768463cde1f9420 21-May-2014 Wei Wang <weiwa@google.com> Add scan response as an advertising parameter(2/2).

Change-Id: Ib0c86b81b9a2e0dd4110275c804e814451231966
att/AdvertiseClient.java
att/GattService.java
att/GattServiceStateMachine.java
1a2f87a202a4d634f0b6b5b6e9a8545796207288 20-May-2014 Wei Wang <weiwa@google.com> Revert "Revert "Use state machine in gatt service to handle different state transitions. For this CL only normal BLE scans are moved to state machine.""

This reverts commit e68125be766dac23f9b346464e3d84e078132914.

Change-Id: I11bc9d84390043f189d268916bc681e68deea160
att/AdvertiseClient.java
att/GattService.java
att/GattServiceStateMachine.java
att/ScanClient.java
att/ScanFilterQueue.java
e68125be766dac23f9b346464e3d84e078132914 20-May-2014 Wei Wang <weiwa@google.com> Revert "Use state machine in gatt service to handle different state transitions. For this CL only normal BLE scans are moved to state machine."

This reverts commit 3c6c305ebdfcaf239108f775f8ee2db2a0459c0f.

Change-Id: Ib1601bba4fe9d38a338ecf86740b20fcaccfa48f
att/AdvertiseClient.java
att/GattService.java
att/GattServiceStateMachine.java
att/ScanClient.java
att/ScanFilterQueue.java
3c6c305ebdfcaf239108f775f8ee2db2a0459c0f 07-May-2014 Wei Wang <weiwa@google.com> Use state machine in gatt service to handle different state
transitions.
For this CL only normal BLE scans are moved to state machine.

Change-Id: I27376c7826544ca41aad156deefcd6a63d6cefbb
att/AdvertiseClient.java
att/GattService.java
att/GattServiceStateMachine.java
att/ScanClient.java
att/ScanFilterQueue.java
1d7aaff7194ee04a8f3c8ddb0a94c1d27776de8f 08-May-2014 Wei Wang <weiwa@google.com> Changes due to the rename of isShortUuid to is16BitUuid.

Change-Id: I6a822ebcbe55d1e3162c3f3374278bf7f0adea5f
att/GattService.java
628441e02c280f8f48adba0ade3c7028cbcdeec2 07-May-2014 Wei Wang <weiwa@google.com> Use state machine in gatt service to handle different state
transitions.
For this CL only normal BLE scans are moved to state machine.

Change-Id: I27376c7826544ca41aad156deefcd6a63d6cefbb
att/AdvertiseClient.java
att/GattService.java
att/GattServiceStateMachine.java
att/ScanClient.java
att/ScanFilterQueue.java
468f938001cd5dc7912fc8779c00987c44aafab2 15-May-2014 Mike Lockwood <lockwood@google.com> Set HFP client profile off by default, enable via resource override rather than system property.

Change-Id: Ief080b21026c7b150835e044f800ccaf786bbd2c
tservice/Config.java
a4b39a558accff559561d60dbdafe9cf457a430b 15-May-2014 Mike Lockwood <lockwood@google.com> Merge "[4/4] Bluetooth: Add support for HFP Client role." into klp-wireless-dev
790352c7ff44eec4bb2458bea79c71e5b86c3206 15-May-2014 Mike Lockwood <lockwood@google.com> Merge "Submitted on behalf of 3rd party copied from packages/apps/Bluetooth/" into klp-wireless-dev
88d774ebc08d875d54db6b13cec06c8ce3d0925a 13-May-2014 Prerepa Viswanadham <dham@google.com> Improve name of api.

Change-Id: Ib35203a46f74aed43e2ce32dba02755016d84998
att/GattService.java
f745ace608784e226a78170bf5a24fe114f1026f 10-May-2014 Prerepa Viswanadham <dham@google.com> set scan parameters in BT stack. Apply the most demanding request
in terms of duty cycle for all outstanding requests.

Change-Id: Iee460003d210455ab180367f3518bfb10a6c2539
att/GattService.java
att/ScanClient.java
53f26c079f676b3a72a20de4e30f075057d3777d 09-May-2014 Prerepa Viswanadham <dham@google.com> LE: Add API to set scan interval and window (3/4)

Drop client_if from api
Change-Id: I5ad339573c5fec28b22d8c4c5949eaf0d4d118aa
att/GattService.java
63ee04788c7384779eadb10f0c2cd10779ebfb43 13-May-2014 Prerepa Viswanadham <dham@google.com> Improve name of api.

Change-Id: Ib35203a46f74aed43e2ce32dba02755016d84998
att/GattService.java
dd2d4b97992bfa4bb549fc5e61b0a7c02acc013a 10-May-2014 Prerepa Viswanadham <dham@google.com> set scan parameters in BT stack. Apply the most demanding request
in terms of duty cycle for all outstanding requests.

Change-Id: Iee460003d210455ab180367f3518bfb10a6c2539
att/GattService.java
att/ScanClient.java
c8e3bda018603f40aabf62e2fb59615b24039634 09-May-2014 Prerepa Viswanadham <dham@google.com> LE: Add API to set scan interval and window (3/4)

Drop client_if from api
Change-Id: I5ad339573c5fec28b22d8c4c5949eaf0d4d118aa
att/GattService.java
709ec52d8053ccbdc00ccf463d35f1f6b91fa41a 19-Aug-2013 Hemant Gupta <hemantg@codeaurora.org> [4/4] Bluetooth: Add support for HFP Client role.

Implementation changes in Bluetooth App to support
HFP Client role.

Change-Id: I795f475c6a1548fd7cc68d0a02b22f30cf5a182b
tservice/Config.java
fpclient/HandsfreeClientHalConstants.java
fpclient/HandsfreeClientService.java
fpclient/HandsfreeClientStateMachine.java
7d84dc7f7165c69e7d84b50bd21f8a63fa7df275 29-Apr-2014 Hemant Gupta <hemantg@codeaurora.org> Submitted on behalf of 3rd party copied from
packages/apps/Bluetooth/

Initial commit for HFP Client

Change-Id: I0dabd9df1cafc48d5e30e29c36898b6d1af6e874
fpclient/HandsfreeClientHalConstants.java
fpclient/HandsfreeClientService.java
fpclient/HandsfreeClientStateMachine.java
39fadfcd92a969a750dafb8e37c468daff9c1054 08-May-2014 Wei Wang <weiwa@google.com> Changes due to the rename of isShortUuid to is16BitUuid.

Change-Id: I6a822ebcbe55d1e3162c3f3374278bf7f0adea5f
att/GattService.java
0d1322483285ccc9ca7bedf515821c5c105a44e6 30-Dec-2013 Hemant Gupta <hemantg@codeaurora.org> PBAP: Change string search comparison from NULL to empty

This change compares the searchValue atribute to empty
string value rather than comparing with the NULL object
since the searchValue object itself is never NULL and
only the value becomes an empty string. Without this
patch DUT was returning no list on Vcard-listing request
by PBAP Client.

Change-Id: I20cdfc0246af3057ba8ee268dee3de1893810638
bap/BluetoothPbapObexServer.java
c592e5a6de0011cd60f23ac18a7bd56d8eeb5dd1 07-Jan-2014 Hemant Gupta <hemantg@codeaurora.org> PBAP: Fix crash in com.android.bluetooth

This patch will add the changes to catch the
CursorWindowAllocationException at all the places where cursor
is used for quering operations. Without this patch, crash was
observed in com.android.bluetooth in stress test of BT On/off
multiple times.

FATAL EXCEPTION: main
android.database.CursorWindowAllocationException:
Cursor window could not be created from binder.
com.android.bluetooth.pbap.BluetoothPbapVcardManager.
getCallHistorySize(BluetoothPbapVcardManager.java)

Change-Id: I6a4fadb949969dca453cff0fe84a25d849063573
bap/BluetoothPbapUtils.java
bap/BluetoothPbapVcardManager.java
b17782509bd34201cf0daa62dadc929d65eb98b0 19-Mar-2014 Zhihai Xu <zhihaixu@google.com> MHF: Disconnect audio for HS1 before disconnecting ACL.

When HS2 is connected while call is active on HS1,
disconnect audio first followed by disconnecting ACL
for HS1.
from QCOM
Change-Id: I53b6fedd47008cf0d6d65a72f744b2df4a198e34
fp/HeadsetStateMachine.java
34409f35db6e9ca74f727e3fe92141388ae5b069 16-Jul-2013 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Set profile priorities only after SDP completion

Set the profile priorities only after SDP completion.
Perform lookup and set profile priorities to ON, only for
profiles supported by bonded BT device.
CR BLTH02405767

Change-Id: I83fe6e772993b7c41c6a86f504d2b09ea38b2356

Conflicts:
src/com/android/bluetooth/btservice/AdapterService.java
tservice/AdapterService.java
tservice/BondStateMachine.java
tservice/RemoteDevices.java
1a39ecdeaad346e86ca95f802519c8c58edfc4b9 07-Feb-2014 Hemant Gupta <hemantg@codeaurora.org> Bluetooth-OPP: Handle HID mouse right click event

This change will handle mouse right click event to display only
context menu with options Open and Clear. Otherwise, during HID mouse
right click two popup will be displayed context menu and Open option
while selecting context menu, option app crash is observed.

Change-Id: I8328f87f9c4bc007cd46a5567268621499e35343
pp/BluetoothOppTransferHistory.java
18591a7894c5e4516491438c2e758adf8d2ade90 18-Apr-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Add transport param to Connect APIs

Support for passing preferred transport for GATT connections as part of
Connect APIs

Change-Id: Ibeafb922aec954d1f2e693b422e264fbc87468f2
att/GattService.java
84748eda69cbd96a761288090fb248f5fe861332 15-Mar-2014 Sunny Kapdi <sunnyk@codeaurora.org> MHF: Start DIALING_OUT_TIMEOUT for correct device

When processing Dial request, start DIALING_OUT_TIMEOUT
timer for correct matching device.
Also add null check for device retrieved from
getDeviceForMessage()

Change-Id: Id9946c6b91ca1b23a24dfe408a81db25b9dfb86a
CRs-Fixed: 612278
fp/HeadsetStateMachine.java
c1f19a57e4366b2f89a1fbb03f3626856b5da482 15-Mar-2014 Sunny Kapdi <sunnyk@codeaurora.org> MHF: Broadcast connected state for HS

- Since telephony doesn't store list of connected HS, BT needs
to broadcast connected state for an already connected HS,
when other HS disconnects. This will notify telephony that
even though one HS is disconnected, but still there is one
other connected HS. This fixes call routing issue to BT HS
from phone UI.

- Set mActiveScoDevice to null when HS disconnects while
it has SCO connected for ongoing call.

Change-Id: I91aba22844938b61afc0bac52b5b6de95354f491
CRs-Fixed: 619841
fp/HeadsetStateMachine.java
343b96e3995da4038b614384dcdad8a6494b4bc4 15-Mar-2014 Nitin Srivastava <nitinsr@codeaurora.org> Multi HF support

1. Added support for Multi HF connections
in Bluetooth application.
2. All connection transition states for
2nd HS onwards is handled in new state-
MultiHFPending.
3. The changes are done to handle proper
state transition for all connected HS.

Change-Id: I033ae57943e50273f9d3cac4c5f8d1624cb9ee09
tservice/AdapterService.java
fp/AtPhonebook.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
f2fab45657d6097f08b95a83eca0bf8005807599 03-Feb-2014 Nitin Srivastava <nitinsr@codeaurora.org> BT: HDP: Add NULL check in cleanupApps

Add NULL check for profile Apps data before accessing
them during cleanup.

Change-Id: Iebc6dc0399ed3d77078962b50550d3080a82644f
dp/HealthService.java
cdd2da9489cdfcf35ffdc622eba6f2155f6d376e 25-Sep-2013 Zhihai Xu <zhihaixu@google.com> Bluetooth: Added Shared Preferences to restore tethering preference

Added a Shared Preferences to have the tethering preference persist,
The value is stored while changing the tethering preference by user
and tethering preference will be restored based on the value(last
saved tethering preference) while starting the PAN service.
from QCOM
Change-Id: I468564a51ff17dfdf1b95a532fa429477db0da15
an/PanService.java
86449ac4bc7a8f4b2afeab4da420ae4f980c850a 13-Dec-2013 Hemant Gupta <hemantg@codeaurora.org> Bluetooth-OPP: Enable support to send same file multiple times

Change will add support to send same file multiple times. Otherwise,
if same file is selected to send multiple times after first transfer
succeeds queued instances of the same file got removed and it fails
to be sent.

Change-Id: Ic5b3706644a417cae2491d1df9588a22344f1711
pp/BluetoothOppManager.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppUtility.java
f30c02bcdcd22bbcc27c3481f371b162e49c33ef 06-Feb-2014 Hemant Gupta <hemantg@codeaurora.org> PBAP: Fix search by number issue for contacts.

Fix String outofbounds exception while searching
contacts by NUMBER Search attribute.

Change-Id: Ib82cc138c1fa17c68751eb124114e1f8c2c83324
bap/BluetoothPbapObexServer.java
07fcc0521a01be523dd625fa1ac29b4d8991c2d9 09-Feb-2014 Hemant Gupta <hemantg@codeaurora.org> Bluetooth: Map: Trim folder name in pushMessage and setPath

Trim folder name string passed from remote, before processing the
pushMessage and setPath request to do proper handling when a blank
folder name is passed from some Carkits. Without this change there
will be some IOT issues with some carkit(s) which will append a space
instead of empty string for pushing message to current folder.

Change-Id: I8b0bdfc1f837c53f0773057db27b81ae9acb279a
ap/BluetoothMapObexServer.java
145880aa83b9e88d31daad5d47f250840573824e 09-Dec-2013 Hemant Gupta <hemantg@codeaurora.org> PBAP: Compare Name and ID both for getting vcard by number

This change will add a ID comparison along with the
Name before writing the final vcard entry when we get
the list through getContactsNamesByNumber
to avoid providing the vcard having the same name but
different numbers.

Change-Id: Ie2e1567a784cd3d872495a029fce6b51a39de993
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapVcardManager.java
cf8f608b3da0f82c1a238023275836e3efd2481f 17-Feb-2014 Nitin Srivastava <nitinsr@codeaurora.org> BT: HFP: Set VR flags to false when HS disconnects

When a HS is disconnected while in VR session and then
reconnected again, VR attempt from HS fails as VR flags
mVoiceRecognitionStarted and mWaitingForVoiceRecognition
were not reset to false when HS disconnected.

Change-Id: I008f01393a5529f63cd8392401e1402a9afe70a8
fp/HeadsetStateMachine.java
255407d2c34234150b09e70584adaf72175b0eea 19-Mar-2014 Zhihai Xu <zhihaixu@google.com> MHF: Disconnect audio for HS1 before disconnecting ACL.

When HS2 is connected while call is active on HS1,
disconnect audio first followed by disconnecting ACL
for HS1.
from QCOM
Change-Id: I53b6fedd47008cf0d6d65a72f744b2df4a198e34
fp/HeadsetStateMachine.java
4f491cb7088f918a10d39b52729233d3c98483f2 16-Jul-2013 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Set profile priorities only after SDP completion

Set the profile priorities only after SDP completion.
Perform lookup and set profile priorities to ON, only for
profiles supported by bonded BT device.
CR BLTH02405767

Change-Id: I83fe6e772993b7c41c6a86f504d2b09ea38b2356

Conflicts:
src/com/android/bluetooth/btservice/AdapterService.java
tservice/AdapterService.java
tservice/BondStateMachine.java
tservice/RemoteDevices.java
e013986fbc8796db569587afa5c6b34e53d7a31b 07-Feb-2014 Hemant Gupta <hemantg@codeaurora.org> [4/4] Add Support for AVRCP Controller Feature

- Provide support for AVRCP Controller CAT 1 and CAT 2
Passthrough commands.
- Fix bug in usage of percent volume change in absolute
volume case.

Change-Id: Ie753329a96c30343d92c421c5e0113ff3e624db6
2dp/A2dpService.java
2dp/Avrcp.java
c968f020c251cdd07cc59be11e263161ff9be7d0 01-May-2014 Matthew Xie <mattx@google.com> am 97af6d96: am cc4730be: Add Intent.FLAG_RECEIVER_FOREGROUND for pairing intent broadcast

* commit '97af6d969c21b54c426264c21ed0d8e85e0bca3f':
Add Intent.FLAG_RECEIVER_FOREGROUND for pairing intent broadcast
97af6d969c21b54c426264c21ed0d8e85e0bca3f 01-May-2014 Matthew Xie <mattx@google.com> am cc4730be: Add Intent.FLAG_RECEIVER_FOREGROUND for pairing intent broadcast

* commit 'cc4730be1fcf272355368ca4a2c464d71d3f432d':
Add Intent.FLAG_RECEIVER_FOREGROUND for pairing intent broadcast
cc4730be1fcf272355368ca4a2c464d71d3f432d 01-May-2014 Matthew Xie <mattx@google.com> Add Intent.FLAG_RECEIVER_FOREGROUND for pairing intent broadcast

The pairing intents targeting apps for user interaction. The flag
should be used.
bug 13909361

Change-Id: I13f10df46549773bf416f72ca630ea8ee49fe548
tservice/RemoteDevices.java
ebc7d6d8ff2512a1e8bc799f887716d88b671e85 07-Feb-2014 Hemant Gupta <hemantg@codeaurora.org> Bluetooth-OPP: Handle HID mouse right click event

This change will handle mouse right click event to display only
context menu with options Open and Clear. Otherwise, during HID mouse
right click two popup will be displayed context menu and Open option
while selecting context menu, option app crash is observed.

Change-Id: I8328f87f9c4bc007cd46a5567268621499e35343
pp/BluetoothOppTransferHistory.java
e19c9bbf0157891af875c9613591801e3ec04ad2 30-Apr-2014 Zhihai Xu <zhihaixu@google.com> am 1e5ccec7: am f0362f25: am b398dad1: Merge "Improve sending web link with Bluetooth"

* commit '1e5ccec7481ef41cb31b8d50cbd3e9dd624c91f1':
Improve sending web link with Bluetooth
1e5ccec7481ef41cb31b8d50cbd3e9dd624c91f1 30-Apr-2014 Zhihai Xu <zhihaixu@google.com> am f0362f25: am b398dad1: Merge "Improve sending web link with Bluetooth"

* commit 'f0362f2538cae32d5e24afed609a813d99e33143':
Improve sending web link with Bluetooth
f0362f2538cae32d5e24afed609a813d99e33143 30-Apr-2014 Zhihai Xu <zhihaixu@google.com> am b398dad1: Merge "Improve sending web link with Bluetooth"

* commit 'b398dad1e5dbd0e4724fedbcb694cd62cba02573':
Improve sending web link with Bluetooth
278ca5fcf7f9595521a4f722abd9b4785c70e265 08-Apr-2011 Mathias Jeppsson <mathias.jeppsson@sonyericsson.com> Improve sending web link with Bluetooth

When sending web link from Google maps app, link cannot be used by
receiver as maps app will send extra text in addition to web link.

Improve the creation of html so that only the web link is
interpreted as a link.

Code is partly copied from MessageView class in the email app.

Change-Id: Idb093cc3d5af5fa6b85649d194fa6dc0c6fdfd1e
pp/BluetoothOppLauncherActivity.java
d93e1487863468898b752d54b07dcd4e0661c113 18-Apr-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Add transport param to Connect APIs

Support for passing preferred transport for GATT connections as part of
Connect APIs

Change-Id: Ibeafb922aec954d1f2e693b422e264fbc87468f2
att/GattService.java
5d56b57b6fac07125f5462a6ed3dd3b1a546541b 15-Mar-2014 Sunny Kapdi <sunnyk@codeaurora.org> MHF: Start DIALING_OUT_TIMEOUT for correct device

When processing Dial request, start DIALING_OUT_TIMEOUT
timer for correct matching device.
Also add null check for device retrieved from
getDeviceForMessage()

Change-Id: Id9946c6b91ca1b23a24dfe408a81db25b9dfb86a
CRs-Fixed: 612278
fp/HeadsetStateMachine.java
1b1780bd64223ee4cc4103b75316ccc0745cbcc5 15-Mar-2014 Sunny Kapdi <sunnyk@codeaurora.org> MHF: Broadcast connected state for HS

- Since telephony doesn't store list of connected HS, BT needs
to broadcast connected state for an already connected HS,
when other HS disconnects. This will notify telephony that
even though one HS is disconnected, but still there is one
other connected HS. This fixes call routing issue to BT HS
from phone UI.

- Set mActiveScoDevice to null when HS disconnects while
it has SCO connected for ongoing call.

Change-Id: I91aba22844938b61afc0bac52b5b6de95354f491
CRs-Fixed: 619841
fp/HeadsetStateMachine.java
69d4ca45a25e86823fbdb754ca6a3995f8131d59 15-Mar-2014 Nitin Srivastava <nitinsr@codeaurora.org> Multi HF support

1. Added support for Multi HF connections
in Bluetooth application.
2. All connection transition states for
2nd HS onwards is handled in new state-
MultiHFPending.
3. The changes are done to handle proper
state transition for all connected HS.

Change-Id: I033ae57943e50273f9d3cac4c5f8d1624cb9ee09
tservice/AdapterService.java
fp/AtPhonebook.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
5f1aaa0fc4fc7e94c4f67de35a35ec6ca5ad9ec9 03-Feb-2014 Nitin Srivastava <nitinsr@codeaurora.org> BT: HDP: Add NULL check in cleanupApps

Add NULL check for profile Apps data before accessing
them during cleanup.

Change-Id: Iebc6dc0399ed3d77078962b50550d3080a82644f
dp/HealthService.java
3f4dc8e00f57579f5b57726929f1d34260a77cd1 29-Apr-2014 Bill Yi <byi@google.com> Merge commit 'b8bd4924c6de7333a08294a7d20d065e7b7a6f31' into HEAD
e40925fc889d7f9dfc2a12c8165086cc7c312cc6 25-Sep-2013 Zhihai Xu <zhihaixu@google.com> Bluetooth: Added Shared Preferences to restore tethering preference

Added a Shared Preferences to have the tethering preference persist,
The value is stored while changing the tethering preference by user
and tethering preference will be restored based on the value(last
saved tethering preference) while starting the PAN service.
from QCOM
Change-Id: I468564a51ff17dfdf1b95a532fa429477db0da15
an/PanService.java
ca2a13ee25488f913766081e42daa2dce85d75aa 13-Dec-2013 Hemant Gupta <hemantg@codeaurora.org> Bluetooth-OPP: Enable support to send same file multiple times

Change will add support to send same file multiple times. Otherwise,
if same file is selected to send multiple times after first transfer
succeeds queued instances of the same file got removed and it fails
to be sent.

Change-Id: Ic5b3706644a417cae2491d1df9588a22344f1711
pp/BluetoothOppManager.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppUtility.java
90d9ea96c0b0f3209dc03667e21d14a13ca1f614 06-Feb-2014 Hemant Gupta <hemantg@codeaurora.org> PBAP: Fix search by number issue for contacts.

Fix String outofbounds exception while searching
contacts by NUMBER Search attribute.

Change-Id: Ib82cc138c1fa17c68751eb124114e1f8c2c83324
bap/BluetoothPbapObexServer.java
4ffed8e8fbde75ab5151cce325acf2a636e09c8f 09-Feb-2014 Hemant Gupta <hemantg@codeaurora.org> Bluetooth: Map: Trim folder name in pushMessage and setPath

Trim folder name string passed from remote, before processing the
pushMessage and setPath request to do proper handling when a blank
folder name is passed from some Carkits. Without this change there
will be some IOT issues with some carkit(s) which will append a space
instead of empty string for pushing message to current folder.

Change-Id: I8b0bdfc1f837c53f0773057db27b81ae9acb279a
ap/BluetoothMapObexServer.java
130969d18eadbd94361fe95bf16b8131cdea6168 09-Dec-2013 Hemant Gupta <hemantg@codeaurora.org> PBAP: Compare Name and ID both for getting vcard by number

This change will add a ID comparison along with the
Name before writing the final vcard entry when we get
the list through getContactsNamesByNumber
to avoid providing the vcard having the same name but
different numbers.

Change-Id: Ie2e1567a784cd3d872495a029fce6b51a39de993
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapVcardManager.java
849da7cd88ec65cb153e9d81d3e2ea78418ba181 17-Feb-2014 Nitin Srivastava <nitinsr@codeaurora.org> BT: HFP: Set VR flags to false when HS disconnects

When a HS is disconnected while in VR session and then
reconnected again, VR attempt from HS fails as VR flags
mVoiceRecognitionStarted and mWaitingForVoiceRecognition
were not reset to false when HS disconnected.

Change-Id: I008f01393a5529f63cd8392401e1402a9afe70a8
fp/HeadsetStateMachine.java
9063719ccd0a0b6fc6485393f88336124d399ef6 25-Mar-2014 Zhihai Xu <zhihaixu@google.com> LE: Add API to configure MTU for a given connection (4/4)
this patch is from broadcom(andre)
bug:13571470
Change-Id: I4faf13f3daa535337b721a8b48e92334ed0ecb7c
att/GattService.java
307c977d7381ab2d6c6b8f2c1fdbfe756547ad1b 29-Jan-2014 Ariel Gertzenstein <agertzen@google.com> DO NOT MERGE Avoid race condition that gets PanService stuck in STATE_DISCONNECTED.

http://b/12788418

Change-Id: I7cc43db047457eb6a4ac501770a714eef0ed6422
an/PanService.java
0de40c51768ecb06d628b6ec1d731ffaaa4af662 10-Apr-2014 zzy <zhenye@broadcom.com> am 93bbeea2: DO NOT MERGE: Exit bt process after cleanup

* commit '93bbeea23b6e974554eba6337d758f70c3314d06':
DO NOT MERGE: Exit bt process after cleanup
93bbeea23b6e974554eba6337d758f70c3314d06 04-Mar-2014 zzy <zhenye@broadcom.com> DO NOT MERGE: Exit bt process after cleanup

Added code to exit bt process and avoid android process caching.
The fix also gives end user a chance to recover a bad state bt process by
simply turning off/on the bluetooth. Since the process is not recycled,
the kernel frees up all leftover fd and memory and gives bt process a fresh start every time.
Addresses b/13912278

Change-Id: I616345da70bb60f1aeaab151a6bf6f793168a829
tservice/AdapterService.java
e296684eab2bf622ff27cb1b3cd3008e919dfe30 31-Mar-2014 Christian Hanner <christian3.hanner@sonymobile.com> Use round() instead of ceil() in calculation of a2dp vol slider position

The avrcp MESSAGE_VOLUME_CHANGED requests volumes in the range 0-127. In
convertToAudioStreamVolume() this value is scaled to a (typically much
smaller, e.g. 0-15) integer value representing the volume slider step to
be presented in the UI. Depending on the resolution in the volume
requests from the a2dp device and the resolution of the UI volume
slider, some of the requested volumes might be mapped onto the same
UI slider positions. If ceil() is exchanged for round() in
convertToAudioStreamVolume() the problem with double mapped volumes
vanishes in most realistic cases.

Change-Id: I89d9ac4b8c330fd4fd2a02984bd628961f2cb035
2dp/Avrcp.java
a785b23c7756a65d5836787251f04e521800157c 08-Apr-2014 Matthew Xie <mattx@google.com> am 7d599189: am b9c0706b: Merge "Bluetooth: Make Bonded device list operations are synchronous"

* commit '7d599189869be67ba2b74b6e0729be74ffbe0b74':
Bluetooth: Make Bonded device list operations are synchronous
e187e2798dc2551068c8a0dd38caaa5a7cbf862b 08-Apr-2014 Matthew Xie <mattx@google.com> am 010b179c: am 5aace9b6: Merge "MAP: Fix MMS pushMessage from OUTBOX to SENT folder"

* commit '010b179cdad1ecc9940b771698d0af90518596d1':
MAP: Fix MMS pushMessage from OUTBOX to SENT folder
7d599189869be67ba2b74b6e0729be74ffbe0b74 08-Apr-2014 Matthew Xie <mattx@google.com> am b9c0706b: Merge "Bluetooth: Make Bonded device list operations are synchronous"

* commit 'b9c0706b00f64a59911a5ac63e3f609dabebc284':
Bluetooth: Make Bonded device list operations are synchronous
010b179cdad1ecc9940b771698d0af90518596d1 08-Apr-2014 Matthew Xie <mattx@google.com> am 5aace9b6: Merge "MAP: Fix MMS pushMessage from OUTBOX to SENT folder"

* commit '5aace9b695c57beffb53c16f4426319baeb79900':
MAP: Fix MMS pushMessage from OUTBOX to SENT folder
b9c0706b00f64a59911a5ac63e3f609dabebc284 08-Apr-2014 Matthew Xie <mattx@google.com> Merge "Bluetooth: Make Bonded device list operations are synchronous"
5aace9b695c57beffb53c16f4426319baeb79900 08-Apr-2014 Matthew Xie <mattx@google.com> Merge "MAP: Fix MMS pushMessage from OUTBOX to SENT folder"
cfaffa85e4a5388f3591bb17f88fc7768676eae2 11-Mar-2014 Andres Morales <anmorales@google.com> Making Bluetooth OPP file transfer intent generic

In the process of adding Wifi as a transport for Beam,
the only consumer of this code as of yet. Need to decouple
the file transfer events from the bluetooth stack to be able
to cleanly reuse them in the wifi code.

Change-Id: I9dafe4f6756bf429b4770826c46d41330a334493
pp/Constants.java
28eff1a17b1e60f985f841faadde6420bf0d001f 12-Mar-2014 Wei Wang <weiwa@google.com> DO NOT MERGE: Add status callback for start/stop advertising.
cherrypick from master.

Change-Id: I666969442b756ce461ff64eff0d09f5283431fb3
att/GattService.java
1498ea75bf38641b6f1938e57d7e550b33eecb7a 31-Mar-2014 Andre Eisenbach <andre@broadcom.com> am a207e911: am 66275876: LE: Add API to configure MTU for a given connection (4/4)

* commit 'a207e911bf5bab8c1a6c3e3e059bca090b01aec2':
LE: Add API to configure MTU for a given connection (4/4)
a207e911bf5bab8c1a6c3e3e059bca090b01aec2 31-Mar-2014 Andre Eisenbach <andre@broadcom.com> am 66275876: LE: Add API to configure MTU for a given connection (4/4)

* commit '662758761424473da90573de5fed1b686ce9ba0e':
LE: Add API to configure MTU for a given connection (4/4)
8bde40eb58d7a6526a2e59dd375bf62bb9eb006b 31-Mar-2014 Matthew Xie <mattx@google.com> am eec38f41: am 2ce3e327: Merge "MAP: Handle MessageListing empty folder name if set to current path."

* commit 'eec38f41c44410c35e1c7b2f7de544bd85b55736':
MAP: Handle MessageListing empty folder name if set to current path.
eec38f41c44410c35e1c7b2f7de544bd85b55736 31-Mar-2014 Matthew Xie <mattx@google.com> am 2ce3e327: Merge "MAP: Handle MessageListing empty folder name if set to current path."

* commit '2ce3e327bcebb56be8a286da9c8a7c3974f36b64':
MAP: Handle MessageListing empty folder name if set to current path.
2ce3e327bcebb56be8a286da9c8a7c3974f36b64 31-Mar-2014 Matthew Xie <mattx@google.com> Merge "MAP: Handle MessageListing empty folder name if set to current path."
662758761424473da90573de5fed1b686ce9ba0e 25-Mar-2014 Andre Eisenbach <andre@broadcom.com> LE: Add API to configure MTU for a given connection (4/4)

bug:13571470
Change-Id: I4faf13f3daa535337b721a8b48e92334ed0ecb7c
att/GattService.java
b8bd4924c6de7333a08294a7d20d065e7b7a6f31 20-Mar-2014 Wei Wang <weiwa@google.com> am e3c4ef80: am 24dce607: DO NOT MERGE: Add status callback for start/stop advertising. cherrypick from master to fix b/13289050

* commit 'e3c4ef80690ff1389367806fcbafaaf019d0f5ca':
DO NOT MERGE: Add status callback for start/stop advertising. cherrypick from master to fix b/13289050
9c628cea53773c6290b665b8f427575310a010dc 20-Mar-2014 Wei Wang <weiwa@google.com> am 93cb7b67: am e3c4ef80: am 24dce607: DO NOT MERGE: Add status callback for start/stop advertising. cherrypick from master to fix b/13289050

* commit '93cb7b670a886fb12150c683469ad48b0e55176d':
DO NOT MERGE: Add status callback for start/stop advertising. cherrypick from master to fix b/13289050
93cb7b670a886fb12150c683469ad48b0e55176d 20-Mar-2014 Wei Wang <weiwa@google.com> am e3c4ef80: am 24dce607: DO NOT MERGE: Add status callback for start/stop advertising. cherrypick from master to fix b/13289050

* commit 'e3c4ef80690ff1389367806fcbafaaf019d0f5ca':
DO NOT MERGE: Add status callback for start/stop advertising. cherrypick from master to fix b/13289050
24dce60783d85fbf49f550203a383b2f4a171a52 12-Mar-2014 Wei Wang <weiwa@google.com> DO NOT MERGE: Add status callback for start/stop advertising.
cherrypick from master to fix b/13289050

Change-Id: I666969442b756ce461ff64eff0d09f5283431fb3
att/GattService.java
0312f2b5c02e472eca2a91c93d465f81a3c6fc3d 19-Mar-2014 Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> HFP: Fix missing OK for AT+CLCC in virtual call

When AT+CLCC is received from HF while we're in virtual call mode there
is only non-zero index call sent without final zero index call. This
makes AT command response incomplete since no OK is sent.

From HFP specification, section 4.31.1:
"The AG shall always send OK response to HF."

Change-Id: I2d759bd3d65f2adb9a364d40ffe23d6197c6375b
fp/HeadsetStateMachine.java
c3b5ffdc43d7370d5e18a25db901f7b9e2dc59d2 12-Mar-2014 Wei Wang <weiwa@google.com> Add status callback for start/stop advertising.
Fixes b/13418851, b/13289050.

Change-Id: I666969442b756ce461ff64eff0d09f5283431fb3
att/GattService.java
14b5e0d58b96d48db7dd5decee1efd0a69084fcb 14-Mar-2014 Zhihai Xu <zhihaixu@google.com> am 5bae8a40: am 969f4932: Merge "DO NOT MERGE release wakelock if no activity in Bluetooth MAP profile to avoid waste power." into klp-dev

* commit '5bae8a40e40e00b84750186309b6f30036c20186':
DO NOT MERGE release wakelock if no activity in Bluetooth MAP profile to avoid waste power.
4a272ffb0148ba02d1f83ec103104a5e9043a99c 11-Mar-2014 Matthew Xie <mattx@google.com> am 422d5b01: Merge "Avoid race condition that gets PanService stuck in STATE_DISCONNECTED."

* commit '422d5b0126fb072a657bb9bd268251bc1cb6fb6e':
Avoid race condition that gets PanService stuck in STATE_DISCONNECTED.
f89cb15152c4d19db35462583d79eda669c0c87d 11-Mar-2014 Matthew Xie <mattx@google.com> am 27385b9b: Merge "PBAP: Remove initialisation of Missed calls number"

* commit '27385b9b93a06862fed92f7260416276dbbbfa66':
PBAP: Remove initialisation of Missed calls number
cf295c3744f4ec77bb0b1fad1c6558ee5ce7313f 11-Mar-2014 Matthew Xie <mattx@google.com> am 429460a8: Merge "OPP: Handle intent receiver leak for BT TURN OFF."

* commit '429460a8ec5a1e0a7dc011acb80d3826b01b1936':
OPP: Handle intent receiver leak for BT TURN OFF.
7718f33abcc44702f234ce5cdc87e8040812a0df 11-Mar-2014 Matthew Xie <mattx@google.com> am 4a57bce1: Merge "MAP: Set Empty name or address for unknown values in GetMessageListing."

* commit '4a57bce1779e7dcd502dcbb64e7e121a700ba258':
MAP: Set Empty name or address for unknown values in GetMessageListing.
1b5a93a868272990d0206875f54ba150e6e7c08b 11-Mar-2014 Matthew Xie <mattx@google.com> am 77b9e56b: Merge "Bluetooth: Update Signal strength"

* commit '77b9e56ba1dc3eadf39c46b470552031383e6786':
Bluetooth: Update Signal strength
6024e17f1e9cc9c03f40347b6677d5006f63c183 10-Mar-2014 kschulz <k.schulz@samsung.com> am b140b007: am 6d4c5c8b: DO NOT MERGE MAP: fixed missing filtering on Priority

* commit 'b140b007f98f38b1365c26af2472d1ed5b8a46ee':
DO NOT MERGE MAP: fixed missing filtering on Priority
bda98633f8453ba9e8f96a06c8b724f6d662679b 10-Mar-2014 Zhihai Xu <zhihaixu@google.com> am 8872c350: am d3195daf: DO NOT MERGE update play status based on A2dp audio state from stack.

* commit '8872c350993db08bf1c58ba39a94087fc2df16b1':
DO NOT MERGE update play status based on A2dp audio state from stack.
569452aa91d43eaabe120f6de5bf8d613c574e3a 10-Mar-2014 Matthew Xie <mattx@google.com> am e7668dda: am 422d5b01: Merge "Avoid race condition that gets PanService stuck in STATE_DISCONNECTED."

* commit 'e7668dda0cd1f16e4161e6f0a64c685efc1ed25d':
Avoid race condition that gets PanService stuck in STATE_DISCONNECTED.
e7668dda0cd1f16e4161e6f0a64c685efc1ed25d 10-Mar-2014 Matthew Xie <mattx@google.com> am 422d5b01: Merge "Avoid race condition that gets PanService stuck in STATE_DISCONNECTED."

* commit '422d5b0126fb072a657bb9bd268251bc1cb6fb6e':
Avoid race condition that gets PanService stuck in STATE_DISCONNECTED.
422d5b0126fb072a657bb9bd268251bc1cb6fb6e 10-Mar-2014 Matthew Xie <mattx@google.com> Merge "Avoid race condition that gets PanService stuck in STATE_DISCONNECTED."
98dde68aa7cf3b63683fa5cbd70b11623a29a90f 27-Nov-2013 Zhihai Xu <zhihaixu@google.com> DO NOT MERGE release wakelock if no activity in Bluetooth MAP profile to avoid waste power.

bug:11138488
Change-Id: Ie7d8903cc917aee51711fa47f275863e4046f3d8
ap/BluetoothMapObexServer.java
ap/BluetoothMapService.java
ap/BluetoothMnsObexClient.java
6d4c5c8befa3e585271ed4db770dd6990827d1f0 11-Oct-2013 kschulz <k.schulz@samsung.com> DO NOT MERGE MAP: fixed missing filtering on Priority

FilterPriority was ignored in the code as SMS does not have priority.
This fixes the support for the priority filter for sms + mms.
NOTICE: sms messages does not have priority and hence will return
an empty messagelisting if the client requests a list with priority
filter set til high-pri only.

Bug: 11168636
Change-Id: If028e47850323d20d1e9a23bc947782ae8da1df0
ap/BluetoothMapContent.java
d3195daf68329036df6a01331b466844b5cb29de 08-Jan-2014 Zhihai Xu <zhihaixu@google.com> DO NOT MERGE update play status based on A2dp audio state from stack.

this is to work around the problem:some video/audio player didn't
update the play status by calling setPlaybackState.
The headset(HBS730) register the play status update on the phone.
It will depend the play status reported from the phone to send
play or pause command.

bug:11325212
Change-Id: I7fde5960edd4a5b3474fa17456aacd5b4b432d4d
2dp/A2dpService.java
2dp/A2dpStateMachine.java
2dp/Avrcp.java
ca9674c0f223a5bab5c6750594fd7ee76811771f 08-Mar-2014 Wei Wang <weiwa@google.com> am b285350d: am b9703de9: Merge "DO NOT MERGE BLE peripheral mode (2/4): Gatt Service Change." into klp-dev

* commit 'b285350d6580a118940a0f7d62857a199e362283':
DO NOT MERGE BLE peripheral mode (2/4): Gatt Service Change.
b9703de9f4892341e2a1f5ea1908aed19018569f 08-Mar-2014 Wei Wang <weiwa@google.com> Merge "DO NOT MERGE BLE peripheral mode (2/4): Gatt Service Change." into klp-dev
b8183f71183a43c6917e91b10139c5a2daec4a04 07-Mar-2014 Mike J. Chen <mjchen@google.com> am a1d2ed87: am e3805c61: Merge "Add handshake callback support" into klp-modular-dev

* commit 'a1d2ed879c917f47d11c9462e4d9e35c9a0f68f2':
Add handshake callback support
a1d2ed879c917f47d11c9462e4d9e35c9a0f68f2 07-Mar-2014 Mike J. Chen <mjchen@google.com> am e3805c61: Merge "Add handshake callback support" into klp-modular-dev

* commit 'e3805c6144038207bc72654bd250054e5821c373':
Add handshake callback support
4a9c5ce6029d7fb06b8564a761f6bea5975d74f8 07-Mar-2014 Zhihai Xu <zhihaixu@google.com> am abce10c9: am e061a83b: Device cannot go to sleep while connected to HBM-570 BT headset

* commit 'abce10c9731e65ca11e6d5a80094bbd1bf1313fa':
Device cannot go to sleep while connected to HBM-570 BT headset
004550da492fb000ab08b6324558c1e4cbd383d4 29-Jan-2014 Srinu Jella <sjella@codeaurora.org> Bluetooth: Make Bonded device list operations are synchronous

Change the bonded device list to CopyOnWriteArrayList,to take
care of concurrent add/delete operations to the bonded device
list.

Change-Id: Ia4de2d35f2e30d6407716d0e60dc3bf4d05a2ac5
tservice/AdapterProperties.java
873b8064cca4d0f32808842a39e54e305dd5b410 30-Oct-2013 Wei Wang <weiwa@google.com> DO NOT MERGE BLE peripheral mode (2/4): Gatt Service Change.

Add advertising data to Gatt Service/

Cherry picking ble advertising changes from master to KLP MR2.
b/13137996

Change-Id: I0ea7df8c159ad388d8e58768c49e785e9a4694bb
tservice/AdapterService.java
tservice/ProfileService.java
att/GattService.java
att/HandleMap.java
att/ServiceDeclaration.java
e061a83b8cbd872cd9f0fea33717aa57112e6228 14-Oct-2013 Zhihai Xu <zhihaixu@google.com> Device cannot go to sleep while connected to HBM-570 BT headset

The headset never disconnect the Obex connection for PBAP,
so in this case, we never release the wakelock.
Our PBAP implementation won't release wakelock
until the Obex is disconnected by the remote device
To better control the wake lock, we should
only acquire the wakelock when we receive the reqeust from the remote device
will release the wakelock after we send the response packets.

bug:10957699
Change-Id: I85e0609e36788d9c36334dd804ec52c90b90615b
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
ed0c6ae1773ad1f4249fe3cf7447d7033195f222 29-Jan-2014 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Fix MMS pushMessage from OUTBOX to SENT folder

Fix content type value for MMS pushMessage
from MAP to OUTBOX to be successfully SENT over
network and listed in SENT folder.

Change-Id: I068619481355c19716627fef434f1f80bd2c2d23
ap/BluetoothMapContentObserver.java
448965010ed4fbaf546cc355d1766198f70c21fb 07-Jan-2014 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Handle MessageListing empty folder name if set to current path.

Check if destination folder is already setpath while processing
GetMessageListing Request for empty folderName.

Change-Id: I4ecd87264140fd347c71b428e3c4dffec3f91d48
ap/BluetoothMapObexServer.java
3a04c35ba5f723ee4a6e1f1c37514691ebd1447d 05-Mar-2014 Mike J. Chen <mjchen@google.com> Add handshake callback support

Change-Id: I7619e6e2ac3589ffa5e0b70e4b28e536c886ce02
Signed-off-by: Mike J. Chen <mjchen@google.com>
id/HidService.java
3b8e00b61402bde1d3d179087f030ea7ccd82135 04-Mar-2014 zzy <zhenye@broadcom.com> Exit bt process after cleanup

Added code to exit bt process and avoid android process caching.
The fix also gives end user a chance to recover a bad state bt process by
simply turning off/on the bluetooth. Since the process is not recycled,
the kernel frees up all leftover fd and memory and gives bt process a fresh start every time.

Change-Id: I616345da70bb60f1aeaab151a6bf6f793168a829
tservice/AdapterService.java
9cda136cdea45d0e0d1cbdcd1bc073bc7d018fa0 25-Feb-2014 Matthew Xie <mattx@google.com> Merge "MAP: protected misspelled in message listing encoder"
22545e23dcec98dbc43e914c903c6a98ab08b1aa 05-Feb-2014 Kim Schulz <k.schulz@samsung.com> MAP: protected misspelled in message listing encoder

The keyword protected was misspelled in the message listing encoder.
Solution: change to protected.

The typo corrected.

Change-Id: I099a79a0076e297cfb89545910c750d4e074c3db
Bug: 12915358
ap/BluetoothMapMessageListingElement.java
0053efa4b58c3e5815a500bd719c5018e7e87852 04-Feb-2014 Kim Schulz <k.schulz@samsung.com> MAP: Empty parameter mask handled wrong

If an empty parameter mask is set in a get message listing request
we only returned the handles, where as the spec states that we
should return all parameters.

Solution: Set the parameter filter to 0xFFFF if it is omitted or 0.

Change-Id: I2cb99569c0920c706c0d3b3ed269852471cb1ee6
Bug: 12915453
ap/BluetoothMapAppParams.java
ap/BluetoothMapContent.java
e1bc19b7d99f2a29c305a8e4bb75969a66783def 24-Feb-2014 Matthew Xie <mattx@google.com> am 27385b9b: Merge "PBAP: Remove initialisation of Missed calls number"

* commit '27385b9b93a06862fed92f7260416276dbbbfa66':
PBAP: Remove initialisation of Missed calls number
2e48689248aa50003ef648b12bf36f8c7e9dbd8c 24-Feb-2014 Matthew Xie <mattx@google.com> am 429460a8: Merge "OPP: Handle intent receiver leak for BT TURN OFF."

* commit '429460a8ec5a1e0a7dc011acb80d3826b01b1936':
OPP: Handle intent receiver leak for BT TURN OFF.
b3abf4e52a7045f914f88d07670c0d2fb231a75d 24-Feb-2014 Matthew Xie <mattx@google.com> am 4a57bce1: Merge "MAP: Set Empty name or address for unknown values in GetMessageListing."

* commit '4a57bce1779e7dcd502dcbb64e7e121a700ba258':
MAP: Set Empty name or address for unknown values in GetMessageListing.
d08f6a6e926d7c9057c67b39ffabcdac04819586 24-Feb-2014 Matthew Xie <mattx@google.com> am 77b9e56b: Merge "Bluetooth: Update Signal strength"

* commit '77b9e56ba1dc3eadf39c46b470552031383e6786':
Bluetooth: Update Signal strength
27385b9b93a06862fed92f7260416276dbbbfa66 24-Feb-2014 Matthew Xie <mattx@google.com> Merge "PBAP: Remove initialisation of Missed calls number"
429460a8ec5a1e0a7dc011acb80d3826b01b1936 24-Feb-2014 Matthew Xie <mattx@google.com> Merge "OPP: Handle intent receiver leak for BT TURN OFF."
4a57bce1779e7dcd502dcbb64e7e121a700ba258 24-Feb-2014 Matthew Xie <mattx@google.com> Merge "MAP: Set Empty name or address for unknown values in GetMessageListing."
28c90ba40b2bfd572860600d18e3dd3e2770e635 27-Nov-2013 Smriti Gupta <smritig@codeaurora.org> PBAP: Remove initialisation of Missed calls number

Thic change will remove initialisation of Missed calls number
at the time of connection as NewMissedCall number indicates the
number of missed calls that have been received on the PSE since
the last PullPhoneBook request on the mch folder, at the point
of the request.

Change-Id: I5f769011a34cfe8e7225fca646a58451639dcfa5
bap/BluetoothPbapObexServer.java
0487333556262f47feaa3f931d5a5c123386dd23 21-Nov-2013 Ashwini Munigala <AshwiniM@codeaurora.org> MAP: Set Empty name or address for unknown values in GetMessageListing.

Set Empty sender or recipient name and address values to indicate
info not available from MSE in GetMessageListing response.
Current implemenation to skip the entire feild in response doesnot
mark the uniformity for values being fetched from telephony or
phone book databases.

Change-Id: I44e2f61572607349ec20ec1efcc6c44abe084b83
ap/BluetoothMapContent.java
275aaa55584ba62ab176a30cdabc432a6ff875d2 03-Oct-2013 Ashwini Munigala <AshwiniM@codeaurora.org> OPP: Handle intent receiver leak for BT TURN OFF.

Mark INBOUND and OUTBOUND active transfer as cancelled
on BT TURN OFF.

Change-Id: I52e6d59ba56e004af2dc25b85975dfeb6c19320a
pp/BluetoothOppService.java
ff44cbb06dcc8e1d0cbb346e0ea4af612ab2b33e 30-Nov-2013 Nitin Srivastava <nitinsr@codeaurora.org> Bluetooth: Update Signal strength

This change makes sure that signal
strength is updated properly when
there is no network service.

Change-Id: I8f2e9fedc4ac6f0d039c55d8211ed96fbe25317d
fp/HeadsetPhoneState.java
3ec105beaebd4d6abea80b52206b11032ab4f33c 29-Jan-2014 Sharvil Nanavati <sharvil@google.com> Avoid race condition that gets PanService stuck in STATE_DISCONNECTED.

http://b/12788418

Change-Id: I7cc43db047457eb6a4ac501770a714eef0ed6422
an/PanService.java
b8e4250de151551d5dacca895e62761355839d7d 28-Jan-2014 Mike J. Chen <mjchen@google.com> HID: Hookup get_report_callback and return to Java via broadcast

Change-Id: I5ee7ea72935834ba8a19f7933bb92b8a0a24ba62
Signed-off-by: Mike J. Chen <mjchen@google.com>
id/HidService.java
0f496823a3529298cc3c16013ecc596a39f1659a 10-Jan-2014 Zhihai Xu <zhihaixu@google.com> Merge "update play status based on A2dp audio state from stack."
1edaf3d30ddcecf2f77bbfd880b6e4a7acb7a2c1 10-Jan-2014 Zhihai Xu <zhihaixu@google.com> Merge "fix incorrect track position reported from BT AVRCP"
aa6c1cb7f08a5d1fe2c878b587c62cf4dbb6ee8f 08-Jan-2014 Zhihai Xu <zhihaixu@google.com> fix incorrect track position reported from BT AVRCP

when music player continuously update playing state
with invalid play postion -1 during playing,
The track postion are not changed correcly.

bug:11377223
Change-Id: Ie4cecfe7757cb92fc96ea49a7442a9d0bd9fc63a
2dp/Avrcp.java
188f205b5f093850d4cc627917a21204be36c56a 08-Jan-2014 Zhihai Xu <zhihaixu@google.com> update play status based on A2dp audio state from stack.

this is to work around the problem:some video/audio player didn't
update the play status by calling setPlaybackState.
The headset(HBS730) register the play status update on the phone.
It will depend the play status reported from the phone to send
play or pause command.

bug:11325212
Change-Id: I7fde5960edd4a5b3474fa17456aacd5b4b432d4d
2dp/A2dpService.java
2dp/A2dpStateMachine.java
2dp/Avrcp.java
6824a77ac3c760bb713aca66220704949c0b0866 07-Jan-2014 Zhihai Xu <zhihaixu@google.com> Merge " isA2dpPlaying() reports wrong playing state when suspended"
fe32e48d4129a3950f3a33f0ab443649b29205fb 07-Jan-2014 Zhihai Xu <zhihaixu@google.com> isA2dpPlaying() reports wrong playing state when suspended

bug:12412483
Change-Id: I1cf209479581bf28fc1ebdc462f552b8ec270520
2dp/A2dpStateMachine.java
a08fff0ae81757bdab00ae8865a906c711d5572f 30-Oct-2013 Wei Wang <weiwa@google.com> BLE peripheral mode (2/4): Gatt Service Change.

Change-Id: I0ea7df8c159ad388d8e58768c49e785e9a4694bb
tservice/AdapterService.java
tservice/ProfileService.java
att/GattService.java
att/HandleMap.java
att/ServiceDeclaration.java
daaec40bbe227e6ee735da947afc72777f66c65d 18-Dec-2013 Zhihai Xu <zhihaixu@google.com> Merge "Device cannot go to sleep while connected to HBM-570 BT headset"
68c3d0efab4ad40abd13ff015a6a92bd60a4bd85 18-Dec-2013 Zhihai Xu <zhihaixu@google.com> Merge "release wakelock if no activity in Bluetooth MAP profile to avoid waste power."
a871a846ce37339a05fdf64b26bda0dc5bb6d565 17-Dec-2013 Zhihai Xu <zhihaixu@google.com> MAP: make MMS parsing more robust

Some devices are not following the specs correctly and send plan-text as MMS without the right headers.
This patch makes the MMS parser more robust against faulty MMS messages.
Bug: 11161383

Change-Id: Ib891f3cdc810d32082b3afe93ca18df4fcbff1be
ap/BluetoothMapObexServer.java
8fa8d120e86c7488616cc7f7310843f15278b5d9 14-Oct-2013 Zhihai Xu <zhihaixu@google.com> Device cannot go to sleep while connected to HBM-570 BT headset

The headset never disconnect the Obex connection for PBAP,
so in this case, we never release the wakelock.
Our PBAP implementation won't release wakelock
until the Obex is disconnected by the remote device
To better control the wake lock, we should
only acquire the wakelock when we receive the reqeust from the remote device
will release the wakelock after we send the response packets.

bug:10957699
Change-Id: I85e0609e36788d9c36334dd804ec52c90b90615b
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
c09b531ba47eee740485b0c6022981fc38ef1587 27-Nov-2013 Zhihai Xu <zhihaixu@google.com> release wakelock if no activity in Bluetooth MAP profile to avoid waste power.

bug:11138488
Change-Id: Ie7d8903cc917aee51711fa47f275863e4046f3d8
ap/BluetoothMapObexServer.java
ap/BluetoothMapService.java
ap/BluetoothMnsObexClient.java
2e7c4d9904b097efe6f07d31af3793b96b4d4e77 10-Oct-2013 Kim Schulz <k.schulz@samsung.com> MAP: make MMS parsing more robust

Some devices are not following the specs correctly and send plan-text as MMS without the right headers.
This patch makes the MMS parser more robust against faulty MMS messages.

Bug: 11161383
Change-Id: If5e59f9daaab4537cfe5d06e6203ae783e311fd3
ap/BluetoothMapContentObserver.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapbMessageMmsEmail.java
14f1f53e829b1d00f6c27618e878b1ebb18df8cc 11-Oct-2013 kschulz <k.schulz@samsung.com> MAP: fixed missing filtering on Priority

FilterPriority was ignored in the code as SMS does not have priority.
This fixes the support for the priority filter for sms + mms.
NOTICE: sms messages does not have priority and hence will return
an empty messagelisting if the client requests a list with priority
filter set til high-pri only.

Bug: 11168636
Change-Id: If028e47850323d20d1e9a23bc947782ae8da1df0
ap/BluetoothMapContent.java
72fb3e13a6090e10c68e91f89553ecc19f5bb3bd 22-Nov-2013 Matthew Xie <mattx@google.com> Merge "enable xml format to transfer/receive over bluetooth"
322480a097a098ac39dd148e8aecc1106d5a3a88 15-Nov-2013 Zhihai Xu <zhihaixu@google.com> am f43652de: am 025c8ec1: Merge "remove a read lock to work around a platform deadlock problem." into klp-dev

* commit 'f43652dec776a22a1306b4392867e2f0b8e855d0':
remove a read lock to work around a platform deadlock problem.
025c8ec1e42ccac17c896809c4e6d2cb90b3c71a 15-Nov-2013 Zhihai Xu <zhihaixu@google.com> Merge "remove a read lock to work around a platform deadlock problem." into klp-dev
50f6cb42218fd50ed2532884d1212e1c9a74c7b2 15-Nov-2013 Zhihai Xu <zhihaixu@google.com> remove a read lock to work around a platform deadlock problem.

remove the lock in getStatefunction to work around a platform
deadlock problem.and also for read access, it is safe to remove
the lock to save CPU power

bug:11655066
Change-Id: Iddc0ada04010d95ae7d5fbc93ab837ebfc025b7a
tservice/AdapterProperties.java
ee6898a4b73d90ebe20bc0218a707d3dc7d6e641 07-Nov-2013 Matthew Xie <mattx@google.com> am e56c70f6: am cd68000c: Merge "cancel device discovery before start pairing process" into klp-dev

* commit 'e56c70f66fc8fd0cbcd97999f6efe187049c062c':
cancel device discovery before start pairing process
cd68000c2c9eb487a4bdb718d966a3246fef4d59 07-Nov-2013 Matthew Xie <mattx@google.com> Merge "cancel device discovery before start pairing process" into klp-dev
9ecfc6cfb40a0af13180905b6930111cfdf01c64 06-Nov-2013 Matthew Xie <mattx@google.com> cancel device discovery before start pairing process

During pairing process, SDP search is needed which cannot be handled
if we are doing device discovery
bug 11294130

Change-Id: Ic025fa3000af4f2d4c2c2ac411d26b6a99ad097c
tservice/AdapterService.java
2a963d9c3c34fa5af76b629160008838317bbb1a 06-Nov-2013 Zhihai Xu <zhihaixu@google.com> am 0b98b993: am 240e2c5c: Merge "FF/REW is not correctly for AVRCP." into klp-dev

* commit '0b98b9933f0a2523ad333136777ef42982afc53a':
FF/REW is not correctly for AVRCP.
240e2c5c8248747f0fac86d173a9161d09093d47 06-Nov-2013 Zhihai Xu <zhihaixu@google.com> Merge "FF/REW is not correctly for AVRCP." into klp-dev
7d4c28ea6a75cf71a6dbb3401bef6982258461c1 06-Nov-2013 Edward Jee <edjee@google.com> am 981c0006: am dedebbfb: Handles AT+BVRA=1 received during an open SCO session.

* commit '981c0006cd7a6a4a786afd73a7a80faf571b6733':
Handles AT+BVRA=1 received during an open SCO session.
dedebbfb6eb1af92f013dedd234c2162cc2ec4be 09-Oct-2013 Edward Jee <edjee@google.com> Handles AT+BVRA=1 received during an open SCO session.

Bug: 11072505
Change-Id: If665517cd9efa087154edd57b23163e7cc098f6f
fp/HeadsetStateMachine.java
4945ac8099eb35112307f94c7c5ea7513f657fd3 05-Nov-2013 Zhihai Xu <zhihaixu@google.com> am 2665ad11: am 9dc561f7: Merge "NPE in bluetooth MAP cause bluetooth process crash" into klp-dev

* commit '2665ad11e9e3794dab5f5591ec0fceafddb2d58d':
NPE in bluetooth MAP cause bluetooth process crash
9dc561f7f13569552a62f771b16fe35dc5b9cd16 02-Nov-2013 Zhihai Xu <zhihaixu@google.com> Merge "NPE in bluetooth MAP cause bluetooth process crash" into klp-dev
19e4c6abe87d6c213e802ecf7af6c1d00e1f4b65 02-Nov-2013 Zhihai Xu <zhihaixu@google.com> FF/REW is not correctly for AVRCP.

While a music is being played, if FF/REW is pressed on the connected device,
it remains in the FF/REW state constantly (on the Porsche / Audi A8 carkit)

bug:11377223
Change-Id: Iee5468308f2786839c3a047c95dfa0a49ef28efb
2dp/Avrcp.java
9679a425747e95082e169b3bd3673ed6b5a27590 31-Oct-2013 Zhihai Xu <zhihaixu@google.com> NPE in bluetooth MAP cause bluetooth process crash

bug:11448104
Change-Id: I30045162c89e2150a9ef476f33e1b322e7cc9a44
ap/BluetoothMnsObexClient.java
2918953346cad7a847f6f17f5934c72256c0bf49 24-Oct-2013 Zhihai Xu <zhihaixu@google.com> am d2e9f926: am 82492947: MAP: fix problem with MNS not disconnecting correctly

* commit 'd2e9f9266d5efe9400ba0bdeca2ea61b8510e3e3':
MAP: fix problem with MNS not disconnecting correctly
824929471ee80476e6d6774eedac9f30c5623eb2 23-Oct-2013 Zhihai Xu <zhihaixu@google.com> MAP: fix problem with MNS not disconnecting correctly

MNS is needed to disconnect with the MSE but did not.
This patch fixes that by re-adding a disconnect() that was wrongfully removed during review.
Patch set 2:
-----------
- Split disconnect and shutdown for MNS connection
bug: 11161674
Change-Id: Idd09fc774584dfdb171b0d00be0f7711ae57b853
ap/BluetoothMapService.java
ap/BluetoothMnsObexClient.java
50f08db8a9100b79d7284406eaf2daae3af6a371 22-Oct-2013 Matthew Xie <mattx@google.com> am 3755cde5: am dce8f102: Merge "Change pairing api/intent permission from PRIVILEGED to ADMIN" into klp-dev

* commit '3755cde5fd20306f3965e7b317e3763640b11b42':
Change pairing api/intent permission from PRIVILEGED to ADMIN
dce8f102f76aeea3356c5416b8ebb5e5c8b5cb22 22-Oct-2013 Matthew Xie <mattx@google.com> Merge "Change pairing api/intent permission from PRIVILEGED to ADMIN" into klp-dev
810c49b2cfece1c48ced464d6bd2509ec4cac7a3 22-Oct-2013 Matthew Xie <mattx@google.com> Change pairing api/intent permission from PRIVILEGED to ADMIN

The APIs are createBond, setPin, setPairingConfirmation
The intent is ACTION_PAIRING_REQUEST
bug 11101076

Change-Id: I3b065ab0348a964bb557e57527491b2f34e68a81
tservice/AdapterService.java
tservice/RemoteDevices.java
1763de2c204a587dcfc04fa4324e415dd070139a 18-Oct-2013 Zhihai Xu <zhihaixu@google.com> am a58a4068: am 311fd8bf: Bluetooth Application Crash while try to pairing with laptop - IKDVXPSE-345

* commit 'a58a4068a42d9b705a2501559c0e8600306ad573':
Bluetooth Application Crash while try to pairing with laptop - IKDVXPSE-345
311fd8bf28c1c16c4da81485b26518c8df97f50b 17-Oct-2013 Zhihai Xu <zhihaixu@google.com> Bluetooth Application Crash while try to pairing with laptop - IKDVXPSE-345

the handleRegistration will never run after we shutdown the handler thread first,
with this change, we can make sure the mObserver will never be null
when call handleRegistration.
bug:11148404

Change-Id: I93b351915b49cf59a7d2026b7d83a68a7e76dd38
ap/BluetoothMnsObexClient.java
ded8689b33b1f345aafeea82b972c8b8cfab09cf 12-Oct-2013 Casper Bonde <c.bonde@samsung.com> am 1d8e1090: am 98df3e8f: Fix for MAP/PBAP: Race-condition when requesting authorization from Settings app

* commit '1d8e1090e1e19520749d906701c1aa27dac41a61':
Fix for MAP/PBAP: Race-condition when requesting authorization from Settings app
98df3e8ff33a6137d4ea13845b583aaee2670613 11-Oct-2013 Casper Bonde <c.bonde@samsung.com> Fix for MAP/PBAP: Race-condition when requesting authorization from Settings app

When MAP and PBAP requests authorization from the Settings app via Intents,
it also sets a state isWaitingForAuthorization to indicate
that it should handle incoming replies.
This is however done in the code after the intent have been sent
and in some cases the reply for the intent is returned
before the state has been update = no handling of the reply.
This only happens on the second connect with a paired device and
only when the user have selected the "do not ask again" checkmark
in the popup requesting access.

FIX:
Move the update of isWaitingAuthorization to before sending the intent to settings

bug: 11179645
Change-Id: I25b019e32a01caa8509c8f97195712120823afa9
ap/BluetoothMapService.java
bap/BluetoothPbapService.java
9b2fbb84ec3d673e337d9bf2927056077739e2f0 10-Oct-2013 Edward Jee <edjee@google.com> am c5253c9d: am c3cbf72f: Allows another GMS core app to handle ACTION_PAIRING_REQUEST .

* commit 'c5253c9d5c66330ea3de51b7232eecb13738f151':
Allows another GMS core app to handle ACTION_PAIRING_REQUEST .
c3cbf72f596c2af659905e06e85a5ac1241610a8 05-Oct-2013 Edward Jee <edjee@google.com> Allows another GMS core app to handle ACTION_PAIRING_REQUEST .

Now we use sendOrderedBroadcast for ACTION_PAIRING_REQUEST , and to
receive this intent, BLUETOOTH_PRIVILEGED is required.

Bug: 11087521
Change-Id: I6aa2fbc6538df39b24f141e7d75adc3658a7e7ac
tservice/RemoteDevices.java
fd0c296a9f6bf6a85acb8597ef480ce21154d40f 10-Oct-2013 Zhihai Xu <zhihaixu@google.com> am 2d4b7b73: am c14e9468: Merge "Remove MMS support from MAP profile" into klp-dev

* commit '2d4b7b7362036e7f864b1d9eeb39d671359e9f7b':
Remove MMS support from MAP profile
c3ec58fcc54cb33635f4dee746ee22cb8b0e3210 10-Oct-2013 Zhihai Xu <zhihaixu@google.com> Remove MMS support from MAP profile

reject to push MMS message, will support it in the future
bug 10296324

Change-Id: Idf2aa081b049e323422223d7b24f6404de2d7184
ap/BluetoothMapContentObserver.java
fbfd55a85870939523665dfd7c24844d3e3c4715 07-Oct-2013 Jean-Michel Trivi <jmtrivi@google.com> am d2b8377f: am ce827197: Merge "Update AVRCP implementation of IRemoteControlDisplay" into klp-dev

* commit 'd2b8377f82a65c76606acbd10802648a378bf673':
Update AVRCP implementation of IRemoteControlDisplay
5a0368956f3314a891766ea005b55329ab6db8fc 04-Oct-2013 Jean-Michel Trivi <jmtrivi@google.com> Update AVRCP implementation of IRemoteControlDisplay

Add implementation of new method in IRemoteControlDisplay.

Bug 8209392

Change-Id: Ic700be5476cb2f70b6a26098cbed3e8e130b3573
2dp/Avrcp.java
58eadb614abc047a20a1c2e3a0e043a19e4e2f14 01-Oct-2013 Matthew Xie <mattx@google.com> am cbfd9612: Merge "Change setPin, setPin, setPairingConfirmation permission level to BLUETOOTH_PRIVILEGED" into klp-dev

* commit 'cbfd961209f35c5183a9dc7ee5d34954e6e32d6e':
Change setPin, setPin, setPairingConfirmation permission level to BLUETOOTH_PRIVILEGED
6763446bce0c0185175dc2526820fb5d6ac5dad1 01-Oct-2013 Zhihai Xu <zhihaixu@google.com> am db72c920: Merge "Unable to receive Text Message to CAR Kit(nuvi3580LM)" into klp-dev

* commit 'db72c9202b6309104b231d166c51c1f7ceca3efa':
Unable to receive Text Message to CAR Kit(nuvi3580LM)
cbfd961209f35c5183a9dc7ee5d34954e6e32d6e 30-Sep-2013 Matthew Xie <mattx@google.com> Merge "Change setPin, setPin, setPairingConfirmation permission level to BLUETOOTH_PRIVILEGED" into klp-dev
8dbf324f8e96fe1623467a72f11412d93564df2b 24-Sep-2013 Matthew Xie <mattx@google.com> Change setPin, setPin, setPairingConfirmation permission level to BLUETOOTH_PRIVILEGED

bug 9987787

Change-Id: I2fe88f4c284d8403d79e08194bf7a720b305d029
tservice/AdapterService.java
01ba103be055c3124d2dabc31d8e65dc7742be49 27-Sep-2013 Matthew Xie <mattx@android.com> am 8cce6da9: Merge "AtPhonebook handleCpbsCommand was incorrectly sending two responses to some requests (one inside the swtich statement, then repeating it after breaking out of the switch statement). This broke phonebook sync with Audi 2G MMI car kit. Signed-off-by:

* commit '8cce6da9099e72000182d1406e7238b8f697ef13':
AtPhonebook handleCpbsCommand was incorrectly sending two responses to some requests (one inside the swtich statement, then repeating it after breaking out of the switch statement). This broke phonebook sync with Audi 2G MMI car kit. Signed-off-by: Nigel Hannam <nigel@hannam.eu>
db72c9202b6309104b231d166c51c1f7ceca3efa 27-Sep-2013 Zhihai Xu <zhihaixu@google.com> Merge "Unable to receive Text Message to CAR Kit(nuvi3580LM)" into klp-dev
8cce6da9099e72000182d1406e7238b8f697ef13 27-Sep-2013 Matthew Xie <mattx@android.com> Merge "AtPhonebook handleCpbsCommand was incorrectly sending two responses to some requests (one inside the swtich statement, then repeating it after breaking out of the switch statement). This broke phonebook sync with Audi 2G MMI car kit. Signed-off-by: Nigel Hannam <nigel@hannam.eu>"
70bfe3280ce158c39dbb25fe18386f0d10b490d3 24-Sep-2013 Zhihai Xu <zhihaixu@google.com> Unable to receive Text Message to CAR Kit(nuvi3580LM)

The problem is when we receive the SetNotificationRegistration,
the MNS thread is not ready yet.so the notification is not enabled.
so we won't send new message notification to Carkit.

bug:10898884

Change-Id: Ibaa4a92694bcbb1ea2fb4e8a3de0ff30acdafeb1
ap/BluetoothMapObexServer.java
ap/BluetoothMapService.java
ap/BluetoothMnsObexClient.java
abf19e783556a93cfdd33468454a309ed347bfc4 25-Sep-2013 Zhihai Xu <zhihaixu@google.com> bluetooth crash caused by read phone book with invalid colummn number -1

bug:10919257
Change-Id: I584d5c5c65e26cacfab227742b98c49282710f68
fp/AtPhonebook.java
107aa9c1c7928ff499a7147699b86920262e1562 20-Sep-2013 Zhihai Xu <zhihaixu@google.com> Merge "resource leakage in bluetooth MAP when empty message in phone." into klp-dev
09b09c15dcd853d452b24d46a3c81ca63fa090ea 20-Sep-2013 Matthew Xie <mattx@google.com> Check null condition of number before contact query

bug 10571304

Change-Id: Idb23e7085dc1dc7119e0e2aa8901743707e72285
fp/AtPhonebook.java
fac695e2dc25510b12684217d066b86dbbbba176 20-Sep-2013 Zhihai Xu <zhihaixu@google.com> resource leakage in bluetooth MAP when empty message in phone.

bug:10844044
Change-Id: I60c1b0206d7ba4653d149bee2f9f0dd6da6a5afb
ap/BluetoothMapContentObserver.java
2e90040ffc6f1c4cd5187338c9f708df4d380aee 12-Sep-2013 Matthew Xie <mattx@google.com> Change Volume step scale. Use setStreamVolume instead of avrcpUpdateVolume

bug 10681804

Change-Id: I553dac18d48c86bdb8b11428f56956f04ea87f27
2dp/Avrcp.java
b42ddd9abf40e1f3e3c5a33fa67dea898adcb219 14-Sep-2013 Ying Wang <wangying@google.com> Fix build.

Change-Id: I02a9d4dfa84c5778a1136d39b7bb14a2e523a9ca
ap/BluetoothMapContent.java
ap/BluetoothMapbMessageMmsEmail.java
70be005a18a35ec5fcb46152f0dfbe82156efa3a 22-Aug-2013 Kim Schulz <k.schulz@samsung.com> Fixes to the google review comments + spec 1.1

- updated code to comply with MAP spec 1.1
- removed activity + strings.xml
- removed unused notification code
- fixed TODOs
- added more string validation and case insensitivity
- fixed internal+google review comments
- Added dump of incoming bMessages to /sdcard/bluetooth/log when verbose debug in enabled. Only the latest received message will be stored
- Fix functions msgListingSize and msgListingHasUnread to also consider mms filter message type
- Fix wrong tag length define for notification status parameter
- Re-added shutdown code to interupt the MNS
- removed map activity
- Added initial bluetooth map unit tests
- Fix map event report xml start tag to uppercase 'MAP'
- added support for using ProfileService class
- changed the way the Broadcast Receiver was implemented
- Fixed minor bugs found during Automotive Test Event
- FilterPeriod application parameters can be present, but with zero length
- For MMS the end-boundary were added too early
- The FOLDER entry in bMessage can be empty for a message push
- Wrong error value returned for a set status operation with a wrong handle
- In getMessage() exclude all binary content and smil.xml if the appParam attachment is set to "no".
- Set correct content id and content location for mms. Fix mms mime parser bug.
- moved disconnect to Handler thread
- fixed multipart-message split bug.
- added a few Unit tests for multi-part messages
- MMS parser optimized
- fixed exception in MNS obex Client
- fixed problem with Native PDUs not getting correct timestamp
- corrected mixup in ordinator/recipient for MMS

Change-Id: I3875762822a7f8ce0132065e0da5d0257e3850a1
Bug:10692365
tservice/Config.java
fp/HeadsetService.java
ap/BluetoothMapActivity.java
ap/BluetoothMapAppParams.java
ap/BluetoothMapAuthenticator.java
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapMessageListing.java
ap/BluetoothMapMessageListingElement.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapReceiver.java
ap/BluetoothMapService.java
ap/BluetoothMapSmsPdu.java
ap/BluetoothMapbMessage.java
ap/BluetoothMapbMessageMmsEmail.java
ap/BluetoothMapbMessageSms.java
ap/BluetoothMnsObexClient.java
bap/BluetoothPbapService.java
cd34ad74f093c4867e616ba247fe3853b06afebc 16-Aug-2013 John Du <johnldu@google.com> Stop scan when client binder dies

bug 10213756
Change-Id: I01b397070f729df7c6000c2dc2613efbe8801681
(cherry picked from commit 45ba247afa1cb3c61a871b0c13f6546411afe68b)
att/GattService.java
ff833ce646e50c3593a313cd6a0be53577e41112 10-Apr-2013 Thomas Lehaux <thomasx.lehaux@intel.com> Add null pointer check in A2DPService

A call to the stop() function in A2DPService.java
could cause a NullPointerException in certain events.
This patch adds a null pointer check before a
function call to avoid this issue.

Change-Id: I39b521592d9cc5b910c5ce232d0d8d03389a0391
Orig-Change-Id: I77ee8129c3d81230afc5b59b4cc29e690cbe547a
Author: Thomas Lehaux <thomasx.lehaux@intel.com>
Reviewed-on: http://android.intel.com:8080/102211
Reviewed-by: Poignet, Cedric <cedric.poignet@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Bondier, CedricX <cedricx.bondier@intel.com>
Reviewed-by: Boniface, XavierX <xavierx.boniface@intel.com>
Tested-by: Zurmely, PierreX <pierrex.zurmely@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 85837
2dp/A2dpService.java
cdc8ec8d84c7f16b851238da0d80b51335c4ea07 16-Aug-2013 Edward Jee <edjee@google.com> Enables AT+ANDROID command in Bluetooth HFP.

Adds another vendor-specific command AT+ANDROID in Bluetooth Hands-Free
Profile. And creates an API function that sends an unsolicited result
code +ANDROID .

Bug: 8736189
Change-Id: I7e5bba8a568f596565a1531948061e4d2fe456e0
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
17675906064bb72fdcca75baa56cdf8bb8968d01 19-Jul-2013 John Du <johnldu@google.com> Adding support for Absolute Volume

Change-Id: Ie2ccaad7aaf56a89fe44b168026df3d84b373c06

Conflicts:
jni/com_android_bluetooth_avrcp.cpp
src/com/android/bluetooth/a2dp/Avrcp.java
2dp/A2dpService.java
2dp/Avrcp.java
ace834feb02adabd61f628c4471147aea02d939c 28-Jun-2013 John Du <johnldu@google.com> Add support for ff/rew

Change-Id: I7ec60d94313b9ba5e4e8e62c82f19ae332b6fdd3
(cherry picked from commit 55123eff985f4d15ec198569a5db895ea086447a)
2dp/Avrcp.java
8c85057a003441674807e2991092735011c72b26 14-Aug-2013 Matthew Xie <mattx@google.com> Merge "LE: Add peripheral role support (4/4)" into klp-dev
97d5a00d3d588f89b36be801461455a2ab625907 07-Aug-2013 Andre Eisenbach <andre@broadcom.com> LE: Add peripheral role support (4/4)

Initial stack support for the LE peripheral role.

Change-Id: I3600558fd777999bcd610fa3aaed259414702ea4
att/GattService.java
59f7aee85186fa07fc29ea941cfdab99e7c87d91 14-Aug-2013 Matthew Xie <mattx@google.com> Merge "LE: Add instance ID to descriptors (4/4)" into klp-dev
7f9efa4413d64569cd8a25ef2262778505059d80 09-Jul-2013 Andre Eisenbach <andre@broadcom.com> LE: Add instance ID to descriptors (4/4)

If a remote devices offers multiple descriptors with the same UUID, the
instance ID is used to differentiate between them.

Change-Id: I176dcfe1dc582120173cf3bd2d4329d7d764e39a
att/GattService.java
fd6603b8bf9ed72dcc8bd59aaef3209251b6e17c 19-Jul-2013 Matthew Xie <mattx@google.com> Bluetooth MAP profile - sms and mms support initial check-in

bug:10116530

Change-Id: If9ce878d71c1e1b12416014c433da03b3033e158
ap/BluetoothMapActivity.java
ap/BluetoothMapAppParams.java
ap/BluetoothMapAuthenticator.java
ap/BluetoothMapContent.java
ap/BluetoothMapContentObserver.java
ap/BluetoothMapFolderElement.java
ap/BluetoothMapMessageListing.java
ap/BluetoothMapMessageListingElement.java
ap/BluetoothMapObexServer.java
ap/BluetoothMapReceiver.java
ap/BluetoothMapRfcommTransport.java
ap/BluetoothMapService.java
ap/BluetoothMapSmsPdu.java
ap/BluetoothMapUtils.java
ap/BluetoothMapbMessage.java
ap/BluetoothMapbMessageMmsEmail.java
ap/BluetoothMapbMessageSms.java
ap/BluetoothMnsObexClient.java
ap/BluetoothMnsRfcommTransport.java
bb1ac417208c8e283f9b5b49f4413856500ed0f9 05-Aug-2013 Dianne Hackborn <hackbod@google.com> Use explicit Intent for binding to service.

Change-Id: I51971a02532ad0ad8fafb0529e7adf83ed846cf4
fp/HeadsetStateMachine.java
c0b728adc379712af2a4e2357d82b492745f5e58 31-Jul-2013 Matthew Xie <mattx@google.com> enable xml format to transfer/receive over bluetooth

Add proper MIME types for xml as text/xml.
bug 9170384

Change-Id: Idd23c4fe26e1d82b2ea1deb51acfeeb61c1634aa
pp/Constants.java
138a7c288f5828f5d06ccd971262327a82967228 26-Jul-2013 Zhihai Xu <zhihaixu@google.com> Merge "Add debug menu to enable btsnoop"
9674eb043aeb1474aa23ddd0739e3b8f05432630 10-Jun-2013 Jay Shrauner <shrauner@google.com> Use new CallLog number presentation column

Switch to using new number presentation column in the CallLog table.

Bug:6948882
Change-Id: I5df2969465c19f2357dbbc3266315e020e30476e
fp/AtPhonebook.java
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapVcardManager.java
4efee167e0a1daf750f4a466db716213c1189bb2 12-Jun-2013 Zhihai Xu <zhihaixu@google.com> am 7dc55aab: Merge "ignore invlaid play position update from remote control client." into jb-mr2-dev

* commit '7dc55aab7b1e53f784ffc75d1e7e28c0ee42bb0c':
ignore invlaid play position update from remote control client.
9d80b509f715a3c3f2ebd0de373d427fc31a6e6c 11-Jun-2013 Zhihai Xu <zhihaixu@google.com> Add debug menu to enable btsnoop

bug: 8059358
Change-Id: I2947b2b77955238410e2620489c2e0407ad8ae7b
tservice/AdapterService.java
7dc55aab7b1e53f784ffc75d1e7e28c0ee42bb0c 11-Jun-2013 Zhihai Xu <zhihaixu@google.com> Merge "ignore invlaid play position update from remote control client." into jb-mr2-dev
f56b7b37a156d9207074af80c156db5884bb8c08 08-Jun-2013 Zhihai Xu <zhihaixu@google.com> ignore invlaid play position update from remote control client.

differentiate between applications that use
the new RemoteControlClient APIs to pass a playback position but
don't have one yet, and applications that use the legacy API and
will never pass a position.

bug:9294855
Change-Id: I015b9ded72497464352a9fbb6a605cedfffad373
2dp/Avrcp.java
37d0dc03a85a8b4364b35c01561e4be9d21c3f54 31-May-2013 Matthew Xie <mattx@google.com> am 865b323b: Notify adapter state change from off to on when disable fails

* commit '865b323bb1d0aa9581a9b6a2f5ed96fc0ee70b23':
Notify adapter state change from off to on when disable fails
865b323bb1d0aa9581a9b6a2f5ed96fc0ee70b23 30-May-2013 Matthew Xie <mattx@google.com> Notify adapter state change from off to on when disable fails

So that the settings app would not stuck at turning-off state
User can retry turning off.
bug 9164641

Change-Id: I6ae6d80c97673b4e548b7b5ab47c51f968342060
tservice/AdapterState.java
51954fe06c39291fcf67412a2ed81f017e4925d8 25-May-2013 Matthew Xie <mattx@google.com> am 3cedf3d5: Fix rssi handling as one of property change event

* commit '3cedf3d57aff20e1876a5b450f41b05e975cb8e0':
Fix rssi handling as one of property change event
3cedf3d57aff20e1876a5b450f41b05e975cb8e0 24-May-2013 Matthew Xie <mattx@google.com> Fix rssi handling as one of property change event

The rssi is encoded in one byte as int8_t in the stack.
JNI code copied in high byte without proper masking.
The converting is not needed. I am removing the uncessary converting.
bug 9110215

Change-Id: I50628b3a3c0bcf4a33775c6b62e9febd35bdc78d
tservice/RemoteDevices.java
de221fc5989b5793bd83a67c28fa82a58d9d1825 22-May-2013 Zhihai Xu <zhihaixu@google.com> am 0eea1282: Bluetooth Share has stopped / Secondary user setup / NullPointerException

* commit '0eea1282dcb425c1ea9dc6aa08d323884a9a1655':
Bluetooth Share has stopped / Secondary user setup / NullPointerException
0eea1282dcb425c1ea9dc6aa08d323884a9a1655 22-May-2013 Zhihai Xu <zhihaixu@google.com> Bluetooth Share has stopped / Secondary user setup / NullPointerException

issue 9066070

Change-Id: Ie206eab374c6a8c255f1a6302249f81ac16fc333
tservice/AdapterState.java
c6671c58220cabf78ece05112da9b33a36621c65 15-May-2013 YK Jeffrey Chao <jechao@broadcom.com> am ad9fff21: Preload timeout and retry mechanism (2/3)

* commit 'ad9fff218081d2f49471487d37387c764d69ed29':
Preload timeout and retry mechanism (2/3)
fd0cb64aeb1f806a041a5881dd2ba846b0aa6a93 02-May-2013 Ravi Nagarajan <nravi@broadcom.com> Fix for roam indicator not updating correctly

Use telephony manager PhoneStateListener to update the roam indicator
bug 8781689

Change-Id: I7c06f162918a10d06d77fb302e99bd2db8b02874
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
ad9fff218081d2f49471487d37387c764d69ed29 24-Apr-2013 YK Jeffrey Chao <jechao@broadcom.com> Preload timeout and retry mechanism (2/3)

If the Preload process was stuck due to unknown hardware init failure,
a 8-second ENABLE_TIMEOUT timeout would be eventually expired in Java layer
at AdapterState and attempted to set BT state back to STATE_OFF.
However BluetoothManagerService did not handle this case accordingly and led
to state mis-matching between Java layer and BTIF at the end.

Add the processing logic in AdapterState to handle the case when an explicit
STATE_OFF notification from BTIF was received in the TurningOn Pending state.

bug 7566317

Change-Id: I29c379cd453d05297ed382a5e8f862fa7d0f8881
tservice/AdapterState.java
bad4995703f97fab3c7c84b297a8ca6df65191fa 04-May-2013 Zhihai Xu <zhihaixu@google.com> avoid null pointer in handlePanDeviceStateChange of PanService

see the following null pointer exception
04-30 15:15:21.689 10890 10890 E AndroidRuntime: Caused by: java.lang.NullPointerException
04-30 15:15:21.689 10890 10890 E AndroidRuntime: at com.android.bluetooth.pan.PanService.handlePanDeviceStateChange(PanService.java:457)
which cause crash when disable BT
If the stop is called before the cleanup in PanService, Nullpointer may happen.

issue 8769031

Change-Id: Ia3fb1625c945c508771a697234e6ee18a120d72b
an/PanService.java
009989730a294575c32295976c57af169523abe4 26-Apr-2013 Zhihai Xu <zhihaixu@google.com> Merge "Null pointer exception in SocketAcceptThread of BluetoothPbapService." into jb-mr2-dev
7b91a410d595b879548e540889f8b30a0d6476c4 23-Apr-2013 Zhihai Xu <zhihaixu@google.com> Null pointer exception in SocketAcceptThread of BluetoothPbapService.

issue 7650255

Change-Id: Ied5c4ba2b34ffef9edaaa1ad7d8b4a9a0e73ef90
bap/BluetoothPbapService.java
0592109a75ca9e4e65489c04d6c5994cd7db45b2 25-Apr-2013 Matthew Xie <mattx@google.com> Merge "Enforcing bluetooth permissions for GATT api calls" into jb-mr2-dev
9e4a62e487bda885848771e4fa87717465bf75d2 25-Apr-2013 Matthew Xie <mattx@google.com> Enforcing bluetooth permissions for GATT api calls

bug 8667898

Change-Id: I2100d402f6496271bf97fed03684bedd8d231da4
att/GattService.java
8629665794ef845e945595040e4cf1ea2fa508d3 05-Apr-2013 Priti Aghera <paghera@broadcom.com> HDP Single SDP fix

Modified the stack logic to create single
SDP record for all register call.
bug 8656462
Change-Id: If06193aecbe7555e6b1402275ee243fcd672c812
dp/HealthService.java
db367aa803836ca5b80da6b07ea2ef8a4b0ca1d2 23-Apr-2013 Zhihai Xu <zhihaixu@google.com> enable playback position sync for AVRCP remoteControlDisplay in audio manager

issue 8698103

Change-Id: I3572b519c4181b21629c812ba91e46d977ec33fe
2dp/Avrcp.java
f60d96d6bf4c3dce367ce48436f383897c7f9719 15-Apr-2013 Priti Aghera <paghera@broadcom.com> Fixed a NPE

Bluetooth share was crashing due to NPE. Included a check for
Inputstream in BluetoothOppSendFileInfo.

bug #7924487
Change-Id: Iccceb607a46962f84538e912d62f407ad5ee2f21
pp/BluetoothOppUtility.java
dbaf9cd41555de7e6101f368ac348bbeb2094809 10-Apr-2013 Andre Eisenbach <andre@broadcom.com> LE (3/3): Add application ID to connection callback

Bug: 8589393
Change-Id: Iff14aa568bac4d62920bc35ec1545384e200b53a
att/GattService.java
79d176b0f3d6cb33c7e52be6641fd4808ba87e93 12-Apr-2013 Zhihai Xu <zhihaixu@google.com> Resolve AVRCP IOP issues

This patch has the following fixes
1. Track number should be 0xFFFFFFFF when no track is currently selected
2. When no track is currently selected set play state as stopped
3. Track number sent in the correct byte order

issue 8586495

Change-Id: I2be583d1e87a39015dff605c7442ca658a10b2e2
2dp/Avrcp.java
aa1ffd5c6bd4f016c6ed452b3551e65872eaea8e 04-Apr-2013 Zhihai Xu <zhihaixu@google.com> support playback position changed notification

issue 8494369

Change-Id: Id468d34badac4c963d4e6df0e7e32bbd0c508938
2dp/Avrcp.java
6af1f25031e4378efb1a4fc286974c1038a357ba 05-Apr-2013 Andre Eisenbach <andre@broadcom.com> Add binder DeathRecipient to GATT service

Bluetooth stack connections are now released if a GATT client or server
application closes unexpectedly.

Bug: 8362526
Change-Id: I13b0711f65dcc752f4ed5c5a6e469b6fea41de75
att/ContextMap.java
att/GattService.java
4bcc3acd9b6024ac53c5de7af08ce56079f20e86 04-Apr-2013 Matthew Xie <mattx@google.com> Merge "Implement getRemoteType of IBluetooth.aidl" into jb-mr2-dev
0c61ad1d60fdf9738f9171acaa43f63a9a70d147 03-Apr-2013 Jean-Michel Trivi <jmtrivi@google.com> Merge "Update IRemoteControlDisplay implementation to latest interface" into jb-mr2-dev
d235269f06e99d76a0f63c8fe9e224e0f951f799 03-Apr-2013 Matthew Xie <mattx@google.com> Implement getRemoteType of IBluetooth.aidl

Bring the device type from hal to app api
bug 8529188

Change-Id: Id4a9837afc7234cb50ab6abf73da4bdc010db392
tservice/AdapterService.java
tservice/RemoteDevices.java
bc10e7d58aa55da25c18d8056a0254a2b736146a 02-Apr-2013 Zhihai Xu <zhihaixu@google.com> keep one setPlaybackState function

Change-Id: I4b6f4f17dadd542e890876a8b2fbf3c31badc003
2dp/Avrcp.java
93627064c68acfaef2da5deb2c9c9e73c7aa13af 01-Apr-2013 Jean-Michel Trivi <jmtrivi@google.com> Update IRemoteControlDisplay implementation to latest interface

Changed method setTransportControlFlags(int, int)
to method setTransportControlInfo(int, int, int)

Bug 8120740

Change-Id: I35833384102949eb2a20b0f61e13d9d8573adf3e
2dp/Avrcp.java
6d5b7febd705a33ab41459743d12623afcbf96bd 30-Mar-2013 Zhihai Xu <zhihaixu@google.com> fix compilation error for broadcom branch

Change-Id: I0ed2f039babccf59099c0c7cf0e3ad12392ecff4
2dp/Avrcp.java
c6a2fb9e324208a48173877c70b13f2f1b01286e 30-Mar-2013 Zhihai Xu <zhihaixu@google.com> Revert "Revert "fix the compilation error in broadcom partner branch""

This reverts commit 0e8131db9994d36b7cf9b61bfccb5fb374e09a19

Change-Id: Id91d545d2884022ba8f021cb22d710f4ed421464
2dp/Avrcp.java
0e8131db9994d36b7cf9b61bfccb5fb374e09a19 30-Mar-2013 Zhihai Xu <zhihaixu@google.com> Revert "fix the compilation error in broadcom partner branch"

This reverts commit 9c55356d9405187302a50aa2f9de8b29976645e5

Change-Id: Ife672e4b012a7745abf9d8ba9701fc46a0008539
2dp/Avrcp.java
9c55356d9405187302a50aa2f9de8b29976645e5 30-Mar-2013 Zhihai Xu <zhihaixu@google.com> fix the compilation error in broadcom partner branch

Change-Id: I563742d29570095060c874b1b992cd1c3859dc58
2dp/Avrcp.java
252c3fd10c9da267c6c2c7772025b92bf1ec74e9 29-Mar-2013 Jean-Michel Trivi <jmtrivi@google.com> Merge "Update RemoteControlDisplay interface for playback position" into jb-mr2-dev
b57062726d787db9c40636a9b506870007676d7f 11-Mar-2013 Robert Greenwalt <rgreenwalt@google.com> Don't try using netd anymore.

Instead, form a connection with the NetworkStateTracker so
ConnectivityService can treat this like the other networks.

bug:8445208
Change-Id: Ice7dfb0b50c9481d359aed14a51372878185171c
an/PanService.java
eb8907e19ad3fa8208d7a65c8aae1bf758838705 22-Mar-2013 Jean-Michel Trivi <jmtrivi@google.com> Update RemoteControlDisplay interface for playback position

Update Avrcp class to latest IRemoteControlDisplay interface
that receives playback progress and playback speed.

bug 8120740

Change-Id: I7b30c5a312ab90ee8b1f45ad900efc7c941e133a
2dp/Avrcp.java
de06cdccc4629cdfb12c16de226b3297377912e4 21-Mar-2013 Zhihai Xu <zhihaixu@google.com> Merge "framework support for new Bluetooth profiles AVRCP 1.3:Metadata and play status" into jb-mr2-dev
c1c259c0ace7195240f1443c805995bfe8692a72 14-Mar-2013 Zhihai Xu <zhihaixu@google.com> framework support for new Bluetooth profiles AVRCP 1.3:Metadata and play status

send track changed response if the metadata is changed.

issue 8383522

Change-Id: Ie55ed368d355484a6b83f4aa24c70aa33b72f799
2dp/A2dpService.java
2dp/Avrcp.java
5d5746124a5fd14a13ca7fd085aae6ec600d0ca7 30-Nov-2012 Sungmin Choi <sungmin.choi@lge.com> enable xlsx, docx, pptx format to transfer/receive over bluetooth

Add proper MIME types for xlsx, docx, pptx.

Bug: 7479989
Change-Id: I77b065f7856fa399c5084ffa96deace0e3f15487
pp/Constants.java
d1e5ee9cd1c68ad8eeca61700fe56638d7f3edd4 07-Mar-2013 Nigel Hannam <nigel@hannam.eu> AtPhonebook handleCpbsCommand was incorrectly sending two responses
to some requests (one inside the swtich statement, then repeating it
after breaking out of the switch statement).
This broke phonebook sync with Audi 2G MMI car kit.
Signed-off-by: Nigel Hannam <nigel@hannam.eu>

Change-Id: I65e54400aad2413725469951899d041870691369
fp/AtPhonebook.java
03b8386de26ba6500af2d66687bff9b01f2cbbd7 06-Feb-2013 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Initial version of BLE support for Bluedroid

Change-Id: I9579b3074bc4bc59dd45f71c0937e8879196555e
tservice/AbstractionLayer.java
tservice/BondStateMachine.java
tservice/Config.java
att/ContextMap.java
att/GattDebugUtils.java
att/GattService.java
att/GattServiceConfig.java
att/HandleMap.java
att/ScanClient.java
att/SearchQueue.java
att/ServiceDeclaration.java
8eb70f8bdf4e8c970810b3400aba8d08d14ce222 21-Feb-2013 Martijn Coenen <maco@google.com> Add OBEX object count support to Bluetooth.

To support Android Beam receiving information about
the number of files in a OPP transfer, add the Count
OBEX header. Also add a new intent to tell the handover
requested that a transfer has started, including the
count (if any).

Change-Id: Ib5e0e8dbc6c2e3259e0f732a507557c3688e168c
pp/BluetoothOppBatch.java
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppObexSession.java
pp/BluetoothOppTransfer.java
pp/Constants.java
34e323baafb5563c3874f95847ec544faf6923f8 14-Feb-2013 Matthew Xie <mattx@google.com> Turn on some debug message in Adapter service

We had turned off too much debug messages. It is getting hard to
make out useful information from bugreports. Now, selectively turn
on some messages.

Change-Id: Ia62bc9d5967a10690709abaa0e20a15dd01c258d
tservice/AdapterProperties.java
tservice/AdapterState.java
f206526c98d3c1038dbb5c575d47711e433f5fdf 14-Feb-2013 Matthew Xie <mattx@google.com> Merge "turn off getState debug message, not so useful now"
6efae4264e5b216b37e8da5ced41a7898e18ca3a 14-Feb-2013 Matthew Xie <mattx@google.com> turn off getState debug message, not so useful now

Change-Id: I258cb35f3166ac8a6a4c4ee7965db527cf17c2e2
tservice/AdapterService.java
522d3b2b0a69c0157ca87995d92bb712f6102c1a 28-Jan-2013 Wink Saville <wink@google.com> Add protected log methods to StateMachine

This allow child classes to Override the logging and
have consistent behavior across StateMachines.

Change-Id: I7e23a44d08ca304ade2d7830fd0e307f63f1879e
2dp/A2dpStateMachine.java
fp/HeadsetStateMachine.java
61fa4903058a68538948d624271be96810defab4 15-Jan-2013 Matthew Xie <mattx@google.com> Use getRadioTechnology call instead of getRilVoiceRadioTechnology

getRilVoiceRadioTechnology had obsoleted getRadioTechnology
We are using the obsolete method to get bluetooth master compile
with aosp build for Broadcom branch.

Change-Id: Ica4258f99be82a2b0e04f74eac0bc5ee95f0a914
fp/HeadsetPhoneState.java
3cba4c44cb1f249d78c43d6e40e508cd0505b95b 11-Jan-2013 Adam Powell <adamp@android.com> am 43f8ccf6: am 6eb3b8d3: Merge "Upgrade the app to better follow holo guidelines"

* commit '43f8ccf63a02b28be395fd223461f1421ea2aa99':
Upgrade the app to better follow holo guidelines
43f8ccf63a02b28be395fd223461f1421ea2aa99 09-Jan-2013 Adam Powell <adamp@android.com> am 6eb3b8d3: Merge "Upgrade the app to better follow holo guidelines"

* commit '6eb3b8d3b7ffc1d80ae7734042e2c4d36a77a19f':
Upgrade the app to better follow holo guidelines
d9bd906c02fd27e51e637ee661e424951ff27f39 20-Dec-2012 Zhihai Xu <zhihaixu@google.com> Merge "Bluetooth OPP should sanitize Uri data and MIME types before calling startActivity"
04ebe44a6a6e2da1dfd7a9cacf326667fbb32cd7 03-Dec-2012 Matthew Xie <mattx@google.com> am 67b17615: am fa5a6aff: Merge "Clean up debug messages" into jb-mr1.1-dev

* commit '67b1761534d7e2518830cfb3d2c28271ffe56a26':
Clean up debug messages
67b1761534d7e2518830cfb3d2c28271ffe56a26 03-Dec-2012 Matthew Xie <mattx@google.com> am fa5a6aff: Merge "Clean up debug messages" into jb-mr1.1-dev

* commit 'fa5a6affffb0efe6c41ea44499b0e9b619bee161':
Clean up debug messages
fa5a6affffb0efe6c41ea44499b0e9b619bee161 03-Dec-2012 Matthew Xie <mattx@google.com> Merge "Clean up debug messages" into jb-mr1.1-dev
a64467b1203269cb620e4ea9b3cb7ba0b1aaa3de 01-Dec-2012 Zhihai Xu <zhihaixu@google.com> am 3d34fdb1: am 28cc9881: need send status code back(OK) after broadcast the intent(VENDOR_SPECIFIC_HEADSET_EVENT)

* commit '3d34fdb17090e476a5ccd6d7bb57d61d9f528eff':
need send status code back(OK) after broadcast the intent(VENDOR_SPECIFIC_HEADSET_EVENT)
3d34fdb17090e476a5ccd6d7bb57d61d9f528eff 01-Dec-2012 Zhihai Xu <zhihaixu@google.com> am 28cc9881: need send status code back(OK) after broadcast the intent(VENDOR_SPECIFIC_HEADSET_EVENT)

* commit '28cc9881bb7fb2e5e410006f4f303c494b97665e':
need send status code back(OK) after broadcast the intent(VENDOR_SPECIFIC_HEADSET_EVENT)
28cc9881bb7fb2e5e410006f4f303c494b97665e 01-Dec-2012 Zhihai Xu <zhihaixu@google.com> need send status code back(OK) after broadcast the intent(VENDOR_SPECIFIC_HEADSET_EVENT)

bug 7564004

Change-Id: I5fc1eed1c0db194c3fdd63799b2340eea994988d
fp/HeadsetStateMachine.java
0f4ef70f0bc246b224f7b6da524128db89fcc8a7 30-Nov-2012 Matthew Xie <mattx@google.com> Clean up debug messages

bug 7626174

Change-Id: I0161d54dd325a7a1afcf8926ef54cd483e7503fb
tservice/AdapterProperties.java
tservice/ProfileService.java
id/HidService.java
pp/BluetoothOppService.java
616ea6f6dee795f76b331b05ea8f20ecbd0518c4 28-Nov-2012 Zhihai Xu <zhihaixu@google.com> am 78622268: am e2039454: Merge "Code to broadcast VENDOR_SPECIFIC_HEADSET_EVENT missing" into jb-mr1.1-dev

* commit '786222689749046824ba206ab32f8ac9794c998b':
Code to broadcast VENDOR_SPECIFIC_HEADSET_EVENT missing
786222689749046824ba206ab32f8ac9794c998b 27-Nov-2012 Zhihai Xu <zhihaixu@google.com> am e2039454: Merge "Code to broadcast VENDOR_SPECIFIC_HEADSET_EVENT missing" into jb-mr1.1-dev

* commit 'e203945454e23b2fd31ad278f7d374e1e1ccf2db':
Code to broadcast VENDOR_SPECIFIC_HEADSET_EVENT missing
e203945454e23b2fd31ad278f7d374e1e1ccf2db 27-Nov-2012 Zhihai Xu <zhihaixu@google.com> Merge "Code to broadcast VENDOR_SPECIFIC_HEADSET_EVENT missing" into jb-mr1.1-dev
dd66c701616d77e5bf7f5fd795999f59e5fe28bd 18-Nov-2012 Zhihai Xu <zhihaixu@google.com> Code to broadcast VENDOR_SPECIFIC_HEADSET_EVENT missing

add +XEVENT vendor specific command handler in processUnknownAt

bug 7564004

Change-Id: I78847553700b2da28dbf9ca8f9d0509f5f3fa924
fp/HeadsetStateMachine.java
cae4f76797a8d32657eaa0fdc4294cc0ba944c9c 16-Nov-2012 Wink Saville <wink@google.com> Rename get radio technology

Change-Id: I83f2b0eda8c6ccdff1b7253164e2531ca1357e72
fp/HeadsetPhoneState.java
ad4d840680e407633f4492633885a8149139fdd2 16-Nov-2012 Wink Saville <wink@google.com> Merge "Revert "Rename get radio technology""
c63208de4e1ce7cf4866bd85ad2a327b9da3a340 16-Nov-2012 Wink Saville <wink@google.com> Revert "Rename get radio technology"

This reverts commit d38211fe71e9e738290c6b84ef70188b8ac55071

Change-Id: I8e8cda5ce923ccec6827e9b5609d82c765b15ae2
fp/HeadsetPhoneState.java
a614049ef4be9ba05228ae7c6bc4953299b7892f 15-Nov-2012 Wink Saville <wink@google.com> Merge "Rename get radio technology"
d9d397854afd6511e2987ea7ae3ec8528183aefa 19-Sep-2012 blunden <blunden2@gmail.com> Upgrade the app to better follow holo guidelines

- Fix the icon scaling in the transfer list
The icon is centered and upscaled instead of just centered.

- Remove dialog info icon according to UI team recommendation

- Replace icons with holo versions and add xhdpi

Change-Id: Id3b06e8e06244ec8859d65404d779b66c1354e3d
pp/BluetoothOppBtEnablingActivity.java
pp/BluetoothOppIncomingFileConfirmActivity.java
pp/BluetoothOppTransferActivity.java
bap/BluetoothPbapActivity.java
a6853edb4504e95dcd07e0ffc306ef07dc759b56 13-Nov-2012 Zhihai Xu <zhihaixu@google.com> am 4daa2db1: Merge "need to send BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED intent to all users" into jb-mr1.1-dev

* commit '4daa2db107f17fa8e8dfe35003924c69566bccb6':
need to send BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED intent to all users
4daa2db107f17fa8e8dfe35003924c69566bccb6 13-Nov-2012 Zhihai Xu <zhihaixu@google.com> Merge "need to send BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED intent to all users" into jb-mr1.1-dev
31be0d2814d1d3c640160aeafba17feafbaa8bb6 13-Nov-2012 Zhihai Xu <zhihaixu@google.com> need to send BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED intent to all users

We need to send BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED intent to all users
because bluetooth manager service use this intent to change name.
Bluetooth manager service is always running as User 0. but it is always binding
to bluetooth service running at foreground user, So the bluetooth service
need send BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED broadcast intent
to all users to let bluetooth manager service to receive it at any cases.

bug 7476965

Change-Id: I816786d0828d4a7d414077b1ccbe12d2e273fc75
tservice/AdapterProperties.java
e3e1e8d1fe2a75b38ee1dfe5a102685877a22f84 29-Sep-2012 Fred <fredc@broadcom.com> Fixed potention ANR issue with Bluetooth OPP share.

Updated BluetoothOppLauncherActivity so the call to
BluetoothOppManager.saveSendingFileInfo() runs on a child thread.
saveSendingFileInfo() opens/constructs the content stream, which
can take a long time, depending on the type of content.
It should not run inside the main UI thread of the
BluetoothOppLauncherActivity.

Bug 6802063

Change-Id: Id34b33fe37eb029d6a7592a811bbc9bbcde14ba8
pp/BluetoothOppLauncherActivity.java
cb7b1a54ae3ce309210824099253a916a04d350b 29-Sep-2012 Fred <fredc@broadcom.com> Fixed potention ANR issue with Bluetooth OPP share.

Updated BluetoothOppLauncherActivity so the call to
BluetoothOppManager.saveSendingFileInfo() runs on a child thread.
saveSendingFileInfo() opens/constructs the content stream, which
can take a long time, depending on the type of content.
It should not run inside the main UI thread of the
BluetoothOppLauncherActivity.

Bug 6802063

Change-Id: Id34b33fe37eb029d6a7592a811bbc9bbcde14ba8
pp/BluetoothOppLauncherActivity.java
d38211fe71e9e738290c6b84ef70188b8ac55071 02-Nov-2012 Wink Saville <wink@google.com> Rename get radio technology

Change-Id: I267f54c5533f815d14c8f7a2f81545c8e08b773c
fp/HeadsetPhoneState.java
8b709b4caac6e0cdb35a117fa3a523d0200a203f 24-Oct-2012 Zhihai Xu <zhihaixu@google.com> am ede67c26: License of files Bluetooth package is not updated to ASL2

* commit 'ede67c26e7b2564ea35db6d9b3027a269c150e13':
License of files Bluetooth package is not updated to ASL2
ede67c26e7b2564ea35db6d9b3027a269c150e13 24-Oct-2012 Zhihai Xu <zhihaixu@google.com> License of files Bluetooth package is not updated to ASL2

bug 7385618

Change-Id: I338fd87083387706f3b5f410c9592219bb8a1acb
tils.java
2dp/A2dpService.java
2dp/A2dpStateMachine.java
tservice/AbstractionLayer.java
tservice/AdapterApp.java
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
tservice/Config.java
tservice/JniCallbacks.java
tservice/ProfileService.java
tservice/RemoteDevices.java
dp/HealthService.java
fp/HeadsetHalConstants.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
id/HidService.java
an/PanService.java
b1f690e19d77b67630004517c5342f89b578f204 17-Oct-2012 Zhihai Xu <zhihaixu@google.com> am bd704c74: BT connection notification in not updated in status bar for second user It is due to the system UI is always running as the first user. It can\'t receive broadcast intent ACTION_CONNECTION_STATE_CHANGED and ACTION_BOND_STATE_CHANGED from bluetooth service

* commit 'bd704c741b8c523ad747214f6f0520ac3e2caf8f':
BT connection notification in not updated in status bar for second user It is due to the system UI is always running as the first user. It can't receive broadcast intent ACTION_CONNECTION_STATE_CHANGED and ACTION_BOND_STATE_CHANGED from bluetooth service when We switch to second user. Also the system UI also is running as uid 10055, which will also call function isEnabled, getState, getBondedDevices, getAdapterConnectionState and getBondState in bluetooth service. I allow these functions to be called by all the users. I forget remove check for getBondState in my first patch set
bd704c741b8c523ad747214f6f0520ac3e2caf8f 17-Oct-2012 Zhihai Xu <zhihaixu@google.com> BT connection notification in not updated in status bar for second user
It is due to the system UI is always running as the first user. It can't receive
broadcast intent ACTION_CONNECTION_STATE_CHANGED and ACTION_BOND_STATE_CHANGED
from bluetooth service when We switch to second user. Also the system UI also
is running as uid 10055, which will also call function isEnabled, getState,
getBondedDevices, getAdapterConnectionState and getBondState in bluetooth service.
I allow these functions to be called by all the users.
I forget remove check for getBondState in my first patch set

bug 7333382

Change-Id: I57f39a722e78d6d2453ebfecaab043637fef4d9c
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/BondStateMachine.java
f128aa0298dcaf07cf0bec0717943dd1f97b1eb6 16-Oct-2012 Jake Hamby <jhamby@google.com> am a595fcc5: Fix crash in Bluetooth when sharing MMS video.

* commit 'a595fcc57e7f0be9cf57913cd665dc99e4001b16':
Fix crash in Bluetooth when sharing MMS video.
a595fcc57e7f0be9cf57913cd665dc99e4001b16 16-Oct-2012 Jake Hamby <jhamby@google.com> Fix crash in Bluetooth when sharing MMS video.

Some content providers, such as MMS, don't support the DISPLAY_NAME
or SIZE columns for content URIs. Fall back to using the last segment
of the URI as the filename for Bluetooth file transfers if the query
for DISPLAY_NAME fails.

Bug: 7343310
Change-Id: Ie048c5eea3ba9994259c9e07beabd72622d6b669
pp/BluetoothOppSendFileInfo.java
83f334c0f748a5ee8b68d85fd0133c73e5d6bf28 12-Oct-2012 Adam Powell <adamp@android.com> am d329befd: Merge "Bluetooth: Use proper holo alert drawable"

* commit 'd329befdd38a5c441e1a2b7e4595b7de86ac100b':
Bluetooth: Use proper holo alert drawable
3911cfeb7c5e2242dcce91e3b66d9449dec0bd05 11-Oct-2012 Zhihai Xu <zhihaixu@google.com> Bluetooth OPP should sanitize Uri data and MIME types before calling startActivity

bug 5842045

Change-Id: I00a80fc7dc6c6031ab35113539ff6cdf4cf230a6
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppLiveFolder.java
pp/BluetoothOppNotification.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppTransferHistory.java
pp/BluetoothOppUtility.java
pp/Constants.java
fb8b279141dac5255926d2dd4317f803cd1bbcf0 11-Oct-2012 Matthew Xie <mattx@google.com> Fix NREC command format error

Add = sign before off
bug 7326510

Change-Id: Ief269f608646acaa2872679a5c649da3cf22de37
fp/HeadsetStateMachine.java
df9d0fe584874f8cafa6ecedb3c3c054c9e99cba 10-Oct-2012 Matthew Xie <mattx@google.com> Merge "Turn off dbg messages, be prepared for production build" into jb-mr1-dev
37510150ee738ccfa5913f7120e28f25ae7768df 09-Oct-2012 Zhihai Xu <zhihaixu@google.com> Bluetooth multi-user updates: change bluetooth service
to reject background user access.

bug 6925422

Change-Id: I11d5ebf007c2843a72a9870055fc96672daf8409
tils.java
2dp/A2dpService.java
tservice/AdapterService.java
dp/HealthService.java
fp/HeadsetService.java
id/HidService.java
an/PanService.java
bap/BluetoothPbapService.java
fd1da115cbf09b7dd9bca3c7d3a4fb816a835dc5 08-Oct-2012 Matthew Xie <mattx@google.com> Turn off dbg messages, be prepared for production build

bug 7174712

Change-Id: I58747ec6507da8ea8ae27a182b601aaf626ede42
2dp/A2dpService.java
2dp/A2dpStateMachine.java
tservice/AdapterApp.java
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
tservice/ProfileService.java
tservice/RemoteDevices.java
dp/HealthService.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
id/HidService.java
pp/Constants.java
an/PanService.java
bap/BluetoothPbapService.java
be38be94c0a2faf3802b596be5b3ab568d6d85a4 04-Oct-2012 zzy <zhenye@broadcom.com> remove the AT command separator from the CPBR range parameters

Root cause: Integer.parseInt(indices[0]) throw exception if char ';' at the end.

Bug 7274805
fp/AtPhonebook.java
6458cffaca286611e898c75ad86e2d98c89008b6 02-Oct-2012 Matthew Xie <mattx@google.com> Move socket initialization code out of pbap service's main thread

Socket initialization need the preparation from stack and a domain socket
connection. All this takes time and not proper to be run in the main thread.
bug 7258324

Change-Id: Ic46601602556c2949f18d446016188d874099874
tservice/RemoteDevices.java
bap/BluetoothPbapService.java
c7ead6d5827f3832b9210e92fab7597142059852 01-Oct-2012 Jeff Sharkey <jsharkey@android.com> Move bluetooth priorities from Secure to Global.

Bug: 7231171
Change-Id: I39e3611dcec1104558704ed72855fef85f33c084
2dp/A2dpService.java
fp/HeadsetService.java
id/HidService.java
0e46362107a23fcfe829b270f3ff987d911cd102 26-Sep-2012 Matthew Xie <mattx@google.com> Add MODIFY_PHONE_STATE permission to access Bluetooth service in Phone app

Enforce MODIFY_PHONE_STATE permission for some HeadsetService APIs that
only provided for Phone app for phone stat change notifications
bug 7115021

Change-Id: I62e3f429f4205feb50e123ee94b4c468999804a6
fp/HeadsetService.java
ebdb4d92c0ea0b5e40afe0feec71105695d27a4c 12-Sep-2012 zzy <zhenye@broadcom.com> When pbap cleanup, stopSelfResult called twice with same service id

This seemed like to be the root casue of bug 7136940. The thread 3564 stuck after following log:
09-10 11:24:08.882 3564 V BluetoothPbapService: Pbap Service closeService

bug 7136940
bap/BluetoothPbapService.java
826318bb9de042f10df8639da2965bf4d9d38e85 19-Sep-2012 John Huang <jsh@google.com> Merge "Enable Bluetooth sharing of downloaded files." into jb-mr1-dev
6893668d1ccf0cc6361ef31ace52fedc2e37e35a 15-Sep-2012 Wink Saville <wink@google.com> Add StateMachine make methods.

StateMachines must be started before any messages are sent to them
otherwise an exception is thrown.

Bug: 7091976
Change-Id: I05315d45d4d6db42843442b7feb37c665cfabcab
2dp/A2dpService.java
2dp/A2dpStateMachine.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
ee52ddf33a0ce2cf89cc028136f60ae600c45de5 27-Jul-2012 Jake Hamby <jhamby@google.com> Enable Bluetooth sharing of downloaded files.

Change BT OPP to open the InputStreams of files to share in the
BluetoothOppLauncherActivity (or BluetoothOppHandoverReceiver
for NFC shares), while the process has grantUriPermission() on
the URI's to share.

InputStreams are saved inside the existing BluetoothOppSendFileInfo
objects, which no longer include the mDestination field because
this isn't known at the time the SendFileInfo object is now created
(before the user has chosen the destination BT device). These
objects are stored in a static ConcurrentHashMap in BluetoothOppUtility
and are removed when the file is closed (on success or failure).

If the user tries to share thousands of files in one batch, we may
not be able to open InputStreams for all of the files in the batch.
In this case, the open should fail gracefully.

Bug: 6808783
Change-Id: I3f3f86d2dc1a78a837aeb6a888f90b26434ba499
pp/BluetoothOppManager.java
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppSendFileInfo.java
pp/BluetoothOppService.java
pp/BluetoothOppShareInfo.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppUtility.java
f46f032adaec19a0d0c11b921fb356cbcd7aedbd 14-Sep-2012 Matthew Xie <mattx@google.com> Donot include photo in vard in pbap

Certain carkit abort pbap transfer if vcard includes photo
bug 7070862

Change-Id: Iacd7e20901a7450599e844d1fb34923108e81bdc
bap/BluetoothPbapConfig.java
1c03c84f90991f6c9c740d72d91716d4b6a933e4 11-Sep-2012 zzy <zhenye@broadcom.com> fixed bt on off stress test issue

root cause: cleanup stack process overlapped with bt turning
on process sometime. The cleanup() call in adapterservice.java
need to be call from onUnbind() to synchronize the
BluetoothSererviceManager unbindandFinish() call.
bug 7083069

Change-Id: Ib4c64d7e5fc996277278471969f187bb5e915a76
tservice/AdapterService.java
09f5dca9925c75166688e1ab7aa5ce377277e395 16-Jun-2012 Björn Lundén <blunden2@gmail.com> Bluetooth: Use proper holo alert drawable

Make it use the holo drawables instead of the GB
compability drawable.

Change-Id: Ib85d89f0f3a6248d357a612afa8c0158a0876b86
pp/BluetoothOppBtEnableActivity.java
pp/BluetoothOppBtErrorActivity.java
pp/BluetoothOppTransferActivity.java
37e1e995fdfd6aecd53f1fd1f8f0928021472db1 10-Sep-2012 Kausik Sinnaswamy <kausik@broadcom.com> Terminate PBAP service cleanly during BT off

PBAP service runs in a loop of 10 trials to create the RFCOMM listener
thread; this loop is not getting interrupted during BT off, due to which
we end up delaying PBAP stop by 3 seconds (10 * 300ms). The fix is to
check for BT state after RFCOMM listener failure and break out of the
loop if BT is being turned off.
bug 7134544

Change-Id: I81d2a559857eef9138ebca662ea28f1d3e358bb8
bap/BluetoothPbapService.java
8ca777c3299ebf8c5869d46ba80d3fa474814751 10-Sep-2012 Matthew Xie <mattx@google.com> Revert "Terminate PBAP service cleanly during BT off"

This reverts commit f5d88a7b8659bb9ce49edc4faea6bf56f2158572

Change-Id: I67a4950831dce7392d63edad6f693abcc69d2ffe
bap/BluetoothPbapService.java
f5d88a7b8659bb9ce49edc4faea6bf56f2158572 10-Sep-2012 Kausik Sinnaswamy <kausik@broadcom.com> Terminate PBAP service cleanly during BT off

PBAP service runs in a loop of 10 trials to create the RFCOMM listener
thread; this loop is not getting interrupted during BT off, due to which
we end up delaying PBAP stop by 3 seconds (10 * 300ms). The fix is to
check for BT state after RFCOMM listener failure and break out of the
loop if BT is being turned off.
bug 7134544

Change-Id: I35db2221be30980bec973253cdd888e0ce8cc36b
bap/BluetoothPbapService.java
9eb4a84924718019c35fc5b32e59a6750ecf4116 29-Aug-2012 Ravi Nagarajan <nravi@broadcom.com> Adjust profile priorities when setting auto-connect

At a given point only one device should be set to have
PRIORITY_AUTO_CONNECT per profile. When setting a device priority
adjust the other devices' priority to make sure auto-connect
is attempted with only one device
bug 7076087

Change-Id: I1e03945a06e7acc901b53f34429194b3c3e76cd7
tservice/AdapterService.java
ce0b8381a621aa5dbac9d44932c5293d980df4c8 20-Aug-2012 Martijn Coenen <maco@google.com> Merge "Don't trust length specified by ContentProvider for file transfers." into jb-mr1-dev
a8e40f542287f047a8a2fda7f5ea2aea9607edfe 14-Aug-2012 Ravi Nagarajan <nravi@broadcom.com> Notify headset of signal strength change

Battery and service state changes were relayed to the stack, but not
signal strength. This has been resolved.
bug 6983415

Change-Id: Ie6fbb108805348e39c9119d028afb834556ae6b0
fp/HeadsetPhoneState.java
ca6110d57998fee7c7b572ca29061ee99a82ba37 09-Aug-2012 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Implement enableNoAutoconnect() for NFC handover

Implementation of BT enable in Quiet mode without initiating auto connect and not allowing
Incoming HFP, A2DP and HID connections.

Change-Id: I857aea8d95677f8287df4641ec0aeae58a9f7a99
2dp/A2dpStateMachine.java
tservice/AdapterService.java
fp/HeadsetStateMachine.java
id/HidService.java
44d87716fccf8ff6f114db72711388fa57068078 13-Aug-2012 Ravi Nagarajan <nravi@broadcom.com> listenForPhoneState only after SLC

Start phone state listener after SLC setup, instead of on
Disconnected SM exit(). On BT OFF, quitNow() forces a SM exit()
which incorrectly started the phone state listener. Additionally
no indicator updates should be sent prior to SLC setup
bug 6976119

Change-Id: Icff2bc52602230b098651225bec92d532f3a3ff9
fp/HeadsetStateMachine.java
fdc7bd89b00e40b459c706784fa003509a229096 03-Aug-2012 Martijn Coenen <maco@google.com> Don't trust length specified by ContentProvider for file transfers.

It seems that the length specified by content providers for images
is often not correct. This happens because applications modify the
images later on with meta-data, etc., but don't update the length
field.

This causes Bluetooth OPP transfers to fail, usually with an
IndexOutOfBoundException. The root cause (wrong size in content
provider) of course needs to be fixed, but we can also make
Bluetooth more resilient to these situations.

Since OBEX needs to know the transfer length
up front, the only other way we have of determining the size
of the content is by opening a file descriptor and getting
its length.

Bug: 6857704
Change-Id: Iaf2304b44e9e81ef6e6ac7e0fe3be84ad31a312f
pp/BluetoothOppSendFileInfo.java
ef39cada04683dd7ef7b68c89a8722f2ce635c28 06-Aug-2012 Ravi Nagarajan <nravi@broadcom.com> Add unbond reason to bond state change intent

HAL sends the status to indicate the reason for bonding failure, if any.
Add this to bond state change intent, so that the Settings app can
display the error dialong, if necessary.
bug 6936335

Change-Id: Ide7c9e497bbfc6428b60c7a6de6e01ca538edfb8
tservice/AbstractionLayer.java
tservice/BondStateMachine.java
73d192095093759688cccc896714f71fcee218d8 08-Aug-2012 Matthew Xie <mattx@google.com> Merge "Fix for BT turn on/off issues: NPE, FD/thread leaks, ANR." into jb-mr1-dev
15d36984a79d6e35c659edb0efdf929f0b526bd5 01-Aug-2012 Fred <fredc@broadcom.com> Fix for BT turn on/off issues: NPE, FD/thread leaks, ANR.

This fix addresses numerous BT on/off issues found from the CTS test.
Fixed fD/pipe leak in various state machine Looper objects by calling quit() function.
Fixed cursor leak in AtPhonebook.
Change Pbap to stop the RFCOMM listener on the STATE_TURNING_OFF instead of STATE_OFF.
Removed several cleanup() methods causing NPE.
Reduced RFCOMM listener timeout from 3 seconds to 300ms between retry.
bug 6834336

Change-Id: I52423343d8f52f65294af0143f373871a9874d77
2dp/A2dpService.java
2dp/A2dpStateMachine.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
tservice/RemoteDevices.java
dp/HealthService.java
fp/AtPhonebook.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
id/HidService.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
an/PanService.java
bap/BluetoothPbapReceiver.java
bap/BluetoothPbapService.java
4f5430babbc5a8f870e5a578a4ea3452f41dd97a 01-Aug-2012 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Implement Profile Auto connection logic

Implement Profile Auto connection logic (moved from Settings App )in Bluetooth APK
to avoid Auto connection not happening if the Settings App is not running
As part of this implementation following features are implemented
1. Auto connection initiation during BT on OFF
2. Profile Auto connection priority management
3. Connecting Missing profile logic
4. Initialize Profile Priorities on Bond State Change

Change-Id: I12b7c190e28f043b4b008c9b48ac7e13aaf178e6
2dp/A2dpService.java
2dp/A2dpStateMachine.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
id/HidService.java
0322ae1f5e8ea55c391145e7925cb5962a97c11f 02-Aug-2012 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Proper update of friendly name for a paired device.

Update friendly name for a paired device by properly initializing mAlias
member of DeviceProperties in Property Changed Callback() for remote device.
bug 6884149

Change-Id: I01d0679af4facfe6e92527f7618f4ff791928d0e
tservice/RemoteDevices.java
b45486075acf191f99da6a5d4f69a6f7aeff65da 27-Jul-2012 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Fix typo in PBAP Server name SDP record

Change-Id: Iff48e815987178597d93069ae3874ca903882e37
bap/BluetoothPbapService.java
7ac24de2819e5e4140ab7ab264e7cfffed4d7398 18-Jul-2012 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Do not accept connection from remote PANU if the local role is also PANU

Fix for BLTH01537991
Change-Id: Ieea143a5929217c7dc52c541e55ddf57077b244f
an/PanService.java
15d72a0c3338645bcc409023150aec40b08aadc1 29-Jun-2012 Ravi Nagarajan <nravi@broadcom.com> Resolve incoming pairing and connection issue

When the remote side initiates pairing & connection, occassionally
connection is made before the phone has had a chance to do SDP.
In this case, the profile priorities are not initialized, which caused
us to incorrectly reject the incoming connection. Allow connection
if priority is undefined, but device is not unpaired

Change-Id: Icd8257adea19fc9a4d3853cd85da9bd791cfe505

Conflicts:

src/com/android/bluetooth/a2dp/A2dpStateMachine.java
2dp/A2dpStateMachine.java
fp/HeadsetStateMachine.java
id/HidService.java
74a598e0a8d50343227e3f96bbe56c6be1c240f9 28-Jun-2012 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Ensure mAddr member of DeviceProperties is properly set with device BD Addr

Change-Id: I5dafb48fc63dadfc5ad60e5a4e9735cf72d56534
tservice/RemoteDevices.java
10bab53713ca13b3ccdaac5286c9b576e577be5e 25-Jun-2012 Swaminatha Balaji <swbalaji@broadcom.com> Fix for When Hf is rejected the device should initiate A2dp if a2dp is enabled

Change-Id: I15d3d6c8456e94553f479009c600dca1cd2361ac
2dp/A2dpStateMachine.java
fp/HeadsetStateMachine.java
caa3723eaa20e57aac086d54a41106108503debc 27-Jun-2012 zzy <zhenye@broadcom.com> Added code to ignore the empty value of remote device property change
Change-Id: I0d6b293c0bf35d9b4a2df00e9b3cd810c4a9b251
tservice/RemoteDevices.java
6b19b0e94877ae8f0803133f8cfb4885acff2763 14-Jun-2012 Syed Ibrahim M <syedibra@broadcom.com> Virtual call implementation

Change-Id: I72a96eedd1cac10a0da7223ebc9b70fd4a21974d
fp/HeadsetService.java
fp/HeadsetStateMachine.java
81491a292e9f01007c0f291e7f6acd054f6dcb4c 18-Jun-2012 Priti Aghera <paghera@broadcom.com> HDP-App crash fix
Set the channel fd to null in channel state callback if new state is not CONNECTED

Change-Id: Id540d9ca2e20ef3e03b11a61634b8a2cb4e05df1
dp/HealthService.java
fe0ac5b0476b628be11c93a818f342db90332ea8 20-Jun-2012 Matthew Xie <mattx@google.com> Notify Connection state chnage to AudioManager via an API call

bug 6834913
Change-Id: I58af46710320f3debee1780aeaea7f5548233604
2dp/A2dpStateMachine.java
5705f3a6c994b32ed9c50c21e9689108d2ec00fe 14-Jul-2012 Matthew Xie <mattx@google.com> Remove unused import com.android.internal.telephony.Call

Change-Id: I491dc175b29f98900b79e801ff3fb4f116752668
fp/HeadsetPhoneState.java
57a3923845c46742ed4f03d49dbdbb6c774ccf90 12-Jul-2012 Matthew Xie <mattx@google.com> Removed onStartCommand().

BT ON/OFF now done via enable() and disable() binder API call.
Also fixed bug with BT OFF if set scan mode times out

Change-Id: Ib88dfc148bb5a24cda1e84a86f044ae85a5a6514
tservice/AdapterService.java
tservice/AdapterState.java
c55a9837c004044051b71bb47182ace156691283 07-Apr-2012 Matthew Xie <mattx@google.com> replace logx with alogx

Change-Id: Iec82cb4545bb26a8aa55dc7d473247396b9fd6e1

Conflicts:

jni/com_android_bluetooth_hid.cpp
fp/HeadsetPhoneState.java
4603dc081506452854023a1c6eacdfca468e0dc4 12-Jun-2012 Matthew Xie <mattx@google.com> comment out state machine quit call

Change-Id: I0d4f72d50cd981a3c334583948dc0563f0662662
2dp/A2dpService.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
fp/HeadsetService.java
e469f16e5a7d99471d7db1b216d422e8d12cc4cf 06-Jun-2012 Matthew Xie <mattx@google.com> matt: my fix to get it compile, change logx to alogx, and etc

Change-Id: I0b361ad6ba9a5f6ac4db9203a389ee309b04019a
tservice/AdapterService.java
an/PanService.java
179fd2512d1a93bbd2a1a3803f5764cb417fe4c9 11-Jun-2012 Kausik Sinnaswamy <kausik@broadcom.com> Add remote device while pairing without inquiry

Change-Id: Ia7d99075b196414b3ded117b323ca5295c2c0b73
tservice/AdapterProperties.java
tservice/BondStateMachine.java
2f9a79b2d545e1a8b50a0018456892a9934db99a 06-Jun-2012 Ravi Nagarajan <nravi@broadcom.com> Resolved incoming pairing/connection issue

Sending bond_state_changed and adapter_properties_cb concurrently was
causing a race condition, which resulted in the BOND_STATE_CHANGED intent not
being sent. This caused the Settings to not show the newly bonded
device. This has been resolved by letting BondStateMachine manage
the mBondedDevices

Change-Id: Ieba39602436370fd9a87c3aa938ff3bd724c68cf
tservice/AdapterProperties.java
tservice/BondStateMachine.java
579f67ec87646f840c1235eb62d99ab9fa11f23c 05-Jun-2012 Sreenidhi T <nidhit@broadcom.com> Additional check included for the case when PhoneApp queries Bluetooth Audio state before the stack responds for the sco disconnect issued previously in AudioOn state.

Change-Id: I8b85fc9d3b4463205f01dfaa3bb309a3dbeb8231
fp/HeadsetStateMachine.java
99a6ee18f09cf8e7ddff91d68267db21867b3cdf 31-May-2012 Syed Ibrahim M <syedibra@broadcom.com> Fix the issue where HID connection was failing on first connection randomly.
Made changes in HidService to send a STATE_CONNECTING broadcast when HIDService.connect() is invoked;
Also before rejecting the incoming connection, check if the connection is transitioning from STATE_DISCONNECTED to STATE_CONNECTED and then only do a disconnectHidNative(). The normal flow of HID connect would transition from STATE_CONNECTING to STATE_CONNECTED

Change-Id: Ia416e3a70fc6c3561c3530091691367c5da2674c
id/HidService.java
e479e18951a375a548e617e86e3b1b7d121351a1 25-May-2012 Fred <fredc@broadcom.com> Fixed PBAP to use simple pairing instead of numeric comparison (same as before).
Also, escape special characters in vCard-Listing XML object

Change-Id: I32eb126f3dba4b35af39e6e0636f2f7f7e8d94a8
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
8120c75b7a8b5a9c0e00df500c1ed072a952bda1 26-May-2012 zzy <zhenye@broadcom.com> Added code to cleanup connection state when bt off
an/PanService.java
a25e9c65c2a0192b7b3d819e2b87704f1942aa2f 21-May-2012 Sreenidhi T <nidhit@broadcom.com> Changing the order of notification of connection state change, as it was causing a race condition, with the UI not being updated with the correct connection state.

Change-Id: I6f4c75e4eac4ae798cb7918a4f1b7458e1eaa4b0
2dp/A2dpStateMachine.java
fp/HeadsetStateMachine.java
id/HidService.java
an/PanService.java
4a53a55dc10d3a26c94e5844f7d4a2565a67142c 19-May-2012 fredc <fredc@broadcom.com> Fixed displaying images in pbap browse and pull when configured

Change-Id: I8315d4db76d7cbfeaefe4187100984d12bd952ed
bap/BluetoothPbapVcardManager.java
942da5b41b0c9e45e83e9801f80b982f1e4cd011 18-May-2012 Kausik Sinnaswamy <kausik@broadcom.com> Ensure that A2DP stream is suspended during Voice Dial when SCO
connection is established. This is needed to be compliant with the SIG's
AV+HF whitepaper

Change-Id: Ie072782ea70de0f1b13c6cf8bfcb88c072a1d093
fp/HeadsetStateMachine.java
755aa8f5359a933205552c40b6446b001ae42378 15-May-2012 Priti Aghera <paghera@broadcom.com> Fix for force closing HDP app: Included review comments
Included a callback to linkToDeath and notify the HealthService when BluetoothHealth is dead

Change-Id: Ie34a391f78c4fba0a74bcefd3dedccaa63f7bba3
dp/HealthService.java
75e9fd59f4d4011ba7155732a41b06f0df40bada 15-May-2012 Swaminatha Balaji <swbalaji@broadcom.com> Fix for A2dp/hf connection happening even when profile is disabled in Settings

Change-Id: I32145db12e0107b858e2e25ad1ae6cba6eadb55d
2dp/A2dpStateMachine.java
fp/HeadsetStateMachine.java
a7e8ef3f77ac74449f817f36f570a3545285be85 11-May-2012 fredc <fredc@broadcom.com> Added support for enabling/disabling profiles

Change-Id: I819ca7920d9d866bd3aca88d4365a18e2369ee81
tservice/AdapterApp.java
tservice/AdapterService.java
tservice/Config.java
an/PanService.java
c181b8b49f5ad5b49b33334a9ba8f342ddb3545c 14-May-2012 Kausik Sinnaswamy <kausik@broadcom.com> Fix to ensure that we are able to pair with a device that was just unpaired. The fix was to clear a boolean variable which was causing some stale data to be maintained

Change-Id: Iaad0e21794b0b6e47d12c837ef36e026b6ece655
tservice/BondStateMachine.java
d807ba48ed4418c1a60549abe1c3a98ced8c428d 14-May-2012 Sreenidhi T <nidhit@broadcom.com> Change done to clear mUuid - local copy of Uuid. If not cleared, the cachedBluetoothDevice issued a connect using the local cached copy of uuids, without waiting for the ACTION_UUID intent. This was resulting in multiple calls to connect().

Change-Id: Ida6fd2e805dee8c19b4d7d656b4102891f51fd00
tservice/RemoteDevices.java
970baea8e58a7b537e76e8bcbba34f428cede061 12-May-2012 Priti Aghera <paghera@broadcom.com> Fixed HDP Disconnection issue. Included channel to list of channels when channel state callback is received

Change-Id: Icd361a3f19b883b3cca27fe9eb0cafc3b969290b
dp/HealthService.java
c7a57f31515107366589bd6875c3cc4af1fc806e 07-May-2012 fredc <fredc@broadcom.com> Added PBAP support for fetching owner vcard info from phone's profile. Added PBAP image support

Change-Id: Ieb2993c9505185d4f85cbbf6b5c554936618cff0
tils.java
bap/BluetoothPbapConfig.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapUtils.java
bap/BluetoothPbapVcardManager.java
4852c5686229f1014e9851f4e9a3a19547581b45 10-May-2012 fredc <fredc@broadcom.com> Moved BluetoothAdapter.ACTION_STATE_CHANGED broadcast from AdapterService to BluetoothManagerService

Change-Id: Ic9911359c1d9e04a5d803807ea7cf4ad39616960
tservice/AdapterService.java
tservice/AdapterState.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppService.java
74ae04c73312403e89db0f8e9bd9601d403b4783 07-May-2012 fredc <fredc@broadcom.com> Fixed memory leak in Binder objects from repeatedly turning on/off Bluetooth

Change-Id: Ibee5382816d47b1e9b846461942a9daccc4210a7
tils.java
2dp/A2dpService.java
2dp/A2dpStateMachine.java
tservice/AdapterApp.java
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
tservice/JniCallbacks.java
tservice/ProfileService.java
tservice/RemoteDevices.java
dp/HealthService.java
fp/AtPhonebook.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
id/HidService.java
pp/BluetoothOppIncomingFileConfirmActivity.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppObexClientSession.java
an/PanService.java
bap/BluetoothPbapService.java
ce4edb8ed132976651b32b337f3d90e1a170afa9 08-May-2012 Sreenidhi T <nidhit@broadcom.com> Changes done for disconnecting sco connection based on disconnectAudioNative() return status, instead of waiting till BTA_AG_AUDIO_CLOSE_EVT is received. The delay in disconnecting sco was causing audio to be routed to earpiece instead of speaker, when selected from incall screen.

Change-Id: I307c3e9c114676649750cb64f1043fc7fe79d71b
fp/HeadsetStateMachine.java
405b6148a168c05f9c9eac6a80db68b9a58392e2 27-Apr-2012 Sreenidhi T <nidhit@broadcom.com> Added AT+CPBR support

Change-Id: Ice860d8f97350d805a5478e94a27ae19cf42dafd
fp/AtPhonebook.java
fp/BluetoothCmeError.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
ac7e62c64b4cd8d864f125d3225474a04b867606 27-Apr-2012 zzy <zhenye@broadcom.com> Added code to turn off pan connection when tethering state changed
an/PanService.java
d288c0dac06748780916bf438b7c84482545672f 26-Apr-2012 fredc <fredc@broadcom.com> Backed out workaround for RFCOMM socket close issue when BT is turning off

Change-Id: I793fa2a0fa0127b6ff70aeb448c97c3cc9154d6f
pp/BluetoothOppRfcommListener.java
31ba132491053bc86d419a7d51fc04af3299c076 26-Apr-2012 fredc <fredc@broadcom.com> Fixed Bluetooth on/off issues. Removed singleton instances causing issues when services reload. Updated adapter state machine

Change-Id: Ie1ff4284f507c7da102569f3c0acfd55612a5f6b
tservice/AdapterApp.java
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
tservice/JniCallbacks.java
tservice/ProfileService.java
tservice/RemoteDevices.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppService.java
bap/BluetoothPbapService.java
7aab11364743cbca6eeefecbbde19f0434aff362 24-Apr-2012 fredc <fredc@broadcom.com> Fixed exception in BondStateMachine when quit message occurs. Fixed exception in OPP when remote does not accept incoming request.

Change-Id: Ibb43a26ee0ac62967518468d243880a0af987ba0
tservice/BondStateMachine.java
pp/BluetoothOppTransfer.java
68e7fc4f2c62ebc76e86109a919592ad25ec11d7 24-Apr-2012 Ravi Nagarajan <nravi@broadcom.com> Handle NREC. On connect, enable echo cancellation locally, headset will then override it

Change-Id: I8fca1e82d1457b47122c17393ffbff362e1f3134
fp/HeadsetStateMachine.java
01a8cf98f070a6996b2e8974edc229ac402f3f0c 03-Apr-2012 Kausik Sinnaswamy <kausik@broadcom.com> Added ACL connect/disconnect state callbacks

Change-Id: Ibd44de8601521a11b106711ccad9261fb40beca8
tservice/AbstractionLayer.java
tservice/JniCallbacks.java
tservice/RemoteDevices.java
b8a77aa1b386baaf6381f7b356b9485673e1f942 20-Apr-2012 Ravi Nagarajan <nravi@broadcom.com> On disable send the disable event to stack right away, as the stack will take care of tearing down the active connections. ALL_DEVICES_DISCONNECTED was not being sent (as no profiles handled it), causing 3 second delay on BT off

Change-Id: I8aa83f3cd2019f521d5522e9455303a413dddcc1
tservice/AdapterState.java
6de8229571ce56dcb0010c63cbef65e01ecd5c2a 22-Apr-2012 Priti Aghera <paghera@broadcom.com> Fixed random pin generation for pairing with HID keyboard

Change-Id: I7e6fd39289c6c5ebefd94f45e24de86e6aeaa625
tservice/RemoteDevices.java
b5cc776c9353a203cdde97e62b25f05d9633d14c 19-Apr-2012 fredc <fredc@broadcom.com> Fixed BT on/off issue

Change-Id: I47cbac9fc694d5604a664f20170eeed90eeee8e6

Conflicts:

jni/com_android_bluetooth_btservice_AdapterService.cpp
2dp/A2dpService.java
2dp/A2dpStateMachine.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
tservice/JniCallbacks.java
tservice/ProfileService.java
dp/HealthService.java
fp/HeadsetService.java
id/HidService.java
pp/BluetoothOppRfcommListener.java
pp/Constants.java
an/PanService.java
bap/BluetoothPbapService.java
1404ab28fd296373a98b766b0b01193985446eab 21-Apr-2012 Harish Paryani <hparyani@broadcom.com> Added a comment

Change-Id: Ia52a0f58ee2085f3452877e23a591dcd842bafac
id/HidService.java
522003462124b08ef9345a6778df4089d202d6fa 20-Apr-2012 Harish Paryani <hparyani@broadcom.com> Corrected a comment

Change-Id: I365bf2dd835385629b7e7bbff649e9fdd6646db8
id/HidService.java
42a6e53f2ec04cbd78fea952fc926fdf3e5b8cd9 19-Apr-2012 Ravi Nagarajan <nravi@broadcom.com> Connection state change has to be handled in AudioOn state. Some headsets send RFCOMM disconnect prior to disconnecting the SCO. In this case the state machine has to handle the connection state change

Change-Id: Ib80a49cbd959055624baae6e5a35022c628f4bba
fp/HeadsetStateMachine.java
3fafe61ef25c1899fdc817c52163aec16c31055c 19-Apr-2012 Ravi Nagarajan <nravi@broadcom.com> Memory profiling changes : Updated the Bluetooth code to handle cleaning up of object references (context, handlers, and collection objects ) during service cleanup.Memory profiling changes : Updated the Bluetooth code to handle cleaning up of object references (context, handlers, and collection objects ) during service cleanup.

Change-Id: I2b0235f71c1feaf32215b2aaf89a2e06d8fa7d73
2dp/A2dpService.java
2dp/A2dpStateMachine.java
tservice/AdapterState.java
dp/HealthService.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
id/HidService.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
an/PanService.java
bap/BluetoothPbapService.java
ac234ef0ddd67471d82f77c41535a5ea1b68b443 19-Apr-2012 Kausik Sinnaswamy <kausik@broadcom.com> Added support to handle A2DP audio state changed events and broadcast
A2dp API intents

Change-Id: I1938e5e0acbbaf602239e14e1dfd3c890712930a
2dp/A2dpStateMachine.java
404743adf7bde44df9c8571f7890bc11f613d7ae 17-Apr-2012 Kausik Sinnaswamy <kausik@broadcom.com> BT icon not getting updated on profile connection due to incorrect handling of the prevState

Change-Id: Ibd3836047faebcaacb335898cc3d7392ab7571f4
tservice/AdapterService.java
9a0efb0ee8c63797280b3b9309782541134e9205 16-Apr-2012 fredc <fredc@broadcom.com> adapter non persistent service. Fixed null exception when profile services connect/disconnect

Change-Id: Iefafd1115471256d3107f039897e2af16077cdae
2dp/A2dpStateMachine.java
tservice/AdapterService.java
dp/HealthService.java
fp/HeadsetStateMachine.java
id/HidService.java
an/PanService.java
6654f5c903de510a70f9e72cd5ad7837b615d93f 12-Apr-2012 fredc <fredc@broadcom.com> Non persistent adapter service

Change-Id: I65e1c18e2899cea0a1e5c0102c4d24d39dce0249

Conflicts:

jni/com_android_bluetooth_hdp.cpp
jni/com_android_bluetooth_hid.cpp

Conflicts:

jni/com_android_bluetooth_hid.cpp
tils.java
2dp/A2dpService.java
2dp/A2dpStateMachine.java
tservice/AdapterApp.java
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
tservice/JniCallbacks.java
tservice/RemoteDevices.java
dp/HealthService.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
id/HidService.java
an/PanService.java
bap/BluetoothPbapReceiver.java
bap/BluetoothPbapService.java
990b2cd65392bc6db58eda732ad41de22b713202 12-Apr-2012 Priti Aghera <paghera@broadcom.com> Patch for inconsistent pair-unpair state

Change-Id: I356cd978c6b30b415a94267c9e535dc0297d6540
tservice/AdapterProperties.java
206363c7e1d2a7eb116aa6559c83431cd3f55def 11-Apr-2012 Ravi Nagarajan <nravi@broadcom.com> AT Response needs to be send for CNUM

Change-Id: Ia6aa0e91bc42b9a77143087f65b95c81117b9e3c
fp/HeadsetStateMachine.java
aa90f0cbb860434c5310ae6bfa16987834f582f0 11-Apr-2012 Priti Aghera <paghera@broadcom.com> Patch to fix getBondedDevices and inconsistent pair state

Change-Id: Idaf2a18dcaaaca422d3d5ee9245dbfa75cbbb96c
tservice/AdapterProperties.java
tservice/BondStateMachine.java
57addccaa75691f8eb6f35204d608a63695a9705 09-Apr-2012 Priti Aghera <paghera@broadcom.com> HID-PTS:Included API and calbabkcs for hid pts tests

Change-Id: I7f3b19dbcda24dbb0cd4700a54f7cd05e84d3745
id/HidService.java
d570893c5ec3bc9fd1860aa0355c550d3a51f8dd 09-Apr-2012 Kausik Sinnaswamy <kausik@broadcom.com> Improve BT enable/disable stability under stress tests

Change-Id: Ie6323a225b5e1ccd1ad9f65e90b144c93b957a8b
tservice/AdapterProperties.java
tservice/AdapterState.java
25ec7de5ff422f50f3dbfd0822423c85b47f4794 09-Apr-2012 Ravi Nagarajan <nravi@broadcom.com> Implement the getDevicesMatchingConnectionStates for A2DP

Change-Id: Icf5b14d13c4ee6564876aac529e992a22747ac41
2dp/A2dpStateMachine.java
c55ac7d42cf2d78c7edc67abf6c66813245b2c93 06-Apr-2012 fredc <fredc@broadcom.com> Added support for BluetoothDevice.fetchUuidsWithSdp()

Change-Id: Icd260b0cafd7fee72a7ad0275b62052257c6fc13
tservice/AdapterService.java
tservice/RemoteDevices.java
19da573973557408b1b7398a2c3a167d8da9527d 04-Apr-2012 Srikanth Uppala <suppala@broadcom.com> Fix discoverability timeout issues. (a) implement timeout logic (b) persist 'never timeout' after reboot (c) code cleanup

Change-Id: I9313277c39c69f90d0b0556cf24d9c30a774a0a6
tservice/AdapterProperties.java
tservice/RemoteDevices.java
8826b161f865350f306e8f287aaca615e2f1e4a3 04-Apr-2012 Matthew Xie <mattx@google.com> check device.mAlias null case before copying to it

Change-Id: I705126ce11272d9c3a5577c0266982a6478e8a87
tservice/RemoteDevices.java
9f0d856f41d443ec23d5aa2eecfc561d7a3c01d1 31-Mar-2012 fredc <fredc@broadcom.com> Initial checkin of OPP and PBAP

Change-Id: Ie43a26874bd5f0c00d69c2ce02430f4a16da327a
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppTransfer.java
bap/BluetoothPbapService.java
0708fe3087b690439dd9745b2cf1a96f29f570b0 04-Apr-2012 Syed Ibrahim M <syedibra@broadcom.com> Updated the AdapterState class to handle persisted Bluetooth setting after AIRPLANE MODE OFF event

Change-Id: I5e1ca111b72ff49498e87149c32769997e545c54
tservice/AdapterService.java
tservice/AdapterState.java
cc80b2261351dc74ad1bed237b0423c12d340514 14-Mar-2012 Matthew Xie <mattx@google.com> initial check in of rfcomm socket implementation Author: Zhenye Zhu, Matthew Xie

Change-Id: Ie3ab12c3bafc0a44e378a31c426c5eb41192f154
tils.java
tservice/AbstractionLayer.java
tservice/AdapterService.java
676cb1bdd1c14c7af56562bab51f168e7f8f6d62 23-Mar-2012 Matthew Xie <mattx@google.com> Initial implementation of hdp service and jni

Change-Id: Ieca906080835098383cabbc13fa914363459f555
tservice/AdapterService.java
dp/HealthService.java
f8d98da947bbb9e2380a60df89acbcbd4ca680af 03-Apr-2012 Kausik Sinnaswamy <kausik@broadcom.com> Fixed incorrect handling of the RSSI during inquiry which causes the devices to not get sorted properly.

Change-Id: Ib4eca5405a3393aef79f43943853adf76da23e76
tservice/AbstractionLayer.java
8f8e1bdc4dfc5d9d974b0e0b01dbe981707c9c6f 30-Mar-2012 Ravi Nagarajan <nravi@broadcom.com> ATD commands have a trailing ';'. Remove the trailing ';' prior to dialing a call. Else a send tone popup is received.

Change-Id: Icbd53166001d3be102bac6a8d2f782cb22c4dc56
fp/HeadsetStateMachine.java
b01cf4299897d227c7dbcbe4981b63a1ffe4ffca 30-Mar-2012 Sreenidhi T <nidhit@broadcom.com> Fixed the pairing variant check typo.

Change-Id: I1a835531bc35cc6b1a178a0d131a86715df6f3f0
tservice/RemoteDevices.java
5f1bee8200197a49d8ffc49fe3e91d19c927ff52 28-Mar-2012 Ravi Nagarajan <nravi@broadcom.com> Resolved HSP PTS issues. When call is active, and CKPD is received: 1. If audio is not ON, audio will be enabled 2. If audio is ON, call with be disconnected (fixed a typo here, which answered the call, instead of hangup)

Change-Id: Ib60f7109f9fe982523c3db68ea6014c25bad8262
fp/HeadsetStateMachine.java
b18d6a7da48a6847df88abadd42fbb51316cb76d 27-Mar-2012 Ravi Nagarajan <nravi@broadcom.com> Integrate HFP with VR app. Handle both cases where VR is started by peer as well as launched from the phone

Change-Id: Icf2922f4caf20190fdb3f0afa2ddd19d1852c4fb
fp/HeadsetStateMachine.java
35207a5638f61caca5b9abb31e5c6850a9478a52 22-Mar-2012 Matthew Xie <mattx@google.com> initial implementation of hid service and jni

Change-Id: I527651bd85ad3adddbf4b89802f4a6128c9fa047
tservice/AdapterService.java
id/HidService.java
345d21b0575a4b866bfc9ccfde9c654e7b859ac6 20-Mar-2012 Matthew Xie <mattx@google.com> Fix persistent audio on, Donot connect_audio when enter CONNECTED state. Process DISCONNECT message in AudioOn state.

Change-Id: Id89842ff2179234c320752ae69dcf3c99b125bce
fp/HeadsetStateMachine.java
bcbeaf69468424800a939b3e8678eaef21efa3d6 09-Mar-2012 Matthew Xie <mattx@google.com> process slc_connect state change event, query and send stack the phone state

Change-Id: I4472384290d87f13f7be5647327c789c01582a7b
fp/HeadsetHalConstants.java
fp/HeadsetPhoneState.java
fp/HeadsetStateMachine.java
ab1a751670c1bceb23f3cf880f6ad9421c0487c2 19-Mar-2012 Matthew Xie <mattx@google.com> Revert "fix persistent audio on, Donot connect_audio when enter CONNECTED state"

This reverts commit 3ce52a01d734e73a21074ab8397cf67b16d6595f

Hi Matt,
I reviewed your changes (2), and they look good. However, your changes in (1), seem to be causing a side-effect while testing the headset connection setup while call is active/outgoing/incoming. Since this change was merged, I am sending my comments thru email.
Here is the scenario
1. No headset connection

2. Place an outgoing call, and answer it at the remote side

3. Initiate connection from headset

4. SCO seems to be setup by Java side even before SLC setup completes

ISSUE#1: Once Java receives connection event, it automatically calls connect_audio, even though SLC has not been setup
ð Can you make a change to call connect_audio, only after SLC is complete? If this difficult to do, can this code just be removed, as the stack will do automatically after SLC setup when phone_state_change is called

ISSUE#2: If we redo this for an outgoing call (call answered prior to headset connection), then the Java side does not initiate SCO audio
ð To have a consistent behavior, if Java side is setting up SCO for active call, shouldn’t we be doing the same for outgoing call too?

Thanks
Ravi
fp/HeadsetStateMachine.java
53b834a8a7f9f077ff751ade222d2f81d9d6fdad 09-Mar-2012 Matthew Xie <mattx@google.com> fix persistent audio on, Donot connect_audio when enter CONNECTED state

Change-Id: Ieb2c327ab562c02f293fa616e555ed5a8dc55570
fp/HeadsetStateMachine.java
47ead0fdf1786e6f0c5bde1c6b1b40b08168edb9 10-Mar-2012 Matthew Xie <mattx@google.com> output call back event information

Change-Id: I6a84a19f91fbb102668745623327f7e234c2ad5d
fp/HeadsetStateMachine.java
f0b6639617ce2245ffb88968e8a864d0fa99dd8c 09-Mar-2012 Matthew Xie <mattx@google.com> Save volumes and notify stack only when they change

Change-Id: Ibcf6a55111ee3d6ecab6ecd75ab957258b35e49c
fp/HeadsetPhoneState.java
fp/HeadsetStateMachine.java
986b5b03a378385bfea6c5cc6b6c1d7f0424e0a5 09-Mar-2012 Ravi Nagarajan <nravi@broadcom.com> Added new state BT_BOND_STATE_BONDING. Stack will send a callback for all three states, app does not have to rely on the api return code to switch to bonding. This addresses the incoming pairing as well as the remote unpaired test cases

Change-Id: I37208e5bae7264a0ff78195322ba0a6bd1d82f0f
tservice/BondStateMachine.java
9b300c1a33952a22c3bba1521da2d01cbf607b7b 08-Mar-2012 Matthew Xie <mattx@google.com> update call state to match hf hal header, memory dial fix null pointer

Change-Id: I62f26d0259a910ac80d7a18c6bef49abb6eab820
fp/HeadsetHalConstants.java
fp/HeadsetStateMachine.java
6c91bc0a163cc7600c40d7fb979777fd911d1ef1 17-Feb-2012 Matthew Xie <mattx@google.com> Initial implementation of HFP and A2DP profile/service/statemachine.

Change-Id: Ic6e6d358b94313f237b7be61b70dcc6f4f7902e7
2dp/A2dpService.java
2dp/A2dpStateMachine.java
tservice/AdapterService.java
fp/AtPhonebook.java
fp/HeadsetHalConstants.java
fp/HeadsetPhoneState.java
fp/HeadsetService.java
fp/HeadsetStateMachine.java
1444b5b09d07b1ad5ec2ce89b4267484be25e8bf 07-Mar-2012 Jaikumar Ganesh <jaikumar@google.com> Incoming pairing issue.

Change-Id: Idd77d49a9d6df94e6dc9dfe4f179e93641d48261
tservice/RemoteDevices.java
b9122437dc3562f8306b1c8bc97124dc8c33ae45 07-Mar-2012 Jaikumar Ganesh <jaikumar@google.com> Fix Bond State Machine device list.

The device list was adding the device twice.
Note: This whole class should be removed and moved to
the stack.

Change-Id: I6086ee98bd1b4088a90b76f67a9fff21987f4b04
tservice/BondStateMachine.java
44abcd2791995793a5de09906b0ce6ed51bb6080 07-Mar-2012 Jaikumar Ganesh <jaikumar@google.com> Set scan mode to be connectable when turning on.

If scan mode is not set, set it to be connectable.

Change-Id: I146505dade5d46aa70068cdaada94c06f30d75de
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
fba70fe2abecf70b9f9f7ee09a21cbfc6cb73998 07-Mar-2012 Jaikumar Ganesh <jaikumar@google.com> Add ability to persist Bluetooth state.

Currently, BT is turned on when the Service is started,
if needed. This needs to be changed when BT is not a persistent
process.

Change-Id: I1c36aa75824622a739241d6d4e9aeacbf46e56af
tservice/AdapterService.java
tservice/AdapterState.java
b7e70fcf8923b9452074b2b4ee685da424cc7d93 07-Mar-2012 Kausik Sinnaswamy <kausik@broadcom.com> Merged the Passkey request callback and the passkey reply APIs into the SSP API and callback respectively

Change-Id: I2b8fb1665586d32b0ada1b882cbde1d232233803
tservice/AbstractionLayer.java
tservice/RemoteDevices.java
581bb31a8165ff0f9c7d638cfe4a81aaaafa2ded 06-Mar-2012 Jaikumar Ganesh <jaikumar@google.com> Remove passkey callback.

Use ssp callback for all 3 forms of 2.1 pairing.

Change-Id: I13af1eecc3469e4db8e656717700a1f9166177e3
tservice/AbstractionLayer.java
tservice/AdapterService.java
tservice/JniCallbacks.java
tservice/RemoteDevices.java
fe90735bb6280ccaceb8a0a990781a810a2dd33e 07-Mar-2012 Jaikumar Ganesh <jaikumar@google.com> Fix scan mode bug.

The incorrect paramter was being passed.

Change-Id: Icc119811d61ffa537b837a6712a85ea9dcefaa87
tservice/AdapterService.java
ff68148a7fb74947ea5e7a337161108363cbe9f5 21-Feb-2012 Jaikumar Ganesh <jaikumar@google.com> Fix Bluetooth enable issue.

The stack sends all the property changes,
before sending enable. Hence, we don't need to
wait anymore.

Also fix the return value check for get_property.

Change-Id: Icac32cd74f9028c40ab6b5018b576168c9dac3b9
tservice/AdapterState.java
ff4f17bf64978d0738c66e1b6dd70be8664efc24 20-Dec-2011 Jaikumar Ganesh <jaikumar@google.com> Initial commit for new Bluetooth stack interface.

1. Changes to Android.mk file
2. changes to make the process persistent. This is temporary.
3. Addition of new java and jni classes.

Change-Id: I2453c7a1a475c66bf52f3a84cd8beb12dd37b87a
tils.java
tservice/AbstractionLayer.java
tservice/AdapterProperties.java
tservice/AdapterService.java
tservice/AdapterState.java
tservice/BondStateMachine.java
tservice/JniCallbacks.java
tservice/RemoteDevices.java
2a6bf35f603d12e6533a69c773ac258b0e84941f 02-Feb-2012 Jaikumar Ganesh <jaikumar@google.com> Comments opp and PBAP init code when BT gets enabled.

Change-Id: Id1b9329cb4dba7f4d4e5f478a775bcfd18a68a66
pp/BluetoothOppRfcommListener.java
bap/BluetoothPbapService.java
1eb1a249ee36c3e037355cce6d50511864dc0e7f 17-Jul-2012 Matthew Xie <mattx@google.com> Revert "first patch of test submit"

This reverts commit 1429606cdb0c5b4410a224697e0ac2459ebe4cb7
pp/BluetoothOppBatch.java
1429606cdb0c5b4410a224697e0ac2459ebe4cb7 16-Jul-2012 Matthew Xie <mattx@google.com> first patch of test submit

Change-Id: Ief4f86f471ac62b11b9dcd4cae937d7fb261ba69
pp/BluetoothOppBatch.java
5cb59523d7d7e25c58bd99c100c50e49c78481ce 15-Jun-2012 Matthew Xie <mattx@google.com> Change timestamp type from int to long, timestamp(now) overflows int

BluetoothOppNotification NotificationItem.timeStamp is int, too
small to be a timestamp
bug 6670668

Change-Id: Ieec5377bac3b8c7fbaa24d059ad5957ba9a0544f
pp/BluetoothOppNotification.java
03f25a2055e51bcc5e8870642763b502956b6830 18-May-2012 Martijn Coenen <maco@google.com> Bluetooth OPP: Allow sending all mime-types for handover.

This change allows sending of all mime-types through
ACTION_HANDOVER_SEND and ACTION_HANDOVER_SEND_MULTIPLE.
These intent actions are only used by NFC when doing
handover transfers, and require the whitelisting
permission that is only granted to system applications.

Similarly, for receiving, we will still reject certain
mimetypes, except if the transfer was whitelisted because
it was a handover transfer.

At this moment, only the NFC service has the signature
permission required for whitelisting.

This change also allows to send files without extension,
as long as OPP has a valid mimeType. This is useful when
using OPP in combination with a content provider, which
may specify filenames without any extension but with a
valid mime-type.

Bug: 6561169
Change-Id: Ia39418de6bcb2f8af678c7b8637b63b1697eb493
pp/BluetoothOppHandoverReceiver.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppReceiveFileInfo.java
pp/Constants.java
acc04ecbd174b07d580248aaf6640c3d2b42ca49 24-May-2012 Martijn Coenen <maco@google.com> Merge "Fix variable initialization." into jb-dev
a1f935d1a2a21d82a4069d1832e2d7239d7a256f 24-May-2012 Martijn Coenen <maco@google.com> Fix variable initialization.

This could cause Bluetooth file transfers to fail.

Change-Id: I69b91e84cb7df1f147581e37f056eeacd54687d8
pp/BluetoothOppLauncherActivity.java
4bfe5662b7169484d32186a2042cb88cdbc446ba 17-May-2012 Martijn Coenen <maco@google.com> Merge "Allow bluetooth OPP transfers to be stopped." into jb-dev
584dfb2c53b45080347e412b3f7ed7fd1c9b53e7 16-May-2012 Martijn Coenen <maco@google.com> Allow bluetooth OPP transfers to be stopped.

If handover requesters such as NFC want to cancel an
ongoing transfer, they can use this intent. It requires
the same permission that is used for whitelisting,
which at this point is only granted to the NFC service.

Change-Id: I89e27550d700c4a29a892dba99fda740d8845642
pp/BluetoothOppHandoverReceiver.java
pp/Constants.java
d5e1472188b7e21123a02339ed8766256aa8f630 15-May-2012 Martijn Coenen <maco@google.com> Don't MediaScan files received through handover.

Handover providers such as NFC may move the file in the filesystem
(out of /bluetooth), hence it's better not to scan them here.

Change-Id: Ic374c5ae880cb65e2d8a9ce615115b51fdc29353
pp/BluetoothOppService.java
7a4cc5c2f6ec06e8dc6f930680ce9aceff6df359 14-May-2012 Martijn Coenen <maco@google.com> Add BT address and mimeType to handover intents.

Also, allow refreshing whitelisted entries by sending
another whitelist intent.

Change-Id: If85db397e31364939c67b3018413b625a1888ae6
pp/BluetoothOppManager.java
pp/BluetoothOppNotification.java
pp/BluetoothOppReceiver.java
pp/Constants.java
8099f5e7bfa7227ba674b5f0076f331e737bafd7 06-Apr-2012 Martijn Coenen <maco@google.com> Additional changes to support Bluetooth Beam.

- Added a whitelist permission, to ensure only system
services (such as NFC) can whitelist MAC addresses.
- Added HANDOVER_STATUS permission, to ensure handover
transfer status can only be received by eligible services
(such as NFC).
- Added new confirmation type HANDOVER_CONFIRMED; this indicates
the transfer was initiated by a handover, and doesn't need to be
confirmed. This type is also reused to send broadcasts
to the NFC service, so the NFC service can show notifications
and deal with the received data.
- Added 15 second timeout to whitelist.
- Modify notication code to not show any notifications for handover
transfers; instead, send broadcasts to indicate handover status.
- Modify "transfer complete" code to sendbroasts to indicate handover
status.
Change-Id: I00c08e09eaf44f0bd4bd837cb6b0c37b802742bc
pp/BluetoothOppHandoverReceiver.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppManager.java
pp/BluetoothOppNotification.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppProvider.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppTransferInfo.java
pp/BluetoothOppUtility.java
pp/BluetoothShare.java
pp/Constants.java
d6eaf19f39e163e16d22e29907edec402b30622e 04-Apr-2012 Nick Pelly <npelly@google.com> First cut at Bluetooth Beam.

Add Bluetooth address white-listing to avoid receive confirmation from
Beam interactions.

Change-Id: I25720c6e902c494cbb9845a30a175edad4225b89
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppManager.java
pp/BluetoothOppProvider.java
pp/BluetoothOppReceiver.java
0ac98162ff293fdaa23f93f9839aaad5428af537 18-Nov-2011 Chih-Chung Chang <chihchung@google.com> Read the requested file size completely.

This was causing failures while sharing pictures
from Picassa over Bluetooth.

Bug:5632161.

Change-Id: Ieb2697513299270b2982ebc6c9f0b367adf36d3a
pp/BluetoothOppObexClientSession.java
93ee510229f845a26f57630f32af0093869c1baf 21-Sep-2011 Daisuke Miyakawa <dmiyakawa@google.com> Merge "Only format PAUSE/WAIT character."
d956b40b2f59599447ae0fa0762e055c0c0ce1a3 19-Sep-2011 Daisuke Miyakawa <dmiyakawa@google.com> Only format PAUSE/WAIT character.

Must be after Iff9461d8c71c5800b0731c3708867003d75bb395

Bug: 5348938
Bug: 4177894
Change-Id: I0c5b5b759d11c9d494f9550b9a7bfe948a0690b6
bap/BluetoothPbapVcardManager.java
eb1192b4208d4bf77c92011822e6d171b9f09980 20-Sep-2011 Jaikumar Ganesh <jaikumar@google.com> Reject OBEX connection request for OPP with Target.

According to OPP OBEX specification Sec 5.4, the Push
client should not use target header.

Patch contributed by: inshik.shin@samsung.com

Change-Id: Iaeaa2d488da6592f8bb76a9957ca4b784d032803
pp/BluetoothOppObexServerSession.java
dca6152362544ce9d430ca8f2ece7d5dc0f278d1 08-Sep-2011 Jaikumar Ganesh <jaikumar@google.com> Enforce permissions for Connection dialog intents.

Change-Id: I240985998b0d245aacb051e64b5fdaa335c9c06a
bap/BluetoothPbapService.java
dec631a77ab9cc89c4d3867b80cfe300e7cf83e9 02-Sep-2011 Jake Hamby <jhamby@google.com> Use Notification.Builder.setProgress() for progress notifications.

- Convert OPP service to use the new API to create notifications
with a ProgressBar, replacing the previous custom layout.

Bug: 5143664
Change-Id: Iae5e2d417e735588e11c4d17e4172ca40b9dfe73
pp/BluetoothOppNotification.java
ce8d51a3a43d113a4a6bad30d595c2a81d0f623c 21-Mar-2011 Yoshiharu Kurita <yoshiharu.x.kurita@sonyericsson.com> Handle PBAP response packet as raw bytes

Adjust PBAP response packet to be always handled as bytes.
Currently, it is handled as string when is read from internal data.
This causes the lack of PullvCardListing packet and the abort of
PullPhonebook transaction when multi-byte characters are contained
into corresponding contacts.
This fix will avoid the lack and the abort by writing whole packet
into the target stream as byte.

Change-Id: I17ee3ada25718cc263c9e0942f75605bd971b638
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapVcardManager.java
cab07635ea60924a4e9dc13f87a4408988ad4c57 23-Aug-2011 Jaikumar Ganesh <jaikumar@google.com> Fix SendConnection state params.

Reported by: sj222.choi@samsung.com

Change-Id: I67da4f8a19be72092aa6cd139e561f4e9dfc5f8f
bap/BluetoothPbapService.java
72d2952fcde46d8c2adc68718957c2fe9f5fa3b0 22-Aug-2011 Jaikumar Ganesh <jaikumar@google.com> Update sendConnectionState change function paramter.

Change-Id: Iaf7e43d35ab4a5da325ebae77cbb72617705c772
bap/BluetoothPbapService.java
1f18480dfa9ea5557bcd5928a4c152ab40b85c7e 15-Jun-2011 HÃ¥kan3 Johansson <hakan3.johansson@sonyericsson.com> Send local time, not GMT, in timestamp.

The missed, incoming and outgoing call list shall always have its
time specified in local time according to PBAP V10r00 chapter
"3.1.4.1 Call History extension".

Change-Id: If0c4733552db3813d636a2f4658e64df1c6a4efe
bap/BluetoothPbapCallLogComposer.java
ef697b0b9a74e15b5003e134307e72b20b48de12 02-Aug-2011 jhtop.kim <jhtop.kim@samsung.com> Bluetooth : fix for the OPP service bug while BT on/off

Update patch set for removing BOOT_COMPLETED.

BluetoothOppService.java : use sendMSG instead of sendMSGdelayed
BluetoothOppReceiver.java : delete boot-complete line
AndroidManifest : delete boot-complete line

Change-Id: Icf9a2f48a70ba519cb3caf93a0b33e13472d1f54
Author: jhtop.kim <jhtop.kim@samsung.com>
pp/BluetoothOppReceiver.java
pp/BluetoothOppService.java
66cbd62c4837f1e9a261fb1bde1d470c904f2346 04-Aug-2011 jhtop.kim <jhtop.kim@samsung.com> Bluetooth :fix opp for socket error retry

When the pin or link key missing case occurs,
we need to retry the socket connection. Use a timeout
of 1.5 secs instead of 2.5 secs because the ACL inactivity
timer is 2 secs.

Change-Id: I3d4c096bd823e3204e91040bea608e44471dd4ce
pp/BluetoothOppTransfer.java
6861c09108700815891920147247f2cf48261ee4 02-Aug-2011 Jaikumar Ganesh <jaikumar@google.com> Check if BT is already enabled before starting activity.

If BT is off, and if the user sends a file, BT will be turned on
and the "Enabling dialog" wil be shown. But with the hot feature,
BT turns on very fast which leads to the intent being missed and the
enabling dialog not being dismissed.

Change-Id: I4f4a6f08e04922a61eb7138b76383a77f8d37da4
pp/BluetoothOppBtEnablingActivity.java
77e6229d558b52c316fdba8dd29a6b26fb13fd28 30-Jul-2011 jhtop.kim <jhtop.kim@samsung.com> Bluetooth : fix for pbap ANR while BT on/off

Don't wait to start the listener.

Change-Id: I257332bc38a25b3ca772267a974b4280a8074c40
bap/BluetoothPbapService.java
b0b662a98d8b7c099ee706d0e08bd239adcdffc7 27-Jul-2011 Jaikumar Ganesh <jaikumar@google.com> Fix notification issues with OPP.

Since its a notification event for an ongoing event, add the flag.
That prevents it from being scrollable.

Change-Id: Iaea2e7005cb4f8ab5d0b594c4ef9b30343b730fc
pp/BluetoothOppNotification.java
7eab97d6be9228b1c210bbb171c3e5e88e02f3d8 28-Jun-2011 Matthew Xie <mattx@google.com> Move Pbap permission dialog to Settings app.

Strings and diglog are removed and will reappear and modified in Settings
app. We want phone AT commander to use the dialog too.
bug 4489572

Change-Id: I0283b5deff974e53384dc5a92bd01c02e12bbcd6
bap/BluetoothPbapActivity.java
bap/BluetoothPbapService.java
bf287751bfa6795493b80b0f22854f747f6f974a 22-Jun-2011 Jaikumar Ganesh <jaikumar@google.com> Merge "pullVcard of unknown phone number"
d54a9ac9fd18e2f1df30774a0b6902b91752ea66 22-Jun-2011 Jaikumar Ganesh <jaikumar@google.com> Merge "Revert "pullVcard of unknown phone number""
77ba5f6684f4dd7e4b7fc37982271da5654aec07 21-Dec-2010 Staffan Lindvall <staffan.lindvall.x@sonyericsson.com> pullVcard of unknown phone number

When performing a pullVcardListing, pullVcardEntry or pullPhonebook
on a phone with a call list which contains an unknown phone number,
the phone returns "-1" as number/name. Corresponding errors exist
for private and payphone numbers, where the phone returns the name
"-2" and "-3", respectively. During pullVcardListing the Name
attribute may contain the phone number, in case the name is not
known. The latter is already implemented today, however, instead of
using e.g. "-1" as name when the phone number is not known the
phone should use Name = "Unknown". Currently there are no other
matching corresponding strings defined for private and payphone
number, which means that for now "Unknown" may be returned as name
also for these numbers.
During pullVcardEntry and during pullPhonebook when the phone number
is unknown then the Number attribute should contain the string
"Unknown". During the same scenario the FN and N attributes both
should contain the string "" when the name is not known. When it
comes to private and payphone numbers the same as for
pullVcardListing apply here, i.e. "Unknown" may be used in the
Number attribute also for these numbers

Change-Id: Icf06e527032588f075ff848bea1ba90bf71e874f
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapVcardManager.java
2f429e31a13f81c9248173b144efca32c0070045 22-Jun-2011 Jaikumar Ganesh <jaikumar@google.com> Revert "pullVcard of unknown phone number"

This reverts commit 86d30be8aa68d0a2b561c36b53f4e5ebe586fe72.
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapVcardManager.java
44c347ad717ca51b00819736227f7a9c81905396 15-Jun-2011 Liejun Tao <L.J.Tao@motorola.com> Modify the Rfcomm retry logic

In BluetoothOppTransfer where we check mRetry and e.getMessage()
if mRetry is false and e is not "Invalid exchange", the transfer is stuck

Change-Id: Ie7a4da215c9e74e167db9fa29c6e113a7a7a2c77
pp/BluetoothOppTransfer.java
d318d6a134efc5bd43653c463699802381f2e0cb 08-Jun-2011 Jaikumar Ganesh <jaikumarg@android.com> am 9d67ffda: am c50dbb00: Merge "OPP: Notification position is changing"

* commit '9d67ffdac68b49cfc72491f7e2c340df922dbcca':
OPP: Notification position is changing
81512ba08c038366688fbe918373f7a9d3e31c9a 08-Jun-2011 Jaikumar Ganesh <jaikumarg@android.com> am 6874774a: am e7df5087: Merge "Handle OBEX Abort packets sent from remote device"

* commit '6874774ab6b2fe5d90896be756d26a9887e4124b':
Handle OBEX Abort packets sent from remote device
9d67ffdac68b49cfc72491f7e2c340df922dbcca 07-Jun-2011 Jaikumar Ganesh <jaikumarg@android.com> am c50dbb00: Merge "OPP: Notification position is changing"

* commit 'c50dbb0067de1772ced124f5982a59468ad81426':
OPP: Notification position is changing
6874774ab6b2fe5d90896be756d26a9887e4124b 07-Jun-2011 Jaikumar Ganesh <jaikumarg@android.com> am e7df5087: Merge "Handle OBEX Abort packets sent from remote device"

* commit 'e7df508750728dc2bbd7729d54673bf16f7688c3':
Handle OBEX Abort packets sent from remote device
c96189602abe4cb3ca2ee97fa6fdc383a05930ba 06-Jun-2011 Jaikumar Ganesh <jaikumarg@android.com> am 29cedf41: am a2407587: Merge "Require bonding and encryption for PBAP server"

* commit '29cedf4183144e450c226dec6668ff0d633cee93':
Require bonding and encryption for PBAP server
29cedf4183144e450c226dec6668ff0d633cee93 06-Jun-2011 Jaikumar Ganesh <jaikumarg@android.com> am a2407587: Merge "Require bonding and encryption for PBAP server"

* commit 'a2407587440d487aa0171638eef29526515fde59':
Require bonding and encryption for PBAP server
c50dbb0067de1772ced124f5982a59468ad81426 01-Jun-2011 Jaikumar Ganesh <jaikumarg@android.com> Merge "OPP: Notification position is changing"
9abe9c9e1ccad600b1069490293d78dfd984017b 22-Feb-2011 Andreas Areskoug <andreas.areskoug@stericsson.com> Handle OBEX Abort packets sent from remote device

This patch adds support for handling OBEX Abort packets
sent from remote device, where the remote device is acting
as a client, sending files to the server.

Depends-On: I0fc2255c463c5ce1e8fa1d7febf144b60965a1be

Change-Id: I4bce05a9007ba02e9d9987ec3cbbf1db380247f0
Signed-off-by: christian bejram <christian.bejram@stericsson.com>
pp/BluetoothOppObexServerSession.java
86d30be8aa68d0a2b561c36b53f4e5ebe586fe72 21-Dec-2010 Staffan Lindvall <staffan.lindvall.x@sonyericsson.com> pullVcard of unknown phone number

When performing a pullVcardListing, pullVcardEntry or pullPhonebook
on a phone with a call list which contains an unknown phone number,
the phone returns "-1" as number/name. Corresponding errors exist
for private and payphone numbers, where the phone returns the name
"-2" and "-3", respectively. During pullVcardListing the Name
attribute may contain the phone number, in case the name is not
known. The latter is already implemented today, however, instead of
using e.g. "-1" as name when the phone number is not known the
phone should use Name = "Unknown". Currently there are no other
matching corresponding strings defined for private and payphone
number, which means that for now "Unknown" may be returned as name
also for these numbers.
During pullVcardEntry and during pullPhonebook when the phone number
is unknown then the Number attribute should contain the string
"Unknown". During the same scenario the FN and N attributes both
should contain the string "" when the name is not known. When it
comes to private and payphone numbers the same as for
pullVcardListing apply here, i.e. "Unknown" may be used in the
Number attribute also for these numbers

Change-Id: I33cf6ceecf5c8fba426eacbb3a507228f8e4de4d
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapVcardManager.java
74e5eba4a45ecca87eec3ac1762ca527cc614d78 12-Apr-2011 erik.ljungberg <erik.ljungberg@sonyericsson.com> OPP: Notification position is changing

If several transfers is ongoing the Bluetooth transfer notification
is changing position. The reason for this is that the when field is
not set in the notification. Solved by setting when.

Change-Id: If999fae6dd2d6b5de38c3bfeba786ad2df9da48f
pp/BluetoothOppNotification.java
a2407587440d487aa0171638eef29526515fde59 26-May-2011 Jaikumar Ganesh <jaikumarg@android.com> Merge "Require bonding and encryption for PBAP server"
4672c98499234667141ddd7ffcdd7db6acc45fd3 22-May-2011 Jaikumar Ganesh <jaikumarg@android.com> am b5f6bb1a: am d8a9af40: Merge "BT: Fix for vCard Listing error"

* commit 'b5f6bb1afba8d322d7453cb6a24751599897234a':
BT: Fix for vCard Listing error
b5f6bb1afba8d322d7453cb6a24751599897234a 21-May-2011 Jaikumar Ganesh <jaikumarg@android.com> am d8a9af40: Merge "BT: Fix for vCard Listing error"

* commit 'd8a9af404413ad060eb4aa29a32370b44e61327e':
BT: Fix for vCard Listing error
d8a9af404413ad060eb4aa29a32370b44e61327e 20-May-2011 Jaikumar Ganesh <jaikumarg@android.com> Merge "BT: Fix for vCard Listing error"
73adcc0f5b6051ef514a3f16a2e28eabee2b367e 02-May-2011 Conley Owens <cco3@android.com> Merge commit 'a2f16c01' into m

Conflicts:
src/com/android/bluetooth/pbap/BluetoothPbapCallLogComposer.java
src/com/android/bluetooth/pbap/BluetoothPbapVcardManager.java

Change-Id: Ib3533b9713373c84636940dbe3e41203898aef46
a2f16c010b59d3bc9ff978b178ded62c1e2b9d8f 30-Apr-2011 Conley Owens <cco3@android.com> am 4da2545c: am f6dace4a: Merge "Bluetooth: Add vCard version support for call history."

* commit '4da2545c8543c7ba4729f63c86a38008309ec870':
Bluetooth: Add vCard version support for call history.
f6dace4a1ed909d9a5f87781a7c4e02cc06fc021 29-Apr-2011 Conley Owens <cco3@android.com> Merge "Bluetooth: Add vCard version support for call history."
174a747944b553c654d149140d034612924d3ece 05-Apr-2011 Par-Gunnar Hjalmdahl <par-gunnar.p.hjalmdahl@stericsson.com> BT: Fix for vCard Listing error

This patch fixes listing of the incomplete vCard xml file, which
contains special characters which are larger than one byte.

Change-Id: Ice5a056004aa30255a06f8742428d4bcfa5813c8
Signed-off-by: christian bejram <christian.bejram@stericsson.com>
bap/BluetoothPbapObexServer.java
91fec75311a589cb56260c1c724217e2987055b2 26-Apr-2011 Jaikumar Ganesh <jaikumarg@android.com> am 2db76af8: am a96efa27: am 16fc087d: Merge "Fixing crash in BluetoothPbapService."

* commit '2db76af8fa625692430dfc1a21910be2eaa92581':
Fixing crash in BluetoothPbapService.
2db76af8fa625692430dfc1a21910be2eaa92581 26-Apr-2011 Jaikumar Ganesh <jaikumarg@android.com> am a96efa27: am 16fc087d: Merge "Fixing crash in BluetoothPbapService."

* commit 'a96efa270cf215602b0ab1f3603c24aadff808da':
Fixing crash in BluetoothPbapService.
7d6a3299b58c5b53de4016a2e199974b94ae90df 26-Apr-2011 Mathias Jeppsson <mathias.jeppsson@sonyericsson.com> Fixing crash in BluetoothPbapService.

If Bluetooth is turned off while there is an PBAP connect request
pending, the status bar notification or yes/no activity will not
disappear. If user selects yes, an intent will start PbapService
again. PbapService will try to make the device trusted. As this
instance of PbapService don't have any connected device, crash will
occur.

Make sure status bar notification or yes/no activity disappears, by
sending timeout intent when Bluetooth is turned off.
Also, PbapReceiver should not forward any intents except STATE_ON
if Bluetooth is off as this will start the PbapService.

Change-Id: Iee4f95ab2de34db6e00ff9b1fd7f8677947b8f4f
bap/BluetoothPbapReceiver.java
bap/BluetoothPbapService.java
013de33607d3bcde51074d12ffe4e2c2d734fdcd 14-Apr-2011 Jaikumar Ganesh <jaikumarg@android.com> am 929d38f9: am 3c68bca8: am 138654ff: Merge "The phone did not reject unsupported vCalendar item"

* commit '929d38f9226a00941571804a490e76eb4c6eef10':
The phone did not reject unsupported vCalendar item
929d38f9226a00941571804a490e76eb4c6eef10 14-Apr-2011 Jaikumar Ganesh <jaikumarg@android.com> am 3c68bca8: am 138654ff: Merge "The phone did not reject unsupported vCalendar item"

* commit '3c68bca80f40710b70e3f9173cea167b30a8dcb4':
The phone did not reject unsupported vCalendar item
76d17f9aff4a4aaad0f5af91eee1028473c10b16 06-Dec-2010 Olsson <ola1.olsson@sonyericsson.com> The phone did not reject unsupported vCalendar item

vCalendar is not supported in the phone but it was not
rejected. A blacklist was present in the code but not
used. Hence, this fix enables the blacklist functionality.

Change-Id: I4fefe0e819eb025d37c972cf7e74eabd4f6e6585
pp/BluetoothOppObexServerSession.java
fdd53743b3498251e567e5bd842d945247bc22c4 31-Mar-2011 Daisuke Miyakawa <dmiyakawa@google.com> Merge "Reflect vCard API change"
4b6529651194554bffbeb36baf9b14b09d610e61 31-Mar-2011 Jaikumar Ganesh <jaikumarg@android.com> am 59199b74: am a4f55f77: am c298d29b: Merge "Add check for null pointer to avoid crash."

* commit '59199b744c6f107afaac8ec9347d1c04ca6b2ab8':
Add check for null pointer to avoid crash.
3c4d2c77c2fffe675fbe89ba58856686b6873d2f 17-Mar-2011 Daisuke Miyakawa <dmiyakawa@google.com> Reflect vCard API change

Remove dependency toward OneEntryHandler in vCard code.

This change doesn't take care of oom for simplicity.

See also Id623814e8f5961aaf9cf9b4dcc92f75ace401148

Bug: 4066223
Change-Id: I3c5a58fef5a404b992a3c17578eeb63518294231
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapVcardManager.java
59199b744c6f107afaac8ec9347d1c04ca6b2ab8 30-Mar-2011 Jaikumar Ganesh <jaikumarg@android.com> am a4f55f77: am c298d29b: Merge "Add check for null pointer to avoid crash."

* commit 'a4f55f7702bca57c0dbb543ee3e2cb1686e616fc':
Add check for null pointer to avoid crash.
c298d29b081e4240c80750e9431b7189d0b38513 30-Mar-2011 Jaikumar Ganesh <jaikumarg@android.com> Merge "Add check for null pointer to avoid crash."
b3c06ce9377661a63bc2fbd182c219fd69453b1d 21-Mar-2011 Mathias Jeppsson <mathias.jeppsson@sonyericsson.com> Require bonding and encryption for PBAP server

The Phonebook Access Profile specification requires bonding and
encryption. For devices not supporting SSP (Secure Simple Pairing),
InsecureRfcomm will require neither. Adding EncryptedRfcomm to force
bonding and encryption but not requiring authenticated link key.

Change-Id: I987ca50ff7f60813b5311cead8d6a30a9123d54b
bap/BluetoothPbapService.java
6b923ee6bf0c80dc4edeabb3694132f3fd40ce03 10-Mar-2011 Daisuke Miyakawa <dmiyakawa@google.com> Use old version of vCard composition method

Must be after I91b65f881e1712ecf82c2e119a92bc70c43c623c

Bug: 4066223
Change-Id: Icca2019b10fc84e437efbc2606cd5703b3ea0a5f
bap/BluetoothPbapVcardManager.java
98a53e5bdb2500109c304f2b5364c1715ab745d8 06-Dec-2010 martin ma <martin.ma@sonyericsson.com> Add check for null pointer to avoid crash.

This is added in order to prevent a crash. Also, updating the name
of a device to null, making it appear as 'Unknown', is probably not
intended.

Change-Id: Ibd3c93741489aae9118ba7b45223d58d5de6812f
pp/BluetoothOppPreference.java
c5813a6dcf079202d8dce16a37cbadd427804d9c 01-Mar-2011 Jaikumar Ganesh <jaikumarg@android.com> Merge "Check if BT is allowed in airplane mode"
72d2f1d8b81087c0a00310ff43e5d060dc8b7867 01-Mar-2011 Jaikumar Ganesh <jaikumarg@android.com> Merge "Handle pullVcardListing req without search value for Number attr."
d6a1c1c4bf3da920582e17c8c6e32c7ef74a555f 08-Jan-2011 Jaikumar Ganesh <jaikumar@google.com> Retry rfcomm socket connections after link key exchange error.

If the devices were paired before, but unpaired on the
remote end, it will return an error (when sending a file)for the auth
request for the socket connection. Link keys will get exchanged
but we need to retry the socket connection. There is no good way to
inform this socket asking it to retry apart from
a delayed retry. The socket is opened at the kernel level
but the link key retrys happen at the Bluez userspace level.

Note: This is a temporary change, once the new mgmt interface comes
up in Bluez, we wouldn't need this.

Change-Id: Ifbd93d7f69b93515dda6c6f4ad2796853f9d5841
pp/BluetoothOppTransfer.java
a85ff0a96f7d5f64bf1e9ca99789cb8dc69f6d97 05-Jan-2011 Kevin LeBlanc <kevin.leblanc@sonyericsson.com> Check if BT is allowed in airplane mode

Currenty, the bluetooth sharing activity always quits with an error
message if airplane mode is on. Instead, the activity should check
if bluetooth may be enabled in airplane mode, given the current
system settings.

Change-Id: If9272a941504054d7819e0248f93a8b5bca8d41e
pp/BluetoothOppLauncherActivity.java
4bba23a751f042596561eab0e677135d5267bcdf 07-Jan-2011 Staffan Lindvall <staffan.lindvall.x@sonyericsson.com> Handle pullVcardListing req without search value for Number attr.

When sending pullVcardListing request to the phone while using
the search attribute "Number" without any search value, the
phone responds with error code "internal error".

Instead the phone should return all numbers in the phonebook.

Change-Id: I7c11b76bbd61882c62be3533b1c45c2c72f497b2
bap/BluetoothPbapVcardManager.java
1ed96d522298e8f48690a4f4cbf2e0c6b402e3a0 26-Jan-2011 Jake Hamby <jhamby@google.com> Implement "show received files" intent for Settings.

Add a handler for a new intent (sent from the Settings app) to
show all files received via Bluetooth. This is equivalent to the
now deprecated live folder view of received files.

Bug: 3167219
Change-Id: Ibb8d3738d62301af5b012489a69ac078e554b66d
pp/BluetoothOppReceiver.java
pp/BluetoothOppTransferHistory.java
pp/Constants.java
afdc7cbd31e835ce4610338b54e0de1337957cc8 07-Jan-2011 Yoshiharu Kurita <yoshiharu.x.kurita@sonyericsson.com> Fix 'New Missed Calls' count in PullvCardListing

When the phone receives a PullvCardListing request about mch
(Missed Call History), PBAP application sends a corresponding
response which contains the number of 'New Missed Calls' in
the header. Currently, the number of 'New Missed Calls' is
included into a response against the other type of
PullvCardListing request after the phone receives mch
PullvCardListing request which contains MaxListCount = 0 and
ListStartOffset = 0 (these parameters mean PCE only wants the
number of index), because any of PullvCardListing requests
are miss-detected as mch in this case. And then the internal
value for 'New Missed Calls' is also updated, so the number
of 'New Missed Calls' becomes incorrect when answering the
next PullvCardListing about mch.

The solution is to fix the miss detection.

Change-Id: Ic09257fc554d8b7af9498d2ff79e017f6e56510c
bap/BluetoothPbapObexServer.java
9522370104410f24602ac98172bfbda27f89780d 07-Jan-2011 Yoshiharu Kurita <yoshiharu.x.kurita@sonyericsson.com> Fix 'New Missed Calls' count in PullvCardListing

When the phone receives a PullvCardListing request about mch
(Missed Call History), PBAP application sends a corresponding
response which contains the number of 'New Missed Calls' in
the header. Currently, the number of 'New Missed Calls' is
included into a response against the other type of
PullvCardListing request after the phone receives mch
PullvCardListing request which contains MaxListCount = 0 and
ListStartOffset = 0 (these parameters mean PCE only wants the
number of index), because any of PullvCardListing requests
are miss-detected as mch in this case. And then the internal
value for 'New Missed Calls' is also updated, so the number
of 'New Missed Calls' becomes incorrect when answering the
next PullvCardListing about mch.

The solution is to fix the miss detection.

Change-Id: Ic09257fc554d8b7af9498d2ff79e017f6e56510c
bap/BluetoothPbapObexServer.java
0995f126a9835d63a87d4c2c985a43004978c94d 07-Jan-2011 Staffan Lindvall <staffan.lindvall.x@sonyericsson.com> Handle pullVcardListing req without search value for Number attr.

When sending pullVcardListing request to the phone while using
the search attribute "Number" without any search value, the
phone responds with error code "internal error".

Instead the phone should return all numbers in the phonebook.

Change-Id: I7c11b76bbd61882c62be3533b1c45c2c72f497b2
bap/BluetoothPbapVcardManager.java
c83ffa5289995a4071b5d84055da07e2c72de2d9 05-Jan-2011 Kevin LeBlanc <kevin.leblanc@sonyericsson.com> Check if BT is allowed in airplane mode

Currenty, the bluetooth sharing activity always quits with an error
message if airplane mode is on. Instead, the activity should check
if bluetooth may be enabled in airplane mode, given the current
system settings.

Change-Id: If9272a941504054d7819e0248f93a8b5bca8d41e
pp/BluetoothOppLauncherActivity.java
091ff0151b6b3094ba712e63529d3caaf0f42090 28-Dec-2010 Jean-Baptiste Queru <jbq@google.com> am 3500d1cc: Merge "BT - Not possible to accept incoming obex transfers using key-presses."

* commit '3500d1cc714807945b1427e43eb3bde367849e43':
BT - Not possible to accept incoming obex transfers using key-presses.
3500d1cc714807945b1427e43eb3bde367849e43 28-Dec-2010 Jean-Baptiste Queru <jbq@google.com> Merge "BT - Not possible to accept incoming obex transfers using key-presses."
227e60370e1c070315a43044bfdb77e1efb1393b 28-Dec-2010 Jean-Baptiste Queru <jbq@google.com> am cbb50b68: Merge "Incorrect response code after pull of invalid vCard handle."

* commit 'cbb50b684e181f78d3ca5b304e97f9c5a67809b6':
Incorrect response code after pull of invalid vCard handle.
f0e1bc31822d23c1c8bccf1ab17907a1d803a62d 28-Dec-2010 Jean-Baptiste Queru <jbq@google.com> am 89186622: Merge "Sanitise Bluetooth file name hint when receiving a contact"

* commit '89186622fa240083a46336a9e5e4ade52c5698d9':
Sanitise Bluetooth file name hint when receiving a contact
cbb50b684e181f78d3ca5b304e97f9c5a67809b6 28-Dec-2010 Jean-Baptiste Queru <jbq@google.com> Merge "Incorrect response code after pull of invalid vCard handle."
6f02f510e5dc3fb994516128f2de1d78bc7f9b1e 07-Dec-2010 Staffan Lindvall <staffan.lindvall.x@sonyericsson.com> Incorrect response code after pull of invalid vCard handle.

When calling pullVcardEntry with an invalid / non-existing
vCard handle the response code is always "OK".

Instead the phone should respond "NOT FOUND" according
to Bluetooth PBAP specification.

The problem exists both for phonebook and call logs.

Change-Id: I339b1fe0cdb7fa9b6c6b425f1b1686c24cab9626
bap/BluetoothPbapObexServer.java
5e9a02df66c6044bd4a06b9d53e6cdbd8ad22606 28-Sep-2010 Edward Savage-Jones <edward.savage-jones@sonyericsson.com> Sanitise Bluetooth file name hint when receiving a contact

If a contact name is entered with any of the following characters

:"<>*?|\n\t

the transfer of that contact fails. This is due to the underlying
filesystem (FAT) not being able to handle these characters in a
file name. This fix corrects that situation by replacing any
whitespace characters with a space and illegal FAT filesystem
characters with underscore.

Change-Id: I5021bd26a16c31810a61bac3f70439c1153451c2
pp/BluetoothOppReceiveFileInfo.java
9935a310a4f36c9f835c5c3aa2f604ddc36cabb1 21-Dec-2010 Xiaodong Xu <xiaodong.xu@sonyericsson.com> Bluetooth: Add vCard version support for call history.

Under current implementation, PSE only deliver call history
under format VCard2.1 to PCE, this is not correct according to
PBAP specification, which says "The PSE shall support both
vCard2.1 and vCard3.0 versions and deliver the Entries to the
PCE under the format version that is requested by the PCE."
This fix is to make implementation following such PBAP
specificaiton.

Change-Id: Id0146d0887bad3bd066109ecd3be674b3106bced
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapVcardManager.java
0b13debc0aaca69bbef781da47a2ca5c0e6d9af7 08-Dec-2010 Jean-Baptiste Queru <jbq@google.com> am e7f887da: resolved conflicts for merge of 55936599 to stage-korg-master

* commit 'e7f887dab2591a46ecf80616e00f33bb5d847935':
code cleanup. unused imports, local variabls and static constans removed from com.android.bluetooth.opp package.
e7f887dab2591a46ecf80616e00f33bb5d847935 07-Dec-2010 Jean-Baptiste Queru <jbq@google.com> resolved conflicts for merge of 55936599 to stage-korg-master

Change-Id: I5f04a3ae2f0246853f16b0fdb209e67df95e6ca8
e1fd97242bcac3c546c35a2576df3fafee04d25a 07-Dec-2010 Jean-Baptiste Queru <jbq@google.com> resolved conflicts for merge of 22e1e357 to master

Change-Id: I96ff536c0d1c000a6b6d5b0b2ea5a3849b21985e
22e1e357b6053b572820b54ed8f2b8fe3c1eb0f8 07-Dec-2010 Jean-Baptiste Queru <jbq@google.com> am 16d171b1: Merge "code cleanup. some unused import statement, local variabls, private members and static constants removed form classes in com.android.bluetooth/pbap package."

* commit '16d171b1ba7bd2b74c15b9f4d0289de84117cbb5':
code cleanup. some unused import statement, local variabls, private members and static constants removed form classes in com.android.bluetooth/pbap package.
a930b6831d0c70b6c5d34e548e6b1dceaa6529a0 01-Nov-2010 Mohammad Shamsi <m.h.shams@gmail.com> code cleanup.
unused imports, local variabls and static constans removed from
com.android.bluetooth.opp package.

Change-Id: I0fd682a190221e216fac71723c05d3828b9fa42d
pp/BluetoothOppBatch.java
pp/BluetoothOppManager.java
pp/BluetoothOppNotification.java
pp/BluetoothOppPreference.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppSendFileInfo.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppTransferHistory.java
pp/TestActivity.java
cff3303d1878037f35c9feb58e0c747aef403d4d 01-Nov-2010 Mohammad Shamsi <m.h.shams@gmail.com> code cleanup.
some unused import statement, local variabls, private members and static constants removed form
classes in com.android.bluetooth/pbap package.

Change-Id: I95d7d403ab78afa6f9ada82cfb357056a6bf61d0
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
84ec2fa756c3e918b6083726271128096de57ffb 23-Oct-2010 Jaikumar Ganesh <jaikumar@google.com> Send CONNECTION_STATE_CHANGE intent.

Change-Id: Ibbf53b1f96d92c9d0c6acbfc491e93046136e95d
bap/BluetoothPbapService.java
affbd828459349396e000624a90a4ea800a7108b 14-Oct-2010 Jaikumar Ganesh <jaikumar@google.com> am 5eadab02: am 4492b2c6: Fix OPP crash and Call Log sort order.

Merge commit '5eadab02ea3202f417434a13a7637379fffc43de'

* commit '5eadab02ea3202f417434a13a7637379fffc43de':
Fix OPP crash and Call Log sort order.
4492b2c66cf3b26fd988f3b7f1f5df6cc9ed49f2 12-Oct-2010 Jaikumar Ganesh <jaikumar@google.com> Fix OPP crash and Call Log sort order.

Bug: 3067780 3067770
Dr No: jerry

Change-Id: I2ac39e2f1f0233a6ada84af39d8addfe0fe04cea
pp/BluetoothOppObexServerSession.java
bap/BluetoothPbapVcardManager.java
99c41899699fef2cea41cb227003eeda851f93ad 11-Oct-2010 Jaikumar Ganesh <jaikumar@google.com> am c47e9733: am 3f475149: Merge "Make "search by number" function work" into gingerbread

Merge commit 'c47e9733b12c81b24ec32f0707f2cd5288aaf6b0'

* commit 'c47e9733b12c81b24ec32f0707f2cd5288aaf6b0':
Make "search by number" function work
8fb1d457e213dfa7b4f2f7057a7d7340a1db972c 07-Oct-2010 Nick Pelly <npelly@google.com> am a6a28724: am 82d9bdb1: Merge "Don\'t enforce Authenticated Link key (MITM protection) on PBAP." into gingerbread

Merge commit 'a6a28724002f61ad69d240192e3886be11a61693'

* commit 'a6a28724002f61ad69d240192e3886be11a61693':
Don't enforce Authenticated Link key (MITM protection) on PBAP.
0dcd2262d853c2011e11617a8efba6758370c41f 05-Oct-2010 Liejun Tao <L.J.Tao@motorola.com> Make "search by number" function work

Previous "search by number" is wrong. Re-implement it to make it work.
Add flexible to handle searchValue as both null-terminated and not
null-terminated.

Change-Id: Ie50f8d29dfcbae868c43d482467b09b08ed2be0f
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapVcardManager.java
4fbc7412b96934831ce29a7af54b170056f8c2de 04-Oct-2010 Jaikumar Ganesh <jaikumar@google.com> Don't enforce Authenticated Link key (MITM protection) on PBAP.

Gory Details:
SecureRfcomm API => authentication is true and encyrption is true. (HIGH)
InSecureRfcomm API => authentication is false and encryption is true. (MEDIUM)
The authentication above refers to the authentication of the link
key i.e prevention of MITM attacks.
Bluetooth 2.0 legacy pairing doesn't provide MITM protection.

Bluetooth 2.1 -> If pairing is done with MITM protection already,
this doesn't matter. If pairing is NOT done with MITM protection
we have the same security as the other core profiles. It dones't make
sense to enfore MITM for this profile while having Handsfree profile
to not have MITM i.e some attacker can listen in on conversations.

Why are we changing this now: More headsets with 2.1 and No Input/Output
have started to support PBAP. So we pair without MITM with them and then
when the PBAP request comes it fails because we need MITM protection and
we try to exchange keys (i.e pair again)
The headset don't allow pairing to happen at any time because its a security
issue and hence PBAP request fails.

Change-Id: Ia80c15c545e9396e7c6882b731c90a8ede119827
bap/BluetoothPbapService.java
4ce32fccf381a3b448f0d5ff56665201c0e0e6d3 16-Jun-2010 Ola Johnsson <ola.johnsson@sonyericsson.com> PullvCardList implemented according to specification

The value tag sent as a byte array was not parsed correctly
leading to illegal strings. The list count value was not used
according to the specification, now refers to number of entries
that should be returned. Specification for Phone book access
profile chapter 5.3 default max list size of OxFFFF (65535)
taken from 5.3.4.4. Now uses default values when Application
Parameter headers are missing.

Change-Id: Ib17f2208a91b4f896d9beebaf3a21566502ac291
bap/BluetoothPbapObexServer.java
7a93f67e130cd9d0972d4f1346c8bcf3250e687e 29-Sep-2010 Jaikumar Ganesh <jaikumar@google.com> am 8b08754f: am 5f78d4ef: Merge "Update BT folder icon." into gingerbread

Merge commit '8b08754fe9d87d6f6f3b19b81330622889ac8264'

* commit '8b08754fe9d87d6f6f3b19b81330622889ac8264':
Update BT folder icon.
8b08754fe9d87d6f6f3b19b81330622889ac8264 29-Sep-2010 Jaikumar Ganesh <jaikumar@google.com> am 5f78d4ef: Merge "Update BT folder icon." into gingerbread

Merge commit '5f78d4ef75710e3dbf608644b16da7c6f88d00ed' into gingerbread-plus-aosp

* commit '5f78d4ef75710e3dbf608644b16da7c6f88d00ed':
Update BT folder icon.
5f78d4ef75710e3dbf608644b16da7c6f88d00ed 29-Sep-2010 Jaikumar Ganesh <jaikumar@google.com> Merge "Update BT folder icon." into gingerbread
5b09b7148807c3f864da0a671141f2a2379445b2 29-Sep-2010 Jaikumar Ganesh <jaikumar@google.com> Update BT folder icon.

Change-Id: I1aecca20d4a9aaaf8e4aad37eb5c2e2357fad6ad
pp/BluetoothOppLiveFolder.java
3fba9e8d40649b06fe1f4f7d99f4655e9e2500fe 28-Sep-2010 Brad Fitzpatrick <bradfitz@android.com> am c24d5e25: am 0a79bdbb: Trim the Bluetooth database off the main thread.

Merge commit 'c24d5e2584346d02fe6a6cabae2ada4cf3e04ee1'

* commit 'c24d5e2584346d02fe6a6cabae2ada4cf3e04ee1':
Trim the Bluetooth database off the main thread.
c24d5e2584346d02fe6a6cabae2ada4cf3e04ee1 28-Sep-2010 Brad Fitzpatrick <bradfitz@android.com> am 0a79bdbb: Trim the Bluetooth database off the main thread.

Merge commit '0a79bdbbfa3b79b808cbbe7490731e5aae4489e9' into gingerbread-plus-aosp

* commit '0a79bdbbfa3b79b808cbbe7490731e5aae4489e9':
Trim the Bluetooth database off the main thread.
0a79bdbbfa3b79b808cbbe7490731e5aae4489e9 28-Sep-2010 Brad Fitzpatrick <bradfitz@android.com> Trim the Bluetooth database off the main thread.

This looks to be most if not all of the remaining StrictMode
violations in this process. Not a huge deal, but cleaning up noise
will make bigger problems stand out easier in the future.

Change-Id: I262194c12114114fbe059d73475afb1bbb5654ab
pp/BluetoothOppService.java
453050fdaf7dcd488f399d3549ce257e7b9e7e79 17-May-2010 Wojciech Jowsa <wojciech.jowsa@stericsson.com> BT - Not possible to accept incoming obex transfers using key-presses.

It is not possible to accept/reject an incoming obex file transfer
using key-press. Only touch screen press was working.

With this fix, key press down is not ignored and it is possible
to accept/reject an incoming obex file transfer with key-press.

ST-Ericsson Change ID: ER260817
Change-Id: Ic7f668bd1b0efa549d0218edc8719efee1984941

Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
pp/BluetoothOppIncomingFileConfirmActivity.java
6dfc94e0b2a57f95432dd2dd4e505f7d80f6b594 22-Sep-2010 a5206c <a5206c@motorola.com> am 541939ff: am 77b122f5: For PBAP, Limit the number of call log to CALLLOG_NUM_LIMIT

Merge commit '541939ff48867b2a8656503d29f29eb6bf6f1a30'

* commit '541939ff48867b2a8656503d29f29eb6bf6f1a30':
For PBAP, Limit the number of call log to CALLLOG_NUM_LIMIT
541939ff48867b2a8656503d29f29eb6bf6f1a30 22-Sep-2010 a5206c <a5206c@motorola.com> am 77b122f5: For PBAP, Limit the number of call log to CALLLOG_NUM_LIMIT

Merge commit '77b122f551ae37811c75ae76fa2029f7b3f2f404' into gingerbread-plus-aosp

* commit '77b122f551ae37811c75ae76fa2029f7b3f2f404':
For PBAP, Limit the number of call log to CALLLOG_NUM_LIMIT
77b122f551ae37811c75ae76fa2029f7b3f2f404 22-Sep-2010 a5206c <a5206c@motorola.com> For PBAP, Limit the number of call log to CALLLOG_NUM_LIMIT
bap/BluetoothPbapObexServer.java
f3d6b25c0ea3b2bcd01ab457967c7b40ccd20b5b 13-Sep-2010 Daisuke Miyakawa <dmiyakawa@google.com> Let BT use FLAG_REFRAIN_IMAGE_EXPORT.

Bug: 2603200
Change-Id: I385e831b8c5684cc75c249ee6d41d5256a29f3c5
bap/BluetoothPbapVcardManager.java
0fd720422f69837c3c121c2debeac71794d27e30 03-Sep-2010 Brad Fitzpatrick <bradfitz@android.com> am d4693ca9: am 55470710: Replace use of SharedPreference commit() with apply().

Merge commit 'd4693ca99284a12703a0de9fd6c70f50262073e0'

* commit 'd4693ca99284a12703a0de9fd6c70f50262073e0':
Replace use of SharedPreference commit() with apply().
d4693ca99284a12703a0de9fd6c70f50262073e0 03-Sep-2010 Brad Fitzpatrick <bradfitz@android.com> am 55470710: Replace use of SharedPreference commit() with apply().

Merge commit '55470710c2624bde2aa56275d29b60055638c06c' into gingerbread-plus-aosp

* commit '55470710c2624bde2aa56275d29b60055638c06c':
Replace use of SharedPreference commit() with apply().
55470710c2624bde2aa56275d29b60055638c06c 03-Sep-2010 Brad Fitzpatrick <bradfitz@android.com> Replace use of SharedPreference commit() with apply().

Also fix a typo and replace a bunch of redundant
SharedPreference.Editor commits with one at the end.

Change-Id: I75623cb6809a363d05421f80f1560d586ae1ab80
pp/BluetoothOppManager.java
pp/BluetoothOppPreference.java
6a962312358451fbb3c77ff7f6048388178f5677 02-Sep-2010 Daisuke Miyakawa <dmiyakawa@google.com> am 0ddb8aab: Modify variables used in vCard code.

Merge commit '0ddb8aabe0f62d7741ee0aa040e43643b823c441' into gingerbread-plus-aosp

* commit '0ddb8aabe0f62d7741ee0aa040e43643b823c441':
Modify variables used in vCard code.
0ddb8aabe0f62d7741ee0aa040e43643b823c441 02-Sep-2010 Daisuke Miyakawa <dmiyakawa@google.com> Modify variables used in vCard code.

See also Icf265ce7f83c1e2bd5db0c3d9bd4c142afd6db34

Change-Id: I3a94e86d0788a395ac0744bdf6e31c8e64fb0c15
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapVcardManager.java
addc5ca6de80b9956faf7b3fff9815a4ccde8e93 30-Aug-2010 Jaikumar Ganesh <jaikumar@google.com> am 44fbf5a3: am 8e658ce5: Merge "Send vCard with Unicode encoded Strings over BT" into gingerbread

Merge commit '44fbf5a3537d1d701eedbd85e7115c36ef851c58'

* commit '44fbf5a3537d1d701eedbd85e7115c36ef851c58':
Send vCard with Unicode encoded Strings over BT
44fbf5a3537d1d701eedbd85e7115c36ef851c58 30-Aug-2010 Jaikumar Ganesh <jaikumar@google.com> am 8e658ce5: Merge "Send vCard with Unicode encoded Strings over BT" into gingerbread

Merge commit '8e658ce507d2525616ca27aa7135032eee9a5e75' into gingerbread-plus-aosp

* commit '8e658ce507d2525616ca27aa7135032eee9a5e75':
Send vCard with Unicode encoded Strings over BT
8e658ce507d2525616ca27aa7135032eee9a5e75 30-Aug-2010 Jaikumar Ganesh <jaikumar@google.com> Merge "Send vCard with Unicode encoded Strings over BT" into gingerbread
f890b9395afee07aef2ae93e1213819919bc5e9f 27-Aug-2010 Edward Savage-Jones <edward.savage-jones@sonyericsson.com> Send vCard with Unicode encoded Strings over BT

The standard Android code doesn't correctly handle creation of byte
packets when sending vCard data. The length of a String is used to
specify the number of bytes being sent, which works if all
characters are ASCII (1 byte per char), but if Unicode characters
exist within the string, then bytes vs String length differ which
causes a truncation of the vCard during Bluetooth send.

Change-Id: Ic39dd53a38f1f353523c625940b0317b00e86d4f
bap/BluetoothPbapVcardManager.java
b8c5dba8b3e9a46873b8568d5cbead6d7390f96b 27-Aug-2010 Edward Savage-Jones <edward.savage-jones@sonyericsson.com> Send vCard with Unicode encoded Strings over BT

The standard Android code doesn't correctly handle creation of byte
packets when sending vCard data. The length of a String is used to
specify the number of bytes being sent, which works if all
characters are ASCII (1 byte per char), but if Unicode characters
exist within the string, then bytes vs String length differ which
causes a truncation of the vCard during Bluetooth send.

Change-Id: Ic39dd53a38f1f353523c625940b0317b00e86d4f
bap/BluetoothPbapVcardManager.java
accd7a537cabd7d0a8f83471a4f635a2b44f9c00 11-Aug-2010 Jaikumar Ganesh <jaikumar@google.com> am d5b94fe6: am ff2927dc: Merge "Optimize Opp Notification" into gingerbread

Merge commit 'd5b94fe6cd8144b9c6f0d6de35080f8ca49c601d'

* commit 'd5b94fe6cd8144b9c6f0d6de35080f8ca49c601d':
Optimize Opp Notification
d5b94fe6cd8144b9c6f0d6de35080f8ca49c601d 11-Aug-2010 Jaikumar Ganesh <jaikumar@google.com> am ff2927dc: Merge "Optimize Opp Notification" into gingerbread

Merge commit 'ff2927dcdff66114e56b0636d6b29ac71f62508b' into gingerbread-plus-aosp

* commit 'ff2927dcdff66114e56b0636d6b29ac71f62508b':
Optimize Opp Notification
eb77c4b1d9aa71d7dd8dd934e9d1971583f9c0e2 03-Aug-2010 Liejun Tao <L.J.Tao@motorola.com> Optimize Opp Notification

Current Opp notification is running too frequently. When file transfer
speed is fast, it could update notification 7-8 times in 1 second.
Use a timer to limit the notification to once per second.

Change-Id: I162033d9e12148260515c8ed318928e4de9a4392
pp/BluetoothOppNotification.java
pp/BluetoothOppService.java
pp/BluetoothOppTransferHistory.java
b6885cba0539ea82025862394e0dac010a5a8f33 16-Jul-2010 The Android Open Source Project <initial-contribution@android.com> am 587ef795: merge from open-source master

Merge commit '587ef79589b5b453e71f8472baea583390579e20'

* commit '587ef79589b5b453e71f8472baea583390579e20':
PullvCardList implemented according to specification
587ef79589b5b453e71f8472baea583390579e20 16-Jul-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: Id325ee50130e50b8080fd3a1e51a4fda8371e4c8
12f500b84c1a635d0ed951c8c586f81b55fb9f6b 16-Jun-2010 Ola Johnsson <ola.johnsson@sonyericsson.com> PullvCardList implemented according to specification

The value tag sent as a byte array was not parsed correctly
leading to illegal strings. The list count value was not used
according to the specification, now refers to number of entries
that should be returned. Specification for Phone book access
profile chapter 5.3 default max list size of OxFFFF (65535)
taken from 5.3.4.4. Now uses default values when Application
Parameter headers are missing.

Change-Id: Ib17f2208a91b4f896d9beebaf3a21566502ac291
bap/BluetoothPbapObexServer.java
0d17dc3f5be65452b7998125e22537868bdfa9ed 08-Jun-2010 Jaikumar Ganesh <jaikumar@google.com> am 69b2c318: Merge "Set number as "Unknown" for private numbers." into kraken
00aee7a70e3c76b6c9ef59133d59fcdc592fea99 07-Jun-2010 Jaikumar Ganesh <jaikumar@google.com> Set number as "Unknown" for private numbers.

Change-Id: I54bb9595913c90e72eef659627d95bb63398e84a
bap/BluetoothPbapCallLogComposer.java
920ed171213a79b0d9877f4f7ce3a9046bed58a6 28-May-2010 David Yue <a5206c@motorola.com> am 0c21a35d: correct PBAP call log parameters
0c21a35d6d56dd42c97a80e3233df578d0a1cb21 27-May-2010 David Yue <a5206c@motorola.com> correct PBAP call log parameters
bap/BluetoothPbapCallLogComposer.java
12cb33f6d9fd269944a5618661e3880beea58b6e 17-May-2010 Daisuke Miyakawa <dmiyakawa@google.com> Use a static version of vCard library.

See also I435e1057.

Bug: 2689523
Change-Id: I6aaa893d13ad2ff66f1439731ef7dbcf079b5011
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapVcardManager.java
f7df7a88230c525e2973ca5603f54a77fe47445d 13-May-2010 Jaikumar Ganesh <jaikumar@google.com> Use FLAG_REFRAIN_PHONE_NUMBER_FORMATTING to prevent discard
of "+", "p", "w" etc in phone numbers.

Change-Id: I20aa8d697925ac68dbfd9dc997dcf66fc0d7f5d8
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapVcardManager.java
ff55fbfa8cf30fe8a72e1a68420cd744ce957828 15-Apr-2010 Daisuke Miyakawa <dmiyakawa@google.com> Use FLAG_REFRAIN_PHONE_NUMBER_FORMATTING to prevent discard
of "+", "p", "w" etc in phone numbers.

Change-Id: Ic69d60e5831e59a497c523aa62c753922edf06f6
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapVcardManager.java
a988a391b2093fd2f9a50bde63177fe8a416da96 12-May-2010 David Yue <a5206c@motorola.com> am 00cd32b6: am b7533e86: Add missing moveToNext() calling.
00cd32b6c83164f942149613c03e41d7cd61a9fb 12-May-2010 David Yue <a5206c@motorola.com> am b7533e86: Add missing moveToNext() calling.

Merge commit 'b7533e86bb84a2f95c2cff62c1565a8e1696d1ea' into kraken

* commit 'b7533e86bb84a2f95c2cff62c1565a8e1696d1ea':
Add missing moveToNext() calling.
b7533e86bb84a2f95c2cff62c1565a8e1696d1ea 11-May-2010 David Yue <a5206c@motorola.com> Add missing moveToNext() calling.

Bug: 2674275
Change-Id: Ib5f5d2ebe3ff6ab02e43df38097a89541e132b55
bap/BluetoothPbapCallLogComposer.java
b754e49db1753161dab1fe32e417101bcfabc9aa 05-May-2010 Lixin Yue <L.X.YUE@motorola.com> am 1d222264: Fix the %1 bug in UI when sdcard full
1d2222642c372e5635a906b6d6620ac35a304cf9 16-Apr-2010 Lixin Yue <L.X.YUE@motorola.com> Fix the %1 bug in UI when sdcard full
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppTransferAdapter.java
pp/BluetoothOppUtility.java
0894f16289755e5d3e81e0d8c1c8097179aeb7f7 20-Apr-2010 Daisuke Miyakawa <dmiyakawa@google.com> Remove wrong merge.

Change-Id: I94ff5633226d37fcc2df39fdcb7ad313a523d435
bap/BluetoothPbapVcardManager.java
a7b31bac7cbea0382a14d7dcd22a01c3af370b54 20-Apr-2010 Daisuke Miyakawa <dmiyakawa@google.com> am 96ae98f9: Make BluetoothPbapCallLogComposer use FLAG_REFRAIN_IMAGE_EXPORT.
96ae98f996c5809bb34156b85bfc9e3d01008246 20-Apr-2010 Daisuke Miyakawa <dmiyakawa@google.com> Make BluetoothPbapCallLogComposer use FLAG_REFRAIN_IMAGE_EXPORT.

Bug: 2603200
Change-Id: Ie6a40c12fafac5927b616f31a8335df0181f9e18
bap/BluetoothPbapVcardManager.java
e05d3a710c592db386b55a265a1e657b0467e49f 16-Apr-2010 Daisuke Miyakawa <dmiyakawa@google.com> Make BT new structure.

Change-Id: If1400731a1ba9a91d493ca96f2cc0364ef9b5b18
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapVcardManager.java
ec6f2d44491bf1e3ffa7c75875985f9c16cf721d 26-Mar-2010 Lixin Yue <L.X.YUE@motorola.com> Clear notifications when the user presses clear from the notifications bar.

Bug: 2542260
Change-Id: I00f9d8216d70543b93cfbcdb2cd8da8331044d77
pp/BluetoothOppNotification.java
pp/BluetoothOppReceiver.java
pp/Constants.java
0bd5f7b5c36a60687ffe895368fd8df6df38acab 24-Mar-2010 Jaikumar Ganesh <jaikumar@google.com> Fix pbap and opp running bluetooth in phone process problems.

1. Use the right context instead of application context.
2. Make PbapActivity run in the same process as PbapService as they
share state.

Change-Id: Ib50c63c271dd8b30108f22734c47ee8645cd4839
pp/BluetoothOppManager.java
pp/BluetoothOppPreference.java
bap/BluetoothPbapService.java
20b5a93b6e18cd441065edfdf676ad612affc507 18-Mar-2010 Jaikumar Ganesh <jaikumar@google.com> Fix Typo.

Change-Id: Ia71a5b3bb970463132b2c25b90cf3897fc227fb9
bap/BluetoothPbapObexServer.java
7b0dbafb310175a465c8d06c44b748c1344d1d86 18-Mar-2010 Jaikumar Ganesh <jaikumar@google.com> Merge "Add ABORT request handling to PBAP"
2cd80b69baa6c96f1ab759fb45cd98e2cbc5f845 18-Mar-2010 Jaikumar Ganesh <jaikumar@google.com> Merge "Enhanced support to OPP content share"
151f41949621e082e127fe468bedd28289bc3a19 12-Mar-2010 Lixin Yue <L.X.YUE@motorola.com> Enhanced support to OPP content share

Add support to Browser link share via BT;
Add support to share files via BT in 3rd party file manager;

Change-Id: I9a93eb0891d0f670109afd44ab4064f7f15b01f3
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppSendFileInfo.java
60c43926b63509fa0607fc671e6fd91106d4a827 17-Mar-2010 Jaikumar Ganesh <jaikumar@google.com> Merge "Update notification in Transfer history manually when BT if off"
75fc857d22de0ec22e082bddb720d8465c9e3552 12-Mar-2010 Lixin Yue <L.X.YUE@motorola.com> optimize deleting operation in trimDatabase()
pp/BluetoothOppService.java
0b1b0069658326e8c12dc0f887e4319c5227feb5 16-Mar-2010 Lixin Yue <L.X.YUE@motorola.com> Add ABORT request handling to PBAP
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapVcardManager.java
de773e60fed15a4ad13325089a5609c9bc6ede59 15-Mar-2010 Lixin Yue <L.X.YUE@motorola.com> Update notification in Transfer history manually when BT if off
pp/BluetoothOppNotification.java
pp/BluetoothOppTransferHistory.java
df25af65a20d30b18b4715d47ca6c0b2557116ad 10-Mar-2010 Jaikumar Ganesh <jaikumar@google.com> Merge "Trim Opp database when service restarts."
389f6dd45f7a45b12af847a510086125777e1198 03-Mar-2010 Lixin Yue <L.X.YUE@motorola.com> Trim Opp database when service restarts.

When Opp service restart, we will trim the database.
a) No visible case is deleted.
b) Invisible complete outbound (failed and successful) are deleted.
c) Invisible complete failed inbound are deleted.
d) Invisible complete success inbound are deleted if needed to keep records max
to 1000.

Live folder only has received files, so the above makes sense.

Change-Id: If27080721d9abed025162ff805f661fde01564d3
pp/BluetoothOppService.java
pp/Constants.java
20844c451b1a82d683b3dd6169b00b03373f6531 10-Mar-2010 Jaikumar Ganesh <jaikumar@google.com> Merge "Not update TransferActivity button during activity creating."
0e927e914b80baf2d37439f8b99134cfe274a1d5 08-Mar-2010 Lixin Yue <L.X.YUE@motorola.com> Not update TransferActivity button during activity creating.

This is to fix below issue: when an ongoing transfer is almost to complete,
click the ongoing notification to launch TransferActivity, there will be
possible crash due to NullPointerException.
Root casue is: when TransferActivity onCreate() is called, the transfer is
still ongoing, so mIsComplete is false; but when onCreate() call to
updateProgressbar(), the transfer may change to complete, and then updateButton()
will be called; In updateButton(), mAlert (which will be initialized in father
class AlertActivity) still not intialized, which caused NullPointerException.

Change-Id: Ibfe363f3822386a38b9b108e29f60ad6673f70f6
pp/BluetoothOppTransferActivity.java
509a6cd43906cce5f9bc78a83bd2058a4e5249e7 05-Mar-2010 Lixin Yue <L.X.YUE@motorola.com> Remove the number above status icon for Opp transfers
pp/BluetoothOppNotification.java
f6c72e8d6ec3d3eae78ef4850cfda7364d44a9bf 04-Mar-2010 Michael Chan <mchan@android.com> Merge "Add opp Transfer history to avoid cluster of notificatoins To reduce the cluster of Opp nofications, we introduce the concept of Opp transfer history. Only 2 notifications exist for finished opp transfers, one is for outbound transfers, and another is for inbound transfers. User can see all detailed items in corresponding screen when click the notification."
5cc617943765df27844e459362c4bc1821305216 26-Feb-2010 Lixin Yue <L.X.YUE@motorola.com> Add opp Transfer history to avoid cluster of notificatoins To reduce the cluster of Opp nofications, we introduce the concept of Opp transfer history. Only 2 notifications exist for finished opp transfers, one is for outbound transfers, and another is for inbound transfers. User can see all detailed items in corresponding screen when click the notification.

Change-Id: Iffed353ea6b0d7c958c71fe8d3996937058ced30
pp/BluetoothOppNotification.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppTransferAdapter.java
pp/BluetoothOppTransferHistory.java
pp/Constants.java
fcce2453c8d9370d515f655b2706d5e00b9da139 04-Mar-2010 Daisuke Miyakawa <dmiyakawa@google.com> Add missing addHandler().

Bug: 2485875
bap/BluetoothPbapVcardManager.java
198e5d109571b27b7c45c30ed3ea42febcb99201 23-Feb-2010 Daisuke Miyakawa <dmiyakawa@google.com> Move Pbap logic to Bluetooth package so that we do not have unnecessary tight coupling.
bap/BluetoothPbapCallLogComposer.java
bap/BluetoothPbapVcardManager.java
c6f1bacf1d4c39d7efd5dc98004d936c18ed51f1 23-Dec-2009 Lixin Yue <L.X.YUE@motorola.com> Move insert share info operation to a thread to avoid Receiver timeout

In OppReceiver, the function mOppManager.startTransfer(remoteDevice), which
is used to insert share records to DB, can be really a time-consuming
operation in case of 300 or more objects sharing case.
For onReceive() function in BroadcastReceiver, there are below specification:
The function is normally called within the main thread of its process, so you should never
perform long-running operations in it (there is a timeout of 10 seconds that the system allows
before considering the receiver to be blocked and a candidate to be killed)

Add handle to concurrent sending case
In Gellary, user can multiple select files (say 50files), and share via bluetooth to device1,
and then right away share via bluetooth to device2, and also can share to device3. In such
extream case, we need ensure all share info are saved to db.

Complete the TODO in OppManager
Store application data to SharedPreferences and restore them when service restart.
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppManager.java
pp/BluetoothOppNotification.java
pp/BluetoothOppReceiver.java
1f0fc26568c1babf0c66d2c75812b72e894eb0de 16-Dec-2009 Lixin Yue <L.X.YUE@motorola.com> Fix non-existing received file still appearing in live folder issue

After receiving a file by OPP from Bluetooth remote device, user can delete
this file from Gallery or 3rd party application. In Opp live folder, user
could still open this file, but with dialog "file not exist" displayed, and
there is no way to make this file disappear from liver folder.
Current solution is to delete the BT OPP DB record after openning an invalid
uri associated with the file in folder, as an easy method without syncing.
pp/BluetoothOppReceiver.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppUtility.java
a4508589f298c67fda54c344760ae39f0f375c11 10-Dec-2009 Lixin Yue <L.X.YUE@motorola.com> Update the error codes to be compatible with PBAP spec.

Catch IndexOutOfBoundsException and NullPointerException in Opp sendFile().
pp/BluetoothOppObexClientSession.java
bap/BluetoothPbapObexServer.java
6ef730f85e90a8246d06c7a58bb21eee5074945c 17-Dec-2009 Lixin Yue <L.X.YUE@motorola.com> Enable vcard share in OPP

Bluetooth OPP to handle x-vcard MIME type from contacts share
Handle vcard size by content type instead of tightening with contacts
pp/BluetoothOppSendFileInfo.java
pp/Constants.java
6414394c20cd885f5bd4561e06bbecac9c93cfb1 02-Dec-2009 Lixin Yue <L.X.YUE@motorola.com> am 6ee2d0e0: Fix Opp notifications timestamp not correct issue

Merge commit '6ee2d0e0405a074cf827e0c0ac4bfbffd1850cea' into eclair-mr2

* commit '6ee2d0e0405a074cf827e0c0ac4bfbffd1850cea':
Fix Opp notifications timestamp not correct issue
019188fd686dbe7a9610255ea8aa61bd589a6bd1 30-Nov-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change Ifb8562d3 into eclair-mr2

* changes:
Add a few specific file type support
6ee2d0e0405a074cf827e0c0ac4bfbffd1850cea 02-Nov-2009 Lixin Yue <L.X.YUE@motorola.com> Fix Opp notifications timestamp not correct issue

Should set the value of Notification.when before calling
setLatestEventInfo()

Dr No:Eastham
Bug: 2292381
pp/BluetoothOppNotification.java
fb8562d35d3b7d2fc60e1bb01a9c15cfe9824a94 18-Nov-2009 Tao Liejun <a19884@motorola.com> Add a few specific file type support

Support to receive and send a few specific file types
.xls, .zip, .doc, .ppt, .pdf
pp/Constants.java
975bc7ee50d8d5b596b1801f2c60057de122d2b0 26-Nov-2009 Jaikumar Ganesh <jaikumar@google.com> am 03f598ba: Catch all exceptions while trying to send a file.

Merge commit '03f598bafa0fc0cbde0c5ab8fed89e07a67d482e' into eclair-mr2

* commit '03f598bafa0fc0cbde0c5ab8fed89e07a67d482e':
Catch all exceptions while trying to send a file.
03f598bafa0fc0cbde0c5ab8fed89e07a67d482e 25-Nov-2009 Jaikumar Ganesh <jaikumar@google.com> Catch all exceptions while trying to send a file.

While trying to share pictures, some applications might
not have given the adequate permissions.

DrNo:Jsh
Bug:2284822
pp/BluetoothOppService.java
5dc084a9ecbe35da9ac506ea4385e58d68e08aa5 13-Nov-2009 Jaikumar Ganesh <jaikumar@google.com> am 39a9c98e: Merge change I8b791d4f into eclair

Merge commit '39a9c98edca4633348d91027b3481ee43d4aa588' into eclair-mr2

* commit '39a9c98edca4633348d91027b3481ee43d4aa588':
Don't send default phone number for 0.vcf card.
8b791d4f581f31acf69f1297952c24aa39f01855 13-Nov-2009 Jaikumar Ganesh <jaikumar@google.com> Don't send default phone number for 0.vcf card.

This prevents an entry "My name" with "000000" in the car kit contacts.
We now send only the name and the version in the vcf.
Ideally, we could like to send an empty vcard, but we would need to test
with various car kits with that works well.

Original Change by: Lixin Yue
Bug: 2247067
Dr No: Eastham
bap/BluetoothPbapService.java
5ce62e929e6ce169be5c32c173efc44f76684e2d 06-Nov-2009 Lixin Yue <L.X.YUE@motorola.com> am cd5ed0c7: PBAP only transfer contacts that are visible in contacts application.

Merge commit 'cd5ed0c7d04119e508fbddfd9656ef8559e3e524' into eclair-mr2

* commit 'cd5ed0c7d04119e508fbddfd9656ef8559e3e524':
PBAP only transfer contacts that are visible in contacts application.
cd5ed0c7d04119e508fbddfd9656ef8559e3e524 05-Nov-2009 Lixin Yue <L.X.YUE@motorola.com> PBAP only transfer contacts that are visible in contacts application.

This is to address below issue:
There have been reports by users where they are seeing contacts in the
carkit that are not present in the Contacts App UI but are present in the
database.

Bug: 2245178
Dr No: Eastham
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
ae7f70563660d02d56365092fa27f195b54d5d15 05-Nov-2009 Jaikumar Ganesh <jaikumar@google.com> am 2b36e173: Fix get contact size not correct issue.

Merge commit '2b36e1731eb5ed784abc1a374eb69d8523123df1' into eclair-mr2

* commit '2b36e1731eb5ed784abc1a374eb69d8523123df1':
Fix get contact size not correct issue.
2b36e1731eb5ed784abc1a374eb69d8523123df1 30-Oct-2009 Jaikumar Ganesh <jaikumar@google.com> Fix get contact size not correct issue.

Call history handles should be ordered by "date DESC" per spec. The first
handle 1.vcf should be the most recently happend call.

Add order support for pullVcardListing reqeust:
One typical use case for PBAP is: first use pullVcardListing request to
display the contacts list, then use pullVcardEntry request to tirgger
the selected contact vcard. In such case, we need keep the contact db
query consistent for pullVcardListing and pullVcardEntry.

Use "Own number" for phone owner number instead of "Unknown name" in case
can not get the name from system.

Original Change: Fan Jackson
Dr No: Eastham
Bug Id: 2183320
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
e10881ae39eb4affb7a78827f2060964e8534515 02-Nov-2009 Daisuke Miyakawa <dmiyakawa@google.com> Fix a typo.
bap/BluetoothPbapVcardManager.java
c065fc5530cc0e8f14261f8c347984cdde070169 30-Oct-2009 Jaikumar Ganesh <jaikumar@google.com> Disable sending Photo field for PBAP. Do Not Merge.

Some car kits don't handle contacts with Photo Fields well.
Disable this field for the time being.

Original Change by: Yue Lixin

Bug: 2183320
Dr No: Eastham
bap/BluetoothPbapVcardManager.java
59582607bc341f9e9662d6ec5c1a93bb4c537d38 15-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Fix a build breakage.

Make Bluetooth code use new type instead of old.
bap/BluetoothPbapVcardManager.java
4ceaa3e03dc7a68d4e7c0c8e14a461cfd7c4c19c 12-Oct-2009 Daisuke Miyakawa <dmiyakawa@google.com> Adapt to the new interface of vCard code.

Internal Issue number: 2160039
bap/BluetoothPbapVcardManager.java
b506e52fabbc02445f3652049ed8a390d4fcaa7f 09-Oct-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I428bc0fc into eclair

* changes:
Remove STOPSHIP BT logging.
0e6233ffba67e757f60171803d7ab376cf73c16c 09-Oct-2009 Nick Pelly <npelly@google.com> Remove STOPSHIP BT logging.

Do not merge.

Change-Id: I428bc0fc67030f24112f2e9c865824dfaea4897d
DrNo: eastham
Bug: 2089423
Joke: Why does E.T. have such big eyes? Because he saw his phone bill.
pp/Constants.java
bap/BluetoothPbapService.java
59256dee3f9787fd660c346d61e0271ecd4bfe9a 08-Oct-2009 Jaikumar Ganesh <jaikumar@google.com> Update PBAP code for Contacts database changes and check for OPP
file extension.

Original Author for PBAP - Yue Lixin
Dr No: Eastham
Bug: 2174759
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppReceiveFileInfo.java
bap/BluetoothPbapVcardManager.java
3a88b20fcd71e42451e402d27374b19eeb2ff0da 08-Oct-2009 Nick Pelly <npelly@google.com> Update application code for BluetoothAdapter.getDefaultAdapter().

Change-Id: I7baafb909b74783da4e51d48f2465e7aacf07eb5
DrNo: eastham
Bug: 2158765
Joke: What goes 99-thump, 99-thump? A centipede with a wooden leg.
pp/BluetoothOppBatch.java
pp/BluetoothOppManager.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppUtility.java
bap/BluetoothPbapService.java
773ca65d26f0eb0eda3ec44c2a788043387981cf 05-Oct-2009 Jaikumar Ganesh <jaikumar@google.com> Remove Disconnected and Connected PBAP toasts.

Original Author: Fan Jackson
Bug number: 2060933
Dr No: Eastham
bap/BluetoothPbapService.java
0eb2230d3b7c184a00599e8ab70331c599e9ef1c 02-Oct-2009 Jaikumar Ganesh <jaikumar@google.com> Fix ANR by repeating BT ON/OFF caused by PBAP closeservice deadlock

Move back socket closing sequence ahead of Thread.shutdown and join operation;
Seperate socket closing and resetting as null to avoid NPE during service close

Original Author: Fan Jackson
Bug: 2158262
DrNo: Paul

Change-Id: I2b36f3fb920c80602f5734a67a8cf6c6fbd00de4
bap/BluetoothPbapService.java
29a07d9c52cde18ee818fd21528288cd5c8127c8 30-Sep-2009 Daisuke Miyakawa <dmiyakawa@google.com> Remove redundant dependency toward android.syncml.
bap/BluetoothPbapVcardManager.java
e42f4c90d20e3192c18bbe8fad98059b0c910cd7 30-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I8222c790 into eclair

* changes:
Update OPP/PBAP service to use onStartCommand() Adjust function call seqence in PBAP closeService
8222c7902a2281929fd31e840f6012038e6fa44a 29-Sep-2009 Lixin Yue <L.X.YUE@motorola.com> Update OPP/PBAP service to use onStartCommand()
Adjust function call seqence in PBAP closeService
pp/BluetoothOppService.java
bap/BluetoothPbapService.java
b0fa09caef6a0748a568dc2a89f5d94b85423bb2 29-Sep-2009 Lixin Yue <L.X.YUE@motorola.com> Update OPP/PBAP UI

Add timeout handling to incoming file confirm dialog, to avoid uncertain
behavior when timeout happen
Fix PBAP request timeout issue when open/close slider, dismiss timeout
dialog to avoid uncertain behavior
Fix typo in strings
pp/BluetoothOppIncomingFileConfirmActivity.java
pp/BluetoothOppTransfer.java
pp/BluetoothShare.java
bap/BluetoothPbapActivity.java
4ef0999864c582e64b62ecf46a569574e7cae9a1 29-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change I18bde766 into eclair

* changes:
Update PBAP to make compatiable with spec
18bde766b20c899310ebdd5ca823e30ff27d407f 27-Sep-2009 Lixin Yue <L.X.YUE@motorola.com> Update PBAP to make compatiable with spec

Add check to incoming application parameter, be nice to accept PCE request
Fix minor pullvCardEntry issue for call logs
Fix one pullPhoneBook issue about request size
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapVcardManager.java
668a8d617ac827770a484ad6b3f329ee248745ee 28-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change Ifb946935 into eclair

* changes:
Added WhiteList of acceptable MIME types for OBEX transfers. Part of OBEX/OPP security review. Bug information: http://b/issue?id=1972237
fb946935fe50d957e835ac00a592bd3d222edef3 28-Sep-2009 Oscar Montemayor <oam@android.com> Added WhiteList of acceptable MIME types for OBEX transfers. Part of OBEX/OPP security review.
Bug information: http://b/issue?id=1972237
pp/BluetoothOppObexServerSession.java
pp/Constants.java
202e9f669d8972d6371c349ed65f311de465be1a 28-Sep-2009 Nick Pelly <npelly@google.com> Update application for android.bluetooth.ParcelUuid -> android.os.ParcelUuid

Change-Id: Ia0eb46d9bdff6a8ab3333bb0ad1f66d0303c135a
pp/BluetoothOppTransfer.java
6fbad3dd950238d871c4efce4eb258ae1a54b878 27-Sep-2009 Oscar Montemayor <oam@android.com> Proposed file canonical path prevetion for directory trasvesal attacks. Fix suggested by meder@google.com.
More fixes form CR comments.
pp/BluetoothOppReceiveFileInfo.java
2f8fe66f45bac2bc61395bd4f8de553f4c2b7c30 24-Sep-2009 Lixin Yue <L.X.YUE@motorola.com> Update PBAP to use new VCardComposer

Totally removed the use of old syncml.pim.vcard.VCardComposer
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapRfcommTransport.java
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
9d9e511fe7425fb3105ece227ecedb43d6333333 21-Sep-2009 Tao Liejun <L.J.Tao@motorola.com> Use new SDP API for OPP

Use new API BluetoothDevice.fetchUuidsWithSdp() to query SDP for un-paired device, and request SDP
update when Opp is not in cache.
Handle a concurrent case when incoming connection and file share happens together
Some other minor changes

Change-Id: I7ebf34801518867553551d8f7bba7ac62e22667e
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppReceiveFileInfo.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppService.java
pp/BluetoothOppShareInfo.java
pp/BluetoothOppTransfer.java
pp/Constants.java
c4b72ebe2ed9cd29c40a75411702ca9dca9424ac 24-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 26736 into eclair

* changes:
Update opp/pbap look and feel
38416553a26e55963e11276f1029d78e9e6cad70 23-Sep-2009 Rich Cannings <richc@google.com> Fixes NullPointerException that crashes Bluetooth when filename ends end with slash, e.g.: 'fooo..txt/'.

choosefilename() can return null. We should handle this result and grecefully fail.
pp/BluetoothOppReceiveFileInfo.java
dc3bacd6eb626a93f2c3c4c62b3ef6aa9e575d92 21-Sep-2009 Lixin Yue <L.X.YUE@motorola.com> Update opp/pbap look and feel

Update OPP BtEnabling Dialog-add timeout handling, handle Bluetooth ON intent, handle back key

Change-Id: I3d3ade3a9a4de645ddb7195e8b81ca42afb3d31e
pp/BluetoothOppBtEnableActivity.java
pp/BluetoothOppBtEnablingActivity.java
pp/BluetoothOppIncomingFileConfirmActivity.java
pp/BluetoothOppNotification.java
pp/BluetoothOppTransferActivity.java
1f556d99c4bb7cae5ed55c171ce7f65b5010fa57 22-Sep-2009 Oscar Montemayor <oam@android.com> Replaced back-slashes on hint path URI with forward-slahes, more in line with Linux FS conventions.
Code review changes incorporated patch set 3 rev.
pp/BluetoothOppReceiveFileInfo.java
68ea2a43de2e7cee20c03332ed9f5ff004e42884 02-Sep-2009 Jaikumar Ganesh <jaikumar@google.com> Change handling of remoteUuids.
pp/BluetoothOppTransfer.java
f2c447b81c6c03cb1c8a3e64a10381e23934834a 10-Sep-2009 Nick Pelly <npelly@google.com> Update application for Bluetooth API changes.

Change-Id: I618553f2aa4e8705e3dff1247752e5fc357ef94d
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppService.java
bap/BluetoothPbapReceiver.java
bap/BluetoothPbapService.java
613bae227d65f61903e196944a9c718b4394f25a 09-Sep-2009 Nick Pelly <npelly@google.com> Update application for Bluetooth API change: deprecation of BluetoothError.
pp/BluetoothOppReceiver.java
pp/BluetoothOppService.java
bap/BluetoothPbapReceiver.java
bap/BluetoothPbapService.java
f4a286ee2aba5a75abe41881334bbdb5d0080105 09-Sep-2009 Nick Pelly <npelly@google.com> Update application for Bluetooth API change.
pp/BluetoothOppReceiver.java
pp/BluetoothOppService.java
bap/BluetoothPbapReceiver.java
bap/BluetoothPbapService.java
c5495c585c0d19cdd20963e5a2144e5f984a306e 09-Sep-2009 Lixin Yue <L.X.YUE@motorola.com> Update PBAP to be compatible with Mecel stack

The response to the targeted connect operation should contain a Who with the same UUID as
sent in the request's matching Target header. If the Who header was present in the request,
a Target header identifying the same client should be sent in the response.

Play ringtone for incoming PBAP connection request
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
4446eaa935994bc91d6d308303e8d27526b4590d 31-Aug-2009 Lixin Yue <L.X.YUE@motorola.com> Pbap update

Improve PBAP download contacts performance greatly
Add 10 times retry for creation of listening socket
Change PbapReciever to be clearer
Rename functions and adjust function sequence in PbapService
Cleanup logging
Remove unused functions
Remove serversocket polling
bap/BluetoothPbapActivity.java
bap/BluetoothPbapAuthenticator.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapReceiver.java
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
5c670ec88d1c59e5ad32b0264552199f3d6073c5 01-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 23495 into eclair

* changes:
Workaround bug in Poloroid Pogo.
fa5d402906010cd17c8ed7de0dbcbfdcb78dab20 01-Sep-2009 Nick Pelly <npelly@google.com> Workaround bug in Poloroid Pogo.

Rename extra dots to underscores.

Working with Poloroid to get an updated list of affected MAC addresses. For now
we just have 00:04:48.
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppSendFileInfo.java
pp/BluetoothOppTransfer.java
acab258c177d82338b1696360cd0b8c9821b0f03 26-Aug-2009 Lixin Yue <L.X.YUE@motorola.com> Allow Pbap if device is trusted
bap/BluetoothPbapActivity.java
bap/BluetoothPbapService.java
888485a3f5fe991116c5536bb6d6903d47b63a70 31-Aug-2009 Tao Liejun <L.J.Tao@motorola.com> Cleanup Opp debug code

Stop Rfcomm polling
Delete a few unused functions
pp/BluetoothOppBatch.java
pp/BluetoothOppPreference.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppUtility.java
pp/Constants.java
pp/TestActivity.java
pp/TestTcpListener.java
pp/TestTcpServer.java
pp/TestTcpSessionNotifier.java
pp/TestTcpTransport.java
32e47df203390052c1ef771d78b22fc4aa5f9e72 27-Aug-2009 Tao Liejun <L.J.Tao@motorola.com> Simplify wakelock release for Obex Server
pp/BluetoothOppObexServerSession.java
ce4d93666275df294cb073fe41de5b85932570a8 28-Aug-2009 Nick Pelly <npelly@google.com> Clean up Logging.

Use the pattern if (V) Log.v(...); for logging. The Android style prefers curly braces, but for log lines it is ok to use a one-liner to keep the code manageable.

Remove spaces from some log tags, and rename TAG BluetoothShareProvider to BluetoothOpp.

Rename LOGVV to V, and LOGV to D.

Just before ship we will change Constants.DEBUG and Constants.VERBOSE to false to compile out all the logging code.
pp/BluetoothOppBatch.java
pp/BluetoothOppBtEnableActivity.java
pp/BluetoothOppBtEnablingActivity.java
pp/BluetoothOppBtErrorActivity.java
pp/BluetoothOppIncomingFileConfirmActivity.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppManager.java
pp/BluetoothOppNotification.java
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppPreference.java
pp/BluetoothOppProvider.java
pp/BluetoothOppReceiveFileInfo.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppUtility.java
pp/Constants.java
pp/TestTcpListener.java
pp/TestTcpServer.java
d6641e4a7bb22833e1c07cb3af7989835fa7e16d 19-Aug-2009 Tao Liejun <L.J.Tao@motorola.com> Remove Device picker
pp/BluetoothDevicePickerActivity.java
pp/BluetoothDevicePickerBtStatus.java
pp/BluetoothDevicePickerDevice.java
pp/BluetoothDevicePickerDeviceManager.java
pp/BluetoothDevicePickerDevicePreference.java
pp/BluetoothDevicePickerListener.java
pp/BluetoothDevicePickerManager.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppReceiver.java
pp/BluetoothPinDialog.java
pp/BluetoothShare.java
pp/ProgressCategory.java
1ac5507790a87810061a19dadec36eb328a222ea 07-Aug-2009 Tao Liejun <L.J.Tao@motorola.com> OPP update

Rewrite provider permission to allow LiveFolders work
Support file:// uri to share file
Support multiple share from gallery
Fully support sending file queue
Hold incoming connection for a while when OPP is busy instead of reject directly
Move notification update to a thread
Handle many error cases to display correct error messages
Improve server/client timeout
Delete empty file after reject incoming file
Support upper case incoming file extension
Avoid multiple mediascanner connections
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppManager.java
pp/BluetoothOppNotification.java
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppProvider.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppSendFileInfo.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
pp/Constants.java
41ef8d494511c040451f2f887cb31c3100746b61 07-Aug-2009 Nick Pelly <npelly@google.com> Bluetooth: Update Bluetooth.apk to match BT API change.

Split BluetoothDevice into BluetoothDevice and BluetoothAdapter.

BluetoothAdapter: Represents the local BT adapter. Operations on the local
adapter (start a scan, etc).
BluetoothDevice: Represents a remote BT device. Operations on remote devices
(pair, connect, etc).
pp/BluetoothDevicePickerActivity.java
pp/BluetoothDevicePickerDevice.java
pp/BluetoothDevicePickerDeviceManager.java
pp/BluetoothDevicePickerListener.java
pp/BluetoothDevicePickerManager.java
pp/BluetoothOppBatch.java
pp/BluetoothOppManager.java
pp/BluetoothOppPreference.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppRfcommTransport.java
pp/BluetoothOppService.java
pp/BluetoothOppShareInfo.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppUtility.java
pp/BluetoothPinDialog.java
bap/BluetoothPbapReceiver.java
bap/BluetoothPbapService.java
464d9d216ab1a6cf192e3e526596073c7e35e4a7 13-Aug-2009 L.X.YUE <L.X.YUE@motorola.com> Update Opp icons

Update incomming file notification icon to be consistent with system;
Update OPP launcher icon per Anroid guidline;
pp/BluetoothOppIncomingFileConfirmActivity.java
pp/BluetoothOppNotification.java
52236de777c23788df8147de15912a57e8bc36dd 04-Aug-2009 Tao Liejun <L.J.Tao@motorola.com> Fix a few OPP issues

Grab wakelock for server session
Fix send small file bug
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
pp/Constants.java
d896162ef022a5607b13bae5177637ff3f18b737 28-Jul-2009 Lixin Yue <L.X.YUE@motorola.com> Update PBAP per review comments:

Patch 3 fix listing call-history issue
Remove the use of Enum in PbapObexServer.java
Simplify codes by using function and paras
Change some informal usage in codes
Fix minor issues
Rename some function and vars
bap/BluetoothPbapActivity.java
bap/BluetoothPbapAuthenticator.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapReceiver.java
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
239bc526513429995c61c4148c105725c395b1a9 27-Jul-2009 Jackson Fan <xyfan@motorola.com> Enable Opp Livefolder, modify localizable resource

Update on patchset 2
Update icon for Bluetooth share and Incoming file
Fix minor Opp UI issue
Update log print for mimetype got from android system.
Update return response code for un-supported media type
Patchset 1
remove the use of replace() of localizable resource
Enable Opp Livefolder by using local certificate
Reject vcard actively
pp/BluetoothOppIncomingFileConfirmActivity.java
pp/BluetoothOppLiveFolder.java
pp/BluetoothOppNotification.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppProvider.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppTransferActivity.java
pp/Constants.java
37b69bd05e4b7a7d0e43575a6c22734b2d8c3f69 24-Jul-2009 Jackson Fan <xyfan@motorola.com> Remove TODOs for frameworks change

Modify for aidl added in frameworks
bap/BluetoothPbapService.java
87f9a72cc2d9544f65eab18893f7dc0de4f6ee31 23-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> Disable verbose logging.

TODO: We need to fix logging according to new verbose logging in OPP and PBAP.
pp/BluetoothOppRfcommListener.java
pp/Constants.java
bap/BluetoothPbapService.java
b9cd7fee03a41e56a0cea9aa2e1af3b28c5be590 23-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> Add copyright and fix some style issues.
bap/BluetoothPbapActivity.java
bap/BluetoothPbapAuthenticator.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapReceiver.java
bap/BluetoothPbapRfcommTransport.java
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
2c282d5898ac0916470ebfa9ff26ba784cf4bb24 18-Jul-2009 Jackson Fan <xyfan@motorola.com> Add pbap into bluetooth package

Update PBAP as patchset 5
Adjust some resouces strings after UI test
Change localized resource usage
Modify exception handle, rename a confusing variable name
Remove compile dependency on 240 for now. Add TODO in code
Some minor changes to address the comments
Submit on-behalf of Yue Lixin <a5206c@motorola.com>

Update PBAP as patchset 4 according to comments
Format resource files
Re-organize the logs
Submit on-behalf of Jiafa Liu <pbx376@motorola.com>
bap/BluetoothPbapActivity.java
bap/BluetoothPbapAuthenticator.java
bap/BluetoothPbapObexServer.java
bap/BluetoothPbapReceiver.java
bap/BluetoothPbapRfcommTransport.java
bap/BluetoothPbapService.java
bap/BluetoothPbapVcardManager.java
eb37b3c2c9d59bc1c0f09f911f5bde077a63f4da 18-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> Rename cancelPin to cancelPairingUserInput for Bluetooth 2.1
pp/BluetoothPinDialog.java
af9af3c451fde7712e86c9430169c306b91836a4 15-Jul-2009 Jackson Fan <xyfan@motorola.com> Cleanup resources of OPP

Modify according to Ranian's comments
- adjust layout
- remove Capitalized resource names
- format
pp/TestActivity.java
df7415da0e510ab8e4b73831a5ade38306982fe1 16-Jul-2009 Tao Liejun <L.J.Tao@motorola.com> Fix OPP receive bug

Fix the bug that second receving would fail
Show display name instead of full name in notification
pp/BluetoothOppNotification.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppService.java
pp/BluetoothOppTransfer.java
6769b59d715ea98bd72eafcfea9acd2714a887da 15-Jul-2009 Tao Liejun <L.J.Tao@motorola.com> Make opp compile

Modify to make opp application compliable in new git
-change package name
-change manifest
-modify a few comments
pp/BluetoothDevicePickerActivity.java
pp/BluetoothDevicePickerBtStatus.java
pp/BluetoothDevicePickerDevice.java
pp/BluetoothDevicePickerDeviceManager.java
pp/BluetoothDevicePickerDevicePreference.java
pp/BluetoothDevicePickerManager.java
pp/BluetoothOppBatch.java
pp/BluetoothOppBtEnableActivity.java
pp/BluetoothOppBtEnablingActivity.java
pp/BluetoothOppBtErrorActivity.java
pp/BluetoothOppIncomingFileConfirmActivity.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppLiveFolder.java
pp/BluetoothOppManager.java
pp/BluetoothOppNotification.java
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppPreference.java
pp/BluetoothOppProvider.java
pp/BluetoothOppReceiveFileInfo.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppSendFileInfo.java
pp/BluetoothOppService.java
pp/BluetoothOppShareInfo.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppUtility.java
pp/BluetoothPinDialog.java
pp/BluetoothShare.java
pp/Constants.java
pp/ProgressCategory.java
pp/TestActivity.java
pp/TestTcpListener.java
pp/TestTcpServer.java
pp/TestTcpSessionNotifier.java
09e9cba205af60b3f42e7a4d891a7d1392e1f2a5 11-Jul-2009 Nick Pelly <npelly@google.com> Initial drop of Motorola Bluetooth OPP code.

Minor changes from Moto code:
- Added Motorola BSD license
- Moved com.motorola.bluetoothshare to com.android.bluetooth.opp
- Updated com.motorola.obex to javax.obex
- Moved Android.mk to Android.mk.hide: does not yet compile due to changes in
Obex library.
pp/BluetoothDevicePickerActivity.java
pp/BluetoothDevicePickerBtStatus.java
pp/BluetoothDevicePickerDevice.java
pp/BluetoothDevicePickerDeviceManager.java
pp/BluetoothDevicePickerDevicePreference.java
pp/BluetoothDevicePickerListener.java
pp/BluetoothDevicePickerManager.java
pp/BluetoothOppBatch.java
pp/BluetoothOppBtEnableActivity.java
pp/BluetoothOppBtEnablingActivity.java
pp/BluetoothOppBtErrorActivity.java
pp/BluetoothOppIncomingFileConfirmActivity.java
pp/BluetoothOppLauncherActivity.java
pp/BluetoothOppLiveFolder.java
pp/BluetoothOppManager.java
pp/BluetoothOppNotification.java
pp/BluetoothOppObexClientSession.java
pp/BluetoothOppObexServerSession.java
pp/BluetoothOppObexSession.java
pp/BluetoothOppPreference.java
pp/BluetoothOppProvider.java
pp/BluetoothOppReceiveFileInfo.java
pp/BluetoothOppReceiver.java
pp/BluetoothOppRfcommListener.java
pp/BluetoothOppRfcommTransport.java
pp/BluetoothOppSendFileInfo.java
pp/BluetoothOppService.java
pp/BluetoothOppShareInfo.java
pp/BluetoothOppTransfer.java
pp/BluetoothOppTransferActivity.java
pp/BluetoothOppTransferInfo.java
pp/BluetoothOppUtility.java
pp/BluetoothPinDialog.java
pp/BluetoothShare.java
pp/Constants.java
pp/ProgressCategory.java
pp/TestActivity.java
pp/TestTcpListener.java
pp/TestTcpServer.java
pp/TestTcpSessionNotifier.java
pp/TestTcpTransport.java