summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcore/java/android/server/BluetoothService.java28
-rwxr-xr-xcore/res/res/values/config.xml4
-rw-r--r--core/res/res/values/public.xml1
3 files changed, 22 insertions, 11 deletions
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index fecc8f9b3163..850349b205f6 100755
--- a/core/java/android/server/BluetoothService.java
+++ b/core/java/android/server/BluetoothService.java
@@ -46,6 +46,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
+import android.content.res.Resources;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
@@ -554,12 +555,15 @@ public class BluetoothService extends IBluetooth.Stub {
private synchronized void updateSdpRecords() {
ArrayList<ParcelUuid> uuids = new ArrayList<ParcelUuid>();
+ Resources R = mContext.getResources();
+
// Add the default records
- uuids.add(BluetoothUuid.HSP_AG);
- uuids.add(BluetoothUuid.ObexObjectPush);
+ if (R.getBoolean(com.android.internal.R.bool.config_bluetooth_default_profiles)) {
+ uuids.add(BluetoothUuid.HSP_AG);
+ uuids.add(BluetoothUuid.ObexObjectPush);
+ }
- if (mContext.getResources().
- getBoolean(com.android.internal.R.bool.config_voice_capable)) {
+ if (R.getBoolean(com.android.internal.R.bool.config_voice_capable)) {
uuids.add(BluetoothUuid.Handsfree_AG);
uuids.add(BluetoothUuid.PBAP_PSE);
}
@@ -567,14 +571,16 @@ public class BluetoothService extends IBluetooth.Stub {
// Add SDP records for profiles maintained by Android userspace
addReservedSdpRecords(uuids);
- // Enable profiles maintained by Bluez userspace.
- setBluetoothTetheringNative(true, BluetoothPanProfileHandler.NAP_ROLE,
- BluetoothPanProfileHandler.NAP_BRIDGE);
+ if (R.getBoolean(com.android.internal.R.bool.config_bluetooth_default_profiles)) {
+ // Enable profiles maintained by Bluez userspace.
+ setBluetoothTetheringNative(true, BluetoothPanProfileHandler.NAP_ROLE,
+ BluetoothPanProfileHandler.NAP_BRIDGE);
- // Add SDP records for profiles maintained by Bluez userspace
- uuids.add(BluetoothUuid.AudioSource);
- uuids.add(BluetoothUuid.AvrcpTarget);
- uuids.add(BluetoothUuid.NAP);
+ // Add SDP records for profiles maintained by Bluez userspace
+ uuids.add(BluetoothUuid.AudioSource);
+ uuids.add(BluetoothUuid.AvrcpTarget);
+ uuids.add(BluetoothUuid.NAP);
+ }
// Cannot cast uuids.toArray directly since ParcelUuid is parcelable
mAdapterUuids = new ParcelUuid[uuids.size()];
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index d7f30360e63b..4fde018c419f 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -635,6 +635,10 @@
cell broadcasting sms, and MMS. -->
<bool name="config_sms_capable">true</bool>
+ <!-- Enable/disable default bluetooth profiles:
+ HSP_AG, ObexObjectPush, Audio, NAP -->
+ <bool name="config_bluetooth_default_profiles">true</bool>
+
<!-- IP address of the dns server to use if nobody else suggests one -->
<string name="config_default_dns_server" translatable="false">8.8.8.8</string>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index d48dc66bc985..e1bc33bd4d8a 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -245,6 +245,7 @@
<java-symbol type="bool" name="config_enableWallpaperService" />
<java-symbol type="bool" name="config_sendAudioBecomingNoisy" />
<java-symbol type="bool" name="config_enableScreenshotChord" />
+ <java-symbol type="bool" name="config_bluetooth_default_profiles" />
<java-symbol type="integer" name="config_cursorWindowSize" />
<java-symbol type="integer" name="config_longPressOnPowerBehavior" />