From 857f9057d328be60a2ed13e5c0ef669205486d90 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Fri, 7 Jun 2019 11:18:07 +0530 Subject: [PATCH] Modify setting app type --- .../application/mgt/core/impl/SubscriptionManagerImpl.java | 3 ++- .../device/mgt/core/util/MDMAndroidOperationUtil.java | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java index 8d0b07e0079..479d809d365 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java @@ -459,9 +459,10 @@ public class SubscriptionManagerImpl implements SubscriptionManager { //todo rethink and modify the {@link MobileApp} usage MobileApp mobileApp = new MobileApp(); + MobileAppTypes mobileAppType = MobileAppTypes.valueOf(application.getType()); if (DeviceTypes.ANDROID.toString().equalsIgnoreCase(deviceType)) { if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) { - mobileApp.setType(MobileAppTypes.ENTERPRISE); + mobileApp.setType(mobileAppType); mobileApp.setLocation(application.getApplicationReleases().get(0).getInstallerPath()); return MDMAndroidOperationUtil.createInstallAppOperation(mobileApp); } else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/MDMAndroidOperationUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/MDMAndroidOperationUtil.java index 2f73db6357d..cce871d0097 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/MDMAndroidOperationUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/MDMAndroidOperationUtil.java @@ -48,12 +48,9 @@ public class MDMAndroidOperationUtil { switch (application.getType()) { case ENTERPRISE: - EnterpriseApplication enterpriseApplication = - new EnterpriseApplication(); + EnterpriseApplication enterpriseApplication = new EnterpriseApplication(); enterpriseApplication.setType(application.getType().toString()); - //TODO: replace needs to be removed after doing the proper config update in application-mgt.xml - enterpriseApplication.setUrl(application.getLocation().replace("https://localhost:9443", - "http://192.168.8.6:9763")); + enterpriseApplication.setUrl(application.getLocation()); operation.setPayLoad(enterpriseApplication.toJSON()); break; case PUBLIC: