/* * Copyright (c) 2013 Samsung Electronics Co., Ltd. * * Licensed under the Flora License, Version 1.1 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://floralicense.org/license/ * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include "clock-viewer.h" #include "clock-viewer-util-status.h" #define CLOCK_VIEWER_UTIL_STATUS_VCONFKEY_RESERVED_APPS_STATUS "memory/starter/reserved_apps_status" static struct _util_status_info { int reserved_apps_status; } s_util_status_info = { .reserved_apps_status = 0, }; static void __clock_viewer_util_status_reserved_apps_status_changed_cb(keynode_t *node, void *data) { int ret = 0; int value = 0; ret = vconf_get_int(CLOCK_VIEWER_UTIL_STATUS_VCONFKEY_RESERVED_APPS_STATUS, &value); if (ret != 0) { _ERR("Failed to get reserved apps status[%d]", ret); s_util_status_info.reserved_apps_status = 0; } else { _DBG("Reserved apps status[%d]", value); s_util_status_info.reserved_apps_status = value; } } HAPI void clock_viewer_util_status_init(void) { int ret = 0; // reserved apps status ret = vconf_notify_key_changed(CLOCK_VIEWER_UTIL_STATUS_VCONFKEY_RESERVED_APPS_STATUS, __clock_viewer_util_status_reserved_apps_status_changed_cb, NULL); if (ret != 0) { _ERR("Failed to notify reserved apps status changed event[%d]", ret); } __clock_viewer_util_status_reserved_apps_status_changed_cb(NULL, NULL); } HAPI void clock_viewer_util_status_fini(void) { int ret = 0; // reserved apps status ret = vconf_ignore_key_changed(CLOCK_VIEWER_UTIL_STATUS_VCONFKEY_RESERVED_APPS_STATUS, __clock_viewer_util_status_reserved_apps_status_changed_cb); if (ret != 0) { _ERR("Failed to ignore reserved apps status changed event[%d]", ret); } } HAPI int clock_viewer_util_status_get_reserved_apps_status(void) { return s_util_status_info.reserved_apps_status; }