Fixed incorrect location coordinate issue (EMM-1313)

revert-dabc3590
mharindu 9 years ago
parent 2548a1dd18
commit 918302475b

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

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

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

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

Loading…
Cancel
Save