Commit Graph

415 Commits

Author SHA1 Message Date
Jeff Sharkey
eb4cc492c9 Protect system services with DUMP permission.
Change-Id: I5e53859f8b8e5473e54eca43ebd7de841f1a05ff
2012-04-26 18:17:29 -07:00
Martijn Coenen
6c614b7e59 Allow enabling Bluetooth without auto-connecting.
This is a feature used for NFC-to-Bluetooth handover:
we want to enable BT for file transfer, and disconnect
it when we're done. During this period we don't want
to auto-connect other devices - it should be transparent
to the user that Bluetooth is used. Also, don't allow
A2DP/HSP incoming connections.

Change-Id: I0a03e8084c439b1271b6a80f4d9da5aacfe19c45
2012-04-23 16:25:30 -07:00
Jeff Brown
a2c68198b1 Merge "Get alias for Bluetooth devices." 2012-04-20 20:15:20 -07:00
Jeff Brown
5bbd4b4f5f Get alias for Bluetooth devices.
Bluetooth devices can be renamed by the user.  Make the
input system aware of the user-specified name and transparently
pass it down to applications.  This enables the keyboard
layout picker Settings UI to use device names that are
consistent with what the user set in the Bluetooth UI.

Bug: 6363157
Change-Id: I8eea26ce2c69c2a3f09c8de02e9e847610e0419c
2012-04-20 20:11:12 -07:00
Dianne Hackborn
d0d7503fd3 Move handling of package changes to a background thread.
Helps get rid of some jank when installing applications.

Change-Id: I97d0022f82d67796e334d37086e5911dd6ca6b62
2012-04-19 23:12:09 -07:00
Matthew Xie
43b6fd9a54 Check nullpointer of discoverableTimeout in initBluetoothAfterTurningOn.
When we fail to get the property, print out warning message, turn
Discoverable off.
Bug 6302990

Change-Id: Ie21aa2a89050c74d99d9ee521a95ffa822114757
2012-04-17 11:39:25 -07:00
Travis Geiselbrecht
a91da5da56 add config_bluetooth_default_profiles config var and use it to disable bt profiles
For devices that don't care about the previously default bluetooth profiles,
add a config var to disable them.

Change-Id: I04bb7ad4b1235bc37227645f472fdf5b918f6a31
2012-03-22 15:09:44 -07:00
Ken Wakasa
f76a50ce8f Fix obvious typos under frameworks/base/core
Change-Id: Ia5fc3db1bb51824e7523885553be926bcc42d736
2012-03-09 22:48:43 +09:00
Matthew Xie
cf5cecd854 am 1890fa82: am 79d84930: Merge "Set Bluetooth adapter to PowerOff mode when turnoff with airplane on" into ics-mr1
* commit '1890fa822091ea700b7409ac79a57cf650b55003':
  Set Bluetooth adapter to PowerOff mode when turnoff with airplane on
2012-01-12 11:29:39 -08:00
Matthew Xie
f3171fb60c Set Bluetooth adapter to PowerOff mode when turnoff with airplane on
Currently, when airplane mode was on and BT was on, turning BT off
moved BT to hotoff state. This fix moves BT all the way to Poweroff
state to have better power performance.
bug 5854282

Change-Id: I7ba41797a46a81ddb3a576453f2a8303b5eed525
2012-01-11 14:46:13 -08:00
Matthew Xie
470d057aed am 18ad6514: am ed0830c5: Merge "Move broadcastState STATE_TURNING_ON before persistSwitchSetting" into ics-mr1
* commit '18ad6514bbeb68a96c12ba1636ab8df8e3945f37':
  Move broadcastState STATE_TURNING_ON before persistSwitchSetting
2011-12-12 15:39:27 -08:00
Matthew Xie
2d789e58a8 Move broadcastState STATE_TURNING_ON before persistSwitchSetting
CTS test revealed that persistSwitchSetting could take more than 1 second.
STATE_TURNING_ON intent missed the test timing. We move the broadcast
before persistSwitchSetting
bug 5740715

