display: Remove util.h/plugin-common 32/295632/2
authorYunhee Seo <yuni.seo@samsung.com>
Mon, 10 Jul 2023 02:40:35 +0000 (11:40 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Wed, 12 Jul 2023 08:27:22 +0000 (17:27 +0900)
util.h is used from display plugins for Power manager logging.
The concept of power manager that exist as legacy while refactoring
should be eliminated.
By deleting util.h, the dependency problem is solved and the plugin-common
is also erased.
Also, util.h can be replaced by display-util.h and log.h in the display core.

Change-Id: Ic9630ff0a8ef50190d1abab9ce5a86956b714c8a
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
38 files changed:
CMakeLists.txt
plugins/iot-headed/display/CMakeLists.txt
plugins/iot-headed/display/core.c
plugins/iot-headed/display/device-interface.c
plugins/iot-headed/display/key-filter.c
plugins/iot-headless/display/CMakeLists.txt
plugins/mobile/display/CMakeLists.txt
plugins/mobile/display/core.c
plugins/mobile/display/device-interface.c
plugins/mobile/display/key-filter.c
plugins/tv/display/CMakeLists.txt
plugins/tv/display/core.c
plugins/tv/display/device-interface.c
plugins/tv/display/key-filter.c
plugins/wearable/display/CMakeLists.txt
plugins/wearable/display/auto-brightness-sensorhub.c
plugins/wearable/display/auto-brightness.c
plugins/wearable/display/bezel.c
plugins/wearable/display/core.c
plugins/wearable/display/device-interface.c
plugins/wearable/display/display-handler.c
plugins/wearable/display/hbm.c
plugins/wearable/display/key-filter.c
plugins/wearable/display/lbm.c
plugins/wearable/display/swim.c
src/display/ambient-mode.c
src/display/display-actor.c
src/display/display-dbus.c
src/display/display-dpms.c
src/display/display-lock.c
src/display/display-ops.c
src/display/display-signal.c
src/display/display-signal.h
src/display/display-util.h
src/display/lock-detector.c
src/display/plugin-common/util.h [deleted file]
src/display/poll.c
src/display/setting.c

index d836395..8a9b3f2 100644 (file)
@@ -169,7 +169,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src/deviced)
 
 # FIXME: Temporary include path for separating display core and plugin
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src/display)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src/display/plugin-common)
 
 SET(PKG_MODULES
        vconf
index 2d290d3..532810d 100644 (file)
@@ -3,13 +3,10 @@ PROJECT(iot-headed-display C)
 
 FILE(GLOB ALL_SRCS "*.c")
 SET(SRCS ${ALL_SRCS})
-ADD_SOURCE(${CMAKE_SOURCE_DIR}/src/display/plugin-common COMMON_SRCS)
-SET(SRCS ${SRCS} ${COMMON_SRCS})
 
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/core)
 # FIXME: Temporary include path for separating display core and plugin
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/display)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/display/plugin-common)
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(libpkgs REQUIRED
index 3311604..4f4b671 100644 (file)
@@ -43,8 +43,8 @@
 #include <device/display-internal.h>
 #include <hal/device/hal-device-power.h>
 
+#include "shared/log.h"
 #include "ambient-mode.h"
-#include "util.h"
 #include "core.h"
 #include "poll.h"
 #include "lock-detector.h"
index 245b5d0..abb1969 100644 (file)
@@ -38,7 +38,6 @@
 #include "shared/devices.h"
 #include "shared/common.h"
 #include "shared/device-notifier.h"
-#include "util.h"
 #include "device-interface.h"
 #include "vconf.h"
 #include "core.h"
index 4c31753..fec11d9 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/input.h>
 
 #include "ambient-mode.h"
-#include "util.h"
 #include "core.h"
 #include "poll.h"
 #include "device-interface.h"
 #include "display-config.h"
 #include "display-misc.h"
 #include "display-state-transition.h"
+#include "display-util.h"
 #include "shared/common.h"
 #include "shared/devices.h"
 #include "shared/device-notifier.h"
 #include "shared/common.h"
 #include "shared/plugin.h"
 #include "shared/apps.h"
+#include "shared/log.h"
 #include "power/power-off.h"
 #include "power/power-suspend.h"
 #include "led/touch-key.h"
index 1daab28..20507d2 100644 (file)
@@ -6,7 +6,6 @@ FILE(GLOB SRCS "*.c")
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
 # FIXME: Temporary include path for separating display core and plugin
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/display)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/display/plugin-common)
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(libpkgs REQUIRED
index 1621bd6..eed43f2 100644 (file)
@@ -3,13 +3,10 @@ PROJECT(mobile-display C)
 
 FILE(GLOB ALL_SRCS "*.c")
 SET(SRCS ${ALL_SRCS})
-ADD_SOURCE(${CMAKE_SOURCE_DIR}/src/display/plugin-common COMMON_SRCS)
-SET(SRCS ${SRCS} ${COMMON_SRCS})
 
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/core)
 # FIXME: Temporary include path for separating display core and plugin
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/display)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/display/plugin-common)
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(libpkgs REQUIRED
index 7abf561..b4c14ae 100644 (file)
@@ -42,8 +42,8 @@
 #include <libsyscommon/list.h>
 #include <hal/device/hal-device-power.h>
 
+#include "shared/log.h"
 #include "ambient-mode.h"
-#include "util.h"
 #include "core.h"
 #include "poll.h"
 #include "lock-detector.h"
index 7900c9e..7c74c83 100644 (file)
@@ -37,7 +37,6 @@
 #include "shared/devices.h"
 #include "shared/common.h"
 #include "shared/device-notifier.h"
-#include "util.h"
 #include "device-interface.h"
 #include "vconf.h"
 #include "core.h"
index f3914c1..735b30c 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/input.h>
 
 #include "ambient-mode.h"
-#include "util.h"
 #include "core.h"
 #include "poll.h"
 #include "device-interface.h"
 #include "display-config.h"
 #include "display-misc.h"
 #include "display-state-transition.h"
+#include "display-util.h"
 #include "shared/common.h"
 #include "shared/devices.h"
 #include "shared/device-notifier.h"
 #include "shared/common.h"
 #include "shared/plugin.h"
 #include "shared/apps.h"
+#include "shared/log.h"
 #include "power/power-off.h"
 #include "power/power-suspend.h"
 #include "led/touch-key.h"
index 300d89b..3267977 100644 (file)
@@ -3,13 +3,10 @@ PROJECT(tv-display C)
 
 FILE(GLOB ALL_SRCS "*.c")
 SET(SRCS ${ALL_SRCS})
-ADD_SOURCE(${CMAKE_SOURCE_DIR}/src/display/plugin-common COMMON_SRCS)
-SET(SRCS ${SRCS} ${COMMON_SRCS})
 
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/core)
 # FIXME: Temporary include path for separating display core and plugin
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/display)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/display/plugin-common)
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(libpkgs REQUIRED
index 0f2a7af..6e44cb1 100644 (file)
@@ -42,8 +42,8 @@
 #include <libsyscommon/list.h>
 #include <hal/device/hal-device-power.h>
 
+#include "shared/log.h"
 #include "ambient-mode.h"
-#include "util.h"
 #include "core.h"
 #include "poll.h"
 #include "lock-detector.h"
index 4fc311b..2db6d71 100644 (file)
@@ -37,7 +37,6 @@
 #include "shared/devices.h"
 #include "shared/common.h"
 #include "shared/device-notifier.h"
-#include "util.h"
 #include "device-interface.h"
 #include "vconf.h"
 #include "core.h"
index 149da8f..e699c1c 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/input.h>
 
 #include "ambient-mode.h"
-#include "util.h"
 #include "core.h"
 #include "poll.h"
 #include "device-interface.h"
@@ -39,6 +38,7 @@
 #include "display-config.h"
 #include "display-misc.h"
 #include "display-state-transition.h"
+#include "display-util.h"
 #include "shared/common.h"
 #include "shared/devices.h"
 #include "shared/device-notifier.h"
index c0c040f..00e456b 100644 (file)
@@ -3,13 +3,10 @@ PROJECT(wearable-display C)
 
 FILE(GLOB ALL_SRCS "*.c")
 SET(SRCS ${ALL_SRCS})
-ADD_SOURCE(${CMAKE_SOURCE_DIR}/src/display/plugin-common COMMON_SRCS)
-SET(SRCS ${SRCS} ${COMMON_SRCS})
 
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/core ${CMAKE_SOURCE_DIR}/src/battery-monitor)
 # FIXME: Temporary include path for separating display core and plugin
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/display)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/display/plugin-common)
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(libpkgs REQUIRED
index 04187bb..df03e94 100644 (file)
@@ -27,7 +27,6 @@
 #include "hbm.h"
 #include "lbm.h"
 #include "auto-brightness-sensorhub.h"
-#include "util.h"
 #include "core.h"
 #include "device-interface.h"
 #include "display-info.h"
@@ -35,6 +34,7 @@
 #include "display-backlight.h"
 #include "display-config.h"
 #include "shared/device-notifier.h"
+#include "shared/log.h"
 #include "battery/power-supply.h"
 #include "shared/plugin.h"
 
index 4103f72..0f99182 100644 (file)
@@ -29,7 +29,6 @@
 #include <vconf.h>
 #include <sensor.h>
 
-#include "util.h"
 #include "core.h"
 #include "device-interface.h"
 #include "display-info.h"
@@ -38,6 +37,7 @@
 #include "display-config.h"
 #include "setting.h"
 #include "shared/device-notifier.h"
+#include "shared/log.h"
 #include <libsyscommon/ini-parser.h>
 
 #define MAX_SAMPLING_COUNT     3
index 3d4c80b..3f03460 100644 (file)
 #include "shared/devices.h"
 #include "shared/common.h"
 #include "shared/device-notifier.h"
-#include "util.h"
 #include "poll.h"
 #include "core.h"
 #include "display-ops.h"
+#include "shared/log.h"
 #include "shared/plugin.h"
 
 #ifndef VCONFKEY_SETAPPL_WAKEUP_BY_BEZEL_ENABLE
index 23551d1..efaf336 100644 (file)
@@ -42,9 +42,9 @@
 #include <libsyscommon/list.h>
 #include <hal/device/hal-device-power.h>
 
+#include "shared/log.h"
 #include "auto-brightness-sensorhub.h"
 #include "ambient-mode.h"
-#include "util.h"
 #include "core.h"
 #include "poll.h"
 #include "lock-detector.h"
index 018cfe5..d9c404f 100644 (file)
@@ -37,7 +37,6 @@
 #include "shared/devices.h"
 #include "shared/common.h"
 #include "shared/device-notifier.h"
-#include "util.h"
 #include "device-interface.h"
 #include "vconf.h"
 #include "core.h"
index 60cc33e..df34a70 100644 (file)
 
 #include "auto-brightness-sensorhub.h"
 #include "shared/device-notifier.h"
-#include "util.h"
 #include "core.h"
 #include "device-interface.h"
 #include "poll.h"
 #include "shared/common.h"
 #include "shared/devices.h"
+#include "shared/log.h"
 #include "display-actor.h"
 #include "display-info.h"
 #include "display-panel.h"
index 2c6e9b5..53c9abb 100644 (file)
 #include "auto-brightness-sensorhub.h"
 #include "weaks.h"
 #include "display-info.h"
-#include "util.h"
 #include "core.h"
 #include "display-ops.h"
 #include "display-panel.h"
 #include "shared/common.h"
 #include "shared/device-notifier.h"
+#include "shared/log.h"
 
 #define BOARD_CONF_FILE "/etc/deviced/display.conf"
 
index c399df1..55c1f8e 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/input.h>
 
 #include "ambient-mode.h"
-#include "util.h"
 #include "core.h"
 #include "poll.h"
 #include "device-interface.h"
@@ -40,6 +39,7 @@
 #include "display-config.h"
 #include "display-misc.h"
 #include "display-state-transition.h"
+#include "display-util.h"
 #include "shared/common.h"
 #include "shared/devices.h"
 #include "shared/device-notifier.h"
index b2c43c2..f94f72e 100644 (file)
 #include "auto-brightness-sensorhub.h"
 #include "lbm.h"
 #include "display-info.h"
-#include "util.h"
 #include "core.h"
 #include "device-interface.h"
 #include "display-backlight.h"
 #include "display-ops.h"
 #include "shared/common.h"
 #include "shared/device-notifier.h"
+#include "shared/log.h"
 
 #define SIGNAL_LBM_ON  "LBMOn"
 #define SIGNAL_LBM_OFF "LBMOff"
index 3e90e8a..25ad0fa 100644 (file)
 #include "shared/device-notifier.h"
 #include "shared/devices.h"
 #include "core.h"
-#include "util.h"
 #include "device-interface.h"
 #include "display-ops.h"
 #include "display-panel.h"
 #include "shared/plugin.h"
+#include "shared/log.h"
 
 #include <libsyscommon/libgdbus.h>
 
index 79b000a..139b6c7 100644 (file)
 #include <fcntl.h>
 #include <libsyscommon/libgdbus.h>
 
-#include "util.h"
 #include "core.h"
 #include "display.h"
 #include "display-ops.h"
 #include "display-panel.h"
 #include "display-plugin.h"
 #include "display-state-transition.h"
+#include "shared/log.h"
 #include "shared/device-notifier.h"
 #include "shared/devices.h"
 #include "shared/plugin.h"
index 3b9a324..47ecfdc 100644 (file)
@@ -20,7 +20,6 @@
 #include <stdio.h>
 #include <libsyscommon/list.h>
 
-#include "util.h"
 #include "display-actor.h"
 #include "shared/common.h"
 
index 393e70e..de51880 100644 (file)
@@ -32,7 +32,6 @@
 
 #include "ambient-mode.h"
 #include "core/log.h"
-#include "util.h"
 #include "core.h"
 #include "lock-detector.h"
 #include "shared/common.h"
index 8e69b9a..4c4f38a 100644 (file)
@@ -29,7 +29,6 @@
 #include "core/log.h"
 #include "shared/device-notifier.h"
 #include "device-interface.h"
-#include "util.h"
 #include "display-dpms.h"
 #include "display-plugin.h"
 #include "device-interface.h"
index 1f32883..85d731e 100644 (file)
@@ -34,6 +34,7 @@
 #include "display-config.h"
 #include "display-misc.h"
 #include "display-state-transition.h"
+#include "shared/log.h"
 #include "shared/log-macro.h"
 #include "shared/apps.h"
 
index d459aec..6497f80 100644 (file)
@@ -20,8 +20,8 @@
 #include <stdio.h>
 #include <libsyscommon/list.h>
 
-#include "util.h"
 #include "display-ops.h"
+#include "shared/log.h"
 #include "shared/common.h"
 
 static GList *disp_head;
index 65b33bd..40b3134 100644 (file)
@@ -19,6 +19,7 @@
 #include "display-signal.h"
 #include "display-util.h"
 #include "poll.h"
+#include "shared/log.h"
 #include "shared/plugin.h"
 #include "shared/time.h"
 
index 529ae69..f245ea7 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <libsyscommon/libgdbus.h>
 
-#include "util.h"
 #include "shared/devices.h"
 #include "shared/device-notifier.h"
 
index f201487..333e82f 100644 (file)
 
 #include "shared/devices.h"
 
+#define SEC_TO_MSEC(x) ((x)*1000)
+#define MSEC_TO_SEC(x) ((x)/1000)
+#define USEC_TO_SEC(x) ((x)/1000000.0)
+#define NSEC_TO_SEC(x) ((x)/1000000000.0)
+
 int display_util_get_device_flags_name(enum device_flags flags, const char **flag_name);
 
 #endif /* __DISPLAY_UTIL_H__ */
\ No newline at end of file
index 593d4f6..ca8fc52 100644 (file)
@@ -32,9 +32,9 @@
 #include <sys/types.h>
 #include <libsyscommon/list.h>
 
-#include "util.h"
 #include "core.h"
 #include "display-misc.h"
+#include "shared/log.h"
 #include "shared/device-notifier.h"
 
 struct lock_info {
diff --git a/src/display/plugin-common/util.h b/src/display/plugin-common/util.h
deleted file mode 100644 (file)
index 4bf053a..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * deviced
- *
- * Copyright (c) 2011 - 2013 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.
- */
-
-
-/**
- * @file       util.h
- * @brief      Utilities header for Power manager
- */
-#ifndef __DEF_UTIL_H__
-#define __DEF_UTIL_H__
-
-/**
- * @addtogroup POWER_MANAGER
- * @{
- */
-#ifdef ENABLE_DEVICED_DLOG
-#define ENABLE_DLOG
-#endif
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "POWER_MANAGER"
-#include "shared/log-macro.h"
-
-#define SEC_TO_MSEC(x) ((x)*1000)
-#define MSEC_TO_SEC(x) ((x)/1000)
-#define USEC_TO_SEC(x) ((x)/1000000.0)
-#define NSEC_TO_SEC(x) ((x)/1000000000.0)
-
-/**
- * @}
- */
-#endif
index 2983f82..8a09447 100644 (file)
  */
 
 #include <stdio.h>
-#include "util.h"
 #include "core.h"
 #include "device-interface.h"
 #include "poll.h"
 #include "display-ops.h"
 #include "display-plugin.h"
 #include "display-state-transition.h"
+#include "shared/log.h"
 #include "shared/plugin.h"
 
 static PMMsg recv_data;
index d697d2a..c6509f5 100644 (file)
 #include "ambient-mode.h"
 #include "core.h"
 #include "device-interface.h"
-#include "util.h"
 #include "setting.h"
 #include "display-misc.h"
 #include "display-ops.h"
 #include "display-plugin.h"
 #include "display-state-transition.h"
 #include "led/touch-key.h"
+#include "shared/log.h"
 #include "shared/eventsystem.h"
 #include "shared/plugin.h"