summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothServerSocket.java
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2009-08-14 18:33:38 -0700
committerNick Pelly <npelly@google.com>2009-08-18 08:24:22 -0700
commit2d66488e7d7aeb87e4f7385dfe1a6c800c08391b (patch)
tree140b11f5b273d5308392d723c5c01f252c0d04fd /framework/java/android/bluetooth/BluetoothServerSocket.java
parent96c6b67df8e652d9e830ac31eba59b6787e40ef8 (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 'framework/java/android/bluetooth/BluetoothServerSocket.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothServerSocket.java69
1 files changed, 2 insertions, 67 deletions
diff --git a/framework/java/android/bluetooth/BluetoothServerSocket.java b/framework/java/android/bluetooth/BluetoothServerSocket.java
index f3baeab18d..8be300b041 100644
--- a/framework/java/android/bluetooth/BluetoothServerSocket.java
+++ b/framework/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);
}