SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -fvisibility=hidden")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
IF("${ARCH}" STREQUAL "arm")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DSLP_DEBUG")
-SET(CMAKE_EXE_LINKER_FLAGS "-fvisibility=hidden -Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
aux_source_directory(src SOURCES)
ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+
+#ifndef __TIZEN_SYSTEM_RUNTIME_INFO_DOC_H__
+#define __TIZEN_SYSTEM_RUNTIME_INFO_DOC_H__
+
+/**
+ * @ingroup CAPI_SYSTEM_FRAMEWORK
+ * @defgroup CAPI_SYSTEM_RUNTIME_INFO_MODULE Runtime information
+ * @brief The Runtime Information API provides functions to obtain runtime information.
+ *
+ * @section CAPI_SYSTEM_RUNTIME_INFO_MODULE_HEADER Required Header
+ * \#include <runtime_info.h>
+ *
+ * @section CAPI_SYSTEM_RUNTIME_INFO_MODULE_OVERVIEW Overview
+ * The Runtime Information API provides functions to obtain runtime information, containing miscellaneous system preference.
+ * The Runtime Information available is stored in key/value pairs, where there may be different data types for the value.
+ *
+ * The runtime_info_set_changed_cb() registers a callback function for a particular key, which will be invoked by the System Service if the state matching that key changes.
+*
+*/
+
+#endif /* __TIZEN_SYSTEM_RUNTIME_INFO_DOC_H__ */
/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
*/
/**
- * @brief Enumeration of error code for runtime information
+ * @brief Enumeration for error codes for runtime information.
*/
typedef enum {
- RUNTIME_INFO_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
- RUNTIME_INFO_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
- RUNTIME_INFO_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
- RUNTIME_INFO_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< An input/output error occurred when read value from system */
+ RUNTIME_INFO_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ RUNTIME_INFO_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ RUNTIME_INFO_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ RUNTIME_INFO_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< An input/output error occurred when read value from system */
+ RUNTIME_INFO_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< No permission to use the api */
} runtime_info_error_e;
/**
- * @brief Enumeration of key for runtime information
+ * @brief Enumeration for keys for runtime information..
*/
typedef enum {
- RUNTIME_INFO_KEY_FLIGHT_MODE_ENABLED, /**<Indicates whether the device is in flight mode. */
- RUNTIME_INFO_KEY_WIFI_STATUS, /**<Indicates the current status of Wi-Fi. */
- RUNTIME_INFO_KEY_BLUETOOTH_ENABLED, /**<Indicates whether Bluetooth is enabled. */
- RUNTIME_INFO_KEY_WIFI_HOTSPOT_ENABLED, /**<Indicates whether Wi-Fi hotspot is enabled. */
- RUNTIME_INFO_KEY_BLUETOOTH_TETHERING_ENABLED, /**<Indicates whether Bluetooth tethering is enabled. */
- RUNTIME_INFO_KEY_USB_TETHERING_ENABLED, /**<Indicates whether USB tethering is enabled. */
- RUNTIME_INFO_KEY_LOCATION_SERVICE_ENABLED, /**<Indicates whether the location service is allowed to use location data from GPS satellites. */
- RUNTIME_INFO_KEY_LOCATION_ADVANCED_GPS_ENABLED, /**<Indicates whether the location service is allowed to download location data for GPS operation. */
- RUNTIME_INFO_KEY_LOCATION_NETWORK_POSITION_ENABLED, /**<Indicates whether the location service is allowed to use location data from cellular and Wi-Fi. */
- RUNTIME_INFO_KEY_LOCATION_SENSOR_AIDING_ENABLED, /**<Indicates whether the location service is allowed to use pedestrian sensors for positioning performance. */
- RUNTIME_INFO_KEY_PACKET_DATA_ENABLED, /**<Indicates Whether the packet data through 3G network is enabled. */
- RUNTIME_INFO_KEY_DATA_ROAMING_ENABLED, /**<Indicates whether data roaming is enabled. */
- RUNTIME_INFO_KEY_SILENT_MODE_ENABLED, /**<Indicates whether the device is in silent mode. */
- RUNTIME_INFO_KEY_VIBRATION_ENABLED, /**<Indicates whether vibration is enabled. */
- RUNTIME_INFO_KEY_24HOUR_CLOCK_FORMAT_ENABLED, /**<Indicates whether 24-hour clock is enabled. */
- RUNTIME_INFO_KEY_FIRST_DAY_OF_WEEK, /**<Indicates the first day of week. */
- RUNTIME_INFO_KEY_LANGUAGE, /**<Indicates the current language setting. */
- RUNTIME_INFO_KEY_REGION, /**<Indicates the current region setting. */
- RUNTIME_INFO_KEY_AUDIO_JACK_CONNECTED, /**<Indicates whether audio jack is connected. */
- RUNTIME_INFO_KEY_GPS_STATUS, /**<Indicates the current status of GPS. */
- RUNTIME_INFO_KEY_BATTERY_IS_CHARGING, /**<Indicates the battery is currently charging. */
- RUNTIME_INFO_KEY_TV_OUT_CONNECTED, /**<Indicates whether TV out is connected. */
- RUNTIME_INFO_KEY_AUDIO_JACK_STATUS, /**<Indicates the current status of audio jack. */
- RUNTIME_INFO_KEY_SLIDING_KEYBOARD_OPENED, /**<Indicates whether sliding keyboard is opened. */
- RUNTIME_INFO_KEY_USB_CONNECTED, /**<Indicates whether USB is connected. */
- RUNTIME_INFO_KEY_CHARGER_CONNECTED, /**<Indicates whether charger is connected. */
- RUNTIME_INFO_KEY_VIBRATION_LEVEL_HAPTIC_FEEDBACK, /**<Indicates the current vibration level of haptic feedback. */
- RUNTIME_INFO_KEY_AUTO_ROTATION_ENABLED, /**<Indicates whether auto rotation is enabled. */
+ RUNTIME_INFO_KEY_FLIGHT_MODE_ENABLED, /**<@internal Indicates whether the device is in flight mode. */
+ RUNTIME_INFO_KEY_WIFI_STATUS, /**<@internal Indicates the current status of Wi-Fi. */
+ RUNTIME_INFO_KEY_BLUETOOTH_ENABLED, /**<Indicates whether Bluetooth is enabled. */
+ RUNTIME_INFO_KEY_WIFI_HOTSPOT_ENABLED, /**<Indicates whether Wi-Fi hotspot is enabled. */
+ RUNTIME_INFO_KEY_BLUETOOTH_TETHERING_ENABLED, /**<Indicates whether Bluetooth tethering is enabled. */
+ RUNTIME_INFO_KEY_USB_TETHERING_ENABLED, /**<Indicates whether USB tethering is enabled. */
+ RUNTIME_INFO_KEY_LOCATION_SERVICE_ENABLED, /**<Indicates whether the location service is allowed to use location data from GPS satellites. */
+ RUNTIME_INFO_KEY_LOCATION_ADVANCED_GPS_ENABLED, /**<@internal Indicates whether the location service is allowed to download location data for GPS operation. */
+ RUNTIME_INFO_KEY_LOCATION_NETWORK_POSITION_ENABLED, /**<Indicates whether the location service is allowed to use location data from cellular and Wi-Fi. */
+ RUNTIME_INFO_KEY_PACKET_DATA_ENABLED, /**<Indicates Whether the packet data through 3G network is enabled. */
+ RUNTIME_INFO_KEY_DATA_ROAMING_ENABLED, /**<Indicates whether data roaming is enabled. */
+ RUNTIME_INFO_KEY_SILENT_MODE_ENABLED, /**<@internal Indicates whether the device is in silent mode. */
+ RUNTIME_INFO_KEY_VIBRATION_ENABLED, /**<Indicates whether vibration is enabled. */
+ RUNTIME_INFO_KEY_24HOUR_CLOCK_FORMAT_ENABLED, /**<@internal Indicates whether 24-hour clock is enabled. */
+ RUNTIME_INFO_KEY_FIRST_DAY_OF_WEEK, /**<@internal Indicates the first day of week. */
+ RUNTIME_INFO_KEY_LANGUAGE, /**<@internal Indicates the current language setting. */
+ RUNTIME_INFO_KEY_REGION, /**<@internal Indicates the current region setting. */
+ RUNTIME_INFO_KEY_AUDIO_JACK_CONNECTED, /**<Indicates whether audio jack is connected. */
+ RUNTIME_INFO_KEY_GPS_STATUS, /**<Indicates the current status of GPS. */
+ RUNTIME_INFO_KEY_BATTERY_IS_CHARGING, /**<Indicates the battery is currently charging. */
+ RUNTIME_INFO_KEY_TV_OUT_CONNECTED, /**<Indicates whether TV out is connected. */
+ RUNTIME_INFO_KEY_AUDIO_JACK_STATUS, /**<Indicates the current status of audio jack. */
+ RUNTIME_INFO_KEY_SLIDING_KEYBOARD_OPENED, /**<@internal Indicates whether sliding keyboard is opened. */
+ RUNTIME_INFO_KEY_USB_CONNECTED, /**<Indicates whether USB is connected. */
+ RUNTIME_INFO_KEY_CHARGER_CONNECTED, /**<Indicates whether charger is connected. */
+ RUNTIME_INFO_KEY_VIBRATION_LEVEL_HAPTIC_FEEDBACK, /**<@internal Indicates the current vibration level of haptic feedback. */
+ RUNTIME_INFO_KEY_AUTO_ROTATION_ENABLED, /**<Indicates whether auto rotation is enabled. */
} runtime_info_key_e;
/**
- * @brief Enumeration of Wi-Fi status
+ * @brief Enumeration for Wi-Fi status.
*/
typedef enum {
- RUNTIME_INFO_WIFI_STATUS_DISABLED, /**< GPS is disabled. */
- RUNTIME_INFO_WIFI_STATUS_UNCONNECTED, /**< Wi-Fi is enabled and network connection is not established. */
- RUNTIME_INFO_WIFI_STATUS_CONNECTED, /**< Network connection is established in Wi-Fi network. */
+ RUNTIME_INFO_WIFI_STATUS_DISABLED, /**< GPS is disabled. */
+ RUNTIME_INFO_WIFI_STATUS_UNCONNECTED, /**< Wi-Fi is enabled and network connection is not established. */
+ RUNTIME_INFO_WIFI_STATUS_CONNECTED, /**< Network connection is established in Wi-Fi network. */
} runtime_info_wifi_status_e;
/**
- * @brief Enumeration of GPS status
+ * @brief Enumeration for GPS status.
*/
typedef enum {
- RUNTIME_INFO_GPS_STATUS_DISABLED, /**< GPS is disabled. */
- RUNTIME_INFO_GPS_STATUS_SEARCHING, /**< GPS is searching for satellites. */
- RUNTIME_INFO_GPS_STATUS_CONNECTED, /**< GPS connection is established. */
+ RUNTIME_INFO_GPS_STATUS_DISABLED, /**< GPS is disabled. */
+ RUNTIME_INFO_GPS_STATUS_SEARCHING, /**< GPS is searching for satellites. */
+ RUNTIME_INFO_GPS_STATUS_CONNECTED, /**< GPS connection is established. */
} runtime_info_gps_status_e;
/**
- * @brief Enumeration of first day of week
+ * @internal
+ * @brief Enumeration for first day of week.
*/
typedef enum {
- RUNTIME_INFO_FIRST_DAY_OF_WEEK_SUNDAY, /**< Sunday */
- RUNTIME_INFO_FIRST_DAY_OF_WEEK_MONDAY, /**< Monday */
- RUNTIME_INFO_FIRST_DAY_OF_WEEK_TUESDAY, /**< Tuesday */
- RUNTIME_INFO_FIRST_DAY_OF_WEEK_WEDNESDAY, /**< Wednesday */
- RUNTIME_INFO_FIRST_DAY_OF_WEEK_THURSDAY, /**< Thursday */
- RUNTIME_INFO_FIRST_DAY_OF_WEEK_FRIDAY, /**< Friday */
- RUNTIME_INFO_FIRST_DAY_OF_WEEK_SATURDAY, /**< Saturday */
+ RUNTIME_INFO_FIRST_DAY_OF_WEEK_SUNDAY, /**< Sunday */
+ RUNTIME_INFO_FIRST_DAY_OF_WEEK_MONDAY, /**< Monday */
+ RUNTIME_INFO_FIRST_DAY_OF_WEEK_TUESDAY, /**< Tuesday */
+ RUNTIME_INFO_FIRST_DAY_OF_WEEK_WEDNESDAY, /**< Wednesday */
+ RUNTIME_INFO_FIRST_DAY_OF_WEEK_THURSDAY, /**< Thursday */
+ RUNTIME_INFO_FIRST_DAY_OF_WEEK_FRIDAY, /**< Friday */
+ RUNTIME_INFO_FIRST_DAY_OF_WEEK_SATURDAY, /**< Saturday */
} runtime_info_first_day_of_week_e;
/**
- * @brief Enumeration of audio jack status
+ * @brief Enumeration for audio jack status.
*/
typedef enum {
- RUNTIME_INFO_AUDIO_JACK_STATUS_UNCONNECTED, /**< audio jack is not connected */
- RUNTIME_INFO_AUDIO_JACK_STATUS_CONNECTED_3WIRE, /**< 3-conductor wire is connected. */
- RUNTIME_INFO_AUDIO_JACK_STATUS_CONNECTED_4WIRE, /**< 4-conductor wire is connected. */
+ RUNTIME_INFO_AUDIO_JACK_STATUS_UNCONNECTED, /**< Audio jack is not connected */
+ RUNTIME_INFO_AUDIO_JACK_STATUS_CONNECTED_3WIRE, /**< 3-conductor wire is connected. */
+ RUNTIME_INFO_AUDIO_JACK_STATUS_CONNECTED_4WIRE, /**< 4-conductor wire is connected. */
} runtime_info_audio_jack_status_e;
/**
* @brief Called when the runtime information changes
- * @param[in] key Type of notification
+ * @since_tizen 2.3
+ *
+ * @param[in] key The type of notification
* @param[in] user_data The user data passed from the callback registration function
+ *
* @pre runtime_info_set_changed_cb() will invoke this callback function.
+ *
* @see runtime_info_set_changed_cb()
* @see runtime_info_unset_changed_cb()
*/
typedef void (*runtime_info_changed_cb)(runtime_info_key_e key, void *user_data);
/**
- * @brief Gets the integer value of the runtime information
+ * @brief Gets the integer value of the runtime information.
* @details This function gets current state of the given key which represents specific runtime information.
- * @param[in] key The runtime information status key from which data should be read
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] key The runtime information status key from which data should be read
* @param[out] value The current value of the given key
- * @return 0 on success, otherwise a negative error value.
- * @retval #RUNTIME_INFO_ERROR_NONE Successful
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #RUNTIME_INFO_ERROR_NONE Successful
* @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
+ * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
+ * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
*/
int runtime_info_get_value_int(runtime_info_key_e key, int *value);
/**
- * @brief Gets the boolean value from the runtime information
+ * @brief Gets the boolean value from the runtime information.
* @details This function gets current state of the given key which represents specific runtime information.
- * @param[in] key The runtime information key from which data should be read
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] key The runtime information key from which data should be read
* @param[out] value The current value of the given key
- * @return 0 on success, otherwise a negative error value.
- * @retval #RUNTIME_INFO_ERROR_NONE Successful
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #RUNTIME_INFO_ERROR_NONE Successful
* @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
+ * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
+ * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
*/
int runtime_info_get_value_bool(runtime_info_key_e key, bool *value);
/**
- * @brief Gets the double value from the runtime information
+ * @brief Gets the double value from the runtime information.
* @details This function gets current state of the given key which represents specific runtime information.
- * @param[in] key The runtime information key from which data should be read
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] key The runtime information key from which data should be read
* @param[out] value The current value of the given key
- * @return 0 on success, otherwise a negative error value.
- * @retval #RUNTIME_INFO_ERROR_NONE Successful
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #RUNTIME_INFO_ERROR_NONE Successful
* @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
+ * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
+ * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
*/
int runtime_info_get_value_double(runtime_info_key_e key, double *value);
/**
- * @brief Gets the string value for specified runtime information
+ * @brief Gets the string value for specified runtime information.
* @details This function gets current state of the given key which represents specific runtime information.
- * @remarks @a value must be released with @c free() by you.
- * @param[in] key The runtime information key from which data should be read
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a value using free().
+ *
+ * @param[in] key The runtime information key from which data should be read
* @param[out] value The current value of the given key
- * @return 0 on success, otherwise a negative error value.
- * @retval #RUNTIME_INFO_ERROR_NONE Successful
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #RUNTIME_INFO_ERROR_NONE Successful
* @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
- * @retval #RUNTIME_INFO_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
+ * @retval #RUNTIME_INFO_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
*/
int runtime_info_get_value_string(runtime_info_key_e key, char **value);
/**
* @brief Registers a change event callback for given runtime information key.
+ * @since_tizen 2.3
*
- * @param[in] key The runtime information type
- * @param[in] callback The callback function to invoke
+ * @param[in] key The runtime information type
+ * @param[in] callback The callback function to invoke
* @param[in] user_data The user data to be passed to the callback function
*
- * @return 0 on success, otherwise a negative error value.
- * @retval #RUNTIME_INFO_ERROR_NONE Successful
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #RUNTIME_INFO_ERROR_NONE Successful
* @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api
* @post runtime_info_changed_cb() will be invoked.
*
* @see runtime_info_unset_changed_cb()
/**
* @brief Unregisters the callback function.
+ * @since_tizen 2.3
*
* @param[in] key The runtime information type
- * @return 0 on success, otherwise a negative error value.
- * @retval #RUNTIME_INFO_ERROR_NONE Successful
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #RUNTIME_INFO_ERROR_NONE Successful
* @retval #RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
*
* @see runtime_info_set_changed_cb()
/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
{
#endif
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
typedef enum {
RUNTIME_INFO_DATA_TYPE_STRING,
RUNTIME_INFO_DATA_TYPE_INT,
void runtime_info_updated(runtime_info_key_e key);
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);
+int runtime_info_vconf_get_value_bool(const char *vconf_key, int *value);
int runtime_info_vconf_get_value_double(const char *vconf_key, double *value);
int runtime_info_vconf_get_value_string(const char *vconf_key, char **value);
int runtime_info_location_network_set_event_cb(void);
void runtime_info_location_network_unset_event_cb(void);
-int runtime_info_location_sensor_get_value(runtime_info_value_h);
-int runtime_info_location_sensor_set_event_cb(void);
-void runtime_info_location_sensor_unset_event_cb(void);
-
int runtime_info_packet_data_get_value(runtime_info_value_h);
int runtime_info_packet_data_set_event_cb(void);
void runtime_info_packet_data_unset_event_cb(void);
+++ /dev/null
-<manifest>
- <request>
- <domain name="_" />
- </request>
-</manifest>
<manifest>
- <request>
- <domain name="_" />
- </request>
+ <request>
+ <domain name="_"/>
+ </request>
</manifest>
Name: capi-system-runtime-info
-Summary: A Runtime Information library in Tizen Native API
+Summary: A Runtime Information library in Core API
Version: 0.0.3
Release: 0
Group: System/API
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
Source1001: %{name}.manifest
-Source1002: %{name}-devel.manifest
+
BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(capi-base-common)
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
%description
-A Runtime Information library in Tizen Native API.
+
%package devel
-Summary: A Runtime Information library in Tizen Native API (Development)
+Summary: A Runtime Information library in Core API (Development)
Group: Development/System
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig(capi-base-common)
%prep
%setup -q
-cp %{SOURCE1001} %{SOURCE1002} .
-
+cp %{SOURCE1001} .
%build
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%{_libdir}/lib*.so.*
%files devel
-%manifest %{name}-devel.manifest
%{_includedir}/system/*.h
%{_libdir}/pkgconfig/*.pc
%{_libdir}/lib*.so
},
{
- RUNTIME_INFO_KEY_LOCATION_SENSOR_AIDING_ENABLED, /**<Indicates whether the location service is allowed to use pedestrian sensors for positioning performance. */
- RUNTIME_INFO_DATA_TYPE_BOOL,
- runtime_info_location_sensor_get_value,
- runtime_info_location_sensor_set_event_cb,
- runtime_info_location_sensor_unset_event_cb,
- NULL
-},
-
-{
RUNTIME_INFO_KEY_PACKET_DATA_ENABLED, /**<Indicates Whether the packet data through 3G network is enabled. */
RUNTIME_INFO_DATA_TYPE_BOOL,
runtime_info_packet_data_get_value,
return RUNTIME_INFO_ERROR_NONE;
}
-int runtime_info_get_value_int(runtime_info_key_e key, int *value)
+API int runtime_info_get_value_int(runtime_info_key_e key, int *value)
{
int retcode;
runtime_info_value_u runtime_info_value;
return retcode;
}
-int runtime_info_get_value_bool(runtime_info_key_e key, bool *value)
+API int runtime_info_get_value_bool(runtime_info_key_e key, bool *value)
{
int retcode;
runtime_info_value_u runtime_info_value;
return retcode;
}
-int runtime_info_get_value_double(runtime_info_key_e key, double *value)
+API int runtime_info_get_value_double(runtime_info_key_e key, double *value)
{
int retcode;
runtime_info_value_u runtime_info_value;
return retcode;
}
-int runtime_info_get_value_string(runtime_info_key_e key, char **value)
+API int runtime_info_get_value_string(runtime_info_key_e key, char **value)
{
int retcode;
runtime_info_value_u runtime_info_value;
return retcode;
}
-int runtime_info_set_changed_cb(runtime_info_key_e key, runtime_info_changed_cb callback, void *user_data)
+API int runtime_info_set_changed_cb(runtime_info_key_e key, runtime_info_changed_cb callback, void *user_data)
{
runtime_info_item_h runtime_info_item;
runtime_info_func_set_event_cb set_event_cb;
return RUNTIME_INFO_ERROR_NONE;
}
-int runtime_info_unset_changed_cb(runtime_info_key_e key)
+API int runtime_info_unset_changed_cb(runtime_info_key_e key)
{
runtime_info_item_h runtime_info_item;
runtime_info_func_unset_event_cb unset_event_cb;
static const char *VCONF_BT_HOTSPOT_ENABLED = VCONFKEY_MOBILE_HOTSPOT_MODE;
static const char *VCONF_USB_HOTSPOT_ENABLED = VCONFKEY_MOBILE_HOTSPOT_MODE;
static const char *VCONF_PACKET_DATA_ENABLED = VCONFKEY_3G_ENABLE;
-static const char *VCONF_DATA_ROAMING_ENABLED = "db/setting/data_roaming";
+static const char *VCONF_DATA_ROAMING_ENABLED = VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL;
static const char *VCONF_GPS_STATUS = VCONFKEY_LOCATION_GPS_STATE;
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;
+ vconf_value = VCONFKEY_WIFI_OFF;
switch (vconf_value) {
case VCONFKEY_WIFI_OFF:
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_BT_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_BT_STATUS_OFF;
switch (vconf_value) {
case VCONFKEY_BT_STATUS_OFF:
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_WIFI_HOTSPOT_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_MOBILE_HOTSPOT_MODE_NONE;
value->b = (vconf_value&VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI) ? true : false;
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_BT_HOTSPOT_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_MOBILE_HOTSPOT_MODE_NONE;
value->b = (vconf_value&VCONFKEY_MOBILE_HOTSPOT_MODE_BT) ? true : false;
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_USB_HOTSPOT_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_MOBILE_HOTSPOT_MODE_NONE;
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;
+ int vconf_value;
if (runtime_info_vconf_get_value_bool(VCONF_PACKET_DATA_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = 0;
- value->b = vconf_value;
+ value->b = (bool)vconf_value;
return RUNTIME_INFO_ERROR_NONE;
}
int runtime_info_data_roaming_get_value(runtime_info_value_h value)
{
- bool vconf_value;
+ int vconf_value;
if (runtime_info_vconf_get_value_bool(VCONF_DATA_ROAMING_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = 0;
- value->b = vconf_value;
+ value->b = (bool)vconf_value;
return RUNTIME_INFO_ERROR_NONE;
}
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_GPS_STATUS, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_LOCATION_GPS_OFF;
switch (vconf_value) {
case VCONFKEY_LOCATION_GPS_OFF:
#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";
+static const char *VCONF_24HOUR_FORMAT = VCONFKEY_REGIONFORMAT_TIME1224;
+static const char *VCONF_FIRST_DAY_OF_WEEK = VCONFKEY_SETAPPL_WEEKOFDAY_FORMAT_INT;
static const char *VCONF_LANGUAGE = VCONFKEY_LANGSET;
static const char *VCONF_REGION = VCONFKEY_REGIONFORMAT;
#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";
+static const char *VCONF_LOCATION_AGPS_ENABLED = VCONFKEY_LOCATION_AGPS_ENABLED;
static const char *VCONF_LOCATION_NETWORK_ENABLED = VCONFKEY_LOCATION_NETWORK_ENABLED;
-static const char *VCONF_LOCATION_SENSOR_ENABLED = "db/location/setting/SensorEnabled";
int runtime_info_location_service_get_value(runtime_info_value_h value)
{
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_LOCATION_SERVICE_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = 0;
value->b = vconf_value;
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_LOCATION_AGPS_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = 0;
value->b = vconf_value;
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_LOCATION_NETWORK_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = 0;
value->b = vconf_value;
{
runtime_info_vconf_unset_event_cb(VCONF_LOCATION_NETWORK_ENABLED, 0);
}
-
-int runtime_info_location_sensor_get_value(runtime_info_value_h value)
-{
- int vconf_value;
-
- if (runtime_info_vconf_get_value_int(VCONF_LOCATION_SENSOR_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
-
- value->b = vconf_value;
-
- return RUNTIME_INFO_ERROR_NONE;
-}
-
-int runtime_info_location_sensor_set_event_cb()
-{
- return runtime_info_vconf_set_event_cb(VCONF_LOCATION_SENSOR_ENABLED, RUNTIME_INFO_KEY_LOCATION_SENSOR_AIDING_ENABLED, 0);
-}
-
-void runtime_info_location_sensor_unset_event_cb()
-{
- runtime_info_vconf_unset_event_cb(VCONF_LOCATION_SENSOR_ENABLED, 0);
-}
-
static const char *VCONF_FLIGHT_MODE = VCONFKEY_TELEPHONY_FLIGHT_MODE;
static const char *VCONF_AUDIO_JACK = VCONFKEY_SYSMAN_EARJACK;
-static const char *VCONF_SILENT_MODE = "db/setting/sound/sound_on";
-static const char *VCONF_VIBRATION_ENABLED = "db/setting/sound/vibration_on";
+static const char *VCONF_SOUND_ENABLED = VCONFKEY_SETAPPL_SOUND_STATUS_BOOL;
+static const char *VCONF_VIBRATION_ENABLED = VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL;
static const char *VCONF_ROTATION_LOCK_ENABLED = VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL;
static const char *VCONF_BATTERY_CHARGING = VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW;
static const char *VCONF_TVOUT_CONNECTED = VCONFKEY_SYSMAN_EARJACK;
int runtime_info_flightmode_get_value(runtime_info_value_h value)
{
- bool vconf_value;
+ int vconf_value;
if (runtime_info_vconf_get_value_bool(VCONF_FLIGHT_MODE, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = 0;
- value->b = vconf_value;
+ value->b = (bool)vconf_value;
return RUNTIME_INFO_ERROR_NONE;
}
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_AUDIO_JACK, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_SYSMAN_EARJACK_REMOVED;
switch (vconf_value) {
case VCONFKEY_SYSMAN_EARJACK_3WIRE:
int runtime_info_silent_mode_get_value(runtime_info_value_h value)
{
- bool vconf_value;
+ int sound, vib;
- if (runtime_info_vconf_get_value_bool(VCONF_SILENT_MODE, &vconf_value))
+ if (runtime_info_vconf_get_value_bool(VCONF_SOUND_ENABLED, &sound))
return RUNTIME_INFO_ERROR_IO_ERROR;
- value->b = vconf_value;
+ if (runtime_info_vconf_get_value_bool(VCONF_VIBRATION_ENABLED, &vib))
+ return RUNTIME_INFO_ERROR_IO_ERROR;
+
+ if (sound == 0 && vib == 0)
+ value->b = true;
+ else
+ value->b = false;
return RUNTIME_INFO_ERROR_NONE;
}
int runtime_info_silent_mode_set_event_cb(void)
{
- return runtime_info_vconf_set_event_cb(VCONF_SILENT_MODE, RUNTIME_INFO_KEY_SILENT_MODE_ENABLED, 0);
+ int ret;
+
+ ret = runtime_info_vconf_set_event_cb(VCONF_SOUND_ENABLED, RUNTIME_INFO_KEY_SILENT_MODE_ENABLED, 0);
+ if (ret != RUNTIME_INFO_ERROR_NONE)
+ return ret;
+
+ ret = runtime_info_vconf_set_event_cb(VCONF_VIBRATION_ENABLED, RUNTIME_INFO_KEY_SILENT_MODE_ENABLED, 1);
+ if (ret != RUNTIME_INFO_ERROR_NONE)
+ runtime_info_vconf_unset_event_cb(VCONF_SOUND_ENABLED, 0);
+
+ return ret;
}
void runtime_info_silent_mode_unset_event_cb(void)
{
- runtime_info_vconf_unset_event_cb(VCONF_SILENT_MODE, 0);
+ runtime_info_vconf_unset_event_cb(VCONF_SOUND_ENABLED, 0);
+ runtime_info_vconf_unset_event_cb(VCONF_VIBRATION_ENABLED, 1);
}
int runtime_info_vibration_enabled_get_value(runtime_info_value_h value)
{
- bool vconf_value;
+ int vconf_value;
if (runtime_info_vconf_get_value_bool(VCONF_VIBRATION_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = 0;
- value->b = vconf_value;
+ value->b = (bool)vconf_value;
return RUNTIME_INFO_ERROR_NONE;
}
int runtime_info_auto_rotation_enabled_get_value(runtime_info_value_h value)
{
- bool vconf_value;
+ int vconf_value;
if (runtime_info_vconf_get_value_bool(VCONF_ROTATION_LOCK_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = 0;
- value->b = vconf_value;
+ value->b = (bool)vconf_value;
return RUNTIME_INFO_ERROR_NONE;
}
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_TVOUT_CONNECTED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_SYSMAN_EARJACK_REMOVED;
switch (vconf_value) {
case VCONFKEY_SYSMAN_EARJACK_TVOUT:
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_AUDIO_JACK_STATUS, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_SYSMAN_EARJACK_REMOVED;
switch (vconf_value) {
case VCONFKEY_SYSMAN_EARJACK_3WIRE:
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_SLIDING_KEYBOARD_STATUS, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_SYSMAN_SLIDING_KEYBOARD_NOT_SUPPORTED;
switch (vconf_value) {
case VCONFKEY_SYSMAN_SLIDING_KEYBOARD_NOT_AVAILABE:
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_USB_CONNECTED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_SYSMAN_USB_DISCONNECTED;
switch (vconf_value) {
case VCONFKEY_SYSMAN_USB_DISCONNECTED:
if (runtime_info_vconf_get_value_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, &vconf_value))
return RUNTIME_INFO_ERROR_IO_ERROR;
- value->i = vconf_value;
+ value->i = vconf_value;
return RUNTIME_INFO_ERROR_NONE;
}
return vconf_get_int(vconf_key, value);
}
-int runtime_info_vconf_get_value_bool(const char *vconf_key, bool *value)
+int runtime_info_vconf_get_value_bool(const char *vconf_key, int *value)
{
- return vconf_get_bool(vconf_key, (int *)value);
+ return vconf_get_bool(vconf_key, value);
}
int runtime_info_vconf_get_value_double(const char *vconf_key, double *value)