Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a91da5da authored by Travis Geiselbrecht's avatar Travis Geiselbrecht Committed by Mike Lockwood
Browse files

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
parent b85c933d
Loading
Loading
Loading
Loading
+17 −11
Original line number Diff line number Diff line
@@ -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
        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,6 +571,7 @@ public class BluetoothService extends IBluetooth.Stub {
        // Add SDP records for profiles maintained by Android userspace
        addReservedSdpRecords(uuids);

        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);
@@ -575,6 +580,7 @@ public class BluetoothService extends IBluetooth.Stub {
            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()];
+4 −0
Original line number Diff line number Diff line
@@ -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>

+1 −0
Original line number Diff line number Diff line
@@ -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" />