}
for (std::list < package_data_s >::iterator iter = packageInfoList.begin(); iter != packageInfoList.end(); ++iter) {
- bool ret = callback(iter->package_id, iter->count, iter->monitor_policy, user_data);
+ bool ret = callback(iter->package_id, iter->count, iter->time, iter->monitor_policy, user_data);
if (ret == false)
break;
}
typedef struct _package_data_s {
char *package_id;
int count;
+ time_t time;
int monitor_policy;
} package_data_s;
*
* @param[in] package_id The package ID
* @param[in] count The privacy count
+ * @param[in] time The latest access time
* @param[in] monitor_policy The monitor policy (0 or 1)
* @param[in] user_data The user data passed from the callback registration function
*
*
* @see privacy_guard_client_foreach_package_info_by_privacy_id()
*/
-typedef bool (*privacy_guard_client_package_info_cb) (const char *package_id, const int count, const int monitor_policy, void *user_data);
+typedef bool (*privacy_guard_client_package_info_cb) (const char *package_id, const int count, const time_t time, const int monitor_policy, void *user_data);
/**
snprintf(buf, BUF_SIZE, "SELECT DISTINCT PKG_ID, MONITOR_POLICY FROM MonitorPolicy WHERE (USER_ID=? OR USER_ID=%d) AND PRIVACY_ID=?", GLOBAL_USER);
static const std::string query = std::string(buf);
- snprintf(buf, BUF_SIZE, "SELECT COUNT(*) FROM StatisticsMonitorInfo WHERE (USER_ID=? OR USER_ID=%d) AND PKG_ID=? AND PRIVACY_ID=? AND USE_DATE>=? AND USE_DATE<=?", GLOBAL_USER);
+ snprintf(buf, BUF_SIZE, "SELECT COUNT(*), MAX(USE_DATE) FROM StatisticsMonitorInfo WHERE (USER_ID=? OR USER_ID=%d) AND PKG_ID=? AND PRIVACY_ID=? AND USE_DATE>=? AND USE_DATE<=?", GLOBAL_USER);
static const std::string PKGINFO_SELECT = std::string(buf);
// get start~end date (for 7 days)
// if (count == 0)
// continue;
p_data.count = count;
+
+ time_t time = sqlite3_column_int(infoStmt, 1);
+ PG_LOGD("## time[%d]", time);
+ p_data.time = time;
+
packageInfoList.push_back(p_data);
}