Commit Graph

270 Commits

Author SHA1 Message Date
Jaikumar Ganesh
b7ec3e1019 Fix PANU - Bluetooth tethering - JNI calls.
Change-Id: Ia0b37a03e65be6632cc0bb8f1a98f268d42c9d87
2010-12-16 18:02:29 -08:00
Robert Greenwalt
81d5ad515a Fix Bluetooth-tethering config of interface.
bug:3288692
Change-Id: Id7f1b680392f938000953157716bf9a8f8a66af9
2010-12-16 11:35:40 -08:00
Jaikumar Ganesh
6a3c473910 Add FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT to name changed broadcast.
BT can come up before the system boots up and we send a broadcast,
this can cause issues.

Bug: 3259948
Change-Id: I53ce6b9851fbf611309db1f0a16768ef9f388e0c
2010-12-15 13:14:47 -08:00
Robert Greenwalt
04808c2940 Fix some IpV4-only code.
InterfaceConfiguration changed to use InetAddress and stop with the string->int->string
conversions.

bug:2542681
Change-Id: I11c4954547333c43bb840fa0469ddde57b0d043b
2010-12-14 14:41:26 -08:00
Jaikumar Ganesh
2d1fc4e3f5 Remove delay with auto connection.
SDP records are now registered with a dbus call so we don't have to wait
for initiating auto connections.

Also reduce time to connect other profiles case by 2 secs.

Change-Id: I8f0eab6a95d3bfaf11a8eb7495a024949639d7fc
2010-12-13 15:58:44 -08:00
Jaikumar Ganesh
84690c88f3 Add direct calls to Bluez to add SDP records.
This helps Settings app to enable just the Headset service.

Change-Id: Ia9c39467df1e83d665e377313e16e6c54991f6d6
2010-12-13 11:37:41 -08:00
Jaikumar Ganesh
58b93c3640 Update BT code for voice capability cases.
1. Disable PBAP and Headset / Handsfree records.
2. Add API to query for local adapter UUIDs.

Change-Id: Ic84ba6a49738adc89a8695d3a4890f08562e0621
2010-11-24 10:49:47 -08:00
Jake Hamby
39657b808f Revert "Don't call cancel discovery when its already canceelled."
This reverts commit 58d0dcb75b.
Fixes a bug where discovery would start every 20-30 seconds.
2010-11-19 16:45:58 -08:00
Jaikumar Ganesh
58d0dcb75b Don't call cancel discovery when its already canceelled.
Reported by: Leijun Tao

Change-Id: I5f04ecde16d147776a30810210cd3c973aee4d87
2010-11-12 09:41:12 -08:00
Jaikumar Ganesh
bb0773fac8 Fix crash in dump function.
Change-Id: I5a4cd7cf3fd325ced5d05f036c191f759dee16e0
2010-11-11 15:18:19 -08:00
Jaikumar Ganesh
7a0f816916 Disconnect PAN and Input devices on BT disable.
Also, add a missing break.

Change-Id: I228f80a4223de20e60d2f3828e3f63bdc14f5afc
2010-11-01 15:04:06 -07:00
Jaikumar Ganesh
c53cab20b2 Add an API call to get the ConnectionState of the Bluetooth Adapter.
Change-Id: Icd87d7720189034946aaa98e1a6c5d03ef4219e5
2010-10-26 16:03:01 -07:00
Jaikumar Ganesh
b2ec4fa8d7 Fix A2DP connection problem, if disconnected while playing music.
Change-Id: I594564c11dc1698f00f9db3e6f6e4f8da9e2fe69
2010-10-26 11:22:48 -07:00
Jaikumar Ganesh
8febf88618 Add logs to debug incoming A2DP connection issue.
Change-Id: Ifbdd625ec8dc50544990a1ddbd87284285f3f2d2
2010-10-26 00:28:39 -07:00
Jaikumar Ganesh
b1ef244732 Clean up some logging to make it more useful to debug.
Change-Id: Ic30210ea6886b1c4630d7671a4b01736512e9da8
2010-10-26 00:15:45 -07:00
Jaikumar Ganesh
a46f2fb152 Implement ACTION_CONNECTION_STATE_CHANGED intent.
Change-Id: I6b5783c189c9796ebd85d9d54bdcb07949bef27e
2010-10-25 18:44:57 -07:00
Jaikumar Ganesh
ff7db40be1 Make setting the adapter properties asynchronous.
1. These involve disk operations and multiple processes.
2. onPropertyChange already informs us asychronously.
3. Settings app is the only user, will have to revisit the function
   if we make them public.

