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

Commit a87f923a authored by Chienyuan's avatar Chienyuan
Browse files

Remove mUsePbapPce and mUseMapClient

Use BluetoothAdapter.getSupportedProfiles() to determine init Profile or not.

Bug: 112062630
Test: make -j50 RunSettingsLibRoboTests
Change-Id: I02016db2c79301fb9362f5d7ced8a4e7a9ad902d
parent 7dd9fce6
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -3340,9 +3340,6 @@
         to occur. The expand button will have increased touch boundaries to accomodate this. -->
    <bool name="config_notificationHeaderClickableForExpand">false</bool>

    <!-- Configuration for automotive -->
    <bool name="enable_pbap_pce_profile">false</bool>

    <!-- Default data warning level in mb -->
    <integer name="default_data_warning_level_mb">2048</integer>

+0 −2
Original line number Diff line number Diff line
@@ -3247,8 +3247,6 @@

  <java-symbol type="style" name="Theme.DeviceDefault.QuickSettings" />

  <java-symbol type="bool" name="enable_pbap_pce_profile" />

  <java-symbol type="integer" name="default_data_warning_level_mb" />
  <java-symbol type="bool" name="config_useVideoPauseWorkaround" />
  <java-symbol type="bool" name="config_sendPackageName" />
+23 −29
Original line number Diff line number Diff line
@@ -95,8 +95,6 @@ public class LocalBluetoothProfileManager {
    private PanProfile mPanProfile;
    private PbapClientProfile mPbapClientProfile;
    private PbapServerProfile mPbapProfile;
    private final boolean mUsePbapPce;
    private final boolean mUseMapClient;
    private HearingAidProfile mHearingAidProfile;

    /**
@@ -113,9 +111,6 @@ public class LocalBluetoothProfileManager {

        mDeviceManager = deviceManager;
        mEventManager = eventManager;
        mUsePbapPce = mContext.getResources().getBoolean(R.bool.enable_pbap_pce_profile);
        // MAP Client is typically used in the same situations as PBAP Client
        mUseMapClient = mContext.getResources().getBoolean(R.bool.enable_pbap_pce_profile);
        // pass this reference to adapter and event manager (circular dependency)
        adapter.setProfileManager(this);

@@ -160,15 +155,13 @@ public class LocalBluetoothProfileManager {
                    BluetoothHeadsetClient.ACTION_AUDIO_STATE_CHANGED,
                    BluetoothHeadsetClient.STATE_AUDIO_DISCONNECTED);
        }
        if (mUseMapClient) {
        if (mMapClientProfile == null && supportedList.contains(BluetoothProfile.MAP_CLIENT)) {
            if (DEBUG) Log.d(TAG, "Adding local MAP CLIENT profile");
                mMapClientProfile =
                        new MapClientProfile(mContext, mDeviceManager,this);
            mMapClientProfile = new MapClientProfile(mContext, mDeviceManager,this);
            addProfile(mMapClientProfile, MapClientProfile.NAME,
                    BluetoothMapClient.ACTION_CONNECTION_STATE_CHANGED);
        }
        } else if (mMapProfile == null && supportedList.contains(BluetoothProfile.MAP)) {
        if (mMapProfile == null && supportedList.contains(BluetoothProfile.MAP)) {
            if (DEBUG) Log.d(TAG, "Adding local MAP profile");
            mMapProfile = new MapProfile(mContext, mDeviceManager, this);
            addProfile(mMapProfile, MapProfile.NAME, BluetoothMap.ACTION_CONNECTION_STATE_CHANGED);
@@ -210,8 +203,7 @@ public class LocalBluetoothProfileManager {
            addProfile(mPbapProfile, PbapServerProfile.NAME,
                    BluetoothPbap.ACTION_CONNECTION_STATE_CHANGED);
        }
        if (mUsePbapPce && mPbapClientProfile == null && supportedList.contains(
                BluetoothProfile.PBAP_CLIENT)) {
        if (mPbapClientProfile == null && supportedList.contains(BluetoothProfile.PBAP_CLIENT)) {
            if (DEBUG) Log.d(TAG, "Adding local PBAP Client profile");
            mPbapClientProfile = new PbapClientProfile(mContext, mDeviceManager,this);
            addProfile(mPbapClientProfile, PbapClientProfile.NAME,
@@ -543,7 +535,9 @@ public class LocalBluetoothProfileManager {
            removedProfiles.remove(mMapClientProfile);
        }

        if (mUsePbapPce) {
        if ((mPbapClientProfile != null) &&
                BluetoothUuid.isUuidPresent(localUuids, BluetoothUuid.PBAP_PCE) &&
                BluetoothUuid.containsAnyUuid(uuids, PbapClientProfile.SRC_UUIDS)) {
            profiles.add(mPbapClientProfile);
            removedProfiles.remove(mPbapClientProfile);
        }