Change-Id: I54a0a0afc8d1c4fc28f84e6122809af2f1456ca7
2011-12-12 11:36:18 -08:00
Matthew Xie
2016055a97 am 12479141: am 0d9a41e7: Merge "Broadcast turning on/off intent as early as possible when switch on/off BT" into ics-mr1
* commit '12479141dd3e63a5f26a4509d0922c9ef9e3d78c':
  Broadcast turning on/off intent as early as possible when switch on/off BT
2011-12-05 20:00:46 -08:00
Matthew Xie
0d9a41e74c Merge "Broadcast turning on/off intent as early as possible when switch on/off BT" into ics-mr1 2011-12-05 19:56:54 -08:00
Matthew Xie
a6ba6fd4bb Broadcast turning on/off intent as early as possible when switch on/off BT
Move broadcastState(BluetoothAdapter.STATE_TURNING_ON/OFF) before any other
method calls when turn on/off Bluetooth.
Bug 5703346

Change-Id: Iddbdab58367a7d648708aa23671eb09701d66793
2011-12-05 17:36:01 -08:00
Matthew Xie
2f2e3ba11c am 6001d3ad: am 1a1be44c: Merge "Unlink the Binder DeathRecipient when removing a Bluetooth service record" into ics-mr1
* commit '6001d3ad9f5ddb5be09ec6e70b5e646cb9a0f469':
  Unlink the Binder DeathRecipient when removing a Bluetooth service record
2011-12-01 13:36:48 -08:00
Matthew Xie
1a1be44c5b Merge "Unlink the Binder DeathRecipient when removing a Bluetooth service record" into ics-mr1 2011-12-01 13:32:19 -08:00
Jason Simmons
c980a495a6 Unlink the Binder DeathRecipient when removing a Bluetooth service record
The fix holds a reference to the Reaper objects, so that they don't get GCed
and cause the error - unlink not called on death recipients.
bug 5602314

Change-Id: Ib8a9e254d7c9ebe9d54f5c10b3daa31d062b4df0
2011-12-01 12:06:50 -08:00
Jeff Sharkey
ddba10622d Clean up InterfaceConfiguration flags.
Offer modifier methods for interface flags instead of mutating
directly, and remove square brackets.

Change-Id: I4cce719dccedfb3f0e8448c111e65b93c0008cbb
2011-11-29 18:37:04 -08:00
Jaikumar Ganesh
f96ccc175d am f4e41c35: am eb701df8: Merge "Cleanup references when turning BT off." into ics-mr1
* commit 'f4e41c35387728720780935564a491cf9bf1357e':
  Cleanup references when turning BT off.
2011-11-29 10:09:40 -08:00
Jaikumar Ganesh
9bb275197d Cleanup references when turning BT off.
Bug: 5572649
Change-Id: I62f9e0620832b69995d5c6e1c24634c9a3895a4b
2011-11-28 16:19:36 -08:00
Matthew Xie
a5ca41e9cc am a4f5c425: am 2b9af44e: am 6da97a24: Merge "Check the bluetooth state for getUuid call" into ics-mr0
* commit 'a4f5c425b822a46fc49bc87bba82688570584ff1':
  Check the bluetooth state for getUuid call
2011-11-17 15:13:03 -08:00
Matthew Xie
2b9af44e40 am 6da97a24: Merge "Check the bluetooth state for getUuid call" into ics-mr0
* commit '6da97a24e329851888890d4e380066037d08bcd7':
  Check the bluetooth state for getUuid call
2011-11-17 13:10:14 -08:00
Matthew Xie
1bce803f66 am 37fb92fb: am 302afb93: Merge "Call notifyIncomingA2dpConnection with correct rejected status" into ics-mr1
* commit '37fb92fb634d10ca94731a73f2a60d86135baa6a':
  Call notifyIncomingA2dpConnection with correct rejected status