Change-Id: If019a83c05a0c9e625f27faf99063d33f369f0d8
2010-10-25 16:36:45 -07:00
Jaikumar Ganesh
5a1e4cf83f Update BT APIs return type from Set to List.
Change-Id: Ia27220dd26cde13007f6938c830517ee7f6968ce
2010-10-22 11:36:28 -07:00
Jaikumar Ganesh
03cd78cf5e Convert return type of APIs from Set to List.
Most of the time it will either be empty or have 1 device.
Using list makes it much a better API and since its supported
by the AIDL format, the code becomes much nicer.

Change-Id: I5a2508b33ba754fc8cc738409d658e1235aaf2cf
2010-10-22 11:36:27 -07:00
Jaikumar Ganesh
7d0548d094 Fix race condition between starting of service and getting the Profile Proxy.
Incoming A2DP connections were not working.

Change-Id: I5a3322ddb39b2512495b4cd2e35593da0f605087
2010-10-18 15:32:11 -07:00
Jaikumar Ganesh
64144c4474 am 096a1e6c: am 8b525c07: Merge "Check for state before disconnecting." into gingerbread
Merge commit '096a1e6c83d3638788468dfb21a3b4662745d617'

* commit '096a1e6c83d3638788468dfb21a3b4662745d617':
  Check for state before disconnecting.
2010-10-15 14:27:55 -07:00
Jaikumar Ganesh
72cd64b20e resolved conflicts for merge of bbb90d13 to master
Change-Id: I85de73f6e11e7547a006d41ca49021bca19af14b
2010-10-15 10:02:57 -07:00
Jaikumar Ganesh
096a1e6c83 am 8b525c07: Merge "Check for state before disconnecting." into gingerbread
Merge commit '8b525c076068eb38106dca05513816c01d8bdddb' into gingerbread-plus-aosp

* commit '8b525c076068eb38106dca05513816c01d8bdddb':
  Check for state before disconnecting.
2010-10-14 13:41:16 -07:00
Jaikumar Ganesh
5844f1d357 Check for state before disconnecting.
This is a race condition exposed after we turned off some STOPSHIP
logging and some other logging. We drop the ACl connection after 2 secs
of inactivity and hence the device didn't exist -> DBUS crash.

Bug: 3097224
Change-Id: I90adbbee2c5793924037685e484027ed5cd2e0d0
2010-10-14 12:33:16 -07:00
Jaikumar Ganesh
aa4b235dd7 resolved conflicts for merge of 79a5307a to master
Change-Id: I5a524fe53e74df722db003cec6ab62451fe0f899
2010-10-14 09:39:41 -07:00
Jaikumar Ganesh
bbb90d134a am c008ca96: Merge "Work around for errant headsets." into gingerbread
Merge commit 'c008ca96bb32289958010dcf8f247c35ab9b1f18' into gingerbread-plus-aosp

* commit 'c008ca96bb32289958010dcf8f247c35ab9b1f18':
  Work around for errant headsets.
2010-10-13 16:48:41 -07:00
Jaikumar Ganesh
c008ca96bb Merge "Work around for errant headsets." into gingerbread 2010-10-13 16:44:17 -07:00
Jaikumar Ganesh
70a053bf1b Work around for errant headsets.
1. Some headsets send an AVCTP connection before an AVDTP connection
When that AVCTP connection fails, we get stuck in IncomingA2DP state
because we don't handle AVCTP signals for now.
We need to handle the signals and fix it better.

2. Also when ACL gets disconnected, reset state i.e
when the low level connection disconnected reset our state.
This is like a fail safe in case we get stuck.

