summaryrefslogtreecommitdiffstats
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
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
-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 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()];
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index d7f3036..4fde018 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 d48dc66..e1bc33b 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" />