use of com.android.settingslib.media.MediaDevice in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class MediaOutputSlice method getSlice.
@Override
public Slice getSlice() {
// Reload theme for switching dark mode on/off
mContext.getTheme().applyStyle(R.style.Theme_Settings_Home, true);
final ListBuilder listBuilder = new ListBuilder(mContext, getUri(), ListBuilder.INFINITY).setAccentColor(COLOR_NOT_TINTED);
if (!isVisible()) {
Log.d(TAG, "getSlice() is not visible");
return listBuilder.build();
}
final List<MediaDevice> devices = getMediaDevices();
final MediaDevice connectedDevice = getWorker().getCurrentConnectedMediaDevice();
if (connectedDevice != null) {
listBuilder.addRow(getActiveDeviceHeaderRow(connectedDevice));
}
for (MediaDevice device : devices) {
if (connectedDevice == null || !TextUtils.equals(connectedDevice.getId(), device.getId())) {
listBuilder.addRow(getMediaDeviceRow(device));
}
}
return listBuilder.build();
}
Aggregations