OSDN Git Service

android-x86/packages-apps-Bluetooth.git
8 years agoFix AVRCP crash, position and state tracking
Marie Janssen [Tue, 12 Jul 2016 14:53:54 +0000 (07:53 -0700)]
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

8 years agoRefactor playback position tracking
Marie Janssen [Thu, 30 Jun 2016 21:29:18 +0000 (14:29 -0700)]
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

8 years agoAllow MAP to accept and list draft messages without recipients
Ajay Panicker [Wed, 6 Jul 2016 19:20:02 +0000 (12:20 -0700)]
Allow MAP to accept and list draft messages without recipients

Bug: 28970268
Change-Id: I5bdef6cd67708036352ed37ea35b027d6a54af03

8 years agoCheck for call/call setup state before creating SCO
Satish Kodishala [Wed, 4 May 2016 14:11:24 +0000 (19:41 +0530)]
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)

8 years agoSet the Adapter Service onCreate()
Pavlin Radoslavov [Sat, 25 Jun 2016 00:31:52 +0000 (17:31 -0700)]
Set the Adapter Service onCreate()

We should call setAdapterService(this) inside onCreate() instead of
inside BleOnProcessStart(). The former is more robust.

Change-Id: Ide1d98dfdde148645f3efe246e6fbf95659195a7

8 years agoUse the live AdapterService in ProfileService.
Calvin On [Fri, 24 Jun 2016 00:10:59 +0000 (00:10 +0000)]
Use the live AdapterService in ProfileService.
am: d4152d61ac

Change-Id: I3e9f60f8589a62640055654d25fab66d270fec54

8 years agoUse the live AdapterService in ProfileService.
Calvin On [Wed, 22 Jun 2016 21:23:49 +0000 (14:23 -0700)]
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)

8 years agoMerge "Use the live AdapterService in ProfileService." into nyc-mr1-dev
Calvin On [Thu, 23 Jun 2016 21:06:58 +0000 (21:06 +0000)]
Merge "Use the live AdapterService in ProfileService." into nyc-mr1-dev

8 years agoClose output stream before getting response
Ajay Panicker [Thu, 23 Jun 2016 20:46:46 +0000 (20:46 +0000)]
Close output stream before getting response
am: e026ad5004

Change-Id: I54248b785427cce08568d7fed2bb329f90b3af02

8 years agoClose output stream before getting response
Ajay Panicker [Thu, 23 Jun 2016 20:29:34 +0000 (13:29 -0700)]
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

8 years agoUse the live AdapterService in ProfileService.
Calvin On [Wed, 22 Jun 2016 21:23:49 +0000 (14:23 -0700)]
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

8 years agoMerge \"Prevent energy data overflow\" into nyc-dev
Adam Lesinski [Wed, 22 Jun 2016 18:57:32 +0000 (18:57 +0000)]
Merge \"Prevent energy data overflow\" into nyc-dev
am: 303ef0bd13

Change-Id: Ic6927d8d5b929954b78c616d64332c29b24e55bf

8 years agoMerge "Prevent energy data overflow" into nyc-dev
Adam Lesinski [Wed, 22 Jun 2016 18:48:20 +0000 (18:48 +0000)]
Merge "Prevent energy data overflow" into nyc-dev

8 years agoFix how file size is calculated if not provided
Ajay Panicker [Wed, 22 Jun 2016 00:00:07 +0000 (00:00 +0000)]
Fix how file size is calculated if not provided
am: 120ba1db4d

Change-Id: I240f7fc0955aa6ec9d1e4e18cf217eac2b3aa394

8 years agoFix how file size is calculated if not provided
Ajay Panicker [Tue, 21 Jun 2016 00:54:36 +0000 (17:54 -0700)]
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

8 years agoPrevent energy data overflow
Adam Lesinski [Tue, 21 Jun 2016 01:46:55 +0000 (18:46 -0700)]
Prevent energy data overflow

- Stores energy data as longs
- Monitors for overflow and logs + discards sample

Bug:27598905
Change-Id: I442c0f63adb5197a45e7982e68f1260c856ed351

8 years agoFix sender name string to match MAP spec
Ajay Panicker [Fri, 19 Feb 2016 21:53:17 +0000 (13:53 -0800)]
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)

8 years agoMercedes Benz MAP message listing workaround
ugo_yu [Fri, 27 May 2016 12:11:08 +0000 (20:11 +0800)]
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

