summaryrefslogtreecommitdiff
path: root/include/power-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/power-internal.h')
-rw-r--r--include/power-internal.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/power-internal.h b/include/power-internal.h
index fac6b59..6647d8a 100644
--- a/include/power-internal.h
+++ b/include/power-internal.h
@@ -25,6 +25,8 @@ extern "C" {
#include <glib.h>
#include <gio/gio.h>
+#include <hal/device/hal-board.h>
+
#include "device-error.h"
/**
@@ -129,6 +131,18 @@ typedef void (*change_state_callback) (uint64_t state, int retval, void *user_da
*/
int device_power_change_state(uint64_t state, int timeout_sec, change_state_callback cb, void *user_data);
+/**
+ * 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);
+}
+
#ifdef __cplusplus
}
#endif