|
46 | 46 | import android.content.Intent; |
47 | 47 | import android.content.IntentFilter; |
48 | 48 | import android.content.SharedPreferences; |
| 49 | +import android.content.res.Resources; |
49 | 50 | import android.os.Binder; |
50 | 51 | import android.os.Handler; |
51 | 52 | import android.os.IBinder; |
@@ -554,27 +555,32 @@ private synchronized void addReservedSdpRecords(final ArrayList<ParcelUuid> uuid |
554 | 555 | private synchronized void updateSdpRecords() { |
555 | 556 | ArrayList<ParcelUuid> uuids = new ArrayList<ParcelUuid>(); |
556 | 557 |
|
| 558 | + Resources R = mContext.getResources(); |
| 559 | + |
557 | 560 | // Add the default records |
558 | | - uuids.add(BluetoothUuid.HSP_AG); |
559 | | - uuids.add(BluetoothUuid.ObexObjectPush); |
| 561 | + if (R.getBoolean(com.android.internal.R.bool.config_bluetooth_default_profiles)) { |
| 562 | + uuids.add(BluetoothUuid.HSP_AG); |
| 563 | + uuids.add(BluetoothUuid.ObexObjectPush); |
| 564 | + } |
560 | 565 |
|
561 | | - if (mContext.getResources(). |
562 | | - getBoolean(com.android.internal.R.bool.config_voice_capable)) { |
| 566 | + if (R.getBoolean(com.android.internal.R.bool.config_voice_capable)) { |
563 | 567 | uuids.add(BluetoothUuid.Handsfree_AG); |
564 | 568 | uuids.add(BluetoothUuid.PBAP_PSE); |
565 | 569 | } |
566 | 570 |
|
567 | 571 | // Add SDP records for profiles maintained by Android userspace |
568 | 572 | addReservedSdpRecords(uuids); |
569 | 573 |
|
570 | | - // Enable profiles maintained by Bluez userspace. |
571 | | - setBluetoothTetheringNative(true, BluetoothPanProfileHandler.NAP_ROLE, |
572 | | - BluetoothPanProfileHandler.NAP_BRIDGE); |
| 574 | + if (R.getBoolean(com.android.internal.R.bool.config_bluetooth_default_profiles)) { |
| 575 | + // Enable profiles maintained by Bluez userspace. |
| 576 | + setBluetoothTetheringNative(true, BluetoothPanProfileHandler.NAP_ROLE, |
| 577 | + BluetoothPanProfileHandler.NAP_BRIDGE); |
573 | 578 |
|
574 | | - // Add SDP records for profiles maintained by Bluez userspace |
575 | | - uuids.add(BluetoothUuid.AudioSource); |
576 | | - uuids.add(BluetoothUuid.AvrcpTarget); |
577 | | - uuids.add(BluetoothUuid.NAP); |
| 579 | + // Add SDP records for profiles maintained by Bluez userspace |
| 580 | + uuids.add(BluetoothUuid.AudioSource); |
| 581 | + uuids.add(BluetoothUuid.AvrcpTarget); |
| 582 | + uuids.add(BluetoothUuid.NAP); |
| 583 | + } |
578 | 584 |
|
579 | 585 | // Cannot cast uuids.toArray directly since ParcelUuid is parcelable |
580 | 586 | mAdapterUuids = new ParcelUuid[uuids.size()]; |
|
0 commit comments