Commit Graph

378 Commits

Author SHA1 Message Date
Zhihai Xu
2208e652d6 Merge "NPE in BluetoothSocket.write()" 2014-01-04 00:54:02 +00:00
Wei Wang
18c76934f6 BLE peripheral mode (3/4): Add peripheral mode API.
Change-Id: Id9d2f566b6d9ed0fffe73b67efad2e3d045360b4

Conflicts:
	core/java/android/bluetooth/BluetoothAdapter.java
	core/java/android/bluetooth/BluetoothGatt.java
2013-12-19 16:33:32 -08:00
Zhihai Xu
610770d712 NPE in BluetoothSocket.write()
If calling connect succeed, we should not see this NPE.
An IOException may happen after call BluetoothSocket.connect.
If you still call write after the IOException,
you will get this NPE.
add NPE protection for possible wrong calling sequence from application,
To make bluetoothSocket more error-tolerant.

bug:12104154
Change-Id: I7fa4e847b500ca9b9d2a43df432f31a1bb016c0a
2013-12-17 11:39:20 -08:00
Katie McCormick
e217347556 am 9c514b8f: am 4561f199: am 08e0142f: am f85470e6: am fbbc1b79: Merge "Doc update: Update package summary for BT." into klp-docs
* commit '9c514b8fe98603072e66cd44744cd1b42e28e678':
  Doc update: Update package summary for BT.
2013-12-13 01:08:07 +00:00
Katie McCormick
f2041ac56e Doc update: Update package summary for BT.
Fixes:

b/8584860

Change-Id: Ic85436f90b46508e6a182e3fc51365f5bfb8da14
2013-12-12 15:42:00 -08:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Matthew Xie
3f96fdd861 am 46cfa691: am 9a53fbe4: am ce39e8ce: Merge "Change pairing api/intent permission from PRIVILEGED to ADMIN" into klp-dev
* commit '46cfa691379af957cabecac83ae909ba83f93a8f':
  Change pairing api/intent permission from PRIVILEGED to ADMIN
2013-10-21 16:11:07 -07:00
Matthew Xie
ac2c6c3a16 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: I3a314efd973b3ce078ab5347159c336f222d9f15
2013-10-21 14:56:33 -07:00
Narayan Kamath
98e1797367 Remove captive portal code that has no effect.
Note that this CL does not change any behaviour.

At the center of this change is
CaptivePortalTracker#detectCaptivePortal(), which does nothing
except call back into ConnectivityService. Removing it allows us to
simplify code in ConnectivityService. It also allows us to remove
ConnectivityService#captivePortalCheckComplete which was only ever
called in response to this method.

While this does not change any behaviour, it preserves existing
bad behaviour, i.e, that the CAPTIVE_PORTAL_CHECK NetworkInfo
state does not correspond to actual captive portal detection.
We transition into that state and immediately (and unconditionally)
out of it and into CONNECTED.

Change-Id: Ib3797f956d2db5e3cacaaa53e899d81aa8e958af
2013-10-16 08:10:55 +00:00
Matthew Xie
64be26fad7 Merge "Check callback null condition for register/unregsiter state change callback" into klp-dev 2013-10-10 21:56:20 +00:00
Matthew Xie
9b69399399 Check callback null condition for register/unregsiter state change callback
Fix BluetoothPan closing sequence for unregsiter state change callback
bug 11160007

Change-Id: I405ec91a938289fe9541de2ebd9abc1fb938f44a
2013-10-10 12:12:04 -07:00
Edward Jee
430e361b20 Makes ACTION_PAIRING_REQUEST require BLUETOOTH_PRIVILEGED.
Bug: 11087521
Change-Id: I99cc584987bf12fe0648b048398b4eb9836e6172
2013-10-10 18:42:34 +00:00
Mike Lockwood
68c692df5f Revert "Allow L2CAP sockets"
This reverts commit 34b0f92613.
2013-10-02 07:56:46 -07:00
Matthew Xie
091fc2ba7a Unhide setPin, setPin, setPairingConfirmation, and relevant intent fields
bug 9987787

Change-Id: Id1c149964137e35703310e2f2893c8830aacddea
2013-09-29 13:17:56 -07:00
Kim Schulz
0d37605374 Fixed review comments
- fixed review comments (internal+google)
- corrected tabs/spaces
- Add connection id header for obex client operations
- added support for implementing ProfileService class

Change-Id: Idab8b4fa54a0f31bec4ffa263a69a9850a07f858

Bug:10692365
2013-09-12 19:07:28 -07:00
Dmitry Grinberg
34b0f92613 Allow L2CAP sockets
Change-Id: Icb498e6c0430789b6168bec3beb1d4650e4f1238
2013-09-06 12:27:12 -07:00
Matthew Xie
02a25a97a2 Merge "Block ble adv api based on resource config" into klp-dev 2013-09-03 22:36:09 +00:00
Matthew Xie
c5470778a4 Block ble adv api based on resource config
bug 10516911

