|
|
@ -26,6 +26,14 @@ var ArrayList = Packages.java.util.ArrayList;
|
|
|
|
var log = new Log();
|
|
|
|
var log = new Log();
|
|
|
|
var deviceManagementService = utility.getDeviceManagementService();
|
|
|
|
var deviceManagementService = utility.getDeviceManagementService();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var unspecifiedFilter = function(prop){
|
|
|
|
|
|
|
|
if(prop==null){
|
|
|
|
|
|
|
|
return "Unspecified";
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
return prop;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var listDevices = function () {
|
|
|
|
var listDevices = function () {
|
|
|
|
var devices = deviceManagementService.getAllDevices("android");
|
|
|
|
var devices = deviceManagementService.getAllDevices("android");
|
|
|
|
var deviceList = [];
|
|
|
|
var deviceList = [];
|
|
|
@ -34,14 +42,14 @@ var listDevices = function () {
|
|
|
|
|
|
|
|
|
|
|
|
var propertiesList = DeviceManagerUtil.convertPropertiesToMap(device.getProperties());
|
|
|
|
var propertiesList = DeviceManagerUtil.convertPropertiesToMap(device.getProperties());
|
|
|
|
deviceList.push({
|
|
|
|
deviceList.push({
|
|
|
|
"identifier": device.getDeviceIdentifier(),
|
|
|
|
"identifier": unspecifiedFilter(device.getDeviceIdentifier()),
|
|
|
|
"name": device.getName(),
|
|
|
|
"name": unspecifiedFilter(device.getName()),
|
|
|
|
"ownership": device.getOwnership(),
|
|
|
|
"ownership": unspecifiedFilter(device.getOwnership()),
|
|
|
|
"owner": device.getOwner(),
|
|
|
|
"owner": unspecifiedFilter(device.getOwner()),
|
|
|
|
"deviceType": device.getType(),
|
|
|
|
"deviceType": unspecifiedFilter(device.getType()),
|
|
|
|
"vendor": propertiesList.get("vendor"),
|
|
|
|
"vendor": unspecifiedFilter(propertiesList.get("vendor")),
|
|
|
|
"model": propertiesList.get("model"),
|
|
|
|
"model": unspecifiedFilter(propertiesList.get("model")),
|
|
|
|
"osVersion": propertiesList.get("osVersion")
|
|
|
|
"osVersion": unspecifiedFilter(propertiesList.get("osVersion"))
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return deviceList;
|
|
|
|
return deviceList;
|
|
|
@ -94,17 +102,17 @@ var viewDevice = function(type, deviceId){
|
|
|
|
var entry = iterator.next();
|
|
|
|
var entry = iterator.next();
|
|
|
|
var key = entry.getKey();
|
|
|
|
var key = entry.getKey();
|
|
|
|
var value = entry.getValue();
|
|
|
|
var value = entry.getValue();
|
|
|
|
properties[key]= value;
|
|
|
|
properties[key]= unspecifiedFilter(value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
"identifier": device.getDeviceIdentifier(),
|
|
|
|
"identifier": unspecifiedFilter(device.getDeviceIdentifier()),
|
|
|
|
"name": device.getName(),
|
|
|
|
"name": unspecifiedFilter(device.getName()),
|
|
|
|
"ownership": device.getOwnership(),
|
|
|
|
"ownership": unspecifiedFilter(device.getOwnership()),
|
|
|
|
"owner": device.getOwner(),
|
|
|
|
"owner": unspecifiedFilter(device.getOwner()),
|
|
|
|
"deviceType": device.getType(),
|
|
|
|
"deviceType": unspecifiedFilter(device.getType()),
|
|
|
|
"vendor": propertiesList.get("vendor"),
|
|
|
|
"vendor": unspecifiedFilter(propertiesList.get("vendor")),
|
|
|
|
"model": propertiesList.get("model"),
|
|
|
|
"model": unspecifiedFilter(propertiesList.get("model")),
|
|
|
|
"osVersion": propertiesList.get("osVersion"),
|
|
|
|
"osVersion": unspecifiedFilter(propertiesList.get("osVersion")),
|
|
|
|
"properties": properties
|
|
|
|
"properties": properties
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|