diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java
index e2a35770c2..7d3c6afd90 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java
@@ -899,6 +899,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
") d1 " +
"WHERE d1.DEVICE_ID = e.DEVICE_ID " +
"AND d1.DEVICE_ID = ddi.DEVICE_ID " +
+ "AND d1.DEVICE_ID = ddd.DEVICE_ID " +
"AND ddi.KEY_FIELD = ? ";
if (dataSourceType.contains(DeviceManagementConstants.DataBaseTypes.DB_TYPE_H2)) {
sql += "AND CAST( ddi.VALUE_FIELD AS BIGINT ) < ? ";
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java
index 2ef6697453..db30811c58 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java
@@ -865,6 +865,7 @@ public class OracleDeviceDAOImpl extends AbstractDeviceDAOImpl {
") d1 " +
"WHERE d1.DEVICE_ID = e.DEVICE_ID " +
"AND d1.DEVICE_ID = ddi.DEVICE_ID " +
+ "AND d1.DEVICE_ID = ddd.DEVICE_ID " +
"AND ddi.KEY_FIELD = ? " +
"AND CAST( ddi.VALUE_FIELD AS BIGINT ) < ? " +
"ORDER BY ENROLMENT_ID " +
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/PostgreSQLDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/PostgreSQLDeviceDAOImpl.java
index fc137897bb..d4a6ba853e 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/PostgreSQLDeviceDAOImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/PostgreSQLDeviceDAOImpl.java
@@ -851,6 +851,7 @@ public class PostgreSQLDeviceDAOImpl extends AbstractDeviceDAOImpl {
") d1 " +
"WHERE d1.DEVICE_ID = e.DEVICE_ID " +
"AND d1.DEVICE_ID = ddi.DEVICE_ID " +
+ "AND d1.DEVICE_ID = ddd.DEVICE_ID " +
"AND ddi.KEY_FIELD = ? " +
"AND CAST( ddi.VALUE_FIELD AS BIGINT ) < ? " +
"LIMIT ? OFFSET ?";
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java
index ecda3ef66d..64e8912db3 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java
@@ -667,6 +667,7 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
") d1 " +
"WHERE d1.DEVICE_ID = e.DEVICE_ID " +
"AND d1.DEVICE_ID = ddi.DEVICE_ID " +
+ "AND d1.DEVICE_ID = ddd.DEVICE_ID " +
"AND ddi.KEY_FIELD = ? " +
"AND CAST( ddi.VALUE_FIELD AS BIGINT ) < ? " +
"LIMIT ? OFFSET ?";
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java
index aad18333e4..d5adc3538a 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java
@@ -3427,7 +3427,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
deviceLocation.setDistance(Double.parseDouble(distance));
deviceLocation.setSpeed(Float.parseFloat(speed));
deviceLocation.setBearing(Float.parseFloat(bearing));
- deviceInformationManager.addDeviceLocation(device, deviceLocation);
+ deviceInformationManager.addDeviceLocation(deviceLocation);
} catch (Exception e) {
//We are not failing the execution since this is not critical for the functionality. But logging as
// a warning for reference.
diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java
index a17e3dcb70..f35c0700ee 100644
--- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java
+++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java
@@ -27,6 +27,7 @@ import org.apache.http.Consts;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpRequestBase;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.entity.ContentType;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
@@ -53,7 +54,7 @@ public class HandlerUtil {
* @throws IOException IO exception returns if error occurs when executing the httpMethod
*/
public static ProxyResponse execute(HttpRequestBase httpRequest) throws IOException {
- try (CloseableHttpClient client = HttpClients.createDefault()) {
+ try (CloseableHttpClient client = getHttpClient()) {
HttpResponse response = client.execute(httpRequest);
ProxyResponse proxyResponse = new ProxyResponse();
@@ -217,4 +218,18 @@ public class HandlerUtil {
return gatewayPort;
}
+ /**
+ * Retrieve Http client based on hostname verification.
+ * @return {@link CloseableHttpClient} http client
+ */
+ public static CloseableHttpClient getHttpClient() {
+ boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.
+ getProperty("org.wso2.ignoreHostnameVerification"));
+ if (isIgnoreHostnameVerification) {
+ return HttpClients.custom().setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE).build();
+ } else {
+ return HttpClients.createDefault();
+ }
+ }
+
}
diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml
index a8f2325821..e8375b32ad 100644
--- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml
+++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml
@@ -258,6 +258,8 @@
perm:geo-service:alerts-manage
appm:read
perm:devices:permanent-delete
+ perm:android:manage-configuration
+ perm:android:view-configuration
app-mgt