diff options
| author | Jaikumar Ganesh <jaikumar@google.com> | 2010-07-19 16:28:27 -0700 |
|---|---|---|
| committer | Jaikumar Ganesh <jaikumar@google.com> | 2010-07-21 10:43:02 -0700 |
| commit | de07503a382e81ba82f4cd4dee81ff2fbf3295bc (patch) | |
| tree | fc3d73fe306195e9c4080901d74e635323bd3db0 /core/java/android/server/BluetoothEventLoop.java | |
| parent | c3ee99d9eb7e8b4b20c2b8f1c548373e1017e0d3 (diff) | |
Add HID to the state machine and add native call backs.
Change-Id: Ib9f3e476d4176bc04e23e7674dc54aa5a6417308
Diffstat (limited to 'core/java/android/server/BluetoothEventLoop.java')
| -rw-r--r-- | core/java/android/server/BluetoothEventLoop.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java index 9b7a73dc1b4e..eb9b62be2676 100644 --- a/core/java/android/server/BluetoothEventLoop.java +++ b/core/java/android/server/BluetoothEventLoop.java @@ -693,6 +693,26 @@ class BluetoothEventLoop { } } + private void onInputDeviceConnectionResult(String path, boolean result) { + // Success case gets handled by Property Change signal + if (!result) { + String address = mBluetoothService.getAddressFromObjectPath(path); + if (address == null) return; + + boolean connected = false; + BluetoothDevice device = mAdapter.getRemoteDevice(address); + int state = mBluetoothService.getInputDeviceState(device); + if (state == BluetoothInputDevice.STATE_CONNECTING) { + connected = false; + } else if (state == BluetoothInputDevice.STATE_DISCONNECTING) { + connected = true; + } else { + Log.e(TAG, "Error onInputDeviceConnectionResult. State is:" + state); + } + mBluetoothService.handleInputDevicePropertyChange(address, connected); + } + } + private void onRestartRequired() { if (mBluetoothService.isEnabled()) { Log.e(TAG, "*** A serious error occured (did bluetoothd crash?) - " + |
