Hide pair other ear button after device connected via CSIP
The pair other ear button should disappear after both ears of binaural hearing aids are connected. Remove checking if CSIP is enabled since CSIP is always enabled in pairing stage. Bug: 296646732 Test: check the UI manually Change-Id: I804819eef41b5d3754ad0a79d9fc1afc66cef5cc
This commit is contained in:
@@ -42,9 +42,10 @@ public final class HearingAidUtils {
|
||||
*/
|
||||
public static void launchHearingAidPairingDialog(FragmentManager fragmentManager,
|
||||
@NonNull CachedBluetoothDevice device, int launchPage) {
|
||||
// No need to show the pair another ear dialog if the device supports and enables CSIP.
|
||||
// No need to show the pair another ear dialog if the device supports CSIP.
|
||||
// CSIP will pair other devices in the same set automatically.
|
||||
if (isCsipSupportedAndEnabled(device)) {
|
||||
if (device.getProfiles().stream().anyMatch(
|
||||
profile -> profile instanceof CsipSetCoordinatorProfile)) {
|
||||
return;
|
||||
}
|
||||
if (device.isConnectedAshaHearingAidDevice()
|
||||
@@ -63,10 +64,4 @@ public final class HearingAidUtils {
|
||||
HearingAidPairingDialogFragment.newInstance(device.getAddress(), launchPage)
|
||||
.show(fragmentManager, HearingAidPairingDialogFragment.TAG);
|
||||
}
|
||||
|
||||
private static boolean isCsipSupportedAndEnabled(@NonNull CachedBluetoothDevice device) {
|
||||
return device.getProfiles().stream().anyMatch(
|
||||
profile -> (profile instanceof CsipSetCoordinatorProfile)
|
||||
&& (profile.isEnabled(device.getDevice())));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user