2011-11-17 07:48:29 -08:00
Matthew Xie
0901e601b5 Call notifyIncomingA2dpConnection with correct rejected status
notifyIncomingA2dpConnection was called with wrong rejected status.
Fix this.
bug 5626476

Change-Id: Ie8e4a8bdc6f6357a62172c86c21ee547376952a4
2011-11-16 17:14:36 -08:00
Matthew Xie
44b58ab89e Check the bluetooth state for getUuid call
Donnot make the bluetoothservice.getUuids call if the bluetooth
is not on. Also get rid of all the necessary locks on BluetoothService
for get property call. It had a lock on BluetoothAdapterProperty.
bug5472114

Change-Id: I383472ae6006fc1f0129c960c8a44ed0df027a43
2011-11-16 12:27:57 -08:00
Matthew Xie
44ada1845d am 5a8ad071: am a303f0ec: Merge "Send CONNECT_OTHER_PROFILE to Device profile for hfp and a2dp incoming connect" into ics-mr1
* commit '5a8ad0717dad332cab4b2d9f7a6030b76cb8d6bb':
  Send CONNECT_OTHER_PROFILE to Device profile for hfp and a2dp incoming connect
2011-11-11 13:42:42 -08:00
Matthew Xie
98f06da8ed Send CONNECT_OTHER_PROFILE to Device profile for hfp and a2dp incoming connect
Send CONNECT_OTHER_PROFILE to Device profile for low priority hfp and a2dp
incoming connect. In the case when HFP autoconnect is off but a2dp autoconnect
is on, if HF autoconnect to HFP, phone will reject HFP but connect a2dp.
Before this fix, phone reject HFP. A2dp will not get connected unless the HF do
media auto-connect, which most carkits do not do.
Also do similar change for incoming a2dp connection
bug 5091838

Change-Id: Ife1815f527bcd94e0d9ffc645028484fa9c49a43
2011-11-11 12:11:35 -08:00
Matthew Xie
cef4cb20c3 Add more comments to the file header to explain the state diagram
The state diagram does not capture every messages. Here we explain
the missing parts to make the diagram clearer.

Change-Id: Ic5de5eb0556be4339d98023b0e7947d6e2cb30d1
2011-11-11 11:15:21 -08:00
Matthew Xie
cf6bc99b97 Merge "Turn off debug messge" 2011-10-07 12:57:08 -07:00
Matthew Xie
f0f95112ff Turn off debug messge
Bug 5425619

Change-Id: I7accb88a40604c5b8a8f2323e751a7f8f3cb9da8
2011-10-07 11:15:03 -07:00
Matthew Xie
9de1feb673 Send TURN_HOT message to the state machine from BluetoothService after it starts
All the messages sent to the StateMachine were ignored before the StateMachine
starts. To avoid TURN_HOT message from being ignored, move it out to BluetoothService
to send to the BluetoothAdapterStateMachine after the state machine starts
bug 5333923

Change-Id: I14ccd6dd7e6430aad2bca9230d01578b5327cc3f
2011-10-03 12:50:27 -07:00
Matthew Xie
dcbc97fc28 Check null of pidPair to skip the case the service record has been removed
Check null of pidPair instead of pidPair.first which caused a nullpointer
exception. clean local variables after sending out STATE_OFF intent.
Check bluetooth state in removeServiceRecord.
bug 5330367

Change-Id: Ib0af8143223bea48d3f587cca18544c4aef29980
2011-09-19 22:45:00 -07:00
Jaikumar Ganesh
f28c539389 Merge "Use an integer for the channel id." 2011-09-14 14:46:20 -07:00
Jaikumar Ganesh
d1ec771e27 Merge "Add Register before boot flag." 2011-09-14 14:46:10 -07:00
Jaikumar Ganesh
ee4837b3a0 Add Register before boot flag.
In some instances, the device might connect before we have booted up.

Change-Id: I1a50585207a2b0b2339acb048dffaea84e1a91e9
2011-09-14 11:57:46 -07:00
Matthew Xie
f1754050ce Keep Binder reference in the mServiceRecordToPid hashmap
so that the Binder object does not get destroyed when the thread
that registers the service record ends.
bug 5276332

