mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Fixed issue in location service
This commit is contained in:
parent
198b3c67dc
commit
c5d1eaa21b
@ -287,7 +287,10 @@ public class AndroidAPIUtils {
|
|||||||
} else if (AndroidConstants.OperationCodes.DEVICE_LOCATION.equals(operation.getCode())) {
|
} else if (AndroidConstants.OperationCodes.DEVICE_LOCATION.equals(operation.getCode())) {
|
||||||
try {
|
try {
|
||||||
DeviceLocation location = new Gson().fromJson(operation.getOperationResponse(), DeviceLocation.class);
|
DeviceLocation location = new Gson().fromJson(operation.getOperationResponse(), DeviceLocation.class);
|
||||||
if (location != null) {
|
// reason for checking "location.getLatitude() != null" because when device fails to provide
|
||||||
|
// device location and send status instead, above Gson converter create new location object
|
||||||
|
// with null attributes
|
||||||
|
if (location != null && location.getLatitude() != null) {
|
||||||
location.setDeviceIdentifier(deviceIdentifier);
|
location.setDeviceIdentifier(deviceIdentifier);
|
||||||
updateDeviceLocation(location);
|
updateDeviceLocation(location);
|
||||||
}
|
}
|
||||||
@ -295,7 +298,6 @@ public class AndroidAPIUtils {
|
|||||||
throw new OperationManagementException("Error occurred while updating the device location.", e);
|
throw new OperationManagementException("Error occurred while updating the device location.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getDeviceManagementService().updateOperation(deviceIdentifier, operation);
|
getDeviceManagementService().updateOperation(deviceIdentifier, operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user