Tizen Native API
Runtime information

The Runtime Information API provides functions to obtain runtime information.

Required Header

#include <runtime_info.h>

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.

Functions

int runtime_info_get_value_int (runtime_info_key_e key, int *value)
 Gets the integer value of the runtime information.
int runtime_info_get_value_bool (runtime_info_key_e key, bool *value)
 Gets the boolean value from the runtime information.
int runtime_info_get_value_double (runtime_info_key_e key, double *value)
 Gets the double value from the runtime information.
int runtime_info_get_value_string (runtime_info_key_e key, char **value)
 Gets the string value for specified runtime information.
int runtime_info_set_changed_cb (runtime_info_key_e key, runtime_info_changed_cb callback, void *user_data)
 Registers a change event callback for given runtime information key.
int runtime_info_unset_changed_cb (runtime_info_key_e key)
 Unregisters the callback function.

Typedefs

typedef void(* runtime_info_changed_cb )(runtime_info_key_e key, void *user_data)
 Called when the runtime information changes.

Typedef Documentation

typedef void(* runtime_info_changed_cb)(runtime_info_key_e key, void *user_data)

Called when the runtime information changes.

Since :
2.3.1
Parameters:
[in]keyThe type of notification
[in]user_dataThe user data passed from the callback registration function
Precondition:
runtime_info_set_changed_cb() will invoke this callback function.
See also:
runtime_info_set_changed_cb()
runtime_info_unset_changed_cb()

Enumeration Type Documentation

Enumeration for audio jack status.

Since :
2.3.1
Enumerator:
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.

Enumeration for error codes for runtime information.

Since :
2.3.1
Enumerator:
RUNTIME_INFO_ERROR_NONE 

Successful

RUNTIME_INFO_ERROR_INVALID_PARAMETER 

Invalid parameter

RUNTIME_INFO_ERROR_OUT_OF_MEMORY 

Out of memory

RUNTIME_INFO_ERROR_IO_ERROR 

An input/output error occurred when read value from system

RUNTIME_INFO_ERROR_PERMISSION_DENIED 

No permission to use the api

RUNTIME_INFO_ERROR_NOT_SUPPORTED 

Not supported parameter

Enumeration for GPS status.

Since :
2.3.1
Enumerator:
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.

Enumeration for keys for runtime information.

Since :
2.3.1
Enumerator:
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_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_VIBRATION_ENABLED 

Indicates whether vibration is enabled.

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_USB_CONNECTED 

Indicates whether USB is connected.

RUNTIME_INFO_KEY_CHARGER_CONNECTED 

Indicates whether charger is connected.

RUNTIME_INFO_KEY_AUTO_ROTATION_ENABLED 

Indicates whether auto rotation is enabled.


Function Documentation

int runtime_info_get_value_bool ( runtime_info_key_e  key,
bool *  value 
)

Gets the boolean value from the runtime information.

This function gets current state of the given key which represents specific runtime information.

Since :
2.3.1
Parameters:
[in]keyThe runtime information key from which data should be read
[out]valueThe current value of the given key
Returns:
0 on success, otherwise a negative error value
Return values:
RUNTIME_INFO_ERROR_NONESuccessful
RUNTIME_INFO_ERROR_INVALID_PARAMETERInvalid parameter
RUNTIME_INFO_ERROR_IO_ERRORAn input/output error occurred when read value from system
RUNTIME_INFO_ERROR_PERMISSION_DENIEDNo permission to use the api
RUNTIME_INFO_ERROR_NOT_SUPPORTEDNot supported parameter
int runtime_info_get_value_double ( runtime_info_key_e  key,
double *  value 
)

Gets the double value from the runtime information.

This function gets current state of the given key which represents specific runtime information.

Since :
2.3.1
Parameters:
[in]keyThe runtime information key from which data should be read
[out]valueThe current value of the given key
Returns:
0 on success, otherwise a negative error value
Return values:
RUNTIME_INFO_ERROR_NONESuccessful
RUNTIME_INFO_ERROR_INVALID_PARAMETERInvalid parameter
RUNTIME_INFO_ERROR_IO_ERRORAn input/output error occurred when read value from system
RUNTIME_INFO_ERROR_PERMISSION_DENIEDNo permission to use the api
RUNTIME_INFO_ERROR_NOT_SUPPORTEDNot supported parameter
int runtime_info_get_value_int ( runtime_info_key_e  key,
int *  value 
)

Gets the integer value of the runtime information.

This function gets current state of the given key which represents specific runtime information.

Since :
2.3.1
Parameters:
[in]keyThe runtime information status key from which data should be read
[out]valueThe current value of the given key
Returns:
0 on success, otherwise a negative error value
Return values:
RUNTIME_INFO_ERROR_NONESuccessful
RUNTIME_INFO_ERROR_INVALID_PARAMETERInvalid parameter
RUNTIME_INFO_ERROR_IO_ERRORAn input/output error occurred when read value from system
RUNTIME_INFO_ERROR_PERMISSION_DENIEDNo permission to use the api
RUNTIME_INFO_ERROR_NOT_SUPPORTEDNot supported parameter
int runtime_info_get_value_string ( runtime_info_key_e  key,
char **  value 
)

Gets the string value for specified runtime information.

This function gets current state of the given key which represents specific runtime information.

Since :
2.3.1
Remarks:
You must release value using free().
Parameters:
[in]keyThe runtime information key from which data should be read
[out]valueThe current value of the given key
Returns:
0 on success, otherwise a negative error value
Return values:
RUNTIME_INFO_ERROR_NONESuccessful
RUNTIME_INFO_ERROR_INVALID_PARAMETERInvalid parameter
RUNTIME_INFO_ERROR_IO_ERRORAn input/output error occurred when read value from system
RUNTIME_INFO_ERROR_OUT_OF_MEMORYOut of memory
RUNTIME_INFO_ERROR_PERMISSION_DENIEDNo permission to use the api
RUNTIME_INFO_ERROR_NOT_SUPPORTEDNot supported parameter
int runtime_info_set_changed_cb ( runtime_info_key_e  key,
runtime_info_changed_cb  callback,
void *  user_data 
)

Registers a change event callback for given runtime information key.

Since :
2.3.1
Parameters:
[in]keyThe runtime information type
[in]callbackThe callback function to invoke
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
RUNTIME_INFO_ERROR_NONESuccessful
RUNTIME_INFO_ERROR_INVALID_PARAMETERInvalid parameter
RUNTIME_INFO_ERROR_PERMISSION_DENIEDNo permission to use the api
RUNTIME_INFO_ERROR_NOT_SUPPORTEDNot supported parameter
Postcondition:
runtime_info_changed_cb() will be invoked.
See also:
runtime_info_unset_changed_cb()
runtime_info_changed_cb()

Unregisters the callback function.

Since :
2.3.1
Parameters:
[in]keyThe runtime information type
Returns:
0 on success, otherwise a negative error value
Return values:
RUNTIME_INFO_ERROR_NONESuccessful
RUNTIME_INFO_ERROR_INVALID_PARAMETERInvalid parameter
See also:
runtime_info_set_changed_cb()