* @see runtime_info_get_all_apps_memory_usage()
* @see runtime_info_get_all_apps_cpu_rate()
*/
-int runtime_info_app_usage_get_count(app_usage_h handle, unsigned int *count);
+int runtime_info_app_usage_get_count(app_usage_h handle, int *count);
/**
* void print_memory_usage(void)
* {
* int i;
- * unsigned int count;
+ * int count;
* app_usage_h mem_usage_handle;
* char *appid;
* unsigned int usage;
* void print_cpu_usage(void)
* {
* int i;
- * unsigned int count;
+ * int count;
* app_usage_h cpu_rate_handle;
* char *appid;
* unsigned int rate;
/* Populate the entries of info array using the data received from resourced */
len = g_variant_n_children(reply);
+ if (len <= 0) {
+ _E("NO_DATA(0x%08x) : there is no registered app", RUNTIME_INFO_ERROR_NO_DATA);
+ g_variant_unref(reply);
+ return RUNTIME_INFO_ERROR_NO_DATA;
+ }
usages = calloc(1, sizeof(struct app_usages_s));
if (!usages) {
return RUNTIME_INFO_ERROR_OUT_OF_MEMORY;
}
- usages->len = len;
+ usages->len = (int)len;
usages->list = calloc(len, sizeof(struct app_usage_s));
if (!usages->list) {
return RUNTIME_INFO_ERROR_NONE;
}
-API int runtime_info_app_usage_get_count(app_usage_h handle, unsigned int *count)
+API int runtime_info_app_usage_get_count(app_usage_h handle, int *count)
{
struct app_usages_s *usages = handle;