For logging purpose, CachedBluetoothDevice#toString is more clear then BluetoothDevice#toString, so change to use CachedBluetoothDevice#toString
Bug: 307890347
Test: atest HearingDevicePairingFragmentTest
Change-Id: Ia0af65565ca7067fa6c4d5db286c3739fb65c1d2
The device might still in advertising mode even if it's bonded. We can
just ignore this kind of devices in the scanning result.
Bug: 307890347
Test: manual test
Change-Id: I782cc62edd4fec779f5f55444425b32a77f85e5e
Checks the gatt status in `onConnectionStateChange()` and `onServiceDiscovered()` callbacks. Disconnects and removes the gatt from the `mConnectingGattList` if the gatt status is not success in these callbacks.
Bug: 307890347
Test: manual test
Change-Id: Iab09f13b2ff3d33e5c4d6a8710736307c26b17e7
Should clear the `mConnectingGattList` when the gatts in the list are all disconnected in `OnStop()`. Otherwise, we can't re-connecting gatt for these devices after the page enter `onStart()` again.
Bug: 307890347
Test: manual test
Change-Id: I3b9fe05f894548887339011f5757c71e3a40eb5c
Some of the hearing aids support both ASHA + MFi, however, they only
advertise MFi service uuid in advertisement packets.
We can filter the devices with MFi uuid while scanning and then connect
gatt to discover the remote services before pairing to make sure if the
devices are compatible with Android or not. Only devices that support
ASHA/HAP will be shown.
Bug: 307890347
Test: atest HearingDevicePairingFragmentTest
Change-Id: Ie1f4eedddd4c43fad0fcbcd35f436dea5ab06925
Rewrite a new hearing device pairing page with update UI for "See more
devices".
Bug: 307473972
Test: atest HearingDevicePairingFragmentTest
Test: flip the flag com.android.settings.flags.new_hearing_device_pairing_page && atest HearingAidPairingDialogFragmentTest AddDevicePreferenceControllerTest
Change-Id: Ic60601905e3d0d7d7c5b1ef9733652118a211f1d