8 years agoImport translations. DO NOT MERGE
Bill Yi [Sun, 5 Jun 2016 15:56:48 +0000 (15:56 +0000)]
Import translations. DO NOT MERGE
am: 397d9de948  -s ours

* commit '397d9de948c3c5084468401ff1951f2db16260a2':
  Import translations. DO NOT MERGE

Change-Id: I221cce3b46e062e60f4439ead38a97aa561d6edc

8 years agoImport translations. DO NOT MERGE
Bill Yi [Fri, 3 Jun 2016 23:45:47 +0000 (16:45 -0700)]
Import translations. DO NOT MERGE

Change-Id: I98fcef7d96fe6957419e34bdb4357e254d8e6fc0
Auto-generated-cl: translation import

8 years agoImport translations. DO NOT MERGE
Bill Yi [Fri, 3 Jun 2016 23:42:34 +0000 (16:42 -0700)]
Import translations. DO NOT MERGE

Change-Id: If896174730ea6a12d1d591aadf2eff5047d2e60a
Auto-generated-cl: translation import

8 years agoCheck exception to prevent crash on invalid URIs
Marie Janssen [Thu, 2 Jun 2016 22:05:45 +0000 (22:05 +0000)]
Check exception to prevent crash on invalid URIs
am: eacf805631

* commit 'eacf805631c3fb557ba7210dc6da3eb4dd1a04b2':
  Check exception to prevent crash on invalid URIs

Change-Id: I6c697a50c6078ba89f0f5bd0018ddcf99ef869d2

8 years agoHFP 1.7 profile update (4/4)
Mudumba Ananth [Mon, 29 Feb 2016 10:14:18 +0000 (02:14 -0800)]
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

8 years agoCheck exception to prevent crash on invalid URIs
Marie Janssen [Wed, 25 May 2016 21:27:00 +0000 (14:27 -0700)]
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

8 years agoOnly allow access to MAP if SMS is not supported
rongbo.x.chi [Wed, 25 May 2016 00:27:29 +0000 (00:27 +0000)]
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

8 years agoOnly allow access to MAP if SMS is not supported
rongbo.x.chi [Mon, 7 Dec 2015 08:42:18 +0000 (16:42 +0800)]
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

8 years agoAdd guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641 am: b01d679002 am...
Ajay Panicker [Tue, 24 May 2016 22:27:38 +0000 (22:27 +0000)]
Add guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641 am: b01d679002 am: 0b2a403b82  -s ours am: 6d74162bea am: 46790a61d3 am: 5b68598a5f am: 4b1a2258f7
am: 996e934491

* commit '996e934491359a490a95f510da6f9eca6e684918':
  Add guest mode functionality (3/3)

Change-Id: I1fc9922c46d768c0cc69b875c1a83bd44248aa43

8 years agoAdd guest mode functionality (3/3) am: af5b1764da am: 69689c0098 -s ours am: 1d6901f...
Ajay Panicker [Tue, 24 May 2016 22:26:50 +0000 (22:26 +0000)]
Add guest mode functionality (3/3) am: af5b1764da am: 69689c0098  -s ours am: 1d6901fdcf am: 749752db0d
am: 24bbc49362

* commit '24bbc4936234ba42ef38c14d0f7c2174b98b1792':
  Add guest mode functionality (3/3)

Change-Id: I47282efc33a5d9f7a7cd05dd57efb2af2aa8ca46

8 years agoAdd guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641 am: b01d679002 am...
Ajay Panicker [Tue, 24 May 2016 22:26:00 +0000 (22:26 +0000)]
Add guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641 am: b01d679002 am: 0b2a403b82  -s ours am: 6d74162bea am: 46790a61d3 am: 5b68598a5f
am: 4b1a2258f7

* commit '4b1a2258f7b811312ddefb1af62a87544f574ab1':
  Add guest mode functionality (3/3)

Change-Id: I0a69c7db93c9f510985107e31609c9b45dc3698f

8 years agoAdd guest mode functionality (3/3) am: af5b1764da am: 69689c0098 -s ours am: 1d6901fdcf
Ajay Panicker [Tue, 24 May 2016 22:25:26 +0000 (22:25 +0000)]
Add guest mode functionality (3/3) am: af5b1764da am: 69689c0098  -s ours am: 1d6901fdcf
am: 749752db0d

* commit '749752db0d737e47f59347f01e9c304608f63e27':
  Add guest mode functionality (3/3)

