From 778bb3e9873d8e7f2b0cc7ff22c1ecdc09605654 Mon Sep 17 00:00:00 2001 From: Pahansith Gunathilake Date: Thu, 3 Mar 2022 01:01:08 +0530 Subject: [PATCH] Fix invalid time immediate after device enrollment --- .../device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java index 6db8bd2fdd..ff17b026f4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java @@ -74,7 +74,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO { stmt.setDouble(14, deviceInfo.getTotalRAMMemory()); stmt.setDouble(15, deviceInfo.getAvailableRAMMemory()); stmt.setBoolean(16, deviceInfo.isPluggedIn()); - stmt.setLong(17, DeviceManagementDAOUtil.getCurrentUTCTime()); + stmt.setLong(17, DeviceManagementDAOUtil.getCurrentUTCTime() * 1000L); stmt.setInt(18, enrolmentId); stmt.execute(); @@ -508,7 +508,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO { stmt.setDouble(13, newDeviceInfo.getTotalRAMMemory()); stmt.setDouble(14, newDeviceInfo.getAvailableRAMMemory()); stmt.setBoolean(15, newDeviceInfo.isPluggedIn()); - stmt.setLong(16, System.currentTimeMillis()); + stmt.setLong(16, DeviceManagementDAOUtil.getCurrentUTCTime() * 1000L); stmt.setInt(17, deviceId); stmt.setInt(18, enrollmentId);