Bug: 3051490
Change-Id: Ibcf188103999ffb1e08c36c2554504c639fb7f50
2010-10-13 16:38:28 -07:00
Jaikumar Ganesh
79a5307ac2 am 1bc3a407: Merge "Fix auto connection priority handling." into gingerbread
Merge commit '1bc3a407ceb380e35e894f405f544b5b87e980d4' into gingerbread-plus-aosp

* commit '1bc3a407ceb380e35e894f405f544b5b87e980d4':
  Fix auto connection priority handling.
2010-10-12 16:50:45 -07:00
Jaikumar Ganesh
bcf5cf47ed Fix auto connection priority handling.
Bug: 3027023
1. user is connected to a headset. Headset is turned off.
2. User connects to another device. The priority of the first
   headset must be set to ON. We only have 1 device set at AUTO_CONNECT
   priority.

1. A remote headset sends an incoming connection. Don't set
   AUTO_CONNECT till its gets connected.
2. For outgoing connections, set it to AUTO_CONNECT in Connecting state
   since the user initated this connection.

Change-Id: Iaa211bf22b1fd99850875f7eda686c47142173ba
2010-10-12 16:42:45 -07:00
Jake Hamby
980d40b568 resolved conflicts for merge of 738aadd7 to master
Change-Id: I8810cc6dbd532de002d6a623ad93e86afb48c0b4
2010-09-30 19:33:43 -07:00
Jake Hamby
738aadd70f resolved conflicts for merge of 0a972acf to gingerbread-plus-aosp
Change-Id: Id8dc5038edc214b4433bdf690243f2f5fe5b4812
2010-09-30 16:29:13 -07:00
Jake Hamby
f51eadaf1f Typo fixes in comments and minor code cleanups.
* Fix some typos in Javadoc and log messages.
* Remove redundant initializer in BluetoothAdapter.readOutOfBandData()
* Use canonical "UTF-8" charset name instead of "UTF8" in
    BluetoothDevice.convertPinToBytes()

Change-Id: I58cd5dc48a7ad0053d204c5f590b4b3d438d8672
2010-09-30 15:43:34 -07:00
Jaikumar Ganesh
659d3d566b am c10207b6: am a5c742bf: Merge "Update local cache before sending intent." into gingerbread
Merge commit 'c10207b6bfcfe09636dd2035b4237f1001008a48'

* commit 'c10207b6bfcfe09636dd2035b4237f1001008a48':
  Update local cache before sending intent.
2010-09-30 11:25:18 -07:00
Jaikumar Ganesh
c10207b6bf am a5c742bf: Merge "Update local cache before sending intent." into gingerbread
Merge commit 'a5c742bfd08df55849418cd1c77065ac54d83502' into gingerbread-plus-aosp

* commit 'a5c742bfd08df55849418cd1c77065ac54d83502':
  Update local cache before sending intent.
2010-09-29 13:27:38 -07:00
Jaikumar Ganesh
2dfe101149 Update local cache before sending intent.
Change-Id: I0e016cae3070b1811dd68958afb8a8501081097d
2010-09-29 10:31:02 -07:00
Jaikumar Ganesh
96a79830ea Update code for new BT public APIs.
Change-Id: Id730fb6226db59f3a0416111c4790653c2fccb0b
2010-09-28 20:00:53 -07:00
Jaikumar Ganesh
ea8e8d7342 am b390728b: am a224f70b: Fix interaction between BluetoothEventLoop and BluetoothService.
Merge commit 'b390728b54805ecba3e0690edf2b83b60933e6a7'

* commit 'b390728b54805ecba3e0690edf2b83b60933e6a7':
  Fix interaction between BluetoothEventLoop and BluetoothService.
2010-09-15 07:07:38 -07:00
Jaikumar Ganesh
707952ecd4 Rework Bluetooth tethering networking configuration.
Limit it to 5 for now, and store the iface.