Change-Id: I8e8327d41c0ee3d6b6ed1c68b7517aca44dfab66

8 years agoAdd guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641 am: b01d679002 am...
Ajay Panicker [Tue, 24 May 2016 22:21:47 +0000 (22:21 +0000)]
Add guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641 am: b01d679002 am: 0b2a403b82  -s ours am: 6d74162bea am: 46790a61d3
am: 5b68598a5f

* commit '5b68598a5f4e0bef1ee87671617be8476dbf30a6':
  Add guest mode functionality (3/3)

Change-Id: Ib4ea170b03af67655426ab030032aeb36342f6ba

8 years agoAdd guest mode functionality (3/3) am: af5b1764da am: 69689c0098 -s ours
Ajay Panicker [Tue, 24 May 2016 22:21:27 +0000 (22:21 +0000)]
Add guest mode functionality (3/3) am: af5b1764da am: 69689c0098  -s ours
am: 1d6901fdcf

* commit '1d6901fdcf7e546b3bdbeb1bc1b9c1cae3688745':
  Add guest mode functionality (3/3)

Change-Id: If3aaa4e34c015da99d38e984d8b0dd1bedd2e1f3

8 years agoAdd guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641 am: b01d679002 am...
Ajay Panicker [Tue, 24 May 2016 22:16:17 +0000 (22:16 +0000)]
Add guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641 am: b01d679002 am: 0b2a403b82  -s ours am: 6d74162bea
am: 46790a61d3

* commit '46790a61d3722128f68bbfd2e12656923def72d0':
  Add guest mode functionality (3/3)

Change-Id: I956eb988a5f80ff11af426a406251a852eb1a09a

8 years agoAdd guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641 am: b01d679002 am...
Ajay Panicker [Tue, 24 May 2016 22:16:04 +0000 (22:16 +0000)]
Add guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641 am: b01d679002 am: 0b2a403b82  -s ours
am: 6d74162bea

* commit '6d74162bea2771991a434e0c463b58c080ee1b26':
  Add guest mode functionality (3/3)

Change-Id: I90e7d0a5372f25eeb2a92f8773aa81caa3d1de1f

8 years agoAdd guest mode functionality (3/3) am: af5b1764da
Ajay Panicker [Tue, 24 May 2016 22:15:53 +0000 (22:15 +0000)]
Add guest mode functionality (3/3) am: af5b1764da
am: 69689c0098  -s ours

* commit '69689c0098a7582f8bba393f72b2575ed5508e71':
  Add guest mode functionality (3/3)

Change-Id: I0715575a2e7de20356c1b8c0b170eb85eb5e77e3

8 years agoAdd guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641 am: b01d679002
Ajay Panicker [Tue, 24 May 2016 22:13:11 +0000 (22:13 +0000)]
Add guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641 am: b01d679002
am: 0b2a403b82  -s ours

* commit '0b2a403b821149b8d0c6ec3ab28db46beff3d75e':
  Add guest mode functionality (3/3)

Change-Id: Ic32d37360b9a73b10b27bed3a73d9fdf865db346

8 years agoAdd guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641
Ajay Panicker [Tue, 24 May 2016 22:07:27 +0000 (22:07 +0000)]
Add guest mode functionality (3/3) am: e1ca5cccd6 am: 480b762641
am: b01d679002

* commit 'b01d6790028caf2ba951d5c6eeacf7d4f8ecbbd3':
  Add guest mode functionality (3/3)

Change-Id: I98de45cdc87a200c4ff32ccfac88d42edac767a5

8 years agoAdd guest mode functionality (3/3) am: e1ca5cccd6
Ajay Panicker [Tue, 24 May 2016 22:05:26 +0000 (22:05 +0000)]
Add guest mode functionality (3/3) am: e1ca5cccd6
am: 480b762641

* commit '480b76264134b6a44aef6948f32b4bd6a62fcd0f':
  Add guest mode functionality (3/3)

Change-Id: I512cef0d0c23d4702cf9de61be4bf8f47c164bac

8 years agoAdd guest mode functionality (3/3)
Ajay Panicker [Tue, 24 May 2016 22:02:02 +0000 (22:02 +0000)]
Add guest mode functionality (3/3)
am: af5b1764da

* commit 'af5b1764daa3b212d471f000d7091ac07c040453':
  Add guest mode functionality (3/3)

Change-Id: I2591d37bb52e2bda796200100f7f21bf00f55d7a

