From ade78959011ca628324fa351de2fb31e8602935a Mon Sep 17 00:00:00 2001
From: mharindu <milanharindu.ucsc@gmail.com>
Date: Mon, 21 Sep 2015 16:26:10 +0530
Subject: [PATCH 1/6] Added data type check in android policy compliance

---
 .../impl/android/AndroidPolicyMonitoringService.java       | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidPolicyMonitoringService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidPolicyMonitoringService.java
index 3c58c0c6e2..0300dea48c 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidPolicyMonitoringService.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidPolicyMonitoringService.java
@@ -59,7 +59,12 @@ public class AndroidPolicyMonitoringService implements PolicyMonitoringService {
         List<ComplianceFeature> complianceFeatures = new ArrayList<ComplianceFeature>();
 
         // Parsing json string to get compliance features.
-        JsonElement jsonElement = new JsonParser().parse((String) compliancePayload);
+        JsonElement jsonElement;
+        if (compliancePayload instanceof String) {
+            jsonElement = new JsonParser().parse((String) compliancePayload);
+        } else {
+            throw new PolicyComplianceException("Invalid policy compliance payload");
+        }
         JsonArray jsonArray = jsonElement.getAsJsonArray();
         Gson gson = new Gson();
         ComplianceFeature complianceFeature;

From 571b4deb4e32b37703b7d40f3940887bc02709a3 Mon Sep 17 00:00:00 2001
From: mharindu <milanharindu.ucsc@gmail.com>
Date: Mon, 21 Sep 2015 16:37:14 +0530
Subject: [PATCH 2/6] Refactored android policy compliance

---
 .../mobile/impl/android/AndroidPolicyMonitoringService.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 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/AndroidPolicyMonitoringService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidPolicyMonitoringService.java
index 0300dea48c..49ff0ab17d 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidPolicyMonitoringService.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidPolicyMonitoringService.java
@@ -69,8 +69,8 @@ public class AndroidPolicyMonitoringService implements PolicyMonitoringService {
         Gson gson = new Gson();
         ComplianceFeature complianceFeature;
 
-        for (int i = 0; i < jsonArray.size(); i++) {
-            complianceFeature = gson.fromJson(jsonArray.get(i), ComplianceFeature.class);
+        for (JsonElement element : jsonArray) {
+            complianceFeature = gson.fromJson(element, ComplianceFeature.class);
             complianceFeatures.add(complianceFeature);
         }
 

From d6ce49e289b1704a07781b73193dcd8d72ef0fd2 Mon Sep 17 00:00:00 2001
From: prabathabey <prabathabey@git.com>
Date: Mon, 5 Oct 2015 20:35:07 +0530
Subject: [PATCH 3/6] Bumping the versions of all dependent component versions
 to their respective latests

---
 pom.xml | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 34409e1cdf..271440476d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -522,7 +522,7 @@
     <properties>
 
         <!--Carbon kernel versions-->
-        <carbon.kernel.version>4.4.0</carbon.kernel.version>
+        <carbon.kernel.version>4.4.1</carbon.kernel.version>
         <carbon.kernel.version.range>[4.4.0, 4.5.0)</carbon.kernel.version.range>
 
         <carbon.p2.plugin.version>1.5.4</carbon.p2.plugin.version>
@@ -553,22 +553,22 @@
         <javax.ws.rs.version>1.1.1</javax.ws.rs.version>
 
         <!-- Carbon Commons -->
-        <carbon.commons.version>4.4.1</carbon.commons.version>
+        <carbon.commons.version>4.4.7</carbon.commons.version>
 
         <!-- Carbon Deployment -->
         <carbon.deployment.version>4.4.0</carbon.deployment.version>
 
         <!-- Identity -->
-        <carbon.identity.version>4.4.0</carbon.identity.version>
+        <carbon.identity.version>4.6.0</carbon.identity.version>
 
         <!-- Multi-tenancy -->
-        <carbon.multitenancy.version>4.4.0</carbon.multitenancy.version>
+        <carbon.multitenancy.version>4.4.1</carbon.multitenancy.version>
 
         <!-- Registry -->
-        <carbon.registry.version>4.4.1</carbon.registry.version>
+        <carbon.registry.version>4.4.8</carbon.registry.version>
 
         <!-- Governance -->
-        <carbon.governance.version>4.4.1</carbon.governance.version>
+        <carbon.governance.version>4.5.8</carbon.governance.version>
 
         <!-- Device Management -->
         <carbon.device.mgt.version>0.9.2-SNAPSHOT</carbon.device.mgt.version>

From b1d4050188ee50624a92427971574eccf32ba15f Mon Sep 17 00:00:00 2001
From: prabathabey <prabathabey@git.com>
Date: Tue, 6 Oct 2015 20:28:36 +0530
Subject: [PATCH 4/6] Upgrading carbon-multitenancy/carbon-identity versions

---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 271440476d..d5b2dd6c64 100644
--- a/pom.xml
+++ b/pom.xml
@@ -559,10 +559,10 @@
         <carbon.deployment.version>4.4.0</carbon.deployment.version>
 
         <!-- Identity -->
-        <carbon.identity.version>4.6.0</carbon.identity.version>
+        <carbon.identity.version>4.6.0-m2</carbon.identity.version>
 
         <!-- Multi-tenancy -->
-        <carbon.multitenancy.version>4.4.1</carbon.multitenancy.version>
+        <carbon.multitenancy.version>4.5.0-m1</carbon.multitenancy.version>
 
         <!-- Registry -->
         <carbon.registry.version>4.4.8</carbon.registry.version>

From 4ddc7e2a5d5497fa592b31d8a034ff30cd1f4a46 Mon Sep 17 00:00:00 2001
From: harshanl <harshan@wso2.com>
Date: Wed, 7 Oct 2015 16:59:26 +0530
Subject: [PATCH 5/6] updated cxfversion'

---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index d5b2dd6c64..03f61fdd7a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -548,7 +548,7 @@
         <orbit.tomcat.jdbc.pooling.version>7.0.34.wso2v2</orbit.tomcat.jdbc.pooling.version>
 
         <!-- CXF version -->
-        <cxf.version>2.6.1</cxf.version>
+        <cxf.version>2.7.16</cxf.version>
         <jackson.version>1.9.0</jackson.version>
         <javax.ws.rs.version>1.1.1</javax.ws.rs.version>
 

From d0e3a03c83e10a05b81645f5726f02073116a0fd Mon Sep 17 00:00:00 2001
From: prabathabey <prabathabey@git.com>
Date: Wed, 7 Oct 2015 17:03:41 +0530
Subject: [PATCH 6/6] Upgrading cxf version in dependencies

---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index d5b2dd6c64..03f61fdd7a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -548,7 +548,7 @@
         <orbit.tomcat.jdbc.pooling.version>7.0.34.wso2v2</orbit.tomcat.jdbc.pooling.version>
 
         <!-- CXF version -->
-        <cxf.version>2.6.1</cxf.version>
+        <cxf.version>2.7.16</cxf.version>
         <jackson.version>1.9.0</jackson.version>
         <javax.ws.rs.version>1.1.1</javax.ws.rs.version>