Change-Id: I7a62103a1116ffbf7c3c934c1794384c0e6fbdd3
2013-08-28 15:45:23 -07:00
Ying Wang
b240578f03 Fix docs build.
Change-Id: I7bfcfea052de6959230bb361400e760eab35b78c
2013-08-26 17:48:22 -07:00
Edward Jee
922d41b6ef 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: I4757c410d31b97511c92f66d71035eb929f9fd29
2013-08-23 01:17:07 +00:00
Vinit Deshapnde
e2a6d3df12 Merge "Introduce network link quality statistics" into klp-dev 2013-08-22 16:16:45 +00:00
Vinit Deshapnde
1f12cb52a4 Introduce network link quality statistics
This change starts tracking traffic quality data for WiFi and mobile
networks. The quality is tracked based on incidental traffic, and not
on specific measurements. Theoretical bandwidths are hard-coded, as
well as sampling interval; although sampling interval can be changed
by setting a system policy.

Bugs filed to remove shortcomings of this change -

10342372 Change LinkInfo name to something better
10342318 Move hardcoded values of MobileLinkInfo to resources
         so they can be updated without changing code

Bug: 10006249

Change-Id: I83d8c7594da20fe53abbd5e1f909b1f606b035bb
2013-08-21 13:09:01 -07:00
John Du
b7b7d7a05c Update comments
bug 10152994

Change-Id: I05bbd917ebd0d140e0894f8bf7e43d0fc77378c8
2013-08-20 14:03:28 -07:00
John Du
48f8b5dbf6 Change abortReliableWrite(BluetoothDevice) to abortReliableWrite()
BluetoothGatt.abortReliableWrite() should not take a BluetoothDevice
parameter. Instead, it should use mDevice instance variable.
bug 10152994

Change-Id: I7fc79b9011cf878414128cc9f1696e5ccc597056
2013-08-19 16:01:24 -07:00
John Du
5a0cf7a27f Adding support for Absolute Volume
Change-Id: I7bbc6f9296221ca219a50a5e377ebac9dcf5a407
2013-08-16 12:25:20 -07:00
Andre Eisenbach
c60bed487e LE: Add support for the HID-over-GATT profile (2/3)
bug:8330048
Change-Id: I600563d81dec1638dc35e31e19f61d6c04f09ae8
2013-08-15 15:01:10 -07:00
Matthew Xie
a5c81e8636 Merge "LE: Add peripheral role support (1/4)" into klp-dev 2013-08-14 08:14:09 +00:00
Andre Eisenbach
f46b21aa99 LE: Add peripheral role support (1/4)
Initial stack support for the LE peripheral role.

Change-Id: I6222493488822b4289b90888ccc97ad9306f54d1
2013-08-14 00:48:24 -07:00
Matthew Xie
08c34c326f Merge "LE: Add instance ID to descriptors (1/4)" into klp-dev 2013-08-14 07:27:49 +00:00
Andre Eisenbach
25b9cf953b LE: Add instance ID to descriptors (1/4)
If a remote devices offers multiple descriptors with the same UUID, the
instance ID is used to differentiate between them.

Change-Id: I0c36494c980c86abd23f9647196af8d59ef663e9
2013-08-13 19:25:05 -07:00
Matthew Xie
fe3807a5b2 Bluetooth MAP profile - sms and mms support initial check-in
bug:10116530

Change-Id: I57d022005bcff5bc3e56438a81ac92566f957744
2013-08-09 15:01:07 -07:00
Wink Saville
89d16f7597 am 9b7b4450: am 02eab434: am 4d87d91d: Merge "If in a mobile captive portal is detected enable fail fast." into jb-mr2-dev
* commit '9b7b4450185e723dc7021f7e8bae4a12d4dd5606':
  If in a mobile captive portal is detected enable fail fast.
2013-08-08 17:10:34 -07:00
Wink Saville
d747cbc898 If in a mobile captive portal is detected enable fail fast.
When captive portal checking completes pass back the result.
This is used to enable/disable failing fast for mobile. When
failing fast is enabled we don't check for data stalls and thus
won't be continually trying to do recovery operations, such as
restarting the radio.

Bug: 9462512
Change-Id: I0dea0eee519f8ee7f94e79d40e82c18f30d7fe2e
2013-08-07 16:22:47 -07:00
Dianne Hackborn
221ea892dc Start restricting service calls with implicit intents.
The bindService() and startService() calls have always had
undefined behavior when used with an implicit Intent and there
are multiple matching services.  Because of this, it is not
safe for applications to use such Intents when interacting with
services, yet the platform would merrily go about doing... something.

In KLP I want to cause this case to be invalid, resulting in
an exception thrown back to the app.  Unfortunately there are
lots of (scary) things relying on this behavior, so we can't
immediately turn it into an exception, even one qualified by the
caller's target SDK version.

