add key RUNTIME_INFO_KEY_AUTO_ROTATION_ENABLED
authorNam KwanWoo <kw46.nam@samsung.com>
Tue, 22 Jan 2013 04:59:00 +0000 (13:59 +0900)
committerNam KwanWoo <kw46.nam@samsung.com>
Tue, 22 Jan 2013 04:59:00 +0000 (13:59 +0900)
Change-Id: Iab5dd251ee1fc14003fb1f9eb8fed370adaac4a5

debian/changelog
include/runtime_info.h
include/runtime_info_private.h
packaging/capi-system-runtime-info.spec
src/runtime_info.c
src/runtime_info_system.c

index 076f3d9..46ad61e 100755 (executable)
@@ -1,3 +1,11 @@
+capi-system-runtime-info (0.0.2-1) unstable; urgency=low
+
+  * Change key name
+  * Git: framework/api/runtime-info
+  * Tag: capi-system-runtime-info_0.0.2-1
+
+ -- Kwanwoo Nam <kw46.nam@samsung.com>  Tue, 22 Jan 2013 15:40:00 +0900
+
 capi-system-runtime-info (0.0.1-11) unstable; urgency=low
 
   * Fixed prevent defect case : CID 10685
index a1b43ad..01edb0b 100755 (executable)
@@ -11,7 +11,7 @@
  * 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.
  */
 
 #ifndef __TIZEN_SYSTEM_RUNTIME_INFO_H__
@@ -32,8 +32,7 @@ extern "C"
 /**
  * @brief Enumeration of error code for runtime information
  */
