diff options
| author | zzy <zhenye@broadcom.com> | 2012-04-03 19:48:32 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-07-16 21:19:18 -0700 |
| commit | fab62db7cf9962e90bfe30b85df57b6c621b7310 (patch) | |
| tree | d0e6669303c0175c2ca052eb719d485ec8172890 /framework/java/android/bluetooth/BluetoothServerSocket.java | |
| parent | 789124988d485453d3c185f9eda35be81d6d5f7b (diff) | |
Added new rfcomm multi accept code
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothServerSocket.java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothServerSocket.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/framework/java/android/bluetooth/BluetoothServerSocket.java b/framework/java/android/bluetooth/BluetoothServerSocket.java index 4021f7b61a..96be8a2fb6 100644 --- a/framework/java/android/bluetooth/BluetoothServerSocket.java +++ b/framework/java/android/bluetooth/BluetoothServerSocket.java @@ -17,6 +17,8 @@ package android.bluetooth; import android.os.Handler; +import android.os.Message; +import android.os.ParcelUuid; import java.io.Closeable; import java.io.IOException; @@ -86,6 +88,22 @@ public final class BluetoothServerSocket implements Closeable { } /** + * Construct a socket for incoming connections. + * @param type type of socket + * @param auth require the remote device to be authenticated + * @param encrypt require the connection to be encrypted + * @param uuid uuid + * @throws IOException On error, for example Bluetooth not available, or + * insufficient privileges + */ + /*package*/ BluetoothServerSocket(int type, boolean auth, boolean encrypt, ParcelUuid uuid) + throws IOException { + mSocket = new BluetoothSocket(type, -1, auth, encrypt, null, -1, uuid); + mChannel = mSocket.getPort(); + } + + + /** * Block until a connection is established. * <p>Returns a connected {@link BluetoothSocket} on successful connection. * <p>Once this call returns, it can be called again to accept subsequent @@ -133,7 +151,9 @@ public final class BluetoothServerSocket implements Closeable { mHandler = handler; mMessage = message; } - + /*package*/ void setServiceName(String ServiceName) { + mSocket.setServiceName(ServiceName); + } /** * Returns the channel on which this socket is bound. * @hide |
