Make Hearing devices preference always visible

Previously we hide the preference when Bluetooth is off since it's only used for showing connected hearing aids and acting as a shortcut to device detail page.

However, the preference is now a new page of multiple controls, we probably shouldn't hide the preference the Bluetooth is off. Those controls should be accessible even if the Bluetooth is off.

Bug: 284092084
Test: make RunSettingsRoboTests ROBOTEST_FILTER=HearingAidHelperTest
Change-Id: I647a187d73bd673c8ac8ab366579ba92c22ce1dc
This commit is contained in:
Angela Wang
2023-05-25 11:11:37 +00:00
parent b04b977cac
commit abebbfc4b3
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);