8 years agoAdd guest mode functionality (3/3)
Ajay Panicker [Tue, 24 May 2016 22:02:02 +0000 (22:02 +0000)]
Add guest mode functionality (3/3)
am: e1ca5cccd6

* commit 'e1ca5cccd6c2b37f783aa0ee2d9371108ad5c855':
  Add guest mode functionality (3/3)

Change-Id: I9f3c034215aadf5e5ebd77e4a3265c7fbcf21fe3

8 years agoMerge "GATT: Move connection parameters to config.xml" into nyc-mr1-dev
Alain Vongsouvanh [Tue, 24 May 2016 16:09:52 +0000 (16:09 +0000)]
Merge "GATT: Move connection parameters to config.xml" into nyc-mr1-dev

8 years agoRemoved unnecessary "synchronized" statements
Pavlin Radoslavov [Tue, 24 May 2016 02:34:30 +0000 (02:34 +0000)]
Removed unnecessary "synchronized" statements
am: e741f05c93

* commit 'e741f05c93343241123095acab011dc8a0700bc6':
  Removed unnecessary "synchronized" statements

Change-Id: Id0db840569d83817dbb4a65619f9e63618370354

8 years agoRemoved unnecessary "synchronized" statements
Pavlin Radoslavov [Mon, 23 May 2016 05:24:08 +0000 (22:24 -0700)]
Removed unnecessary "synchronized" statements

Bug: 28734075
Bug: 28799467
Change-Id: I6ba8867c179dc416bb0dd06c69ce426c10ea7585

8 years agoGATT: Move connection parameters to config.xml
Alain Vongsouvanh [Fri, 13 May 2016 20:27:59 +0000 (13:27 -0700)]
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)

8 years agoBroadcast UUIDS on BT state transition to ON
venkata Jagadeesh [Mon, 23 May 2016 21:46:16 +0000 (21:46 +0000)]
Broadcast UUIDS on BT state transition to ON
am: 6fb4b2407f

* commit '6fb4b2407f2ae6d87b1f026870f66d717a915973':
  Broadcast UUIDS on BT state transition to ON

Change-Id: Ie3f311eb23193c3da4a5d54e0a956caeaf9a0084

8 years agoBroadcast UUIDS on BT state transition to ON
venkata Jagadeesh [Tue, 12 Jan 2016 09:24:47 +0000 (14:54 +0530)]
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

8 years agoFix LocalRef leakage in get_gatt_db
Jakub Pawlowski [Mon, 23 May 2016 20:48:16 +0000 (20:48 +0000)]
Fix LocalRef leakage in get_gatt_db
am: c949f68641

* commit 'c949f686413deb9b711696d53d8064669a1475d0':
  Fix LocalRef leakage in get_gatt_db

Change-Id: I2fecf9ff7527236c3b31248db035ae891cb68d28

8 years agoFix LocalRef leakage in get_gatt_db
Jakub Pawlowski [Mon, 23 May 2016 18:05:32 +0000 (11:05 -0700)]
Fix LocalRef leakage in get_gatt_db

Bug: 28878699
Change-Id: I81929d9f802d4f50eb7eb60d54ceca6ff19bb651

8 years agoAdd guest mode functionality (3/3)
Ajay Panicker [Fri, 18 Mar 2016 00:12:08 +0000 (17:12 -0700)]
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

8 years agoImport translations. DO NOT MERGE
Baligh Uddin [Sun, 22 May 2016 23:13:09 +0000 (23:13 +0000)]
Import translations. DO NOT MERGE
am: b3ddda59b6  -s ours

* commit 'b3ddda59b674623296238121a6e81c3c1e434756':
  Import translations. DO NOT MERGE

Change-Id: I7e9ab8623adba8a29b600f6ca11447533c925f1f

8 years agoImport translations. DO NOT MERGE
Baligh Uddin [Sat, 21 May 2016 19:12:24 +0000 (12:12 -0700)]
Import translations. DO NOT MERGE

Auto-generated-cl: translation import

Bug: 28857042
Change-Id: I7d9aa50ddc3826c10cf29aa91e3fae9ee79a1004

8 years agoChange scan downgrade timeout from 5 min to 30 min
Ajay Panicker [Sat, 21 May 2016 02:40:29 +0000 (02:40 +0000)]
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

