|
|
|
@ -101,13 +101,13 @@ public class AndroidDeviceManager implements DeviceManager {
|
|
|
|
|
status = true;
|
|
|
|
|
} catch (MobileDeviceMgtPluginException e) {
|
|
|
|
|
throw new DeviceManagementException(
|
|
|
|
|
"Error occurred while retrieving the Registry instance : ", e);
|
|
|
|
|
"Error occurred while retrieving the Registry instance", e);
|
|
|
|
|
} catch (RegistryException e) {
|
|
|
|
|
throw new DeviceManagementException(
|
|
|
|
|
"Error occurred while persisting the Registry resource of Android Configuration : ", e);
|
|
|
|
|
"Error occurred while persisting the Registry resource of Android Configuration", e);
|
|
|
|
|
} catch (JAXBException e) {
|
|
|
|
|
throw new DeviceManagementException(
|
|
|
|
|
"Error occurred while parsing the Android configuration : ", e);
|
|
|
|
|
"Error occurred while parsing the Android configuration", e);
|
|
|
|
|
}
|
|
|
|
|
return status;
|
|
|
|
|
}
|
|
|
|
@ -130,13 +130,13 @@ public class AndroidDeviceManager implements DeviceManager {
|
|
|
|
|
return null;
|
|
|
|
|
} catch (MobileDeviceMgtPluginException e) {
|
|
|
|
|
throw new DeviceManagementException(
|
|
|
|
|
"Error occurred while retrieving the Registry instance : ", e);
|
|
|
|
|
"Error occurred while retrieving the Registry instance", e);
|
|
|
|
|
} catch (JAXBException e) {
|
|
|
|
|
throw new DeviceManagementException(
|
|
|
|
|
"Error occurred while parsing the Android configuration : ", e);
|
|
|
|
|
"Error occurred while parsing the Android configuration", e);
|
|
|
|
|
} catch (RegistryException e) {
|
|
|
|
|
throw new DeviceManagementException(
|
|
|
|
|
"Error occurred while retrieving the Registry resource of Android Configuration : ", e);
|
|
|
|
|
"Error occurred while retrieving the Registry resource of Android Configuration", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -161,12 +161,10 @@ public class AndroidDeviceManager implements DeviceManager {
|
|
|
|
|
try {
|
|
|
|
|
AndroidDAOFactory.rollbackTransaction();
|
|
|
|
|
} catch (MobileDeviceManagementDAOException mobileDAOEx) {
|
|
|
|
|
String msg = "Error occurred while roll back the device enrol transaction :" +
|
|
|
|
|
device.toString();
|
|
|
|
|
String msg = "Error occurred while roll back the device enrol transaction :" + device.toString();
|
|
|
|
|
log.warn(msg, mobileDAOEx);
|
|
|
|
|
}
|
|
|
|
|
String msg =
|
|
|
|
|
"Error while enrolling the Android device : " + device.getDeviceIdentifier();
|
|
|
|
|
String msg = "Error occurred while enrolling the Android device : " + device.getDeviceIdentifier();
|
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|
|
}
|
|
|
|
|
return status;
|
|
|
|
@ -187,11 +185,10 @@ public class AndroidDeviceManager implements DeviceManager {
|
|
|
|
|
try {
|
|
|
|
|
AndroidDAOFactory.rollbackTransaction();
|
|
|
|
|
} catch (MobileDeviceManagementDAOException mobileDAOEx) {
|
|
|
|
|
String msg = "Error occurred while roll back the update device transaction :" +
|
|
|
|
|
device.toString();
|
|
|
|
|
String msg = "Error occurred while roll back the update device transaction :" + device.toString();
|
|
|
|
|
log.warn(msg, mobileDAOEx);
|
|
|
|
|
}
|
|
|
|
|
String msg = "Error while updating the enrollment of the Android device : " +
|
|
|
|
|
String msg = "Error occurred while updating the enrollment of the Android device : " +
|
|
|
|
|
device.getDeviceIdentifier();
|
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|
|
}
|
|
|
|
@ -217,8 +214,7 @@ public class AndroidDeviceManager implements DeviceManager {
|
|
|
|
|
isEnrolled = true;
|
|
|
|
|
}
|
|
|
|
|
} catch (MobileDeviceManagementDAOException e) {
|
|
|
|
|
String msg = "Error while checking the enrollment status of Android device : " +
|
|
|
|
|
deviceId.getId();
|
|
|
|
|
String msg = "Error occurred while checking the enrollment status of Android device : " + deviceId.getId();
|
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|
|
}
|
|
|
|
|
return isEnrolled;
|
|
|
|
@ -247,8 +243,7 @@ public class AndroidDeviceManager implements DeviceManager {
|
|
|
|
|
device = MobileDeviceManagementUtil.convertToDevice(mobileDevice);
|
|
|
|
|
} catch (MobileDeviceManagementDAOException e) {
|
|
|
|
|
throw new DeviceManagementException(
|
|
|
|
|
"Error occurred while fetching the Android device: '" +
|
|
|
|
|
deviceId.getId() + "'", e);
|
|
|
|
|
"Error occurred while fetching the Android device: '" + deviceId.getId() + "'", e);
|
|
|
|
|
}
|
|
|
|
|
return device;
|
|
|
|
|
}
|
|
|
|
@ -292,12 +287,9 @@ public class AndroidDeviceManager implements DeviceManager {
|
|
|
|
|
boolean status;
|
|
|
|
|
Device existingDevice = this.getDevice(deviceIdentifier);
|
|
|
|
|
// This object holds the current persisted device object
|
|
|
|
|
MobileDevice existingMobileDevice =
|
|
|
|
|
MobileDeviceManagementUtil.convertToMobileDevice(existingDevice);
|
|
|
|
|
|
|
|
|
|
MobileDevice existingMobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(existingDevice);
|
|
|
|
|
// This object holds the newly received device object from response
|
|
|
|
|
MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device);
|
|
|
|
|
|
|
|
|
|
// Updating current object features using newer ones
|
|
|
|
|
existingMobileDevice.setLatitude(mobileDevice.getLatitude());
|
|
|
|
|
existingMobileDevice.setLongitude(mobileDevice.getLongitude());
|
|
|
|
@ -319,8 +311,7 @@ public class AndroidDeviceManager implements DeviceManager {
|
|
|
|
|
device.toString() + "'", e1);
|
|
|
|
|
}
|
|
|
|
|
throw new DeviceManagementException(
|
|
|
|
|
"Error occurred while updating the Android device: '" +
|
|
|
|
|
device.getDeviceIdentifier() + "'", e);
|
|
|
|
|
"Error occurred while updating the Android device: '" + device.getDeviceIdentifier() + "'", e);
|
|
|
|
|
}
|
|
|
|
|
return status;
|
|
|
|
|
}
|
|
|
|
@ -341,8 +332,7 @@ public class AndroidDeviceManager implements DeviceManager {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (MobileDeviceManagementDAOException e) {
|
|
|
|
|
throw new DeviceManagementException("Error occurred while fetching all Android devices",
|
|
|
|
|
e);
|
|
|
|
|
throw new DeviceManagementException("Error occurred while fetching all Android devices", e);
|
|
|
|
|
}
|
|
|
|
|
return devices;
|
|
|
|
|
}
|
|
|
|
|