summaryrefslogtreecommitdiffstats
path: root/core/java/android/server/BluetoothEventLoop.java
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2011-09-07 14:16:52 -0700
committerJaikumar Ganesh <jaikumar@google.com>2011-09-08 15:26:53 -0700
commitb5d2d4526cd2c0117b7a33b1297ac683c37ac5c7 (patch)
tree389a9d4a754b77cfa3f0494446711f57d8203c3b /core/java/android/server/BluetoothEventLoop.java
parent8ee53da5615ff69c7920d111f87730c9ae0a5d23 (diff)
downloadframeworks_base-b5d2d4526cd2c0117b7a33b1297ac683c37ac5c7.zip
frameworks_base-b5d2d4526cd2c0117b7a33b1297ac683c37ac5c7.tar.gz
frameworks_base-b5d2d4526cd2c0117b7a33b1297ac683c37ac5c7.tar.bz2
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
Diffstat (limited to 'core/java/android/server/BluetoothEventLoop.java')
-rw-r--r--core/java/android/server/BluetoothEventLoop.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java
index 6eff796..5dd8cd7 100644
--- a/core/java/android/server/BluetoothEventLoop.java
+++ b/core/java/android/server/BluetoothEventLoop.java
@@ -20,6 +20,7 @@ import android.bluetooth.BluetoothA2dp;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothHealth;
import android.bluetooth.BluetoothInputDevice;
import android.bluetooth.BluetoothPan;
import android.bluetooth.BluetoothProfile;
@@ -981,6 +982,22 @@ class BluetoothEventLoop {
}
/**
+ * Called by native code for the async response to a Connect
+ * method call to org.bluez.Health
+ *
+ * @param chanCode The internal id of the channel
+ * @param result Result code of the operation.
+ */
+ private void onHealthDeviceConnectionResult(int chanCode, int result) {
+ log ("onHealthDeviceConnectionResult " + chanCode + " " + result);
+ // Success case gets handled by Property Change signal
+ if (result != BluetoothHealth.HEALTH_OPERATION_SUCCESS) {
+ mBluetoothService.onHealthDeviceChannelConnectionError(chanCode,
+ BluetoothHealth.STATE_CHANNEL_DISCONNECTED);
+ }
+ }
+
+ /**
* Called by native code on a DeviceDisconnected signal from
* org.bluez.NetworkServer.
*