From 6f42f1fdf82b8839971d5f463a29f673ed28030a Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Sat, 26 Oct 2019 09:06:55 +0530 Subject: [PATCH] Add new app attribute to identify android enterprise app --- .../application/mgt/common/response/Application.java | 10 ++++++++++ .../device/application/mgt/core/util/APIUtil.java | 4 ++++ 2 files changed, 14 insertions(+) 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)); }