Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d8b80dd authored by Ben Dodson's avatar Ben Dodson
Browse files

Get server's listening channel

Change-Id: Ia1cb3486a4ba502185efdcf6d7bcf0f37bb55261
parent 221bfab8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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;
    }
}