From c095ca40ffe76836aa0a8cb6326d1f4502466fc0 Mon Sep 17 00:00:00 2001 From: nipun Date: Thu, 3 Oct 2019 22:14:15 +0530 Subject: [PATCH] Fix the uninstall operation of the uninstall API --- .../dao/impl/subscription/GenericSubscriptionDAOImpl.java | 4 ++-- .../application/mgt/core/impl/SubscriptionManagerImpl.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java index ff8c8c3b2b7..1e02fe3c11a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java @@ -553,8 +553,8 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc for (Integer deviceId : deviceIds) { ps.setObject(index++, deviceId); } - ps.setInt(index++, tenantId); - ps.setInt(index, applicationReleaseId); + ps.setInt(index++, applicationReleaseId); + ps.setInt(index, tenantId); try (ResultSet rs = ps.executeQuery()) { while (rs.next()) { subscribedDevices.add(rs.getInt("DM_DEVICE_ID")); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java index bc8476ea01d..c7624bc3469 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java @@ -496,6 +496,7 @@ public class SubscriptionManagerImpl implements SubscriptionManager { app.setLocation(application.getApplicationReleases().get(0).getInstallerPath()); return MDMAndroidOperationUtil.createInstallAppOperation(app); } else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) { + app.setType(mobileAppType); return MDMAndroidOperationUtil.createAppUninstallOperation(app); } else { String msg = "Invalid Action is found. Action: " + action;