Change function name and location 56/253756/5 accepted/tizen/unified/20210219.041145 submit/tizen/20210218.015647
authorlokilee73 <changjoo.lee@samsung.com>
Wed, 17 Feb 2021 09:03:30 +0000 (18:03 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Wed, 17 Feb 2021 11:35:25 +0000 (20:35 +0900)
ex)
1. function name
   is_display_state_supported -> is_feature_display_state_supported
   is_display_supported -> is_feature_display_supported
2. location
   common.c -> display.c

Change-Id: I0fc050b244858e4d3b3ffcc02b6455af51cdecfa
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
include/display-internal.h
src/callback.c
src/common.c
src/common.h
src/display.c
src/power.c

index 2ad3811..b8574bc 100644 (file)
@@ -118,6 +118,24 @@ int device_display_set_brightness_state(int display_index, display_state_e state
  * @see device_display_change_state_by_reason()
  */
 int device_display_change_state_by_reason(display_state_e type, const char *reason, int timeout, dbus_pending_cb cb);
+
+/**
+ * @platform
+ * @brief Check display feature(http://tizen.org/feature/display)
+ * @since_tizen 6.5
+ * @return @c 1 if it is supported,
+ *         otherwise 0
+ */
+int is_feature_display_supported(void);
+
+/**
+ * @platform
+ * @brief Check display state feature(http://tizen.org/feature/display.state)
+ * @since_tizen 6.5
+ * @return @c 1 if it is supported,
+ *         otherwise 0
+ */
+int is_feature_display_state_supported(void);
 #ifdef __cplusplus
 }
 #endif
