From 6d8b80dd8c56dba02dcb6e64ace37fb85aeee1f5 Mon Sep 17 00:00:00 2001 From: Ben Dodson Date: Fri, 8 Jul 2011 14:36:42 -0700 Subject: [PATCH] Get server's listening channel Change-Id: Ia1cb3486a4ba502185efdcf6d7bcf0f37bb55261 --- core/java/android/bluetooth/BluetoothServerSocket.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/java/android/bluetooth/BluetoothServerSocket.java b/core/java/android/bluetooth/BluetoothServerSocket.java index 83e59e266d8e3..acce182189dc2 100644 --- a/core/java/android/bluetooth/BluetoothServerSocket.java +++ b/core/java/android/bluetooth/BluetoothServerSocket.java @@ -62,6 +62,7 @@ public final class BluetoothServerSocket implements Closeable { /*package*/ final BluetoothSocket mSocket; private Handler mHandler; private int mMessage; + private final int mChannel; /** * Construct a socket for incoming connections. @@ -74,6 +75,7 @@ public final class BluetoothServerSocket implements Closeable { */ /*package*/ BluetoothServerSocket(int type, boolean auth, boolean encrypt, int port) throws IOException { + mChannel = port; mSocket = new BluetoothSocket(type, -1, auth, encrypt, null, port, null); } @@ -125,4 +127,12 @@ public final class BluetoothServerSocket implements Closeable { mHandler = handler; mMessage = message; } + + /** + * Returns the channel on which this socket is bound. + * @hide + */ + public int getChannel() { + return mChannel; + } }