Merge branch 'kernel-4.6.x' into 'kernel-4.6.x'

Sync with master

See merge request entgra/carbon-device-mgt!807
kernel-4.6.x
Pahansith Gunathilake 3 years ago
commit 9daa745001

@ -32,7 +32,7 @@ public class EnrolmentInfo implements Serializable {
public enum Status {
CREATED, ACTIVE, INACTIVE, UNREACHABLE, UNCLAIMED, SUSPENDED, BLOCKED, REMOVED, DISENROLLMENT_REQUESTED,
CONFIGURED, READY_TO_CONNECT, RETURN_PENDING, RETURNED, DEFECTIVE, WARRANTY_PENDING, WARRANTY_SENT,
WARRANTY_REPLACED
WARRANTY_REPLACED, ASSIGNED
}
public enum OwnerShip {

@ -73,10 +73,10 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
String sql = "SELECT ID, DESCRIPTION, GROUP_NAME, OWNER, STATUS, PARENT_PATH FROM DM_GROUP "
+ "WHERE TENANT_ID = ?";
if (StringUtils.isNotBlank(request.getGroupName())) {
sql += " AND UPPER(GROUP_NAME) LIKE ?";
sql += " AND GROUP_NAME LIKE ?";
}
if (StringUtils.isNotBlank(request.getOwner())) {
sql += " AND UPPER(OWNER) LIKE ?";
sql += " AND OWNER LIKE ?";
}
if (StringUtils.isNotBlank(request.getStatus())) {
sql += " AND STATUS = ?";

@ -68,7 +68,9 @@ public class MDMAndroidOperationUtil {
WebApplication webApplication = new WebApplication();
webApplication.setUrl(application.getLocation());
webApplication.setName(application.getName());
webApplication.setType(application.getType().toString());
// webApplication.setType(application.getType().toString());
// Hard-corded "type" to "webapp". Some agent versions accept only "webapp" as the type.
webApplication.setType("webapp");
webApplication.setProperties(application.getProperties());
operation.setPayLoad(webApplication.toJSON());
break;
@ -111,7 +113,9 @@ public class MDMAndroidOperationUtil {
WebApplication webApplication = new WebApplication();
webApplication.setUrl(application.getLocation());
webApplication.setName(application.getName());
webApplication.setType(application.getType().toString());
// webApplication.setType(application.getType().toString());
// Hard-corded "type" to "webapp". Some agent versions accept only "webapp" as the type.
webApplication.setType("webapp");
operation.setPayLoad(webApplication.toJSON());
break;
default:

@ -489,13 +489,14 @@ public class DeviceTypeManager implements DeviceManager {
throws DeviceManagementException {
boolean status = false;
if (propertiesExist) {
Device updatedDevice = new Device();
updatedDevice.setDeviceIdentifier(deviceId.getId());
updatedDevice.setProperties(propertyList);
try {
if (log.isDebugEnabled()) {
log.debug("Getting the details of " + deviceType + " device : '" + deviceId.getId() + "'");
log.debug("Updating device properties of " + deviceType + " device : '"
+ deviceId.getId() + "'");
}
Device updatedDevice = new Device();
updatedDevice.setDeviceIdentifier(deviceId.getId());
updatedDevice.setProperties(propertyList);
deviceTypePluginDAOManager.getDeviceTypeDAOHandler().beginTransaction();
status = deviceTypePluginDAOManager.getDeviceDAO().updateDevice(updatedDevice);
deviceTypePluginDAOManager.getDeviceTypeDAOHandler().commitTransaction();
@ -506,6 +507,24 @@ public class DeviceTypeManager implements DeviceManager {
} finally {
deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection();
}
if (propertyBasedDeviceTypePluginDAOManager != null && status) {
try {
if (log.isDebugEnabled()) {
log.debug("Updating device properties of " + deviceType + " device : '"
+ deviceId.getId() + "'");
}
propertyBasedDeviceTypePluginDAOManager.getDeviceTypeDAOHandler().beginTransaction();
status = propertyBasedDeviceTypePluginDAOManager.getDeviceDAO().updateDevice(updatedDevice);
propertyBasedDeviceTypePluginDAOManager.getDeviceTypeDAOHandler().commitTransaction();
} catch (DeviceTypeMgtPluginException e) {
propertyBasedDeviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction();
String msg = "Error while updating properties for " + deviceType + " device : " +
deviceId.getId();
throw new DeviceManagementException(msg, e);
} finally {
propertyBasedDeviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection();
}
}
}
return status;
}

@ -183,6 +183,7 @@
<Scope>perm:metadata:update</Scope>
<Scope>perm:android:google-account</Scope>
<Scope>perm:android:update-default-sim</Scope>
<Scope>perm:android:info</Scope>
</Scopes>
<SSOConfiguration>
<Issuer>device-mgt</Issuer>

Loading…
Cancel
Save