@@ -23,9 +23,17 @@ private Map<String, Object> getDefaultDeviceInfo() {
2323 map .put ("hostname" , DeviceCallback .getHostnameValue ());
2424 map .put ("osName" , System .getProperty ("os.name" ));
2525 map .put ("osVersion" , System .getProperty ("os.version" ));
26+ map .put ("runtimeVersions" , getRuntimeVersions ());
2627 return map ;
2728 }
2829
30+ private Map <String , String > getRuntimeVersions () {
31+ Map <String , String > runtimeVersions = new HashMap <String , String >();
32+ runtimeVersions .put ("javaType" , System .getProperty ("java.runtime.name" ));
33+ runtimeVersions .put ("javaVersion" , System .getProperty ("java.runtime.version" ));
34+ return runtimeVersions ;
35+ }
36+
2937 private Map <String , Object > getDefaultAppInfo (Configuration configuration ) {
3038 Map <String , Object > map = new HashMap <String , Object >();
3139
@@ -37,4 +45,18 @@ private Map<String, Object> getDefaultAppInfo(Configuration configuration) {
3745 }
3846 return map ;
3947 }
48+
49+ @ SuppressWarnings ("unchecked" )
50+ static void addDeviceRuntimeVersion (Map <String , Object > device , String key , Object value ) {
51+ Object obj = device .get ("runtimeVersions" );
52+ Map <String , Object > runtimeVersions ;
53+
54+ if (obj instanceof Map ) {
55+ runtimeVersions = (Map <String , Object >) obj ;
56+ } else { // fallback to creating a new map if payload was mutated
57+ runtimeVersions = new HashMap <String , Object >();
58+ device .put ("runtimeVersions" , runtimeVersions );
59+ }
60+ runtimeVersions .put (key , value );
61+ }
4062}
0 commit comments