From fc7d86801f619d9eb5f709e43efb2156054bcd86 Mon Sep 17 00:00:00 2001 From: Hasunie Date: Thu, 15 Dec 2016 14:34:15 +0530 Subject: [PATCH] fixing windows8.1 Device name issue --- .../api/services/syncml/impl/SyncmlServiceImpl.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/syncml/impl/SyncmlServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/syncml/impl/SyncmlServiceImpl.java index f74fa8a52c..4810ffbed2 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/syncml/impl/SyncmlServiceImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/syncml/impl/SyncmlServiceImpl.java @@ -287,7 +287,6 @@ public class SyncmlServiceImpl implements SyncmlService { vendor = itemList.get(PluginConstants.SyncML.VENDOR_POSITION).getData(); devMod = itemList.get(PluginConstants.SyncML.MODEL_POSITION).getData(); macAddress = itemList.get(PluginConstants.SyncML.MAC_ADDRESS_POSITION).getData(); - resolution = itemList.get(PluginConstants.SyncML.RESOLUTION_POSITION).getData(); deviceName = itemList.get(PluginConstants.SyncML.DEVICE_NAME_POSITION).getData(); DeviceIdentifier deviceIdentifier = convertToDeviceIdentifierObject(syncmlDocument. getHeader().getSource().getLocURI()); @@ -320,11 +319,6 @@ public class SyncmlServiceImpl implements SyncmlService { macAddressProperty.setValue(macAddress); existingProperties.add(macAddressProperty); - Device.Property deviceNameProperty = new Device.Property(); - deviceNameProperty.setName(PluginConstants.SyncML.DEVICE_NAME); - deviceNameProperty.setValue(deviceName); - existingProperties.add(deviceNameProperty); - Device.Property deviceModelProperty = new Device.Property(); deviceModelProperty.setName(PluginConstants.SyncML.MODEL); deviceModelProperty.setValue(devMod); @@ -334,6 +328,7 @@ public class SyncmlServiceImpl implements SyncmlService { existingDevice.setDeviceIdentifier(syncmlDocument.getHeader().getSource().getLocURI()); existingDevice.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); status = WindowsAPIUtils.getDeviceManagementService().modifyEnrollment(existingDevice); + existingDevice.setName(deviceName); // call effective policy for the enrolling device. PolicyManagerService policyManagerService = WindowsAPIUtils.getPolicyManagerService(); policyManagerService.getEffectivePolicy(deviceIdentifier);