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
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
so that the Binder object does not get destroyed when the thread
that registers the service record ends.
bug 5276332
Change-Id: Id17a4c279e03aa6928dca5bf048c7c90862bd9cf
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
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
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
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
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
Set bluetooth discoverable off at power on time if the discoverable timeout
is no forever
bug 5068151
Change-Id: I413e8de5f49030b741a8b84a566065d112ee60be
This gets the current connection state of the profile with respect
to the local Bluetooth adapter.
Change-Id: I7cff6c9201d29a8b45413cff7384b7483f21bd5c
It was observed that the preparing bluetooth could take up to 8 seconds before
the SD loaded event came in.
Change-Id: I722f94ed9cbd12bdd033ca405838366139c61383
When pairing is stuck, on turning BT off, we were
not setting the outgoing parining variable to null in
setBondState because of the extra check for isEnabled.
isEnabled check was added to prevent the proxy crash in
setProfilePriorities function. Proxies should never be null.
Add a safety check and also some extra logs to debug the problem.
Change-Id: I694dfeb8fa9426b3916775ca868c2313fa9c22ee
Bluez powered property setting is more apropriate for what this method intend to
achieve and it fixes a bug that incoming connection request wake up the stack in
The pairable events are replaced by power and discoverable events
HotOff state
bug 5080232
Change-Id: I43b44cb2f5203bd99bf764d5a1696e8ff52a31db
When users use application specific Bluetooth state changes,
and the bond state changes, we crash.
We need to recheck Bluetooth state in all functions and scenarios
and even maintain a per application pid Bluetooth state, but this fix
is quick fix for a problem.
Change-Id: I905dfb53965907ccb27757ff6ed1816536277f14
Bluez powered property setting is more apropriate for what this method intend to
achieve and it fixes a bug that incoming connection request wake up the stack in
HotOff state
bug 5080232
Change-Id: I1e29314041f082c1536b46f9707d17d463ae0fd7
Clients need this before BT is turned on.
Todo: If BT "hot" feature is off, read from system properties.
Change-Id: I266c2d4731cacde7a53c65e3d5fb43a2cbe29481
Start the timer (3 second) just after calling disconnect devices.
If the timer expires, it indicates an error condition. we don't wait
on the ALL_DEVICES_DISCONNECTED event upon the error. Instead, get out of
switching state and turn off BT to reset out of the error condition.
Change-Id: I27aa8cd7b6fe50d9191e2d32fc2d6eac50424403
We were the setting the iface as null while disconnecting
and so when disconnected the iface used was null - which would
lead to a crash. During connecting we don't know the interface,
so we use null.
Change-Id: I970f2f1886fa32237936eff439c359187a798832
The ADMIN permission is for use cases where we want to manage BT connection
at a deeper level. So just the Bluetooth permission is good enough here.
Change-Id: Iddd038fe9f9a26f155b4edc9484ba1fe27b178ba
1. The interface was null for reverse tethering.
2. When disconnecting the server, we were passing the address instead of the
interface.
Change-Id: I6004cdf1eed000211cddc6b120e0aded5758eb1e
This is because broadcastState method move the Bluetooth adapter state
to ON. The mBluetoothService.runBluetooth should be called only in the ON state.
Remove mIsDiscovering variable in BluetoothService.
Fix a bug in BluetoothA2dpService that caused 2 times of state change
from DISCONNECTED to CONNECTING that messed up BluetoothService's
connection state count.
Change-Id: Ifb782a845ae70f007d2e036d930bb55f445d68b5
1. Since Input device runs in Bluetooth Service, avoid the proxy call.
2. Accept or reject incoming tethering connections.
This broke because of incoming connection request change for phonebook, HID,
A2DP.
Change-Id: Ia8c537bb79e4dbc66cfb6b23dcad4f99dbf950b3
BluetoothDevice setName overwrite the locally cached remote name.
The changed name is saved in the local storage so that the change
is preserved over power cycle.
bug 5081605
Change-Id: I486966033828d153bfb1076a99e274c8a7f41636
This changes adds an API for system applications
to enable bluetooth without all the side effects like
auto connection to headsets etc.
Also some tweaks to the adapter state machine
Change-Id: Ib9f22d548a26d72334b300101c8eb0d80f08a4bb