Merge branch 'hasuniea-master'

revert-dabc3590
harshanl 9 years ago
commit eac2ea7c1c

@ -23,5 +23,7 @@ public class MobilePluginConstants {
public static final String MEDIA_TYPE_XML = "application/xml"; public static final String MEDIA_TYPE_XML = "application/xml";
public static final String CHARSET_UTF8 = "UTF8"; public static final String CHARSET_UTF8 = "UTF8";
public static final String LANGUAGE_CODE_ENGLISH_US = "en_US";
public static final String LANGUAGE_CODE_ENGLISH_UK = "en_UK";
} }

@ -57,11 +57,14 @@ public class AndroidDeviceManager implements DeviceManager {
public AndroidDeviceManager() { public AndroidDeviceManager() {
this.daoFactory = new AndroidDAOFactory(); this.daoFactory = new AndroidDAOFactory();
this.licenseManager = new RegistryBasedLicenseManager(); this.licenseManager = new RegistryBasedLicenseManager();
License defaultLicense;
License defaultLicense = AndroidPluginUtils.getDefaultLicense();
try { try {
licenseManager if (licenseManager.getLicense(AndroidDeviceManagementService.DEVICE_TYPE_ANDROID,
.addLicense(AndroidDeviceManagementService.DEVICE_TYPE_ANDROID, defaultLicense); MobilePluginConstants.LANGUAGE_CODE_ENGLISH_US) == null) {
defaultLicense = AndroidPluginUtils.getDefaultLicense();
licenseManager.addLicense(AndroidDeviceManagementService.DEVICE_TYPE_ANDROID, defaultLicense);
}
featureManager.addSupportedFeaturesToDB(); featureManager.addSupportedFeaturesToDB();
} catch (LicenseManagementException e) { } catch (LicenseManagementException e) {
log.error("Error occurred while adding default license for Android devices", e); log.error("Error occurred while adding default license for Android devices", e);
@ -117,7 +120,7 @@ public class AndroidDeviceManager implements DeviceManager {
MobileDeviceManagementUtil.getPlatformConfigPath(DeviceManagementConstants. MobileDeviceManagementUtil.getPlatformConfigPath(DeviceManagementConstants.
MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
resource = MobileDeviceManagementUtil.getRegistryResource(androidRegPath); resource = MobileDeviceManagementUtil.getRegistryResource(androidRegPath);
if(resource != null){ if (resource != null) {
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class); JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class);
Unmarshaller unmarshaller = context.createUnmarshaller(); Unmarshaller unmarshaller = context.createUnmarshaller();
return (TenantConfiguration) unmarshaller.unmarshal( return (TenantConfiguration) unmarshaller.unmarshal(

@ -61,7 +61,10 @@ public class WindowsDeviceManager implements DeviceManager {
License defaultLicense = WindowsPluginUtils.getDefaultLicense(); License defaultLicense = WindowsPluginUtils.getDefaultLicense();
try { try {
if (licenseManager.getLicense(WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS,
MobilePluginConstants.LANGUAGE_CODE_ENGLISH_US) == null) {
licenseManager.addLicense(WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS, defaultLicense); licenseManager.addLicense(WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS, defaultLicense);
}
featureManager.addSupportedFeaturesToDB(); featureManager.addSupportedFeaturesToDB();
} catch (LicenseManagementException e) { } catch (LicenseManagementException e) {
log.error("Error occurred while adding default license for Windows devices", e); log.error("Error occurred while adding default license for Windows devices", e);
@ -118,7 +121,7 @@ public class WindowsDeviceManager implements DeviceManager {
MobileDeviceManagementUtil.getPlatformConfigPath(DeviceManagementConstants. MobileDeviceManagementUtil.getPlatformConfigPath(DeviceManagementConstants.
MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
resource = MobileDeviceManagementUtil.getRegistryResource(windowsTenantRegistryPath); resource = MobileDeviceManagementUtil.getRegistryResource(windowsTenantRegistryPath);
if(resource != null){ if (resource != null) {
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class); JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class);
Unmarshaller unmarshaller = context.createUnmarshaller(); Unmarshaller unmarshaller = context.createUnmarshaller();
return (TenantConfiguration) unmarshaller.unmarshal( return (TenantConfiguration) unmarshaller.unmarshal(

Loading…
Cancel
Save