diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/util/APIUtil.java b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/util/APIUtil.java index b057705f0..82d6737df 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/util/APIUtil.java +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/util/APIUtil.java @@ -35,6 +35,7 @@ import java.util.Map; public class APIUtil { private static Log log = LogFactory.getLog(APIUtil.class); + private static int maxEventCount = 100; public static String getAuthenticatedUser() { PrivilegedCarbonContext threadLocalCarbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext(); @@ -82,6 +83,8 @@ public class APIUtil { int eventCount = analyticsDataAPI.searchCount(tenantId, tableName, query); if (eventCount == 0) { return null; + }else if(eventCount>maxEventCount){ + eventCount=maxEventCount; } List resultEntries = analyticsDataAPI.search(tenantId, tableName, query, 0, eventCount, sortByFields);