#undef LOG_TAG
#endif
-#define LOG_TAG "TIZEN_N_RUNTIME_INFO"
+#define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO"
#define RUNTIME_INFO_MAX -1
runtime_info_func_get_value get_value;
if (runtime_info_get_item(key, &runtime_info_item)) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, RUNTIME_INFO_ERROR_INVALID_PARAMETER);
+ LOGE("INVALID_PARAMETER(0x%08x) : invalid key", RUNTIME_INFO_ERROR_INVALID_PARAMETER);
return RUNTIME_INFO_ERROR_INVALID_PARAMETER;
}
if (runtime_info_item->data_type != data_type) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid data type", __FUNCTION__, RUNTIME_INFO_ERROR_INVALID_PARAMETER);
+ LOGE("INVALID_PARAMETER(0x%08x) : invalid data type", RUNTIME_INFO_ERROR_INVALID_PARAMETER);
return RUNTIME_INFO_ERROR_INVALID_PARAMETER;
}
get_value = runtime_info_item->get_value;
if (get_value == NULL) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to call getter for the runtime information", __FUNCTION__, RUNTIME_INFO_ERROR_IO_ERROR);
+ LOGE("IO_ERROR(0x%08x) : failed to call getter for the runtime information", RUNTIME_INFO_ERROR_IO_ERROR);
return RUNTIME_INFO_ERROR_IO_ERROR;
}
if (get_value(value) != RUNTIME_INFO_ERROR_NONE) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to get the runtime informaion / key(%d)", __FUNCTION__, RUNTIME_INFO_ERROR_IO_ERROR, key);
+ LOGE("IO_ERROR(0x%08x) : failed to get the runtime informaion / key(%d)", RUNTIME_INFO_ERROR_IO_ERROR, key);
return RUNTIME_INFO_ERROR_IO_ERROR;
}
runtime_info_value_u runtime_info_value;
if (value == NULL) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid output param", __FUNCTION__, RUNTIME_INFO_ERROR_INVALID_PARAMETER);
+ LOGE("INVALID_PARAMETER(0x%08x) : invalid output param", RUNTIME_INFO_ERROR_INVALID_PARAMETER);
return RUNTIME_INFO_ERROR_INVALID_PARAMETER;
}
retcode = runtime_info_get_value(key, RUNTIME_INFO_DATA_TYPE_INT, &runtime_info_value);
- if (retcode == RUNTIME_INFO_ERROR_NONE) {
+ if (retcode == RUNTIME_INFO_ERROR_NONE)
*value = runtime_info_value.i;
- }
return retcode;
}
runtime_info_value_u runtime_info_value;
if (value == NULL) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid output param", __FUNCTION__, RUNTIME_INFO_ERROR_INVALID_PARAMETER);
+ LOGE("INVALID_PARAMETER(0x%08x) : invalid output param", RUNTIME_INFO_ERROR_INVALID_PARAMETER);
return RUNTIME_INFO_ERROR_INVALID_PARAMETER;
}
retcode = runtime_info_get_value(key, RUNTIME_INFO_DATA_TYPE_BOOL, &runtime_info_value);
- if (retcode == RUNTIME_INFO_ERROR_NONE) {
+ if (retcode == RUNTIME_INFO_ERROR_NONE)
*value = runtime_info_value.b;
- }
return retcode;
}
runtime_info_value_u runtime_info_value;
if (value == NULL) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid output param", __FUNCTION__, RUNTIME_INFO_ERROR_INVALID_PARAMETER);
+ LOGE("INVALID_PARAMETER(0x%08x) : invalid output param", RUNTIME_INFO_ERROR_INVALID_PARAMETER);
return RUNTIME_INFO_ERROR_INVALID_PARAMETER;
}
retcode = runtime_info_get_value(key, RUNTIME_INFO_DATA_TYPE_DOUBLE, &runtime_info_value);
- if (retcode == RUNTIME_INFO_ERROR_NONE) {
+ if (retcode == RUNTIME_INFO_ERROR_NONE)
*value = runtime_info_value.d;
- }
return retcode;
}
runtime_info_value_u runtime_info_value;
if (value == NULL) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid output param", __FUNCTION__, RUNTIME_INFO_ERROR_INVALID_PARAMETER);
+ LOGE("INVALID_PARAMETER(0x%08x) : invalid output param", RUNTIME_INFO_ERROR_INVALID_PARAMETER);
return RUNTIME_INFO_ERROR_INVALID_PARAMETER;
}
retcode = runtime_info_get_value(key, RUNTIME_INFO_DATA_TYPE_STRING, &runtime_info_value);
- if (retcode == RUNTIME_INFO_ERROR_NONE) {
+ if (retcode == RUNTIME_INFO_ERROR_NONE)
*value = runtime_info_value.s;
- }
return retcode;
}
bool subscribe_event = false;
if (callback == NULL) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x)", __FUNCTION__, RUNTIME_INFO_ERROR_INVALID_PARAMETER);
+ LOGE("INVALID_PARAMETER(0x%08x)", RUNTIME_INFO_ERROR_INVALID_PARAMETER);
return RUNTIME_INFO_ERROR_INVALID_PARAMETER;
}
if (runtime_info_get_item(key, &runtime_info_item)) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, RUNTIME_INFO_ERROR_INVALID_PARAMETER);
+ LOGE("INVALID_PARAMETER(0x%08x) : invalid key", RUNTIME_INFO_ERROR_INVALID_PARAMETER);
return RUNTIME_INFO_ERROR_INVALID_PARAMETER;
}
set_event_cb = runtime_info_item->set_event_cb;
if (set_event_cb == NULL) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to set callback for the runtime information", __FUNCTION__, RUNTIME_INFO_ERROR_IO_ERROR);
+ LOGE("IO_ERROR(0x%08x) : failed to set callback for the runtime information", RUNTIME_INFO_ERROR_IO_ERROR);
return RUNTIME_INFO_ERROR_IO_ERROR;
}
event_subscription = malloc(sizeof(runtime_info_event_subscription_s));
if (event_subscription == NULL) {
- LOGE("[%s] OUT_OF_MEMORY(0x%08x)", __FUNCTION__, RUNTIME_INFO_ERROR_OUT_OF_MEMORY);
+ LOGE("OUT_OF_MEMORY(0x%08x)", RUNTIME_INFO_ERROR_OUT_OF_MEMORY);
return RUNTIME_INFO_ERROR_OUT_OF_MEMORY;
}
runtime_info_item->event_subscription->changed_cb = callback;
runtime_info_item->event_subscription->user_data = user_data;
- if (runtime_info_item->event_subscription->most_recent_value != NULL) {
+ if (runtime_info_item->event_subscription->most_recent_value != NULL)
free(runtime_info_item->event_subscription->most_recent_value);
- }
runtime_info_item->event_subscription->most_recent_value = NULL;
- if (subscribe_event == true) {
+ if (subscribe_event == true)
return set_event_cb();
- } else {
+ else
return RUNTIME_INFO_ERROR_NONE;
- }
}
int runtime_info_unset_changed_cb(runtime_info_key_e key)
runtime_info_func_unset_event_cb unset_event_cb;
if (runtime_info_get_item(key, &runtime_info_item)) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, RUNTIME_INFO_ERROR_INVALID_PARAMETER);
+ LOGE("INVALID_PARAMETER(0x%08x) : invalid key", RUNTIME_INFO_ERROR_INVALID_PARAMETER);
return RUNTIME_INFO_ERROR_INVALID_PARAMETER;
}
unset_event_cb = runtime_info_item->unset_event_cb;
if (unset_event_cb == NULL) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to unset callback for the runtime information", __FUNCTION__, RUNTIME_INFO_ERROR_IO_ERROR);
+ LOGE("IO_ERROR(0x%08x) : failed to unset callback for the runtime information", RUNTIME_INFO_ERROR_IO_ERROR);
return RUNTIME_INFO_ERROR_IO_ERROR;
}
int retcode;
if (runtime_info_get_item(key, &runtime_info_item)) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, RUNTIME_INFO_ERROR_INVALID_PARAMETER);
+ LOGE("INVALID_PARAMETER(0x%08x) : invalid key", RUNTIME_INFO_ERROR_INVALID_PARAMETER);
return;
}
if (runtime_info_item->event_subscription == NULL) {
- LOGE("[%s] IO_ERROR(0x%08x) : invalid event subscription", __FUNCTION__, RUNTIME_INFO_ERROR_IO_ERROR);
+ LOGE("IO_ERROR(0x%08x) : invalid event subscription", RUNTIME_INFO_ERROR_IO_ERROR);
return;
}
retcode = runtime_info_get_value(key, runtime_info_item->data_type, ¤t_value);
if (retcode != RUNTIME_INFO_ERROR_NONE) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to get the runtime information", __FUNCTION__, RUNTIME_INFO_ERROR_IO_ERROR);
+ LOGE("IO_ERROR(0x%08x) : failed to get the runtime information", RUNTIME_INFO_ERROR_IO_ERROR);
return;
}
if (runtime_info_item->event_subscription->most_recent_value != NULL) {
- if (!memcmp(runtime_info_item->event_subscription->most_recent_value, ¤t_value, sizeof(runtime_info_value_u))) {
+ if (!memcmp(runtime_info_item->event_subscription->most_recent_value, ¤t_value, sizeof(runtime_info_value_u)))
dispatch_event = false;
- }
} else {
runtime_info_item->event_subscription->most_recent_value = calloc(1, sizeof(runtime_info_value_u));
if (runtime_info_item->event_subscription->most_recent_value == NULL) {
- LOGE("[%s] OUT_OF_MEMORY(0x%08x)", __FUNCTION__, RUNTIME_INFO_ERROR_OUT_OF_MEMORY);
+ LOGE("OUT_OF_MEMORY(0x%08x)", RUNTIME_INFO_ERROR_OUT_OF_MEMORY);
return;
}
}
* 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.
+ * limitations under the License.
*/
#include <stdio.h>
#undef LOG_TAG
#endif
-#define LOG_TAG "TIZEN_N_RUNTIME_INFO"
+#define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO"
static const char *VCONF_WIFI_STATUS = VCONFKEY_WIFI_STATE;
static const char *VCONF_BT_ENABLED = VCONFKEY_BT_STATUS;
int runtime_info_wifi_status_get_value(runtime_info_value_h value)
{
int vconf_value;
-
+
if (runtime_info_vconf_get_value_int(VCONF_WIFI_STATUS, &vconf_value))
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
- switch (vconf_value)
- {
+ switch (vconf_value) {
case VCONFKEY_WIFI_OFF:
value->i = RUNTIME_INFO_WIFI_STATUS_DISABLED;
break;
case VCONFKEY_WIFI_CONNECTED:
case VCONFKEY_WIFI_TRANSFER:
value->i = RUNTIME_INFO_WIFI_STATUS_CONNECTED;
- break;
-
+ break;
+
default:
return RUNTIME_INFO_ERROR_IO_ERROR;
}
return runtime_info_vconf_set_event_cb(VCONF_WIFI_STATUS, RUNTIME_INFO_KEY_WIFI_STATUS, 0);
}
-void runtime_info_wifi_status_unset_event_cb ()
+void runtime_info_wifi_status_unset_event_cb()
{
runtime_info_vconf_unset_event_cb(VCONF_WIFI_STATUS, 0);
}
int runtime_info_bt_enabled_get_value(runtime_info_value_h value)
{
int vconf_value;
-
+
if (runtime_info_vconf_get_value_int(VCONF_BT_ENABLED, &vconf_value))
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
- switch (vconf_value)
- {
+ switch (vconf_value) {
case VCONFKEY_BT_STATUS_OFF:
value->b = false;
break;
case VCONFKEY_BT_STATUS_BT_VISIBLE:
case VCONFKEY_BT_STATUS_TRANSFER:
value->b = true;
- break;
-
+ break;
+
default:
return RUNTIME_INFO_ERROR_IO_ERROR;
}
return runtime_info_vconf_set_event_cb(VCONF_BT_ENABLED, RUNTIME_INFO_KEY_BLUETOOTH_ENABLED, 0);
}
-void runtime_info_bt_enabled_unset_event_cb ()
+void runtime_info_bt_enabled_unset_event_cb()
{
runtime_info_vconf_unset_event_cb(VCONF_BT_ENABLED, 0);
}
int runtime_info_wifi_hotspot_get_value(runtime_info_value_h value)
{
int vconf_value;
-
+
if (runtime_info_vconf_get_value_int(VCONF_WIFI_HOTSPOT_ENABLED, &vconf_value))
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
value->b = (vconf_value&VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI) ? true : false;
int runtime_info_bt_hotspot_get_value(runtime_info_value_h value)
{
int vconf_value;
-
+
if (runtime_info_vconf_get_value_int(VCONF_BT_HOTSPOT_ENABLED, &vconf_value))
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
value->b = (vconf_value&VCONFKEY_MOBILE_HOTSPOT_MODE_BT) ? true : false;
int runtime_info_usb_hotspot_get_value(runtime_info_value_h value)
{
int vconf_value;
-
+
if (runtime_info_vconf_get_value_int(VCONF_USB_HOTSPOT_ENABLED, &vconf_value))
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
value->b = (vconf_value&VCONFKEY_MOBILE_HOTSPOT_MODE_USB) ? true : false;
int runtime_info_packet_data_get_value(runtime_info_value_h value)
{
bool vconf_value;
-
+
if (runtime_info_vconf_get_value_bool(VCONF_PACKET_DATA_ENABLED, &vconf_value))
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
value->b = vconf_value;
int runtime_info_data_roaming_get_value(runtime_info_value_h value)
{
bool vconf_value;
-
+
if (runtime_info_vconf_get_value_bool(VCONF_DATA_ROAMING_ENABLED, &vconf_value))
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
value->b = vconf_value;
int runtime_info_gps_status_get_value(runtime_info_value_h value)
{
int vconf_value;
-
+
if (runtime_info_vconf_get_value_int(VCONF_GPS_STATUS, &vconf_value))
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
- switch (vconf_value)
- {
+ switch (vconf_value) {
case VCONFKEY_LOCATION_GPS_OFF:
value->i = RUNTIME_INFO_GPS_STATUS_DISABLED;
break;
case VCONFKEY_LOCATION_GPS_CONNECTED:
value->i = RUNTIME_INFO_GPS_STATUS_CONNECTED;
break;
-
+
default:
return RUNTIME_INFO_ERROR_IO_ERROR;
}
* 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.
+ * limitations under the License.
*/
#include <stdio.h>
#undef LOG_TAG
#endif
-#define LOG_TAG "TIZEN_N_RUNTIME_INFO"
+#define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO"
static const char *VCONF_24HOUR_FORMAT = "db/menu_widget/regionformat_time1224";
static const char *VCONF_FIRST_DAY_OF_WEEK = "db/setting/weekofday_format";
int runtime_info_24hour_format_get_value(runtime_info_value_h value)
{
int vconf_value;
-
+
if (runtime_info_vconf_get_value_int(VCONF_24HOUR_FORMAT, &vconf_value))
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
- switch (vconf_value)
- {
+ switch (vconf_value) {
case VCONFKEY_TIME_FORMAT_12:
value->b = false;
break;
int runtime_info_first_day_of_week_get_value(runtime_info_value_h value)
{
int vconf_value;
-
+
if (runtime_info_vconf_get_value_int(VCONF_FIRST_DAY_OF_WEEK, &vconf_value))
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
- switch (vconf_value)
- {
+ switch (vconf_value) {
case SETTING_WEEKOFDAY_FORMAT_SUNDAY:
value->i = RUNTIME_INFO_FIRST_DAY_OF_WEEK_SUNDAY;
break;
char *token = NULL;
if (runtime_info_vconf_get_value_string(VCONF_LANGUAGE, &vconf_value))
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
token = strtok(vconf_value, ".");
value->s = strdup(token);
free(vconf_value);
if (value->s == NULL) {
- LOGE("[%s] OUT_OF_MEMORY(0x%08x)", __func__, RUNTIME_INFO_ERROR_OUT_OF_MEMORY);
+ LOGE("OUT_OF_MEMORY(0x%08x)", RUNTIME_INFO_ERROR_OUT_OF_MEMORY);
return RUNTIME_INFO_ERROR_OUT_OF_MEMORY;
}
int runtime_info_region_get_value(runtime_info_value_h value)
{
char *vconf_value;
-
+
if (runtime_info_vconf_get_value_string(VCONF_REGION, &vconf_value))
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
value->s = vconf_value;
return runtime_info_vconf_set_event_cb(VCONF_REGION, RUNTIME_INFO_KEY_REGION, 0);
}
-void runtime_info_region_unset_event_cb ()
+void runtime_info_region_unset_event_cb()
{
runtime_info_vconf_unset_event_cb(VCONF_REGION, 0);
}
#undef LOG_TAG
#endif
-#define LOG_TAG "TIZEN_N_RUNTIME_INFO"
+#define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO"
static const char *VCONF_LOCATION_SERVICE_ENABLED = VCONFKEY_LOCATION_ENABLED;
static const char *VCONF_LOCATION_AGPS_ENABLED = "db/location/setting/AgpsEnabled";
#undef LOG_TAG
#endif
-#define LOG_TAG "TIZEN_N_RUNTIME_INFO"
+#define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO"
static const char *VCONF_FLIGHT_MODE = VCONFKEY_TELEPHONY_FLIGHT_MODE;
static const char *VCONF_AUDIO_JACK = VCONFKEY_SYSMAN_EARJACK;
* 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.
+ * limitations under the License.
*/
#include <stdio.h>
#undef LOG_TAG
#endif
-#define LOG_TAG "TIZEN_N_RUNTIME_INFO"
+#define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO"
int runtime_info_vconf_get_value_int(const char *vconf_key, int *value)
{
int runtime_info_vconf_get_value_bool(const char *vconf_key, bool *value)
{
- return vconf_get_bool(vconf_key, (int*)value);
+ return vconf_get_bool(vconf_key, (int *)value);
}
int runtime_info_vconf_get_value_double(const char *vconf_key, double *value)
char *str_value = NULL;
str_value = vconf_get_str(vconf_key);
-
- if (str_value != NULL)
- {
+
+ if (str_value != NULL) {
*value = str_value;
return 0;
- }
- else
- {
+ } else {
return -1;
}
}
static void runtime_info_vconf_event_cb0(keynode_t *node, void *event_data)
{
if (node != NULL)
- {
runtime_info_updated((runtime_info_key_e)event_data);
- }
}
static void runtime_info_vconf_event_cb1(keynode_t *node, void *event_data)
{
if (node != NULL)
- {
runtime_info_updated((runtime_info_key_e)event_data);
- }
}
static void runtime_info_vconf_event_cb2(keynode_t *node, void *event_data)
{
if (node != NULL)
- {
runtime_info_updated((runtime_info_key_e)event_data);
- }
}
static void runtime_info_vconf_event_cb3(keynode_t *node, void *event_data)
{
if (node != NULL)
- {
runtime_info_updated((runtime_info_key_e)event_data);
- }
}
static void runtime_info_vconf_event_cb4(keynode_t *node, void *event_data)
{
if (node != NULL)
- {
runtime_info_updated((runtime_info_key_e)event_data);
- }
}
static runtime_info_vconf_event_cb runtime_info_vconf_get_event_cb_slot(int slot)
{
- switch (slot)
- {
+ switch (slot) {
case 0:
return runtime_info_vconf_event_cb0;
}
}
-int runtime_info_vconf_set_event_cb (const char *vconf_key, runtime_info_key_e runtime_info_key, int slot)
+int runtime_info_vconf_set_event_cb(const char *vconf_key, runtime_info_key_e runtime_info_key, int slot)
{
runtime_info_vconf_event_cb vconf_event_cb;
vconf_event_cb = runtime_info_vconf_get_event_cb_slot(slot);
if (vconf_event_cb == NULL)
- {
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
- if (vconf_notify_key_changed(vconf_key, vconf_event_cb, (void*)runtime_info_key))
- {
+ if (vconf_notify_key_changed(vconf_key, vconf_event_cb, (void *)runtime_info_key))
return RUNTIME_INFO_ERROR_IO_ERROR;
- }
return RUNTIME_INFO_ERROR_NONE;
}
-void runtime_info_vconf_unset_event_cb (const char *vconf_key, int slot)
+void runtime_info_vconf_unset_event_cb(const char *vconf_key, int slot)
{
runtime_info_vconf_event_cb vconf_event_cb;
vconf_event_cb = runtime_info_vconf_get_event_cb_slot(slot);
if (vconf_event_cb != NULL)
- {
vconf_ignore_key_changed(vconf_key, vconf_event_cb);
- }
}
-