Loading core/java/android/bluetooth/BluetoothAdapter.java +13 −5 Original line number Diff line number Diff line Loading @@ -948,7 +948,15 @@ public final class BluetoothAdapter { */ public BluetoothServerSocket listenUsingRfcommWithServiceRecord(String name, UUID uuid) throws IOException { return createNewRfcommSocketAndRecord(name, uuid, true, true); return createNewRfcommSocketAndRecord(name, -1, uuid, true, true); } /** * @hide */ public BluetoothServerSocket listenUsingRfcommWithServiceRecordOn(String name, int port, UUID uuid) throws IOException { return createNewRfcommSocketAndRecord(name, port, uuid, true, true); } /** Loading Loading @@ -979,7 +987,7 @@ public final class BluetoothAdapter { */ public BluetoothServerSocket listenUsingInsecureRfcommWithServiceRecord(String name, UUID uuid) throws IOException { return createNewRfcommSocketAndRecord(name, uuid, false, false); return createNewRfcommSocketAndRecord(name, -1, uuid, false, false); } /** Loading Loading @@ -1017,15 +1025,15 @@ public final class BluetoothAdapter { */ public BluetoothServerSocket listenUsingEncryptedRfcommWithServiceRecord( String name, UUID uuid) throws IOException { return createNewRfcommSocketAndRecord(name, uuid, false, true); return createNewRfcommSocketAndRecord(name, -1, uuid, false, true); } private BluetoothServerSocket createNewRfcommSocketAndRecord(String name, UUID uuid, private BluetoothServerSocket createNewRfcommSocketAndRecord(String name, int port, UUID uuid, boolean auth, boolean encrypt) throws IOException { BluetoothServerSocket socket; socket = new BluetoothServerSocket(BluetoothSocket.TYPE_RFCOMM, auth, encrypt, new ParcelUuid(uuid)); encrypt, port, new ParcelUuid(uuid)); socket.setServiceName(name); int errno = socket.mSocket.bindListen(); if (errno != 0) { Loading core/java/android/bluetooth/BluetoothServerSocket.java +3 −2 Original line number Diff line number Diff line Loading @@ -92,13 +92,14 @@ public final class BluetoothServerSocket implements Closeable { * @param type type of socket * @param auth require the remote device to be authenticated * @param encrypt require the connection to be encrypted * @param port remote port * @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) /*package*/ BluetoothServerSocket(int type, boolean auth, boolean encrypt, int port, ParcelUuid uuid) throws IOException { mSocket = new BluetoothSocket(type, -1, auth, encrypt, null, -1, uuid); mSocket = new BluetoothSocket(type, -1, auth, encrypt, null, port, uuid); mChannel = mSocket.getPort(); } Loading Loading
core/java/android/bluetooth/BluetoothAdapter.java +13 −5 Original line number Diff line number Diff line Loading @@ -948,7 +948,15 @@ public final class BluetoothAdapter { */ public BluetoothServerSocket listenUsingRfcommWithServiceRecord(String name, UUID uuid) throws IOException { return createNewRfcommSocketAndRecord(name, uuid, true, true); return createNewRfcommSocketAndRecord(name, -1, uuid, true, true); } /** * @hide */ public BluetoothServerSocket listenUsingRfcommWithServiceRecordOn(String name, int port, UUID uuid) throws IOException { return createNewRfcommSocketAndRecord(name, port, uuid, true, true); } /** Loading Loading @@ -979,7 +987,7 @@ public final class BluetoothAdapter { */ public BluetoothServerSocket listenUsingInsecureRfcommWithServiceRecord(String name, UUID uuid) throws IOException { return createNewRfcommSocketAndRecord(name, uuid, false, false); return createNewRfcommSocketAndRecord(name, -1, uuid, false, false); } /** Loading Loading @@ -1017,15 +1025,15 @@ public final class BluetoothAdapter { */ public BluetoothServerSocket listenUsingEncryptedRfcommWithServiceRecord( String name, UUID uuid) throws IOException { return createNewRfcommSocketAndRecord(name, uuid, false, true); return createNewRfcommSocketAndRecord(name, -1, uuid, false, true); } private BluetoothServerSocket createNewRfcommSocketAndRecord(String name, UUID uuid, private BluetoothServerSocket createNewRfcommSocketAndRecord(String name, int port, UUID uuid, boolean auth, boolean encrypt) throws IOException { BluetoothServerSocket socket; socket = new BluetoothServerSocket(BluetoothSocket.TYPE_RFCOMM, auth, encrypt, new ParcelUuid(uuid)); encrypt, port, new ParcelUuid(uuid)); socket.setServiceName(name); int errno = socket.mSocket.bindListen(); if (errno != 0) { Loading
core/java/android/bluetooth/BluetoothServerSocket.java +3 −2 Original line number Diff line number Diff line Loading @@ -92,13 +92,14 @@ public final class BluetoothServerSocket implements Closeable { * @param type type of socket * @param auth require the remote device to be authenticated * @param encrypt require the connection to be encrypted * @param port remote port * @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) /*package*/ BluetoothServerSocket(int type, boolean auth, boolean encrypt, int port, ParcelUuid uuid) throws IOException { mSocket = new BluetoothSocket(type, -1, auth, encrypt, null, -1, uuid); mSocket = new BluetoothSocket(type, -1, auth, encrypt, null, port, uuid); mChannel = mSocket.getPort(); } Loading