Fix after dis/reconnect HA, DUT will request to re-pair one side of HA

Root Cause: Another side of HA jumps to connecting state after pair-other-ear dialog appears.

Solution: Listen to onDeviceAttributesChanged() callback to know when
the sub device gets connected, then to dismiss dialog.

Bug: 236782832
Test: make RunSettingsRoboTests ROBOTEST_FILTER=HearingAidUtilsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=HearingAidPairingDialogFragmentTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AvailableMediaDeviceGroupControllerTest
Change-Id: I8dafefbb05e7cf1cadf37a7acbb2c5d66f2d0a78
This commit is contained in:
jasonwshsu
2022-08-31 01:39:20 +08:00
parent 6c5b859da2
commit 88f36dccc7
6 changed files with 162 additions and 23 deletions

View File

@@ -53,7 +53,7 @@ public final class HearingAidUtils {
Log.w(TAG, "Can not launch hearing aid pairing dialog for invalid side");
return;
}
HearingAidPairingDialogFragment.newInstance(device).show(fragmentManager,
HearingAidPairingDialogFragment.newInstance(device.getAddress()).show(fragmentManager,
HearingAidPairingDialogFragment.TAG);
}
}