summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
diff options
context:
space:
mode:
authorCasper Bonde <c.bonde@samsung.com>2015-04-09 09:20:50 +0200
committerCasper Bonde <c.bonde@samsung.com>2015-04-09 09:20:50 +0200
commitbbb4110b455b3aa29106d5b4f0a37e1be8e09475 (patch)
treee3f845fa32e2bb48f5ae5b076042cf785dcb4d8b /src/com/android/bluetooth/opp/BluetoothOppTransfer.java
parent2e85ea37c1ba495d3f0fd702f0a3920f3faf2848 (diff)
downloadandroid_packages_apps_Bluetooth-bbb4110b455b3aa29106d5b4f0a37e1be8e09475.tar.gz
android_packages_apps_Bluetooth-bbb4110b455b3aa29106d5b4f0a37e1be8e09475.tar.bz2
android_packages_apps_Bluetooth-bbb4110b455b3aa29106d5b4f0a37e1be8e09475.zip
Obex over L2CAP + SDP search API
Each profile had its own implementation of ObexTransport. These implementations were implemented very similar, and could easily be merged into a common implementation. Additionally it will make it easier to adopt the transport to support L2CAP. The SDP functionality is implemented in a way that is scalable, hence adding new record types is easy. Intents are currently used to distribute the SDP search results, as we have observed that the new client side profiles have been located outside the Bluetooth package. We strongly recommend to keep all bluetooth profiles within the Bluetooth package, to acoid the need for exposing all bluetooth interfaces through the Android framework. For instance this new SDP create API is internal to Bluetooth, hence cannot be used by the external profiles - hence they cannot use OBEX over L2CAP. The SDP search currently supports: - MAP both sides - OPP server (only the server needs an SDP record) - PBAP server (only the server needs SDP record) The SDP create record currently supports: - MAP both sides - OPP server - PBAP server The new l2cap sockets introduces a new wrapper class for a rfcomm and an l2cap socket. The wrapper design: - Creates two accept threads running while bluetooth is turned on. - When a connection is accepted the owner is asked wether or not to accept the connection if rejected, the connection will be rejected at obex level, else it will be accepted and the state is changed to busy. - Any further connections will be rejected at Obex level, until the state is changed back to idle. Notes tor executing the test cases: Test OBEX using local pipes(no BT) or two bluetooth enabled devices. Test SDP using two Bluetooth enabled devices Start server testcase first on one device, then start the matching client test on the other device. You cannot run all tests in one go, as they need to run on multiple devices. Edit the test sequesce to add/remove/modify the sequence of OBEX operations to perform. Use the new SDP record create interface. Change-Id: I3941793f9843abf4afa5ffbee40d1d01c118b29b Signed-off-by: Casper Bonde <c.bonde@samsung.com>
Diffstat (limited to 'src/com/android/bluetooth/opp/BluetoothOppTransfer.java')
-rwxr-xr-xsrc/com/android/bluetooth/opp/BluetoothOppTransfer.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
index 6c883d2ae..e96c5367e 100755
--- a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
@@ -34,6 +34,8 @@ package com.android.bluetooth.opp;
import javax.obex.ObexTransport;
+import com.android.bluetooth.BluetoothObexTransport;
+
import android.app.NotificationManager;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
@@ -628,8 +630,8 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
if (V) Log.v(TAG, "Rfcomm socket connection attempt took " +
(System.currentTimeMillis() - timestamp) + " ms");
- BluetoothOppRfcommTransport transport;
- transport = new BluetoothOppRfcommTransport(btSocket);
+ BluetoothObexTransport transport;
+ transport = new BluetoothObexTransport(btSocket);
BluetoothOppPreference.getInstance(mContext).setName(device, device.getName());