Merge branch 'master' into 'master'

Fix application update issue

See merge request entgra/carbon-device-mgt-plugins!28
revert-dabc3590
Charitha Goonetilleke 6 years ago
commit ab309f4485

@ -252,6 +252,9 @@ public class AndroidDeviceUtils {
throws ApplicationManagementException {
// Parsing json string to get applications list.
if (operation.getOperationResponse() != null) {
if (operation.getOperationResponse().equals("SAME_APPLICATION_LIST")) {
return;
}
JsonElement jsonElement = new JsonParser().parse(operation.getOperationResponse());
JsonArray jsonArray = jsonElement.getAsJsonArray();
Application app;
@ -323,9 +326,17 @@ public class AndroidDeviceUtils {
deviceInfo.getDeviceDetailsMap().put("IOW", getProperty(prop.getValue(), "IOW"));
deviceInfo.getDeviceDetailsMap().put("IRQ", getProperty(prop.getValue(), "IRQ"));
} else if (prop.getName().equalsIgnoreCase("RAM_INFO")) {
if (!getProperty(prop.getValue(), "TOTAL_MEMORY").isEmpty()) {
deviceInfo.setTotalRAMMemory(Double.parseDouble(getProperty(prop.getValue(), "TOTAL_MEMORY")));
} else {
deviceInfo.setTotalRAMMemory(-1D);
}
if (!getProperty(prop.getValue(), "AVAILABLE_MEMORY").isEmpty()) {
deviceInfo.setAvailableRAMMemory(Double.parseDouble(
getProperty(prop.getValue(), "AVAILABLE_MEMORY")));
} else {
deviceInfo.setAvailableRAMMemory(-1D);
}
deviceInfo.getDeviceDetailsMap().put("ramThreshold", getProperty(prop.getValue(), "THRESHOLD"));
deviceInfo.getDeviceDetailsMap().put("ramLowMemory", getProperty(prop.getValue(), "LOW_MEMORY"));
} else if (prop.getName().equalsIgnoreCase("BATTERY_INFO")) {
@ -352,16 +363,36 @@ public class AndroidDeviceUtils {
deviceInfo.getDeviceDetailsMap().put("wifiSignalStrength",
getProperty(prop.getValue(), "WIFI_SIGNAL_STRENGTH"));
} else if (prop.getName().equalsIgnoreCase("DEVICE_INFO")) {
if (!getProperty(prop.getValue(), "BATTERY_LEVEL").isEmpty()) {
deviceInfo.setBatteryLevel(Double.parseDouble(
getProperty(prop.getValue(), "BATTERY_LEVEL")));
} else {
deviceInfo.setBatteryLevel(-1D);
}
if (!getProperty(prop.getValue(), "INTERNAL_TOTAL_MEMORY").isEmpty()) {
deviceInfo.setInternalTotalMemory(Double.parseDouble(
getProperty(prop.getValue(), "INTERNAL_TOTAL_MEMORY")));
} else {
deviceInfo.setInternalTotalMemory(-1D);
}
if (!getProperty(prop.getValue(), "INTERNAL_AVAILABLE_MEMORY").isEmpty()) {
deviceInfo.setInternalAvailableMemory(Double.parseDouble(
getProperty(prop.getValue(), "INTERNAL_AVAILABLE_MEMORY")));
} else {
deviceInfo.setInternalAvailableMemory(-1D);
}
if (!getProperty(prop.getValue(), "EXTERNAL_TOTAL_MEMORY").isEmpty()) {
deviceInfo.setExternalTotalMemory(Double.parseDouble(
getProperty(prop.getValue(), "EXTERNAL_TOTAL_MEMORY")));
} else {
deviceInfo.setExternalTotalMemory(-1D);
}
if (!getProperty(prop.getValue(), "EXTERNAL_AVAILABLE_MEMORY").isEmpty()) {
deviceInfo.setExternalAvailableMemory(Double.parseDouble(
getProperty(prop.getValue(), "EXTERNAL_AVAILABLE_MEMORY")));
} else {
deviceInfo.setExternalAvailableMemory(-1D);
}
deviceInfo.getDeviceDetailsMap().put("encryptionEnabled",
getProperty(prop.getValue(), "ENCRYPTION_ENABLED"));

@ -223,6 +223,9 @@ public class AndroidDeviceUtils {
throws ApplicationManagementException {
// Parsing json string to get applications list.
if (operation.getOperationResponse() != null) {
if (operation.getOperationResponse().equals("SAME_APPLICATION_LIST")) {
return;
}
JsonElement jsonElement = new JsonParser().parse(operation.getOperationResponse());
JsonArray jsonArray = jsonElement.getAsJsonArray();
Application app;
@ -294,9 +297,17 @@ public class AndroidDeviceUtils {
deviceInfo.getDeviceDetailsMap().put("IOW", getProperty(prop.getValue(), "IOW"));
deviceInfo.getDeviceDetailsMap().put("IRQ", getProperty(prop.getValue(), "IRQ"));
} else if (prop.getName().equalsIgnoreCase("RAM_INFO")) {
if (!getProperty(prop.getValue(), "TOTAL_MEMORY").isEmpty()) {
deviceInfo.setTotalRAMMemory(Double.parseDouble(getProperty(prop.getValue(), "TOTAL_MEMORY")));
} else {
deviceInfo.setTotalRAMMemory(-1D);
}
if (!getProperty(prop.getValue(), "AVAILABLE_MEMORY").isEmpty()) {
deviceInfo.setAvailableRAMMemory(Double.parseDouble(
getProperty(prop.getValue(), "AVAILABLE_MEMORY")));
} else {
deviceInfo.setAvailableRAMMemory(-1D);
}
deviceInfo.getDeviceDetailsMap().put("ramThreshold", getProperty(prop.getValue(), "THRESHOLD"));
deviceInfo.getDeviceDetailsMap().put("ramLowMemory", getProperty(prop.getValue(), "LOW_MEMORY"));
} else if (prop.getName().equalsIgnoreCase("BATTERY_INFO")) {
@ -323,17 +334,36 @@ public class AndroidDeviceUtils {
deviceInfo.getDeviceDetailsMap().put("wifiSignalStrength",
getProperty(prop.getValue(), "WIFI_SIGNAL_STRENGTH"));
} else if (prop.getName().equalsIgnoreCase("DEVICE_INFO")) {
if (!getProperty(prop.getValue(), "BATTERY_LEVEL").isEmpty()) {
deviceInfo.setBatteryLevel(Double.parseDouble(
getProperty(prop.getValue(), "BATTERY_LEVEL")));
} else {
deviceInfo.setBatteryLevel(-1D);
}
if (!getProperty(prop.getValue(), "INTERNAL_TOTAL_MEMORY").isEmpty()) {
deviceInfo.setInternalTotalMemory(Double.parseDouble(
getProperty(prop.getValue(), "INTERNAL_TOTAL_MEMORY")));
} else {
deviceInfo.setInternalTotalMemory(-1D);
}
if (!getProperty(prop.getValue(), "INTERNAL_AVAILABLE_MEMORY").isEmpty()) {
deviceInfo.setInternalAvailableMemory(Double.parseDouble(
getProperty(prop.getValue(), "INTERNAL_AVAILABLE_MEMORY")));
} else {
deviceInfo.setInternalAvailableMemory(-1D);
}
if (!getProperty(prop.getValue(), "EXTERNAL_TOTAL_MEMORY").isEmpty()) {
deviceInfo.setExternalTotalMemory(Double.parseDouble(
getProperty(prop.getValue(), "EXTERNAL_TOTAL_MEMORY")));
} else {
deviceInfo.setExternalTotalMemory(-1D);
}
if (!getProperty(prop.getValue(), "EXTERNAL_AVAILABLE_MEMORY").isEmpty()) {
deviceInfo.setExternalAvailableMemory(Double.parseDouble(
getProperty(prop.getValue(), "EXTERNAL_AVAILABLE_MEMORY")));
} else {
deviceInfo.setExternalAvailableMemory(-1D);
}
deviceInfo.getDeviceDetailsMap().put("encryptionEnabled",
getProperty(prop.getValue(), "ENCRYPTION_ENABLED"));
deviceInfo.getDeviceDetailsMap().put("passcodeEnabled",

Loading…
Cancel
Save