Use new api to get bluetooth device icon
This CL use CachedBluetoothDevice#getDrawableWithDescription() to get bluetooth device icon. Bug: 178255374 Test: make RunSettingsRoboTests -j56 Change-Id: I45c273e2dd782029da7a3a2724cbca3762cc2d9c
This commit is contained in:
@@ -176,17 +176,9 @@ public final class BluetoothDevicePreference extends GearPreference {
|
||||
}
|
||||
|
||||
void onPreferenceAttributesChanged() {
|
||||
ThreadUtils.postOnBackgroundThread(() -> {
|
||||
final Pair<Drawable, String> pair =
|
||||
BluetoothUtils.getBtRainbowDrawableWithDescription(getContext(), mCachedDevice);
|
||||
|
||||
ThreadUtils.postOnMainThread(() -> {
|
||||
if (pair.first != null) {
|
||||
setIcon(pair.first);
|
||||
contentDescription = pair.second;
|
||||
}
|
||||
});
|
||||
});
|
||||
Pair<Drawable, String> pair = mCachedDevice.getDrawableWithDescription();
|
||||
setIcon(pair.first);
|
||||
contentDescription = pair.second;
|
||||
|
||||
/*
|
||||
* The preference framework takes care of making sure the value has
|
||||
|
Reference in New Issue
Block a user