fixed default license issue

This commit is contained in:
hasuniea 2015-12-04 11:02:40 +05:30
parent cd759d9c12
commit 75d35dadca
2 changed files with 294 additions and 290 deletions

View File

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

View File

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