Show message when no preset info is obtained from the remote device

Display message when hearing aid has no presets configured. Previously, the preset item was grayed out with no explanation, causing confusion. Now, a clear message informs users that presets are not available on their device.

Bug: 345112286
Test: atest BluetoothDetailsHearingAidsPresetsControllerTest
Flag: EXEMPT bugfix
Change-Id: Ie1ece8f08933eb28a5947e2a030888a6bc49bc9f
This commit is contained in:
Angela Wang
2024-06-19 06:56:52 +00:00
parent a6c54bc98f
commit 9a8b50baea
3 changed files with 13 additions and 5 deletions

View File

@@ -38,6 +38,7 @@ import android.bluetooth.BluetoothHapPresetInfo;
import androidx.preference.ListPreference;
import androidx.preference.PreferenceCategory;
import com.android.settings.R;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.HapClientProfile;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
@@ -215,6 +216,8 @@ public class BluetoothDetailsHearingAidsPresetsControllerTest extends
assertThat(mController.getPreference()).isNotNull();
assertThat(mController.getPreference().isEnabled()).isFalse();
assertThat(String.valueOf(mController.getPreference().getSummary())).isEqualTo(
mContext.getString(R.string.bluetooth_hearing_aids_presets_empty_list_message));
}
@Test