power: move #include into a source code 97/276397/1
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 16 Jun 2022 03:59:54 +0000 (12:59 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Thu, 16 Jun 2022 04:03:55 +0000 (13:03 +0900)
A header can be used by other packages and their environment variable
for locating header files cannot locate hal/device/hal-board.h, which
makes No such file or directory error. To address this, hide the
include into source code and only exposes declaration through header.

Change-Id: I3f5c310dcf8f5fa1306fe2551d15d86caf68ba4d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
include/power-internal.h
src/power-internal.c

index 6647d8a..d3653c0 100644 (file)
@@ -25,8 +25,6 @@ extern "C" {
 #include <glib.h>
 #include <gio/gio.h>
 
-#include <hal/device/hal-board.h>
-
 #include "device-error.h"
 
 /**
@@ -134,14 +132,7 @@ int device_power_change_state(uint64_t state, int timeout_sec, change_state_call
 /**
  * Return 0 if cloning partition is in progress.
  */
-static inline int device_power_check_reboot_allowed(void)
-{
-       int retval, cloned;
-
-       retval = hal_device_board_get_partition_ab_cloned(&cloned);
-
-       return (retval != 0 || cloned != 0);
-}
+int device_power_check_reboot_allowed(void);
 
 #ifdef __cplusplus
 }
index 90d18b1..fe72dfc 100644 (file)
@@ -2,6 +2,7 @@
 #include <string.h>
 #include <gio/gio.h>
 #include <libsyscommon/libgdbus.h>
+#include <hal/device/hal-board.h>
 
 #include "power-internal.h"
 #include "common.h"
@@ -305,3 +306,12 @@ int device_power_change_state(uint64_t state, int timeout_sec, change_state_call
 
        return DEVICE_ERROR_NONE;
 }
+
+int device_power_check_reboot_allowed(void)
+{
+       int retval, cloned;
+
+       retval = hal_device_board_get_partition_ab_cloned(&cloned);
+
+       return (retval != 0 || cloned != 0);
+}