DebugActivity: Omit manufacturer for test devices if name contains it

This commit is contained in:
José Rebelo 2024-05-01 23:34:14 +01:00
parent 7a50df61b8
commit 0ff8774fce
1 changed files with 4 additions and 1 deletions

View File

@ -1184,7 +1184,10 @@ public class DebugActivity extends AbstractGBActivity {
for (DeviceType deviceType : DeviceType.values()) {
DeviceCoordinator coordinator = deviceType.getDeviceCoordinator();
int icon = coordinator.getDefaultIconResource();
String name = app.getString(coordinator.getDeviceNameResource()) + " (" + coordinator.getManufacturer() + ")";
String name = app.getString(coordinator.getDeviceNameResource());
if (!name.startsWith(coordinator.getManufacturer())) {
name += " (" + coordinator.getManufacturer() + ")";
}
long deviceId = deviceType.ordinal();
newMap.put(name, new Pair(deviceId, icon));
}