Change-Id: Id17a4c279e03aa6928dca5bf048c7c90862bd9cf
2011-09-14 09:05:27 -07:00
Jaikumar Ganesh
cc0b8b2c47 Use an integer for the channel id.
Hashcode are not guranteed to be unique.

Change-Id: I905c4855785ac3da9fde8bb41e1a2678f1e9e5cc
2011-09-12 16:58:29 -07:00
Jaikumar Ganesh
049f5cc3de Merge "Don't override the hash code for the channel." 2011-09-12 09:45:20 -07:00
Jaikumar Ganesh
61eb5ae855 Don't override the hash code for the channel.
Each channel is uniquely represented by the object itself,
so use the hash code to identify it. Using channelPath in the
calculation will mess up things - since in Connecting state the
channel path is null and when its connected, we will get a different
hash code.

Change-Id: I6af6c783e18fddbd38344432b8156e000baafb15
2011-09-09 15:48:22 -07:00
Jaikumar Ganesh
6d172e60bb Merge "Add error codes for channel disconnection / connection." 2011-09-09 15:19:43 -07:00
Matthew Xie
5d61d8ddec Merge "Apply timeout for powerdown event and reset state machine when bluez crashes" 2011-09-08 17:16:50 -07:00
Jaikumar Ganesh
b5d2d4526c Add error codes for channel disconnection / connection.
Channel connection / disconnection was handled as boolean,
doesn't capture all the values. Also make it asynchronous
instead of the dbus call being synchronous.

Change-Id: If30177b9f93b7c83f162fbbc1233edf3e46dbfea
2011-09-08 15:26:53 -07:00
Jaikumar Ganesh
8ee53da561 Fix crash while connecting channel.
When an incoming connection comes and then we disconnect it,
and then launch the outgoing connection - we crash because
the channel path chan.mChannelPath is null.

Change-Id: I9115cc038f7ce85a193bf05d14b2b0a5e0579a69
2011-09-08 15:17:25 -07:00
Jaikumar Ganesh
eb9d34630f Make Bluetooth Health APIs public.
Fix a few bugs:
  a) Pass a integer token to identify the channel.
  b) Close fds in case of errors.

Change-Id: I2046787be5008769435f2f72a5bd67c19b749da0
2011-09-08 15:17:17 -07:00
Matthew Xie
694c0b833b Apply timeout for powerdown event and reset state machine when bluez crashes
The powerdown event was missed some time for unknown reasons and bluez could
crash for unknown reasons. We will debug on the issue. But for the time
being, we add a powerdown timer and process power up event to recover from
bluez crash
bug 5239719

Change-Id: Ie7315fb01e029747951e1a97a2d2f1dce53a997b
2011-09-08 15:05:19 -07:00
Matthew Xie
484867a8ed Move Bluetooth remove service record handler to the app main thread
Move Bluetooth remove service record handler to the app main thread.
This removes the dependency of caller thread that constructs the
BluetoothAdapter singleton instance. The caller thread could stop while
BluetoothAdapter singleton exists but lose the handler context.
Make the BluetoothService.removeServiceRecord return quickly without
blocking on native call.
bug 4999443

Change-Id: I302534baa381f4aca8192e1e4a9ea21793b07ba6
2011-08-29 16:24:50 -07:00
Amith Yamasani
7b71e4586b Merge "Update searchables when packages are modified, in case they are enabled/disabled." 2011-08-23 13:34:48 -07:00
Amith Yamasani
13bc602b21 Update searchables when packages are modified, in case they are enabled/disabled.
Bug: 5198361 : SearchManagerService doesn't respond to package updates.
Change-Id: I2ac794c5da4769eadd6b860ab0f9123060d2a5e5
2011-08-23 12:11:35 -07:00
Matthew Xie
f9838d0bb9 Merge "Set bluetooth discoverable off at power on time if the timeout is no forever" 2011-08-23 10:54:07 -07:00