Merge "Use new api to get bluetooth device icon" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-04-23 11:59:04 +00:00
committed by Android (Google) Code Review
2 changed files with 16 additions and 11 deletions

View File

@@ -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