8 years agoChange scan downgrade timeout from 5 min to 30 min
Ajay Panicker [Sat, 21 May 2016 00:35:12 +0000 (17:35 -0700)]
Change scan downgrade timeout from 5 min to 30 min

Bug: 28824606
Change-Id: Ic4d1f7832aaa33ce0177905f6a64fea8eb048eae

8 years agoMerge "Fix 2 instances of a field being assigned itself in a constructor." into nyc...
TreeHugger Robot [Fri, 20 May 2016 00:22:31 +0000 (00:22 +0000)]
Merge "Fix 2 instances of a field being assigned itself in a constructor." into nyc-mr1-dev

8 years agoFix a test related to GATT client that could never succeed
Ian Rogers [Thu, 19 May 2016 02:40:49 +0000 (19:40 -0700)]
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)

8 years agoFix 2 instances of a field being assigned itself in a constructor.
Ian Rogers [Wed, 16 Mar 2016 21:08:39 +0000 (14:08 -0700)]
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)

8 years agoDO NOT MERGE ANYWHERE GATT: Move connection parameters to config.xml am: 26f325ad37...
Alain Vongsouvanh [Wed, 18 May 2016 16:20:57 +0000 (16:20 +0000)]
DO NOT MERGE ANYWHERE GATT: Move connection parameters to config.xml am: 26f325ad37  -s ours am: 6bc72a1fbf  -s ours
am: 4457205c96  -s ours

* commit '4457205c9640ce31ee5afb9c934bc45de5555a2a':
  DO NOT MERGE ANYWHERE GATT: Move connection parameters to config.xml

Change-Id: I4f0d4eb4f185d3b83d5ae1254b73d0deea9a2666

8 years agoDO NOT MERGE ANYWHERE GATT: Move connection parameters to config.xml am: 26f325ad37...
Alain Vongsouvanh [Wed, 18 May 2016 16:17:59 +0000 (16:17 +0000)]
DO NOT MERGE ANYWHERE GATT: Move connection parameters to config.xml am: 26f325ad37  -s ours
am: 6bc72a1fbf  -s ours

* commit '6bc72a1fbfb09856983589e5bb19ba5bf67e7e94':
  DO NOT MERGE ANYWHERE GATT: Move connection parameters to config.xml

Change-Id: I8a04e5f7269be7242cfdedf071319d1947e4be7e

8 years agoDO NOT MERGE ANYWHERE GATT: Move connection parameters to config.xml
Alain Vongsouvanh [Wed, 18 May 2016 16:15:29 +0000 (16:15 +0000)]
DO NOT MERGE ANYWHERE GATT: Move connection parameters to config.xml
am: 26f325ad37  -s ours

* commit '26f325ad37145b0de56518f63c97319e322c976b':
  DO NOT MERGE ANYWHERE GATT: Move connection parameters to config.xml

Change-Id: Ibe39628179845b7dd1c16604bcb78614eb397474

8 years agoDO NOT MERGE ANYWHERE GATT: Move connection parameters to config.xml
Alain Vongsouvanh [Fri, 13 May 2016 20:27:59 +0000 (13:27 -0700)]
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)

8 years agoMerge "BluetoothManager: Make requestControllerActivityInfo one call" into nyc-dev
Adam Lesinski [Thu, 12 May 2016 01:26:14 +0000 (01:26 +0000)]
Merge "BluetoothManager: Make requestControllerActivityInfo one call" into nyc-dev
am: fc57cab5ba

* commit 'fc57cab5ba191752d0091c808f940fb677bac0ab':
  BluetoothManager: Make requestControllerActivityInfo one call

Change-Id: I16d66dc0e710548269ee15f775da20b65259f380

8 years agoMerge "BluetoothManager: Make requestControllerActivityInfo one call" into nyc-dev
Adam Lesinski [Thu, 12 May 2016 00:59:28 +0000 (00:59 +0000)]
Merge "BluetoothManager: Make requestControllerActivityInfo one call" into nyc-dev

8 years agoAdd config for enabling HFP Connection Service.
Bryce Lee [Tue, 10 May 2016 23:52:49 +0000 (23:52 +0000)]
Add config for enabling HFP Connection Service.
am: 70c7604401

* commit '70c760440149a0ac78ff33346798253269abd937':
  Add config for enabling HFP Connection Service.

Change-Id: I3a8b988dd1ce7b6df5459cc657239b41ff7750e7

