Fixed incorrect location coordinate issue (EMM-1313)

merge-requests/1/head
mharindu 9 years ago
parent 2548a1dd18
commit 918302475b

@ -149,16 +149,18 @@ public class AndroidDeviceManager implements DeviceManager {
@Override
public boolean enrollDevice(Device device) throws DeviceManagementException {
boolean status = false;
MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device);
boolean isEnrolled = this.isEnrolled(
new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
try {
if (log.isDebugEnabled()) {
log.debug("Enrolling a new Android device : " + device.getDeviceIdentifier());
}
boolean isEnrolled = this.isEnrolled(
new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
if (isEnrolled) {
this.modifyEnrollment(device);
} else {
MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device);
AndroidDAOFactory.beginTransaction();
status = daoFactory.getMobileDeviceDAO().addMobileDevice(mobileDevice);
AndroidDAOFactory.commitTransaction();

@ -116,7 +116,7 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
stmt.setString(5, mobileDevice.getVendor());
stmt.setString(6, mobileDevice.getMobileDeviceId());
stmt.setString(7, properties.get(AndroidPluginConstants.DEVICE_NAME));
stmt.setString(8, mobileDevice.getLongitude());
stmt.setString(8, mobileDevice.getLatitude());
stmt.setString(9, mobileDevice.getLongitude());
stmt.setString(10, mobileDevice.getImei());
stmt.setString(11, mobileDevice.getImsi());

@ -143,16 +143,18 @@ public class AndroidDeviceManager implements DeviceManager {
@Override
public boolean enrollDevice(Device device) throws DeviceManagementException {
boolean status = false;
MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device);
boolean isEnrolled = this.isEnrolled(
new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
try {
if (log.isDebugEnabled()) {
log.debug("Enrolling a new Android device : " + device.getDeviceIdentifier());
}
boolean isEnrolled = this.isEnrolled(
new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()));
if (isEnrolled) {
this.modifyEnrollment(device);
} else {
MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device);
AndroidDAOFactory.beginTransaction();
status = daoFactory.getMobileDeviceDAO().addMobileDevice(mobileDevice);
AndroidDAOFactory.commitTransaction();

@ -116,7 +116,7 @@ public class AndroidDeviceDAOImpl implements MobileDeviceDAO{
stmt.setString(5, mobileDevice.getVendor());
stmt.setString(6, mobileDevice.getMobileDeviceId());
stmt.setString(7, properties.get(AndroidPluginConstants.DEVICE_NAME));
stmt.setString(8, mobileDevice.getLongitude());
stmt.setString(8, mobileDevice.getLatitude());
stmt.setString(9, mobileDevice.getLongitude());
stmt.setString(10, mobileDevice.getImei());
stmt.setString(11, mobileDevice.getImsi());

Loading…
Cancel
Save