Change-Id: Ia6044b8e8f886dcd587ab0bb57273e0c11b6cd74
2010-09-14 15:25:14 -07:00
Jaikumar Ganesh
b390728b54 am a224f70b: Fix interaction between BluetoothEventLoop and BluetoothService.
Merge commit 'a224f70b1efc29d9698da5b5c143251a43838f2b' into gingerbread-plus-aosp

* commit 'a224f70b1efc29d9698da5b5c143251a43838f2b':
  Fix interaction between BluetoothEventLoop and BluetoothService.
2010-09-14 09:43:31 -07:00
Jaikumar Ganesh
a224f70b1e Fix interaction between BluetoothEventLoop and BluetoothService.
BluetoothEventLoop primarily handles event notifications from Bluez.
It should know innards of Bonding and especially BondState.
BondState class and BluetoothService call into each other.
When BluetoothEvent loop gets the handle to BondState it leads
to deadlocks and ANRs.

Change-Id: I785c57f6246c1288350d26d4acb87d879b27a5f9
2010-09-13 21:58:10 -07:00
Jaikumar Ganesh
1510770165 Add missing return statement.
Change-Id: Iee4ee8a62c5c85176c457bd674ac25acdf978ae9
2010-09-13 15:24:01 -07:00
Jaikumar Ganesh
20c8f47330 resolved conflicts for merge of 0522f5e9 to master
Change-Id: Ie0a7ece33dced1042948087053e49665f6235fc2
2010-09-13 14:57:59 -07:00
Jaikumar Ganesh
0522f5e9b7 am cc5494c9: Out Of Band API for Secure Simple Pairing.
Merge commit 'cc5494c9996f809e36539b24e8b6b67683383d29' into gingerbread-plus-aosp

* commit 'cc5494c9996f809e36539b24e8b6b67683383d29':
  Out Of Band API for Secure Simple Pairing.
2010-09-13 11:52:19 -07:00
Jaikumar Ganesh
cc5494c999 Out Of Band API for Secure Simple Pairing.
Change-Id: I54ded27ab85d46eef3d2cca84f2394b1ffe88ced
2010-09-13 11:40:21 -07:00
Jaikumar Ganesh
293de3eaf2 am 049912b7: am 9395b465: Merge "Fix to get A2DP to connect after unpairing" into gingerbread
Merge commit '049912b76f320c55cfe56394e520ee2c35f913b8'

* commit '049912b76f320c55cfe56394e520ee2c35f913b8':
  Fix to get A2DP to connect after unpairing
2010-09-09 14:21:32 -07:00
Jaikumar Ganesh
049912b76f am 9395b465: Merge "Fix to get A2DP to connect after unpairing" into gingerbread
Merge commit '9395b4656aca4b00d080ada89a44631459ad7b85' into gingerbread-plus-aosp

* commit '9395b4656aca4b00d080ada89a44631459ad7b85':
  Fix to get A2DP to connect after unpairing
2010-09-09 10:26:54 -07:00
Henrik Backlund
4226415bd9 Fix to get A2DP to connect after unpairing
In this fix, A2DP profile will be connected when pairing with a
previously paired headset. The reason for this error was that the
connection of the A2DP profile was sent before the callback
onCreatePairedDeviceResult was receied in BluetoothEventLoop.java.
By not going to the state BOND_BONDED until after this callback has been
received, the problem is fixed. However the use case is different if the
pairing is initiated by the remote device. In these cases state
BOND_BONDED will be set when onDevicePropertyChanged instead.

Change-Id: I5dedca87d0a6872705ff3a933a99cce6eb37618a
2010-09-09 10:19:55 -07:00
Jaikumar Ganesh
b70765cc27 Decouple Tethering UI with registering of SDP records.
This can lead to usability issues, since the SDP record
will get registered later on.

Change-Id: Ifda78a3831572f1b9955bf06da9a8b0e949942aa
2010-09-02 14:34:40 -07:00
Jaikumar Ganesh
c1520ecb41 Use the new signals sent by Bluez for PAN.
Change-Id: I092b5d6b23bacb37a5bc2ca6d8c47bc6a99467ec
2010-09-02 11:36:58 -07:00