8 years agoAdd config for enabling HFP Connection Service.
Bryce Lee [Mon, 9 May 2016 20:52:14 +0000 (13:52 -0700)]
Add config for enabling HFP Connection Service.

By default, devices which use HFP Client profile should use the built-in
connection service. However, the service should be flexible enough to
allow other implementations.

Bug: 28068989
Change-Id: Ic1be5745541ccfbd838c5440e4cfc75620ae91c2

8 years agoBluetoothManager: Make requestControllerActivityInfo one call
Adam Lesinski [Tue, 10 May 2016 21:03:03 +0000 (14:03 -0700)]
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

8 years agoDO NOT MERGE ANYWHERE Add missing null pointer check inside HeadSetClientService...
Lianchao Song [Tue, 10 May 2016 17:49:30 +0000 (17:49 +0000)]
DO NOT MERGE ANYWHERE Add missing null pointer check inside HeadSetClientService.stop() am: 3fe282a78e  -s ours am: 8080442c99  -s ours
am: 432f43c938  -s ours

* commit '432f43c938cc59e64b1e8130e5873357dae90769':
  DO NOT MERGE ANYWHERE Add missing null pointer check inside HeadSetClientService.stop()

Change-Id: Ib142bcd99a6c6932bb3c404d364a391cebec6b76

8 years agoDO NOT MERGE ANYWHERE Add missing null pointer check inside HeadSetClientService...
Lianchao Song [Tue, 10 May 2016 17:46:49 +0000 (17:46 +0000)]
DO NOT MERGE ANYWHERE Add missing null pointer check inside HeadSetClientService.stop() am: 3fe282a78e  -s ours
am: 8080442c99  -s ours

* commit '8080442c99578192d91eb8fcc23ac9cc0c805587':
  DO NOT MERGE ANYWHERE Add missing null pointer check inside HeadSetClientService.stop()

Change-Id: Id550b4448b5f3eab200c519e347e876579a4cc4c

8 years agoDO NOT MERGE ANYWHERE Add missing null pointer check inside HeadSetClientService...
Lianchao Song [Tue, 10 May 2016 17:43:58 +0000 (17:43 +0000)]
DO NOT MERGE ANYWHERE Add missing null pointer check inside HeadSetClientService.stop()
am: 3fe282a78e  -s ours

* commit '3fe282a78e8643329c5d6bc84ad5788cd4366b70':
  DO NOT MERGE ANYWHERE Add missing null pointer check inside HeadSetClientService.stop()

Change-Id: I376d9ee987ce3c1d859fbc78095cc85ea78475fa

8 years agoDO NOT MERGE ANYWHERE Add missing null pointer check inside HeadSetClientService...
Lianchao Song [Mon, 9 May 2016 14:50:57 +0000 (22:50 +0800)]
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>
8 years agoAdd protection against LE scanning abuse
Ajay Panicker [Mon, 9 May 2016 19:22:03 +0000 (19:22 +0000)]
Add protection against LE scanning abuse
am: aef39f16e4

* commit 'aef39f16e48cbae0ace8136c3235136c0a096061':
  Add protection against LE scanning abuse

Change-Id: Ifb57541579eed30d4d34d3ec407987c2ea02d56e

8 years agoAdd protection against LE scanning abuse
Ajay Panicker [Wed, 13 Apr 2016 21:11:57 +0000 (14:11 -0700)]
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

8 years agoHfpClientConnectionService does not synchronize state
Sanket Agarwal [Mon, 9 May 2016 17:34:24 +0000 (17:34 +0000)]
HfpClientConnectionService does not synchronize state
am: a8fc504fed

* commit 'a8fc504fed7dcb5dc074980b9d4cfa7a56445424':
  HfpClientConnectionService does not synchronize state

Change-Id: I4e527e352ff0fe04f10b11bf782c4e0104811e65

8 years agoHfpClientConnectionService does not synchronize state
Sanket Agarwal [Tue, 26 Apr 2016 22:35:43 +0000 (15:35 -0700)]
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

8 years agoAVRCP: Provide more media attributes
Marie Janssen [Fri, 6 May 2016 18:53:53 +0000 (18:53 +0000)]
AVRCP: Provide more media attributes
am: 0fcd081ccc

* commit '0fcd081cccbf624a3a886fe4eb68adc3498e695c':
  AVRCP: Provide more media attributes

Change-Id: I7ccda700abaf47a0accf12a1220f0e1a3f2b2b4c

