OSDN Git Service

android-x86/packages-apps-Bluetooth.git
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 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 [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 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 [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 [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: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 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 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 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 [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 00:35:12 +0000 (17:35 -0700)]
Change scan downgrade timeout from 5 min to 30 min

Bug: 28824606
Change-Id: Ic4d1f7832aaa33ce0177905f6a64fea8eb048eae

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 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 [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: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 [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 [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 [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 [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 [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: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 [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 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 [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 [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 [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 [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:48:43 +0000 (20:48 +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

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

Change-Id: Ida61f3ba3d91a67185cb06411251dea62d8eedc4

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:45:25 +0000 (20:45 +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

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

Change-Id: I040910aa52e542acad0fffda4ae4ff5dad101008

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:41:25 +0000 (20:41 +0000)]
"DO NOT MERGE" Add write SMS protection am: fd7a794  -s ours am: daa8d67 am: 5eee2cd am: 48115bb  -s ours am: e2dca1a
am: 63bcffd

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

Change-Id: Ia5e0c102295f430fc4ec1d4230b70016d8e4c33e

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

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

Change-Id: I7c3b38bd4ca8c28f20fc89ac936da6e2f0d80480

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:38:06 +0000 (20:38 +0000)]
"DO NOT MERGE" Add write SMS protection am: fd7a794  -s ours am: daa8d67 am: 5eee2cd am: 48115bb  -s ours
am: e2dca1a

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

Change-Id: I79c8f9bc90ba6ad16b854d68c74b075188a6caa0

8 years ago"DO NOT MERGE" Add write SMS protection am: 64745b1 am: 9accc36
Seven Shen [Tue, 19 Apr 2016 20:33:41 +0000 (20:33 +0000)]
"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

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:33:14 +0000 (20:33 +0000)]
"DO NOT MERGE" Add write SMS protection am: fd7a794  -s ours am: daa8d67 am: 5eee2cd
am: 48115bb  -s ours

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

Change-Id: I39546ac3a880b12ddeb33c383184967e90209349

8 years ago"DO NOT MERGE" Add write SMS protection am: 64745b1
Seven Shen [Tue, 19 Apr 2016 20:30:39 +0000 (20:30 +0000)]
"DO NOT MERGE" Add write SMS protection am: 64745b1
am: 9accc36

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

Change-Id: Id5bc27d73ed66c9f12ecf94ec2ef1dc727a6b5c4

8 years ago"DO NOT MERGE" Add write SMS protection am: fd7a794 -s ours am: daa8d67
Ajay Panicker [Tue, 19 Apr 2016 20:30:02 +0000 (20:30 +0000)]
"DO NOT MERGE" Add write SMS protection am: fd7a794  -s ours am: daa8d67
am: 5eee2cd

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

Change-Id: Id83f27fd2d8b2431cea51c8eb5a4ca152a872647

8 years ago"DO NOT MERGE" Add write SMS protection am: fd7a794 -s ours
Ajay Panicker [Tue, 19 Apr 2016 20:26:39 +0000 (20:26 +0000)]
"DO NOT MERGE" Add write SMS protection am: fd7a794  -s ours
am: daa8d67

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

Change-Id: Ia8f55d6ba4a5d008b107673d8830208c3eefd30a

8 years ago"DO NOT MERGE" Add write SMS protection
Seven Shen [Tue, 19 Apr 2016 20:23:31 +0000 (20:23 +0000)]
"DO NOT MERGE" Add write SMS protection
am: 64745b1

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

Change-Id: Idb905753e4e4d711b11b7d5274e622df4e9c4251

8 years ago"DO NOT MERGE" Add write SMS protection
Ajay Panicker [Tue, 19 Apr 2016 20:23:20 +0000 (20:23 +0000)]
"DO NOT MERGE" Add write SMS protection
am: fd7a794  -s ours

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

Change-Id: I3dcb78c9213b10ad354c72ab756af773c04213c7

8 years agoAVRCP: Don't assume 0:00 on metadata change
Marie Janssen [Fri, 15 Apr 2016 21:57:04 +0000 (14:57 -0700)]
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

8 years agoMerge "Implement new async response method for controller activity info" into nyc-dev
Adam Lesinski [Mon, 18 Apr 2016 23:27:08 +0000 (23:27 +0000)]
Merge "Implement new async response method for controller activity info" into nyc-dev

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

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

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

Bug: b/28003743
Bug: b/28065071

Change-Id: I1d31156d134d98959ff3044c98206c60515d7e5a

8 years agoMerge "Import translations. DO NOT MERGE" into nyc-dev
Baligh Uddin [Fri, 15 Apr 2016 22:35:07 +0000 (22:35 +0000)]
Merge "Import translations. DO NOT MERGE" into nyc-dev

8 years agoMerge "Rename btif audio_focus_state -> set_audio_focus_state." am: 93b6179 am: c481822
Sanket Agarwal [Fri, 15 Apr 2016 20:13:48 +0000 (20:13 +0000)]
Merge "Rename btif audio_focus_state -> set_audio_focus_state." am: 93b6179 am: c481822
am: ef9aa9f

* commit 'ef9aa9f2514bafcaee96901dac2baffdf149e848':
  Rename btif audio_focus_state -> set_audio_focus_state.

Change-Id: Ib250b9355a44eae5e6d2fbf575c2bd9c04ffbcd4
(cherry picked from commit c7056ffc0c16fb35fda2cfc5adb51a736c9bb56a)

8 years agoImplement new async response method for controller activity info
Adam Lesinski [Mon, 11 Apr 2016 21:50:36 +0000 (14:50 -0700)]
Implement new async response method for controller activity info

Bug:26842468
Change-Id: I35e6bd6996d408aa2c8ccda754d5b2f05bcb8056

8 years agoAdd a missing null-pointer check in HeadsetService.stop()
Pavlin Radoslavov [Fri, 15 Apr 2016 00:49:45 +0000 (17:49 -0700)]
Add a missing null-pointer check in HeadsetService.stop()

Bug: 27678483

Change-Id: I288b905d6b3f827a94365d512305cd29e186f3d4

8 years agoImport translations. DO NOT MERGE
Baligh Uddin [Fri, 15 Apr 2016 07:55:11 +0000 (00:55 -0700)]
Import translations. DO NOT MERGE

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

8 years agoFix PEERS_MAC_ADDRESS permission for Ble Scanning.
Calvin On [Tue, 12 Apr 2016 22:43:59 +0000 (15:43 -0700)]
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

8 years agoImport translations. DO NOT MERGE
Bill Yi [Sat, 9 Apr 2016 13:51:28 +0000 (06:51 -0700)]
Import translations. DO NOT MERGE

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

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 agoBluetooth streaming should wait for AVRCP to start.
Sanket Agarwal [Thu, 7 Apr 2016 18:56:26 +0000 (11:56 -0700)]
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

8 years agoEnable logging for AVRCP Metadata changes
Marie Janssen [Tue, 5 Apr 2016 17:49:19 +0000 (10:49 -0700)]
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

8 years ago"DO NOT MERGE" Add write SMS protection
Ajay Panicker [Wed, 6 Apr 2016 22:55:15 +0000 (15:55 -0700)]
"DO NOT MERGE" Add write SMS protection

Bug: 25138326
Change-Id: I494db57e9291fac108e2abae85db367992ad81a1

8 years agoMerge "Import translations. DO NOT MERGE" into nyc-dev
Bill Yi [Wed, 6 Apr 2016 17:07:53 +0000 (17:07 +0000)]
Merge "Import translations. DO NOT MERGE" into nyc-dev

8 years agoImport translations. DO NOT MERGE
Bill Yi [Wed, 6 Apr 2016 13:38:59 +0000 (06:38 -0700)]
Import translations. DO NOT MERGE

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

8 years agoFix name collected for scan initiator
Ajay Panicker [Tue, 5 Apr 2016 00:31:19 +0000 (17:31 -0700)]
Fix name collected for scan initiator

Private information was being collected for the scan statistics.

Bug: 27996307
Change-Id: Idab438967f80f86f4f92e7f03cc5787f8d54e8a1

8 years agoMake PBAP PCE (Client) role auto-connectable.
Joseph Pirozzo [Tue, 5 Apr 2016 21:25:18 +0000 (14:25 -0700)]
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

8 years agoChange A2dpSinkService package from a2dp -> a2dpsink.
Sanket Agarwal [Tue, 5 Apr 2016 23:26:29 +0000 (16:26 -0700)]
Change A2dpSinkService package from a2dp -> a2dpsink.

Change go/ag/901764/ changed the package of A2dpSinkService but the JNI
did not do the appropriate change.

Bug: 27744764
Bug: 28025011
Change-Id: I9a6cc0e695bef152c1bdf461a5f92468db5172ab

8 years agoMove MediaBrowserService to Bluetooth Process
Sanket Agarwal [Thu, 31 Mar 2016 00:53:54 +0000 (17:53 -0700)]
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

8 years agoAdd GATT server scan stats and extra protection
Ajay Panicker [Wed, 23 Mar 2016 17:45:52 +0000 (10:45 -0700)]
Add GATT server scan stats and extra protection

Bug: 27811549
Change-Id: I9138193f8e0dec4e548c57b635bad3703961088f

8 years agoAutoconnect Car Profiles
Joseph Pirozzo [Fri, 1 Apr 2016 23:51:31 +0000 (16:51 -0700)]
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

8 years agoRemove DayNight theme
Alan Viverette [Thu, 31 Mar 2016 20:18:44 +0000 (16:18 -0400)]
Remove DayNight theme

Bug: 21854466
Change-Id: Iebd75177ca302af975a76787a22fecf79a77ef26

8 years agoMerge "PBAP client priority settings." into nyc-dev
Joseph Pirozzo [Wed, 30 Mar 2016 21:00:52 +0000 (21:00 +0000)]
Merge "PBAP client priority settings." into nyc-dev

8 years agoPBAP client priority settings.
Joseph Pirozzo [Fri, 25 Mar 2016 23:34:34 +0000 (16:34 -0700)]
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

8 years agoAdd a missing null check inside A2dpService.resetAvrcpBlacklist()
Pavlin Radoslavov [Tue, 29 Mar 2016 23:41:08 +0000 (16:41 -0700)]
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

8 years agoRevert "Add guest mode functionality (1/5)"
Ajay Panicker [Mon, 28 Mar 2016 21:58:49 +0000 (21:58 +0000)]
Revert "Add guest mode functionality (1/5)"

This reverts commit 6e2c4a130d93e448decc67991690fd8d1f83a343.

Change-Id: Iae9ecfc53a4e405bc04d21822a79112f7dc63247

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

8 years agoGATT JNI - get_gatt_db_cb leaking local refs
Jakub Pawlowski [Thu, 24 Mar 2016 23:39:02 +0000 (16:39 -0700)]
GATT JNI - get_gatt_db_cb leaking local refs

Bug: 27835277
Change-Id: I4bd0beb763507ea8a4a43a0f707408757f6ce8e0

8 years agoMerge changes from topic 'pts-test-fix-sync-20160335-1' into nyc-dev
Andre Eisenbach [Mon, 28 Mar 2016 04:33:51 +0000 (04:33 +0000)]
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.

8 years agoFix NPE when performing BLE scans.
Sharvil Nanavati [Sat, 26 Mar 2016 00:03:53 +0000 (17:03 -0700)]
Fix NPE when performing BLE scans.

Bug: 27811549
Change-Id: I017b34745682dd9db5487921df5c01dfde93d67c

8 years agoFix more merge issues in BluetoothPbapVcardManager.java
Andre Eisenbach [Fri, 25 Mar 2016 21:39:40 +0000 (14:39 -0700)]
Fix more merge issues in BluetoothPbapVcardManager.java

Change-Id: I901042e69b3beea93684fe1a194353664fabd0c2

8 years agoPBAPS: Don't filter out DateTime when requested
Smriti Gupta [Fri, 14 Aug 2015 11:18:48 +0000 (16:48 +0530)]
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

8 years agoPBAPS: Fix duplicate entries fetched from database
Smriti Gupta [Mon, 30 Nov 2015 12:45:14 +0000 (18:15 +0530)]
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

8 years agoPBAPS: Get vcard when asked in alphabetical order
Hemant Gupta [Mon, 23 Nov 2015 11:08:05 +0000 (16:38 +0530)]
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

8 years agoPBAPS: Enable contact search with full or part of given string
Hemant Gupta [Mon, 7 Mar 2016 08:12:52 +0000 (13:42 +0530)]
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

8 years agoSAP: Fix ANR(s) in SAP server code
Hemant Gupta [Mon, 7 Mar 2016 07:16:04 +0000 (12:46 +0530)]
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

8 years agoSAP: Remove sdp record while BT is being turned off to prevent leak
Hemant Gupta [Mon, 7 Mar 2016 07:11:14 +0000 (12:41 +0530)]
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