|
|
@ -297,17 +297,17 @@ public class AndroidDeviceManager implements DeviceManager {
|
|
|
|
public boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device)
|
|
|
|
public boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device)
|
|
|
|
throws DeviceManagementException {
|
|
|
|
throws DeviceManagementException {
|
|
|
|
boolean status;
|
|
|
|
boolean status;
|
|
|
|
Device deviceDB = this.getDevice(deviceIdentifier);
|
|
|
|
Device existingDevice = this.getDevice(deviceIdentifier);
|
|
|
|
// This object holds the current persisted device object
|
|
|
|
// This object holds the current persisted device object
|
|
|
|
MobileDevice mobileDeviceDB = MobileDeviceManagementUtil.convertToMobileDevice(deviceDB);
|
|
|
|
MobileDevice existingMobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(existingDevice);
|
|
|
|
|
|
|
|
|
|
|
|
// This object holds the newly received device object from response
|
|
|
|
// This object holds the newly received device object from response
|
|
|
|
MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device);
|
|
|
|
MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device);
|
|
|
|
|
|
|
|
|
|
|
|
// Updating current object features using newer ones
|
|
|
|
// Updating current object features using newer ones
|
|
|
|
mobileDeviceDB.setLatitude(mobileDevice.getLatitude());
|
|
|
|
existingMobileDevice.setLatitude(mobileDevice.getLatitude());
|
|
|
|
mobileDeviceDB.setLongitude(mobileDevice.getLongitude());
|
|
|
|
existingMobileDevice.setLongitude(mobileDevice.getLongitude());
|
|
|
|
mobileDeviceDB.setDeviceProperties(mobileDevice.getDeviceProperties());
|
|
|
|
existingMobileDevice.setDeviceProperties(mobileDevice.getDeviceProperties());
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
@ -316,7 +316,7 @@ public class AndroidDeviceManager implements DeviceManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
AndroidDAOFactory.beginTransaction();
|
|
|
|
AndroidDAOFactory.beginTransaction();
|
|
|
|
status = mobileDeviceManagementDAOFactory.getMobileDeviceDAO()
|
|
|
|
status = mobileDeviceManagementDAOFactory.getMobileDeviceDAO()
|
|
|
|
.updateMobileDevice(mobileDeviceDB);
|
|
|
|
.updateMobileDevice(existingMobileDevice);
|
|
|
|
AndroidDAOFactory.commitTransaction();
|
|
|
|
AndroidDAOFactory.commitTransaction();
|
|
|
|
} catch (MobileDeviceManagementDAOException e) {
|
|
|
|
} catch (MobileDeviceManagementDAOException e) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|