From 7de234c1645e015e02cfc1174d0e7a22fa6bd9dc Mon Sep 17 00:00:00 2001 From: Hasunie Date: Thu, 16 Mar 2017 14:14:32 +0530 Subject: [PATCH] resolved #616 --- .../mdm/services/android/util/AndroidAPIUtils.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java index 39381f3cba..79a7e80d2d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java @@ -487,12 +487,16 @@ public class AndroidAPIUtils { for (JsonElement element : jsonArray) { // if (((JsonObject) element).entrySet().iterator().next().getValue().getAsString().equalsIgnoreCase(needed)); for (Map.Entry ob : ((JsonObject) element).entrySet()) { - if (exist) { - return ob.getValue().getAsString().replace("%", ""); - } JsonElement val = ob.getValue(); if (val != null && !val.isJsonNull() && ob.getValue().getAsString().equalsIgnoreCase(needed)) { - exist = true; + if (exist) { + { + return val.getAsString().replace("%", ""); + } + } + if (val.getAsString().equalsIgnoreCase(needed)) { + exist = true; + } } } }