From 1aee8edace98aff7120cd0ad20fa3d4a9fa0f523 Mon Sep 17 00:00:00 2001 From: harshanl Date: Wed, 28 Oct 2015 22:39:31 +0530 Subject: [PATCH] updated android featuremgr --- .../mgt/mobile/impl/android/AndroidFeatureManager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidFeatureManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidFeatureManager.java index 31e980f9d5..ada8eb7d32 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidFeatureManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidFeatureManager.java @@ -65,7 +65,7 @@ public class AndroidFeatureManager implements FeatureManager { @Override public boolean addFeatures(List features) throws DeviceManagementException { List mobileFeatures = new ArrayList(); - for (Feature feature:features) { + for (Feature feature : features) { mobileFeatures.add(MobileDeviceManagementUtil.convertToMobileFeature(feature)); } try { @@ -134,8 +134,11 @@ public class AndroidFeatureManager implements FeatureManager { List supportedFeatures = getSupportedFeatures(); List existingFeatures = this.getFeatures(); List missingFeatures = MobileDeviceManagementUtil. - getMissingFeatures(supportedFeatures, existingFeatures); - return this.addFeatures(missingFeatures); + getMissingFeatures(supportedFeatures, existingFeatures); + if (missingFeatures.size() > 0) { + return this.addFeatures(missingFeatures); + } + return true; } }