index d2adebb..e8006d0 100644 (file)
@@ -292,7 +292,7 @@ int device_add_callback(device_callback_e type, device_changed_cb cb, void *data
        GList *elem, *elem_next;
        int ret, n;
 
-       if (!is_display_supported() && type == DEVICE_CALLBACK_DISPLAY_STATE)
+       if (!is_feature_display_supported() && type == DEVICE_CALLBACK_DISPLAY_STATE)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
        if (type < 0 || type >= DEVICE_CALLBACK_MAX)
@@ -334,7 +334,7 @@ int device_remove_callback(device_callback_e type, device_changed_cb cb)
        GList *elem, *elem_next;
        int ret, n;
 
-       if (!is_display_supported() && type == DEVICE_CALLBACK_DISPLAY_STATE)
+       if (!is_feature_display_supported() && type == DEVICE_CALLBACK_DISPLAY_STATE)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
        if (type < 0 || type >= DEVICE_CALLBACK_MAX)
index a35a612..8545e10 100644 (file)
@@ -24,8 +24,6 @@
 
 #define MODEL_NAME      "http://tizen.org/system/model_name"
 #define MODEL_EMULATOR  "Emulator"
-#define DISPLAY_FEATURE     "http://tizen.org/feature/display"
-#define DISPLAY_STATE_FEATURE     "http://tizen.org/feature/display.state"
 
 tizen_profile_t _get_tizen_profile()
 {
@@ -128,43 +126,3 @@ bool is_emulator(void)
        return emul;
 }
 //LCOV_EXCL_STOP
-
-int is_display_supported(void)
-{
-       int ret;
-       bool display_avail;
-
-       ret = system_info_get_platform_bool(DISPLAY_FEATURE, &display_avail);
-       if (ret < 0) {
-//LCOV_EXCL_START System Error
-               _E("Failed to get value of display feature");
-               return false;
-//LCOV_EXCL_STOP
-       } else if (ret == 0 && !display_avail) {
-//LCOV_EXCL_START System Error
-               _D("Display feature is not supported");
-               return false;
-//LCOV_EXCL_STOP
-       } else
-               return true;
-}
-
-int is_display_state_supported(void)
-{
-       int ret;
-       bool display_state_avail;
-
-       ret = system_info_get_platform_bool(DISPLAY_STATE_FEATURE, &display_state_avail);
-       if (ret < 0) {
-//LCOV_EXCL_START System Error
-               _E("Failed to get value of display state feature");
-               return false;
-//LCOV_EXCL_STOP
-       } else if (ret == 0 && !display_state_avail) {
-//LCOV_EXCL_START System Error
-               _D("Display state feature is not supported");
-               return false;
-//LCOV_EXCL_STOP
-       } else
-               return true;
-}
index 5008b7f..90fc373 100644 (file)
@@ -69,6 +69,4 @@ int check_async_call_rate(long *num_calls);
 #define TIZEN_FEATURE_TRACKER (_get_tizen_profile() == TIZEN_PROFILE_TV)
 
 bool is_emulator(void);
-int is_display_state_supported(void);
-int is_display_supported(void);
 #endif /* __COMMON_H__ */
index ca776b6..2305f45 100644 (file)
 #include <errno.h>
 #include <vconf.h>
 #include <libsyscommon/dbus-system.h>
+#include <system_info.h>
 
 #include "display.h"
 #include "display-internal.h"
 #include "common.h"
 
+#define DISPLAY_FEATURE     "http://tizen.org/feature/display"
+#define DISPLAY_STATE_FEATURE     "http://tizen.org/feature/display.state"
+
 #define METHOD_GET_DISPLAY_COUNT        "GetDisplayCount"
 #define METHOD_GET_MAX_BRIGHTNESS       "GetMaxBrightness"
 #define METHOD_GET_BRIGHTNESS           "GetBrightness"
@@ -64,7 +68,7 @@ int device_display_get_numbers(int *device_number)
 {
        int ret;
 
-       ret = is_display_supported();
+       ret = is_feature_display_supported();
        if (!ret)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
@@ -91,7 +95,7 @@ int device_display_get_max_brightness(int display_index, int *max_brightness)
 {
        int ret;
 
-       ret = is_display_supported();
+       ret = is_feature_display_supported();
        if (!ret)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
@@ -127,7 +131,7 @@ int device_display_get_brightness(int display_index, int *brightness)
 {
        int ret;
 
-       ret = is_display_supported();
+       ret = is_feature_display_supported();
        if (!ret)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
@@ -157,7 +161,7 @@ int device_display_set_brightness(int display_index, int brightness)
 {
        int ret, max;
 
-       ret = is_display_supported();
+       ret = is_feature_display_supported();
        if (!ret)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
@@ -189,7 +193,7 @@ int device_display_get_state(display_state_e *state)
 {
        int ret, val;
 
-       ret = is_display_supported();
+       ret = is_feature_display_supported();
        if (!ret)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
@@ -249,7 +253,7 @@ int device_display_change_state(display_state_e state)
        static int privilege = -1;
        static long num_calls = 0;
 
-       ret = is_display_state_supported();
+       ret = is_feature_display_state_supported();
        if (!ret)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
@@ -295,7 +299,7 @@ int device_display_get_max_brightness_state(int display_index, display_state_e s
 {
        int ret;
 
-       ret = is_display_supported();
+       ret = is_feature_display_supported();
        if (!ret)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
@@ -340,7 +344,7 @@ int device_display_get_brightness_state(int display_index, display_state_e state
 {
        int ret;
 
-       ret = is_display_supported();
+       ret = is_feature_display_supported();
        if (!ret)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
@@ -376,7 +380,7 @@ int device_display_set_brightness_state(int display_index, display_state_e state
 {
        int ret, max;
 
-       ret = is_display_supported();
+       ret = is_feature_display_supported();
        if (!ret)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
@@ -431,3 +435,43 @@ int device_display_change_state_by_reason(display_state_e type, const char *reas
        return errno_to_device_error(ret);
 }
 //LCOV_EXCL_STOP
+
+int is_feature_display_supported(void)
+{
+       int ret;
+       bool display_avail;
+
+       ret = system_info_get_platform_bool(DISPLAY_FEATURE, &display_avail);
+       if (ret < 0) {
+//LCOV_EXCL_START System Error
+               _E("Failed to get value of display feature");
+               return false;
+//LCOV_EXCL_STOP
+       } else if (ret == 0 && !display_avail) {
+//LCOV_EXCL_START System Error
+               _D("Display feature is not supported");
+               return false;
+//LCOV_EXCL_STOP
+       } else
+               return true;
+}
+
+int is_feature_display_state_supported(void)
+{
+       int ret;
+       bool display_state_avail;
+
+       ret = system_info_get_platform_bool(DISPLAY_STATE_FEATURE, &display_state_avail);
+       if (ret < 0) {
+//LCOV_EXCL_START System Error
+               _E("Failed to get value of display state feature");
+               return false;
+//LCOV_EXCL_STOP
+       } else if (ret == 0 && !display_state_avail) {
+//LCOV_EXCL_START System Error
+               _D("Display state feature is not supported");
+               return false;
+//LCOV_EXCL_STOP
+       } else
+               return true;
+}
index 5999d12..d47041b 100644 (file)
@@ -508,7 +508,7 @@ int device_power_wakeup(bool dim)
 {
        int ret;
 
-       ret = is_display_state_supported();
+       ret = is_feature_display_state_supported();
        if (!ret)
                return DEVICE_ERROR_NOT_SUPPORTED;