diff options
| author | Nick Pelly <npelly@google.com> | 2009-08-14 18:33:38 -0700 |
|---|---|---|
| committer | Nick Pelly <npelly@google.com> | 2009-08-18 08:24:22 -0700 |
| commit | bd022f423a33f0794bb53e5b0720da2d67e4631c (patch) | |
| tree | 4def583f15b783ada3d49866a8cd29bcdb1bbe00 /core/java/android/bluetooth/BluetoothServerSocket.java | |
| parent | 82e7408be29c6c8c6ed80887ea97f48f38b3223d (diff) | |
Bluetooth: API change.
Split BluetoothDevice into BluetoothDevice and BluetoothAdapter.
BluetoothAdapter: Represents the local BT adapter. Operations on the local
adapter (start a scan, etc).
BluetoothDevice: Represents a remote BT device. Operations on remote devices
(pair, connect, etc).
IBluetoothDevice.aidl -> Bluetooth.aidl
BluetoothDeviceService.java -> BluetoothDeviceService.java
TODO:
Javadoc
Diffstat (limited to 'core/java/android/bluetooth/BluetoothServerSocket.java')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothServerSocket.java | 69 |
1 files changed, 2 insertions, 67 deletions
diff --git a/core/java/android/bluetooth/BluetoothServerSocket.java b/core/java/android/bluetooth/BluetoothServerSocket.java index f3baeab18dee..8be300b0418d 100644 --- a/core/java/android/bluetooth/BluetoothServerSocket.java +++ b/core/java/android/bluetooth/BluetoothServerSocket.java @@ -33,72 +33,7 @@ import java.io.IOException; * @hide */ public final class BluetoothServerSocket implements Closeable { - private final BluetoothSocket mSocket; - - /** - * Construct a listening, secure RFCOMM server socket. - * The remote device connecting to this socket will be authenticated and - * communication on this socket will be encrypted. - * Call #accept to retrieve connections to this socket. - * @return An RFCOMM BluetoothServerSocket - * @throws IOException On error, for example Bluetooth not available, or - * insufficient permissions. - */ - public static BluetoothServerSocket listenUsingRfcommOn(int port) throws IOException { - BluetoothServerSocket socket = new BluetoothServerSocket( - BluetoothSocket.TYPE_RFCOMM, true, true, port); - try { - socket.mSocket.bindListenNative(); - } catch (IOException e) { - try { - socket.close(); - } catch (IOException e2) { } - throw e; - } - return socket; - } - - /** - * Construct an unencrypted, unauthenticated, RFCOMM server socket. - * Call #accept to retrieve connections to this socket. - * @return An RFCOMM BluetoothServerSocket - * @throws IOException On error, for example Bluetooth not available, or - * insufficient permissions. - */ - public static BluetoothServerSocket listenUsingInsecureRfcommOn(int port) throws IOException { - BluetoothServerSocket socket = new BluetoothServerSocket( - BluetoothSocket.TYPE_RFCOMM, false, false, port); - try { - socket.mSocket.bindListenNative(); - } catch (IOException e) { - try { - socket.close(); - } catch (IOException e2) { } - throw e; - } - return socket; - } - - /** - * Construct a SCO server socket. - * Call #accept to retrieve connections to this socket. - * @return A SCO BluetoothServerSocket - * @throws IOException On error, for example Bluetooth not available, or - * insufficient permissions. - */ - public static BluetoothServerSocket listenUsingScoOn() throws IOException { - BluetoothServerSocket socket = new BluetoothServerSocket( - BluetoothSocket.TYPE_SCO, false, false, -1); - try { - socket.mSocket.bindListenNative(); - } catch (IOException e) { - try { - socket.close(); - } catch (IOException e2) { } - throw e; - } - return socket; - } + /*package*/ final BluetoothSocket mSocket; /** * Construct a socket for incoming connections. @@ -109,7 +44,7 @@ public final class BluetoothServerSocket implements Closeable { * @throws IOException On error, for example Bluetooth not available, or * insufficient priveleges */ - private BluetoothServerSocket(int type, boolean auth, boolean encrypt, int port) + /*package*/ BluetoothServerSocket(int type, boolean auth, boolean encrypt, int port) throws IOException { mSocket = new BluetoothSocket(type, -1, auth, encrypt, null, port); } |
