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

Commit 8c0f8008 authored by Stanley Tng's avatar Stanley Tng
Browse files

Disable Hearing Aid Profile for all platforms except Pixels

Add code to selectively disable Hearing Aid Profile depending on the
config.xml file.
Note: Cherry-picked from internal branch.

Bug: 78142728
Test: Manual Pairing on various Pixel phones
Change-Id: I8094f1a1665647b026eb9601e032fb7fbb816ec6
(cherry picked from commit a21efa58)
parent 093ade31
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.Context;
import android.os.ParcelUuid;
import android.util.Log;

import java.util.List;
import java.util.Set;

/**
@@ -248,4 +249,8 @@ public class LocalBluetoothAdapter {
    public int getMaxConnectedAudioDevices() {
        return mAdapter.getMaxConnectedAudioDevices();
    }

    public List<Integer> getSupportedProfiles() {
        return mAdapter.getSupportedProfiles();
    }
}
+8 −3
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import com.android.internal.R;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
@@ -150,9 +151,13 @@ public class LocalBluetoothProfileManager {
        addProfile(mPbapProfile, PbapServerProfile.NAME,
             BluetoothPbap.ACTION_CONNECTION_STATE_CHANGED);

        mHearingAidProfile = new HearingAidProfile(mContext, mLocalAdapter, mDeviceManager, this);
        List<Integer> supportedList = mLocalAdapter.getSupportedProfiles();
        if (supportedList.contains(BluetoothProfile.HEARING_AID)) {
            mHearingAidProfile = new HearingAidProfile(mContext, mLocalAdapter, mDeviceManager,
                                                       this);
            addProfile(mHearingAidProfile, HearingAidProfile.NAME,
                       BluetoothHearingAid.ACTION_CONNECTION_STATE_CHANGED);
        }
        if (DEBUG) Log.d(TAG, "LocalBluetoothProfileManager construction complete");
    }