The Windows backend was unconditionally marking each discovered device
as cached. However, a correct thing to do it to only mark those devices
that come from the OS cache.
For Windows these are always the paired devices.
However, there's one caveat here as well. If the device is cached, but
at the same time actually available, Windows will first report it with
rssi == 0 (at least in case of BTLE devices), and only then deliver an
update with the correct RSSI value.
This patch implements the following logic:
* All newly-discovered paired devices are marked as cached first
* Once there's an update, the device is not considered as cached
anymore.
This works fine for BTLE devices, because they regularly report at
least the RSSI updates.
For Classic Bluetooth we don't have any device updates during the
discovery, so simply rely on the pairing status at the time of
initial discovery.
Fixes: QTBUG-140825
Pick-to: 6.10 6.8
Change-Id: Ifd9ca57fe837522be01555984637cea65094900c
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>