summaryrefslogtreecommitdiffstats
path: root/core/java/android/server/BluetoothService.java
diff options
context:
space:
mode:
authorTravis Geiselbrecht <travisg@google.com>2012-03-06 11:41:58 -0800
committerMike Lockwood <lockwood@google.com>2012-03-22 15:09:44 -0700
commita91da5da56a5b2e74bd585fb2d38b8b487ce083e (patch)
tree3c77a8134d31f8314d88b5353581282a6de6b331 /core/java/android/server/BluetoothService.java
parentb85c933d850286874005f97a9764c9b22e49a597 (diff)
downloadframeworks_base-a91da5da56a5b2e74bd585fb2d38b8b487ce083e.zip
frameworks_base-a91da5da56a5b2e74bd585fb2d38b8b487ce083e.tar.gz
frameworks_base-a91da5da56a5b2e74bd585fb2d38b8b487ce083e.tar.bz2
add config_bluetooth_default_profiles config var and use it to disable bt profiles
For devices that don't care about the previously default bluetooth profiles, add a config var to disable them. Change-Id: I04bb7ad4b1235bc37227645f472fdf5b918f6a31
Diffstat (limited to 'core/java/android/server/BluetoothService.java')
-rwxr-xr-xcore/java/android/server/BluetoothService.java28
1 files changed, 17 insertions, 11 deletions
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index fecc8f9..850349b 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()];