From 5dfc7b043073f9db603d2c1b2e5b2680377ac71c Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Fri, 18 Oct 2019 11:45:59 +0530 Subject: [PATCH] Fix app installing issue in multiple times --- .../application/mgt/core/impl/SubscriptionManagerImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 639b4b5844..83ce469ba3 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 @@ -446,12 +446,11 @@ public class SubscriptionManagerImpl implements SubscriptionManager { DeviceIdentifier deviceIdentifier = new DeviceIdentifier(device.getDeviceIdentifier(), device.getType()); DeviceSubscriptionDTO deviceSubscriptionDTO = deviceSubscriptions.get(device.getId()); if (deviceSubscriptionDTO != null) { - if (deviceSubscriptionDTO.isUnsubscribed()) { - appReInstallableDevices.put(deviceIdentifier, device.getId()); - } if (!deviceSubscriptionDTO.isUnsubscribed() && Operation.Status.COMPLETED.toString() .equals(deviceSubscriptionDTO.getStatus())) { appInstalledDevices.put(deviceIdentifier, device.getId()); + } else { + appReInstallableDevices.put(deviceIdentifier, device.getId()); } } else { appInstallableDevices.put(deviceIdentifier, device.getId());