Skip to content

Commit

Permalink
Merge e06a141 into b99a2ca
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianKast authored Sep 7, 2022
2 parents b99a2ca + e06a141 commit 8251b82
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ private DisplayCapabilities createDisplayCapabilities(String displayName, Window
convertedCapabilities.setImageFields(defaultMainWindow.getImageFields());
convertedCapabilities.setTemplatesAvailable(defaultMainWindow.getTemplatesAvailable());
convertedCapabilities.setNumCustomPresetsAvailable(defaultMainWindow.getNumCustomPresetsAvailable());
convertedCapabilities.setMediaClockFormats(new ArrayList<MediaClockFormat>()); // mandatory field but can be empty
convertedCapabilities.setMediaClockFormats(TestValues.GENERAL_MEDIACLOCKFORMAT_LIST); // mandatory field but can be empty
convertedCapabilities.setGraphicSupported(defaultMainWindow.getImageTypeSupported().contains(ImageType.DYNAMIC));
convertedCapabilities.setScreenParams(TestValues.GENERAL_SCREENPARAMS);

return convertedCapabilities;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ private DisplayCapabilities createDeprecatedDisplayCapabilities(String displayNa
// if there are imageTypes in the response, we must assume graphics are supported
convertedCapabilities.setGraphicSupported(defaultMainWindow.getImageTypeSupported() != null && defaultMainWindow.getImageTypeSupported().size() > 0);

if (cachedSystemCapabilities.containsKey(SystemCapabilityType.DISPLAY)) {
// Copied from the RAI response, since this parameter is not present in WindowCapability
DisplayCapabilities displayCapabilitiesOld = (DisplayCapabilities) cachedSystemCapabilities.get(SystemCapabilityType.DISPLAY);
convertedCapabilities.setScreenParams(displayCapabilitiesOld.getScreenParams());
if (displayCapabilitiesOld.getMediaClockFormats() != null) {
convertedCapabilities.setMediaClockFormats(displayCapabilitiesOld.getMediaClockFormats());
}
}

return convertedCapabilities;
}

Expand Down Expand Up @@ -246,7 +255,11 @@ public WindowCapability getWindowCapability(int windowID) {
for (WindowCapability windowCapability : display.getWindowCapabilities()) {
int currentWindowID = windowCapability.getWindowID() != null ? windowCapability.getWindowID() : PredefinedWindows.DEFAULT_WINDOW.getValue();
if (currentWindowID == windowID) {
return windowCapability;
// Clone WindowCapability to prevent modification of stored WindowCapability in SystemCapabilityManager
WindowCapability windowCapabilityCopy = (WindowCapability) windowCapability.clone();
// A null windowID is assumed to be the DefaultWindow according to the spec, but that can be hard for developers to check, so set it explicitly.
windowCapabilityCopy.setWindowID(windowID);
return windowCapabilityCopy;
}
}
return null;
Expand Down

0 comments on commit 8251b82

Please sign in to comment.