From 1960c014624ab798335e97524f84fed41f911c62 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Wed, 2 Oct 2019 11:13:08 +0530 Subject: [PATCH 1/2] Fix incorrect device view issue in android. --- .../android/mocks/DeviceManagementProviderServiceMock.java | 5 +++++ .../cdmf.unit.device.type.android.device-view/device-view.js | 3 ++- .../public/js/device-detail.js | 2 +- .../android/mocks/DeviceManagementProviderServiceMock.java | 5 +++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java index 414f232b6..24d71b52e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java @@ -23,6 +23,7 @@ import org.wso2.carbon.device.mgt.common.configuration.mgt.AmbiguousConfiguratio import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.DeviceConfiguration; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; +import org.wso2.carbon.device.mgt.common.device.details.DeviceData; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; @@ -144,6 +145,10 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv return null; } + @Override public Device getDevice(DeviceData deviceData, boolean b) throws DeviceManagementException { + return null; + } + @Override public List getDevicesBasedOnProperties(Map map) throws DeviceManagementException { return null; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js index 55bb7ce65..7d4c02820 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js @@ -21,6 +21,7 @@ function onRequest(context) { var deviceType = context["uriParams"]["deviceType"]; var deviceId = request.getParameter("id"); var owner = request.getParameter("owner"); + var ownership = request.getParameter("ownership"); var deviceViewData = {}; var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var carbonServer = require("carbon").server; @@ -28,7 +29,7 @@ function onRequest(context) { if (deviceType && deviceId) { var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; - var response = deviceModule.viewDevice(deviceType, deviceId, owner); + var response = deviceModule.viewDevice(deviceType, deviceId, owner, ownership); if (response["status"] === "success") { deviceViewData["deviceFound"] = true; deviceViewData["isAuthorized"] = true; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/public/js/device-detail.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/public/js/device-detail.js index cf3b3665c..8739addd1 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/public/js/device-detail.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/public/js/device-detail.js @@ -211,7 +211,7 @@ var InitiateViewOption = null; order: [], ajax: { url: "/devicemgt/api/operation/paginate", - data: {deviceId: deviceIdentifier, deviceType: deviceType, owner: owner}, + data: {deviceId: deviceIdentifier, deviceType: deviceType, owner: owner, ownership: ownership}, dataSrc: function (json) { $("#operations-spinner").addClass("hidden"); $("#operations-log-container").empty(); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java index 414f232b6..24d71b52e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java @@ -23,6 +23,7 @@ import org.wso2.carbon.device.mgt.common.configuration.mgt.AmbiguousConfiguratio import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.DeviceConfiguration; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; +import org.wso2.carbon.device.mgt.common.device.details.DeviceData; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; @@ -144,6 +145,10 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv return null; } + @Override public Device getDevice(DeviceData deviceData, boolean b) throws DeviceManagementException { + return null; + } + @Override public List getDevicesBasedOnProperties(Map map) throws DeviceManagementException { return null; From 2053a974797c2df1b85175799061490cadf6ce63 Mon Sep 17 00:00:00 2001 From: Charitha Goonetilleke Date: Fri, 4 Oct 2019 11:45:24 +0000 Subject: [PATCH 2/2] Bump android agent version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3cf3e9c0b..9c1a4808c 100644 --- a/pom.xml +++ b/pom.xml @@ -1252,7 +1252,7 @@ 4.2.9-SNAPSHOT - 3.6.3 + 3.7.0 4.6.21