In this change, we start loggin a WTF when such a call happens,
and clean up some stuff in Bluetooth that was doing this behavior.

Change-Id: I62e25d07890588d2362104e20b054aebb6c0e007
2013-08-05 16:53:26 -07:00
Zhihai Xu
876d100f02 Merge "Add debug menu to enable btsnoop" 2013-07-26 18:33:43 +00:00
Zhihai Xu
560a523159 Revert "Bluetooth stopped working in master - "bad file descriptor""
This reverts commit df3cedab6f.

Change-Id: I9ffaf5580924c150145d37ec38ffde602199b7e2
2013-07-26 18:10:06 +00:00
Zhihai Xu
df3cedab6f Bluetooth stopped working in master - "bad file descriptor"
ignore IllegalArgumentException in BluetoothSocket.close().

bug: 9960585
Change-Id: I301aa388b738dcb92b643fdd96b5c9cb6f8b3efe
2013-07-24 15:09:45 -07:00
kmccormick
00c5620acf am 30c8973f: am 75c59fb9: am dc22fa92: Merge "Doc change: new Bluetooth LE doc" into jb-mr2-dev
* commit '30c8973f66ad035a1734c8e53173b58ac1fbd32d':
  Doc change: new Bluetooth LE doc
2013-06-21 16:34:40 -07:00
kmccormick
f14ff1c9ce Doc change: new Bluetooth LE doc
Change-Id: Ib6d67497a9b4d54d13b4da8f1f9ee991bc5ef562
2013-06-21 14:52:05 -07:00
Zhihai Xu
af5971ef27 Add debug menu to enable btsnoop
bug: 8059358
Change-Id: I2d5f13e68defefb92e0b11b749fe77ad67215f36
2013-06-17 11:46:52 -07:00
Jeff Sharkey
fea17de7aa Explicit locale when formatting machine strings.
Bug: 9390451
Change-Id: I3581c53407554a1dffd541fb42b06d68f20a7be0
2013-06-11 14:36:41 -07:00
Matthew Xie
703ea1862e am 0fdb05a7: am b190890a: Merge "Update javadoc to give app write better guidence" into jb-mr2-dev
* commit '0fdb05a770ce3ea0bd7f6ee9bae2283a38284607':
  Update javadoc to give app write better guidence
2013-05-30 15:16:00 -07:00
Matthew Xie
b190890a94 Merge "Update javadoc to give app write better guidence" into jb-mr2-dev 2013-05-30 18:45:42 +00:00
Matthew Xie
b30f91e38c Update javadoc to give app write better guidence
Update javadoc of close methods of GATT cliet and server
Update javadoc of BluetoothAdapter
bug 8963528

Change-Id: I45ec618fd495225ed11a6171f33bfdc218397d4c
2013-05-30 11:42:26 -07:00
Matthew Xie
16a90db8d7 am 897d98a7: am 6ea0636a: Merge "Revert "Revert "Change GATT_FAILURE from 0 to 0x101""" into jb-mr2-dev
* commit '897d98a7530109bff8d73b3651d8884c76f54c42':
  Revert "Revert "Change GATT_FAILURE from 0 to 0x101""
2013-05-28 22:30:10 -07:00
Matthew Xie
90ca807f7b Revert "Revert "Change GATT_FAILURE from 0 to 0x101""
This reverts commit d21f674c15
bug 9109238
Change-Id: Ie1fc3d7420e6c401d3db29499d8846e6b70a61bb
2013-05-28 15:28:24 -07:00
Matthew Xie
67cc127186 am e7e6bf9f: am 27e45361: Merge "Revert "Change GATT_FAILURE from 0 to 0x101"" into jb-mr2-dev
* commit 'e7e6bf9f02a0a74f0a8d3812d2a3a3f3ec855086':
  Revert "Change GATT_FAILURE from 0 to 0x101"
2013-05-28 13:50:13 -07:00
Matthew Xie
d78afea78d am 84e1afcc: am 413f6293: Merge "Change GATT_FAILURE from 0 to 0x101" into jb-mr2-dev
* commit '84e1afcccc328e7a52bfde16e824a3ed37889d1d':
  Change GATT_FAILURE from 0 to 0x101
2013-05-28 13:50:09 -07:00
Matthew Xie
d21f674c15 Revert "Change GATT_FAILURE from 0 to 0x101"
This reverts commit 8310e6196f

Change-Id: I467f7cfc8626b0fc54509a89158cd2d84a0c10b8
2013-05-26 21:03:16 +00:00
Matthew Xie
8310e6196f Change GATT_FAILURE from 0 to 0x101
GATT_FAILURE 0 clashes with GATT_SUCCESS. For now, they represent different
kind of faiure. One for Gatt operation, one for Gatt registration. But we
should separate them as good practice.
bug 9109238

Change-Id: I686bb6004bc8831aa3e3bbffe2f7c8e24412e3c3
2013-05-23 17:39:35 -07:00