diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Application.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Application.java index 3a828c74931..7f1c0200e48 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Application.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Application.java @@ -48,6 +48,12 @@ public class Application { example = "ENTERPRISE, PUBLIC, WEB, WEB_CLIP etc") private String type; + @ApiModelProperty(name = "isAndroidEnterpriseApp", + value = "Android enterprise app or not", + required = true, + example = "true or false") + private boolean isAndroidEnterpriseApp; + @ApiModelProperty(name = "subMethod", value = "Subscription type of the application", required = true, @@ -149,4 +155,8 @@ public class Application { public double getRating() { return rating; } public void setRating(double rating) { this.rating = rating; } + + public boolean isAndroidEnterpriseApp() { return isAndroidEnterpriseApp; } + + public void setAndroidEnterpriseApp(boolean androidEnterpriseApp) { isAndroidEnterpriseApp = androidEnterpriseApp; } } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java index cd36c309843..55a4f639091 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java @@ -352,6 +352,10 @@ public class APIUtil { application.setUnrestrictedRoles(applicationDTO.getUnrestrictedRoles()); application.setRating(applicationDTO.getAppRating()); List applicationReleases = new ArrayList<>(); + if (ApplicationType.PUBLIC.toString().equals(applicationDTO.getType()) && application.getCategories() + .contains("GooglePlaySyncedApp")) { + application.setAndroidEnterpriseApp(true); + } for (ApplicationReleaseDTO applicationReleaseDTO : applicationDTO.getApplicationReleaseDTOs()) { applicationReleases.add(releaseDtoToRelease(applicationReleaseDTO)); }