@ -45,12 +45,6 @@ public class DeviceManagementRepository {
public void removeDeviceManagementProvider(DeviceMgtService provider) throws DeviceManagementException {
String deviceType = provider.getProviderType();
try {
DeviceManagerUtil.unregisterDeviceType(deviceType);
} catch (DeviceManagementException e) {
throw new DeviceManagementException("Error occurred while removing device management provider '" +
deviceType + "'", e);
}
providers.remove(deviceType);
@ -142,7 +142,7 @@ public final class DeviceManagerUtil {
DeviceTypeDAO deviceTypeDAO = DeviceManagementDAOFactory.getDeviceTypeDAO();
DeviceType deviceType = deviceTypeDAO.getDeviceType(typeName);
if (deviceType == null) {
if (deviceType != null) {
DeviceType dt = new DeviceType();
dt.setName(typeName);
deviceTypeDAO.removeDeviceType(typeName);