There is heavy work to do when add device to list in the
DeviceListPreferenceFragment, off load these work from main thread
to solve the issue.
Make devicePreferenceMap a ConcurrentHashMap to avoid potential race
condition.
Also no longer use getCachedPreference(key) since we not put anything
into the cache, the fallback flow is always used.
Also in BluetoothDevicePreference.onPreferenceAttributesChanged(), move
more heavy work to background thread.
Using System.currentTimeMillis() to sort devices could cause flaky
because System.currentTimeMillis() could be same for different device,
use AtomicInteger instead.
Fix: 286628533
Test: Following the step in bug
Change-Id: Ia9750adb6b4c1424d084381e9d7c2ca8e7912391
* Before adding new hearing device feature, we will extract the common part into Base class first. They will share most of the UI component.
Bug: 237625815
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDevicePairingDetailBaseTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDevicePairingDetailTest
Change-Id: I3a44c4c464d630fdcafa151afc82d3000fd728a3