8 years agoFix divergent equals and hashCode behavior
Ian Rogers [Thu, 5 May 2016 20:36:19 +0000 (20:36 +0000)]
Fix divergent equals and hashCode behavior
am: 27b250928c

* commit '27b250928cb3401d9a0a3a3f4b2026f1a431b6df':
  Fix divergent equals and hashCode behavior

Change-Id: I5a31d6166a0e1ed2d4f4c6cedb0afb5c831836f7

8 years agoAVRCP: Provide more media attributes
Marie Janssen [Mon, 25 Apr 2016 18:24:39 +0000 (11:24 -0700)]
AVRCP: Provide more media attributes

Add track number, total tracks, genre, and consolidate MediaAttribute
handling into a single place.

Bug: 28589463

Change-Id: I53049bc2a43c0f30af9639fbc3d6a02cd8a74900

8 years agoFix divergent equals and hashCode behavior
Ian Rogers [Wed, 4 May 2016 17:37:28 +0000 (10:37 -0700)]
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

8 years agoFix work profile app not being able to create bond
Jakub Pawlowski [Wed, 4 May 2016 22:02:56 +0000 (22:02 +0000)]
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: I99c8f2b889e0f0893e6b54bc312aef6a6eb19cd1

8 years agoFix work profile app not being able to create bond
Jakub Pawlowski [Fri, 15 Apr 2016 12:30:01 +0000 (05:30 -0700)]
Fix work profile app not being able to create bond

Bug: 28153078
Change-Id: I49c020d7d016c667a6cb3366ef862a1eb9dfb4d5

8 years agoAdd guest mode functionality (3/3)
Ajay Panicker [Fri, 18 Mar 2016 00:12:08 +0000 (17:12 -0700)]
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

8 years agoMake Bluetooth encryption aware
Ajay Panicker [Tue, 3 May 2016 00:50:45 +0000 (00:50 +0000)]
Make Bluetooth encryption aware
am: cf48e13e3b

* commit 'cf48e13e3bcfbc326bf860331d367a6e4524af8d':
  Make Bluetooth encryption aware

Change-Id: I9e9f85059213a41cea86bfb98795fff96d35fadf

8 years agoMake Bluetooth encryption aware
Ajay Panicker [Mon, 11 Apr 2016 23:45:52 +0000 (16:45 -0700)]
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

8 years agoMerge "Log permission check failure as warning" into nyc-dev
Jakub Pawlowski [Tue, 26 Apr 2016 18:23:52 +0000 (18:23 +0000)]
Merge "Log permission check failure as warning" into nyc-dev
am: 7a94490

* commit '7a9449022d3ea672b96062df7a16d9259b2a66f0':
  Log permission check failure as warning

Change-Id: I6d700e26a443a3c6496cc9148eba840544558d52

8 years agoMerge "Log permission check failure as warning" into nyc-dev
Jakub Pawlowski [Tue, 26 Apr 2016 18:20:41 +0000 (18:20 +0000)]
Merge "Log permission check failure as warning" into nyc-dev

8 years agoAbsolute volume: Black list device if remote can\'t change volume
Liejun Tao [Tue, 26 Apr 2016 18:17:26 +0000 (18:17 +0000)]
Absolute volume: Black list device if remote can\'t change volume
am: 2583f09

* commit '2583f09407c8265c12d198d408692c75eabf22a3':
  Absolute volume: Black list device if remote can't change volume

Change-Id: I1dd27493c5708f4d79e4134cfb00fe17d90b85f3

8 years agoAbsolute volume: Black list device if remote can't change volume
Liejun Tao [Wed, 9 Mar 2016 05:04:17 +0000 (23:04 -0600)]
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

8 years agoLog permission check failure as warning
Jakub Pawlowski [Tue, 26 Apr 2016 16:13:09 +0000 (09:13 -0700)]
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

8 years agoMerge "Properly label app as unregistered and add NPE protection" into nyc-dev
Ajay Panicker [Fri, 22 Apr 2016 23:47:15 +0000 (23:47 +0000)]
Merge "Properly label app as unregistered and add NPE protection" into nyc-dev
am: e062a53

* commit 'e062a53f929cfbb90a81c966f1e1b207510247f3':
  Properly label app as unregistered and add NPE protection

Change-Id: I257b811c9fcfc3f4e4516701091f9d810682b64e

8 years agoMerge "Properly label app as unregistered and add NPE protection" into nyc-dev
Ajay Panicker [Fri, 22 Apr 2016 22:46:33 +0000 (22:46 +0000)]
Merge "Properly label app as unregistered and add NPE protection" into nyc-dev

