Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 704989939
  • Loading branch information
DeviceInfra authored and copybara-github committed Dec 11, 2024
1 parent 9391acf commit 9786e7b
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,24 @@ public DeviceId getLinuxDeviceId(String deviceControlId) {
}
}

/**
* Generates the Gem5 device id from device control id, and sets uuid in the format
* <hostname>:gem5:<deviceControlId>.
*
* @param deviceControlId the device control id from detector.
*/
public DeviceId getGem5DeviceId(String deviceControlId) {
try {
return DeviceId.of(
deviceControlId, String.format("%s:gem5:%s", getLocalHostName(), deviceControlId), true);
} catch (MobileHarnessException e) {
// Should not happen.
logger.atWarning().withCause(e).log(
"Failed to generate Gem5Device uuid, use random uuid instead..");
return DeviceId.of(deviceControlId, UUID.randomUUID().toString(), true);
}
}

/**
* Generates the NoOp device id from device control id, adds the lab host name as the prefix of
* the uuid.
Expand Down

0 comments on commit 9786e7b

Please sign in to comment.