-typedef enum
-{
+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 */
@@ -43,8 +42,7 @@ typedef enum
 /**
  * @brief Enumeration of key for runtime information
  */
-typedef enum
-{
+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. */
@@ -59,7 +57,7 @@ typedef enum
        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_ROTATION_LOCK_ENABLED, /**<Indicates whether rotation lock is enabled. */
+       RUNTIME_INFO_KEY_ROTATION_LOCK_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. */
@@ -73,14 +71,14 @@ typedef enum
        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_e;
 
 
 /**
  * @brief Enumeration of Wi-Fi status
  */
-typedef enum
-{
+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. */
@@ -89,8 +87,7 @@ typedef enum
 /**
  * @brief Enumeration of GPS status
  */
-typedef enum
-{
+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. */
@@ -99,8 +96,7 @@ typedef enum
 /**
  * @brief Enumeration of first day of week
  */
-typedef enum
-{
+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 */
@@ -113,8 +109,7 @@ typedef enum
 /**
  * @brief Enumeration of audio jack status
  */
-typedef enum
-{
+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. */
@@ -170,7 +165,7 @@ int runtime_info_get_value_double(runtime_info_key_e key, double *value);
 /**
  * @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. 
+ * @remarks @a value must be released with @c free() by you.
  * @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.
@@ -201,7 +196,7 @@ int runtime_info_set_changed_cb(runtime_info_key_e key, runtime_info_changed_cb
 
 
 /**
- * @brief   Unregisters the callback function. 
+ * @brief   Unregisters the callback function.
  *
  * @param[in] key The runtime information type
  * @return  0 on success, otherwise a negative error value.
index 51fec30..575a47b 100755 (executable)
@@ -11,7 +11,7 @@
  * 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.
  */
 
 
@@ -39,7 +39,7 @@ typedef union {
        char *s;
 } runtime_info_value_u;
 
-typedef runtime_info_value_u *runtime_info_value_h;
+typedef runtime_info_value_u * runtime_info_value_h;
 
 typedef int (*runtime_info_func_get_value) (runtime_info_value_h value);
 typedef int (*runtime_info_func_set_event_cb) (void);
@@ -116,8 +116,6 @@ int runtime_info_vibration_enabled_set_event_cb(void);
 void runtime_info_vibration_enabled_unset_event_cb(void);
 
 int runtime_info_rotation_lock_enabled_get_value(runtime_info_value_h);
-int runtime_info_rotation_lock_enabled_set_event_cb(void);
-void runtime_info_rotation_lock_enabled_unset_event_cb(void);
 
 int runtime_info_24hour_format_get_value(runtime_info_value_h);
 int runtime_info_24hour_format_set_event_cb(void);
@@ -167,6 +165,10 @@ int runtime_info_vibration_level_haptic_feedback_get_value(runtime_info_value_h
 int runtime_info_vibration_level_haptic_feedback_set_event_cb();
 void runtime_info_vibration_level_haptic_feedback_unset_event_cb();
 
+int runtime_info_auto_rotation_enabled_get_value(runtime_info_value_h);
+int runtime_info_auto_rotation_enabled_set_event_cb(void);
+void runtime_info_auto_rotation_enabled_unset_event_cb(void);
+
 #ifdef __cplusplus
 }
 #endif
index 5864fc4..2220456 100755 (executable)
@@ -1,7 +1,7 @@
 Name:       capi-system-runtime-info
 Summary:    A Runtime Information library in Tizen Native API
-Version:    0.0.1
-Release:    9
+Version:    0.0.2
+Release:    0
 Group:      System/Libraries
 License:    Apache License, Version 2.0
 Source0:    %{name}-%{version}.tar.gz
@@ -38,6 +38,10 @@ make %{?jobs:-j%jobs}
 
 %install
 rm -rf %{buildroot}
+
+mkdir -p %{buildroot}/usr/share/license
+cp -f LICENSE %{buildroot}/usr/share/license/%{name}
+
 %make_install
 
 %post -p /sbin/ldconfig
@@ -47,9 +51,12 @@ rm -rf %{buildroot}
 
 %files
 %{_libdir}/lib*.so.*
+/usr/share/license/%{name}
 %manifest runtime-info.manifest
 
 %files devel
 %{_includedir}/system/*.h
 %{_libdir}/pkgconfig/*.pc
 %{_libdir}/lib*.so
+
+
index dc64831..ff9d269 100644 (file)
@@ -185,8 +185,8 @@ runtime_info_item_s runtime_info_item_table[] = {
        RUNTIME_INFO_KEY_ROTATION_LOCK_ENABLED, /**<Indicates whether rotation lock is enabled. */
        RUNTIME_INFO_DATA_TYPE_BOOL,
        runtime_info_rotation_lock_enabled_get_value,
-       runtime_info_rotation_lock_enabled_set_event_cb,
-       runtime_info_rotation_lock_enabled_unset_event_cb,
+       NULL,
+       NULL,
        NULL
 },
 
@@ -244,7 +244,6 @@ runtime_info_item_s runtime_info_item_table[] = {
        NULL
 },
 
-
 {
        RUNTIME_INFO_KEY_BATTERY_IS_CHARGING, /**<Indicates the battery is currently charging. */
        RUNTIME_INFO_DATA_TYPE_BOOL,
@@ -254,7 +253,6 @@ runtime_info_item_s runtime_info_item_table[] = {
        NULL
 },
 
-
 {
        RUNTIME_INFO_KEY_TV_OUT_CONNECTED, /**<Indicates whether TV out is connected. */
        RUNTIME_INFO_DATA_TYPE_BOOL,
@@ -264,7 +262,6 @@ runtime_info_item_s runtime_info_item_table[] = {
        NULL
 },
 
-
 {
        RUNTIME_INFO_KEY_AUDIO_JACK_STATUS, /**<Indicates the current status of audio jack. */
        RUNTIME_INFO_DATA_TYPE_INT,
@@ -274,7 +271,6 @@ runtime_info_item_s runtime_info_item_table[] = {
        NULL
 },
 
-
 {
        RUNTIME_INFO_KEY_SLIDING_KEYBOARD_OPENED, /**<Indicates whether sliding keyboard is opened. */
        RUNTIME_INFO_DATA_TYPE_BOOL,
@@ -284,7 +280,6 @@ runtime_info_item_s runtime_info_item_table[] = {
        NULL
 },
 
-
 {
        RUNTIME_INFO_KEY_USB_CONNECTED, /**<Indicates whether usb is connected. */
        RUNTIME_INFO_DATA_TYPE_BOOL,
@@ -312,6 +307,14 @@ runtime_info_item_s runtime_info_item_table[] = {
        NULL
 },
 
+{
+       RUNTIME_INFO_KEY_AUTO_ROTATION_ENABLED, /**<Indicates whether auto rotation is enabled. */
+       RUNTIME_INFO_DATA_TYPE_BOOL,
+       runtime_info_auto_rotation_enabled_get_value,
+       runtime_info_auto_rotation_enabled_set_event_cb,
+       runtime_info_auto_rotation_enabled_unset_event_cb,
+       NULL
+},
 
 {
        RUNTIME_INFO_MAX, RUNTIME_INFO_DATA_TYPE_INT, NULL, NULL, NULL, NULL
index 18afd47..280341d 100644 (file)
@@ -142,6 +142,13 @@ void runtime_info_vibration_enabled_unset_event_cb()
 
 int runtime_info_rotation_lock_enabled_get_value(runtime_info_value_h value)
 {
+       value->b = false;
+
+       return RUNTIME_INFO_ERROR_INVALID_PARAMETER;
+}
+
+int runtime_info_auto_rotation_enabled_get_value(runtime_info_value_h value)
+{
        bool vconf_value;
 
        if (runtime_info_vconf_get_value_bool(VCONF_ROTATION_LOCK_ENABLED, &vconf_value))
@@ -152,12 +159,12 @@ int runtime_info_rotation_lock_enabled_get_value(runtime_info_value_h value)
        return RUNTIME_INFO_ERROR_NONE;
 }
 
-int runtime_info_rotation_lock_enabled_set_event_cb()
+int runtime_info_auto_rotation_enabled_set_event_cb()
 {
-       return runtime_info_vconf_set_event_cb(VCONF_ROTATION_LOCK_ENABLED, RUNTIME_INFO_KEY_ROTATION_LOCK_ENABLED, 0);
+       return runtime_info_vconf_set_event_cb(VCONF_ROTATION_LOCK_ENABLED, RUNTIME_INFO_KEY_AUTO_ROTATION_ENABLED, 0);
 }
 
-void runtime_info_rotation_lock_enabled_unset_event_cb()
+void runtime_info_auto_rotation_enabled_unset_event_cb()
 {
        runtime_info_vconf_unset_event_cb(VCONF_ROTATION_LOCK_ENABLED, 0);
 }