Loading framework/java/android/bluetooth/BluetoothSocket.java +9 −7 Original line number Diff line number Diff line Loading @@ -427,19 +427,21 @@ public final class BluetoothSocket implements Closeable { } /** * Attempt to connect to a remote device. * * <p>This method will block until a connection is made or the connection fails. If this method * returns without an exception then this socket is now connected. * * <p>Creating new connections to remote Bluetooth devices should not be attempted while device * discovery is in progress. Device discovery is a heavyweight procedure on the Bluetooth * adapter and will significantly slow a device connection. Use * {@link BluetoothAdapter#cancelDiscovery()} to cancel an ongoing discovery. Discovery is not * managed by the Activity, but is run as a system service, so an application should always call * {@link BluetoothAdapter#cancelDiscovery()} even if it did not directly request a discovery, * just to be sure. * adapter and will significantly slow a device connection. Use {@link * BluetoothAdapter#cancelDiscovery()} to cancel an ongoing discovery. Discovery is not managed * by the Activity, but is run as a system service, so an application should always call {@link * BluetoothAdapter#cancelDiscovery()} even if it did not directly request a discovery, just to * be sure. * * <p>{@link #close} can be used to abort this call from another thread. * * @throws BluetoothSocketException in case of failure, with the corresponding * {@link BluetoothSocketException#ErrorCode}. * @throws BluetoothSocketException in case of failure, with the corresponding error code. * @throws IOException for other errors (eg: InputStream read failures etc.). */ @RequiresBluetoothConnectPermission Loading framework/java/android/bluetooth/BluetoothSocketException.java +5 −5 Original line number Diff line number Diff line Loading @@ -204,9 +204,9 @@ public class BluetoothSocketException extends IOException { @ErrorCode private final int mErrorCode; /** * Create a {@link BluetoothSocketException} with a {@link ErrorCode} and custom error message. * Create a {@link BluetoothSocketException} with an error code and custom error message. * * @param code : {@link ErrorCode} representing the reason for failure. * @param code : error code representing the reason for failure. * @param msg : Custom error message associated to the failure. */ public BluetoothSocketException(@ErrorCode int code, @NonNull String msg) { Loading @@ -215,10 +215,10 @@ public class BluetoothSocketException extends IOException { } /** * Create a {@link BluetoothSocketException} with an error {@link ErrorCode}. A generic error * message is generated based on the {@code code} provided. * Create a {@link BluetoothSocketException} with an error code. A generic error message is * generated based on the {@code code} provided. * * @param code : {@link ErrorCode} representing the reason for failure. * @param code : error code representing the reason for failure. */ public BluetoothSocketException(@ErrorCode int code) { this(code, getMessage(code)); Loading Loading
framework/java/android/bluetooth/BluetoothSocket.java +9 −7 Original line number Diff line number Diff line Loading @@ -427,19 +427,21 @@ public final class BluetoothSocket implements Closeable { } /** * Attempt to connect to a remote device. * * <p>This method will block until a connection is made or the connection fails. If this method * returns without an exception then this socket is now connected. * * <p>Creating new connections to remote Bluetooth devices should not be attempted while device * discovery is in progress. Device discovery is a heavyweight procedure on the Bluetooth * adapter and will significantly slow a device connection. Use * {@link BluetoothAdapter#cancelDiscovery()} to cancel an ongoing discovery. Discovery is not * managed by the Activity, but is run as a system service, so an application should always call * {@link BluetoothAdapter#cancelDiscovery()} even if it did not directly request a discovery, * just to be sure. * adapter and will significantly slow a device connection. Use {@link * BluetoothAdapter#cancelDiscovery()} to cancel an ongoing discovery. Discovery is not managed * by the Activity, but is run as a system service, so an application should always call {@link * BluetoothAdapter#cancelDiscovery()} even if it did not directly request a discovery, just to * be sure. * * <p>{@link #close} can be used to abort this call from another thread. * * @throws BluetoothSocketException in case of failure, with the corresponding * {@link BluetoothSocketException#ErrorCode}. * @throws BluetoothSocketException in case of failure, with the corresponding error code. * @throws IOException for other errors (eg: InputStream read failures etc.). */ @RequiresBluetoothConnectPermission Loading
framework/java/android/bluetooth/BluetoothSocketException.java +5 −5 Original line number Diff line number Diff line Loading @@ -204,9 +204,9 @@ public class BluetoothSocketException extends IOException { @ErrorCode private final int mErrorCode; /** * Create a {@link BluetoothSocketException} with a {@link ErrorCode} and custom error message. * Create a {@link BluetoothSocketException} with an error code and custom error message. * * @param code : {@link ErrorCode} representing the reason for failure. * @param code : error code representing the reason for failure. * @param msg : Custom error message associated to the failure. */ public BluetoothSocketException(@ErrorCode int code, @NonNull String msg) { Loading @@ -215,10 +215,10 @@ public class BluetoothSocketException extends IOException { } /** * Create a {@link BluetoothSocketException} with an error {@link ErrorCode}. A generic error * message is generated based on the {@code code} provided. * Create a {@link BluetoothSocketException} with an error code. A generic error message is * generated based on the {@code code} provided. * * @param code : {@link ErrorCode} representing the reason for failure. * @param code : error code representing the reason for failure. */ public BluetoothSocketException(@ErrorCode int code) { this(code, getMessage(code)); Loading