Skip to content

Commit b49a896

Browse files
zzyMatthew Xie
authored andcommitted
Add serial port profile support and allow to connect to rfcomm channel without sdp discovery
bug 7272974 Change-Id: Idc10edc056b48da2fd96bea84eba3fb73b97bab1
1 parent e6e8100 commit b49a896

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/java/android/bluetooth/BluetoothSocket.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.io.InputStream;
2020
import java.io.OutputStream;
2121
import java.util.List;
22+
import java.util.UUID;
2223
import android.net.LocalSocket;
2324
import java.nio.ByteOrder;
2425
import java.nio.ByteBuffer;
@@ -140,7 +141,9 @@ private enum SocketState {
140141
throw new IOException("Invalid RFCOMM channel: " + port);
141142
}
142143
}
143-
mUuid = uuid;
144+
if(uuid != null)
145+
mUuid = uuid;
146+
else mUuid = new ParcelUuid(new UUID(0, 0));
144147
mType = type;
145148
mAuth = auth;
146149
mEncrypt = encrypt;

0 commit comments

Comments
 (0)