summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/opp
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/bluetooth/opp')
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppService.java16
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppTransfer.java6
2 files changed, 18 insertions, 4 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java
index 611d8b226..4051b4226 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppService.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppService.java
@@ -32,6 +32,7 @@
package com.android.bluetooth.opp;
+import com.android.bluetooth.R;
import com.google.android.collect.Lists;
import javax.obex.ObexTransport;
@@ -381,9 +382,18 @@ public class BluetoothOppService extends Service {
if ( ( mSocketListener.openRfcommSocket() != null) &&
( mL2cSocketListener.openL2capSocket() != null) &&
SdpManager.getDefaultManager() != null) {
- mOppSdpHandle = SdpManager.getDefaultManager()
- .createOppOpsRecord("OBEX Object Push", mSocketListener.getRfcommChannel(),
- mL2cSocketListener.getL2capPsm(), 0x0102, SdpManager.OPP_FORMAT_ALL);
+ boolean isDisabledNonAosp = getResources().getBoolean
+ (R.bool.disable_non_aosp_bt_features);
+ if (D) Log.d(TAG, "isDisabledNonAosp :" + isDisabledNonAosp);
+ if (isDisabledNonAosp) {
+ mOppSdpHandle = SdpManager.getDefaultManager().createOppOpsRecord
+ ("OBEX Object Push",mSocketListener.getRfcommChannel(),
+ -1, 0x0101, SdpManager.OPP_FORMAT_ALL);
+ } else {
+ mOppSdpHandle = SdpManager.getDefaultManager().createOppOpsRecord(
+ "OBEX Object Push",mSocketListener.getRfcommChannel(),
+ mL2cSocketListener.getL2capPsm(), 0x0102,SdpManager.OPP_FORMAT_ALL);
+ }
mSocketListener.start(mHandler);
mL2cSocketListener.start(mHandler);
} else {
diff --git a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
index 4dcbb09c3..d74cbd67b 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
@@ -32,6 +32,7 @@
package com.android.bluetooth.opp;
+import com.android.bluetooth.R;
import javax.obex.ObexTransport;
import com.android.bluetooth.BluetoothObexTransport;
@@ -565,7 +566,10 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
mConnectThread.start();
} else {
OolConnManager.setSdpInitiatedAddress(mBatch.mDestination);
- if (!mBatch.mDestination.sdpSearch(BluetoothUuid.ObexObjectPush)) {
+ boolean isDisabledNonAosp = mContext.getResources().getBoolean
+ (R.bool.disable_non_aosp_bt_features);
+ if (D) Log.d(TAG, "isDisabledNonAosp :" + isDisabledNonAosp);
+ if (isDisabledNonAosp || !mBatch.mDestination.sdpSearch(BluetoothUuid.ObexObjectPush)) {
/* SDP failed, start rfcomm connect directly */
mConnectThread = new SocketConnectThread(mBatch.mDestination, false, false);
/* update bd address as sdp could not be started */