8 years agoSynchronize access to ServiceDeclaration fields.
Calvin On [Fri, 22 Apr 2016 21:21:58 +0000 (21:21 +0000)]
Synchronize access to ServiceDeclaration fields.
am: f8ecbbb

* commit 'f8ecbbb375c6a41895e0144d8d8cd42587891570':
  Synchronize access to ServiceDeclaration fields.

Change-Id: I4838d4fd0b7d724de73dcc8ee57c528186f7c254

8 years agoSynchronize access to ServiceDeclaration fields.
Calvin On [Wed, 20 Apr 2016 02:17:50 +0000 (19:17 -0700)]
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

8 years agoProperly label app as unregistered and add NPE protection
Ajay Panicker [Wed, 20 Apr 2016 21:14:33 +0000 (14:14 -0700)]
Properly label app as unregistered and add NPE protection

Bug: 28252914
Change-Id: I1e28a9af96bcf0d56914fcc676a8ff85400bc1c4

8 years agoAVRCP: Use MediaController
Marie Janssen [Fri, 22 Apr 2016 00:25:54 +0000 (00:25 +0000)]
AVRCP: Use MediaController
am: 2fc493d0ea

* commit '2fc493d0ea2b504df25d783a488dfadfe301329e':
  AVRCP: Use MediaController

Change-Id: Ibc45bcea6a38686b0c28171ee56a1a0dcb4cbd34

8 years agoAVRCP: Use MediaController
Marie Janssen [Tue, 19 Apr 2016 14:12:42 +0000 (07:12 -0700)]
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

8 years ago"DO NOT MERGE" Add write SMS protection
Seven Shen [Thu, 21 Apr 2016 21:54:27 +0000 (21:54 +0000)]
"DO NOT MERGE" Add write SMS protection
am: 60e306ba5c

* commit '60e306ba5c132d5408ccae3a290e7cace020a49f':
  "DO NOT MERGE" Add write SMS protection

Change-Id: I0814706dcaa770fac4f12e522517f53eb17f02af

8 years ago"DO NOT MERGE" Add write SMS protection
Seven Shen [Wed, 6 Apr 2016 19:25:17 +0000 (12:25 -0700)]
"DO NOT MERGE" Add write SMS protection

Bug: 25138326
Change-Id: I9f418370b8725d49e3734406b6f435107bcff021

8 years agoAdd guest mode functionality (1/5)
Ajay Panicker [Wed, 20 Apr 2016 00:52:03 +0000 (00:52 +0000)]
Add guest mode functionality (1/5)
am: 3558402aae

* commit '3558402aae35c6b01c505be012d6736b0c758802':
  Add guest mode functionality (1/5)

Change-Id: I2bef0061e1276dee86dd840d0e80888dea1c1adc

8 years agoAdd guest mode functionality (1/5)
Ajay Panicker [Fri, 18 Mar 2016 00:12:08 +0000 (17:12 -0700)]
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

8 years ago"DO NOT MERGE" Add write SMS protection am: fd7a794 -s ours am: daa8d67 am: 5eee2cd...
Ajay Panicker [Tue, 19 Apr 2016 20:50:29 +0000 (20:50 +0000)]
"DO NOT MERGE" Add write SMS protection am: fd7a794  -s ours am: daa8d67 am: 5eee2cd am: 48115bb  -s ours am: e2dca1a am: 63bcffd am: c522820 am: 8a05cda  -s ours
am: ee763f7

* commit 'ee763f7526696a1c6eed92331397781d6eb7789c':
  "DO NOT MERGE" Add write SMS protection

Change-Id: I6004e17e53a5e44206eaf45cb0a498cf6ea8ff4b

8 years ago"DO NOT MERGE" Add write SMS protection am: 64745b1 am: 9accc36 am: 6c32c81 am: b90c2...
Seven Shen [Tue, 19 Apr 2016 20:50:29 +0000 (20:50 +0000)]
"DO NOT MERGE" Add write SMS protection am: 64745b1 am: 9accc36 am: 6c32c81 am: b90c267  -s ours
am: fed0765

* commit 'fed0765ad788e5ee92b46993d64e74f9f5ac431a':
  "DO NOT MERGE" Add write SMS protection

Change-Id: If59497f9e755c99c9fa7d17fc2bb33b278343897