@@ -133,12 +133,15 @@ public DeviceId getUsbDeviceId(String deviceControlId) {
133133 public DeviceId getSshDeviceId (String deviceControlId ) {
134134 try {
135135 return DeviceId .of (
136- deviceControlId , String .format ("%s:%s" , getLocalHostName (), deviceControlId ), false );
136+ deviceControlId ,
137+ String .format ("%s:%s" , getLocalHostName (), deviceControlId ),
138+ /* isUuidVolatile= */ false );
137139 } catch (MobileHarnessException e ) {
138140 // Should not happen.
139141 logger .atWarning ().withCause (e ).log (
140142 "Failed to generate sshable EmbeddedLinuxDevice uuid, use random uuid instead." );
141- return DeviceId .of (deviceControlId , UUID .randomUUID ().toString (), false );
143+ return DeviceId .of (
144+ deviceControlId , UUID .randomUUID ().toString (), /* isUuidVolatile= */ false );
142145 }
143146 }
144147
@@ -154,7 +157,7 @@ public DeviceId getVideoDeviceId(String deviceControlId) {
154157 return DeviceId .of (
155158 deviceControlId ,
156159 String .format ("%s:%s" , getLocalHostName (), deviceControlId ).replace ('/' , '-' ),
157- false );
160+ /* isUuidVolatile= */ false );
158161 } catch (MobileHarnessException e ) {
159162 throw new AssertionError ("Failed to generate VideoDevice uuid." , e );
160163 }
@@ -168,12 +171,13 @@ public DeviceId getVideoDeviceId(String deviceControlId) {
168171 */
169172 public DeviceId getLinuxDeviceId (String deviceControlId ) {
170173 try {
171- return DeviceId .of (deviceControlId , getLocalHostName (), false );
174+ return DeviceId .of (deviceControlId , getLocalHostName (), /* isUuidVolatile= */ false );
172175 } catch (MobileHarnessException e ) {
173176 // Should not happen.
174177 logger .atWarning ().withCause (e ).log (
175178 "Failed to generate LinuxDevice uuid, use random uuid instead." );
176- return DeviceId .of (deviceControlId , UUID .randomUUID ().toString (), false );
179+ return DeviceId .of (
180+ deviceControlId , UUID .randomUUID ().toString (), /* isUuidVolatile= */ false );
177181 }
178182 }
179183
@@ -191,25 +195,44 @@ public DeviceId getNoOpDeviceId(String deviceControlId) {
191195 // Should not happen.
192196 logger .atWarning ().withCause (e ).log (
193197 "Failed to generate NoOpDevice uuid, use random uuid instead.." );
194- return DeviceId .of (deviceControlId , UUID .randomUUID ().toString (), true );
198+ return DeviceId .of (deviceControlId , UUID .randomUUID ().toString (), /* isUuidVolatile= */ true );
195199 }
196200 }
197201
198202 /**
199- * Generates the gem5 device id from device control id, adds the lab host name as the prefix of
203+ * Generates the Gem5 device id from device control id, adds the lab host name as the prefix of
200204 * the uuid.
201205 *
202206 * @param deviceControlId the device control id from detector.
203207 */
204208 public DeviceId getGem5DeviceId (String deviceControlId ) {
205209 try {
206210 return DeviceId .of (
207- deviceControlId , String .format ("%s:%s" , getLocalHostName (), deviceControlId ), false );
211+ deviceControlId ,
212+ String .format ("%s:%s" , getLocalHostName (), deviceControlId ),
213+ /* isUuidVolatile= */ false );
208214 } catch (MobileHarnessException e ) {
209215 throw new AssertionError ("Failed to generate Gem5Device uuid." , e );
210216 }
211217 }
212218
219+ /**
220+ * Generates the ZeBu device id from device control id, adds the lab host name as the prefix of
221+ * the uuid.
222+ *
223+ * @param deviceControlId the device control id from detector.
224+ */
225+ public DeviceId getZebuDeviceId (String deviceControlId ) {
226+ try {
227+ return DeviceId .of (
228+ deviceControlId ,
229+ String .format ("%s:%s" , getLocalHostName (), deviceControlId ),
230+ /* isUuidVolatile= */ false );
231+ } catch (MobileHarnessException e ) {
232+ throw new AssertionError ("Failed to generate ZebuDevice uuid." , e );
233+ }
234+ }
235+
213236 private String getLocalHostName () throws MobileHarnessException {
214237 try {
215238 return netUtil .getLocalHostName ();
0 commit comments