Merge "Make Hearing devices preference always visible" into udc-qpr-dev am: 7df08d69be am: 5176db8a71

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23429459

Change-Id: I6e5e91d3bbc44f3973fc021a94cde5d0accb5ce0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Angela Wang
2023-06-01 03:36:35 +00:00
committed by Automerger Merge Worker
2 changed files with 12 additions and 10 deletions

View File

@@ -56,7 +56,8 @@ public class HearingAidHelper {
* @return a list of hearing aids {@link BluetoothDevice} objects
*/
public List<BluetoothDevice> getConnectedHearingAidDeviceList() {
if (!isHearingAidSupported()) {
if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()
|| !isHearingAidSupported()) {
return new ArrayList<>();
}
final List<BluetoothDevice> deviceList = new ArrayList<>();
@@ -88,9 +89,6 @@ public class HearingAidHelper {
* supported.
*/
public boolean isHearingAidSupported() {
if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) {
return false;
}
final List<Integer> supportedList = mBluetoothAdapter.getSupportedProfiles();
return supportedList.contains(BluetoothProfile.HEARING_AID)
|| supportedList.contains(BluetoothProfile.HAP_CLIENT);