board: replace get_reboot_mode() to get_boot_mode() 74/272274/4 accepted/tizen/unified/20220318.133008 submit/tizen/20220317.053005
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 14 Mar 2022 03:10:44 +0000 (12:10 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 14 Mar 2022 06:06:03 +0000 (15:06 +0900)
Change-Id: I600e6c036fbf2bedb79cdfaf2f46889ac835e4fe
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
include/board-internal.h
include/booting-internal.h [deleted file]
src/board-internal.c
src/booting-internal.c [deleted file]

index d094e04..64579f0 100644 (file)
@@ -6,6 +6,8 @@ extern "C" {
 #endif
 
 int device_board_get_serial_number(char *buffer, int buffer_max);
+
+int device_board_get_boot_mode(char *buffer, int len);
 int device_board_get_boot_reason(char *buffer, int len);
 
 #ifdef __cplusplus
diff --git a/include/booting-internal.h b/include/booting-internal.h
deleted file mode 100644 (file)
index 75f8718..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2020 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.
- */
-
-#ifndef __TIZEN_SYSTEM_BOOTING_INTERNAL_H__
-#define __TIZEN_SYSTEM_BOOTING_INTERNAL_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum {
-       NORMAL_BOOT = 0,
-       SILENT_BOOT,
-} boot_mode_e;
-
-int device_get_reboot_mode(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
index a7c6d29..e715334 100644 (file)
@@ -30,6 +30,11 @@ int device_board_get_serial_number(char *buffer, int buffer_max)
        return 0;
 }
 
+int device_board_get_boot_mode(char *buffer, int len)
+{
+       return hal_device_board_get_boot_mode(buffer, len);
+}
+
 int device_board_get_boot_reason(char *buffer, int len)
 {
        return hal_device_board_get_boot_reason(buffer, len);
diff --git a/src/booting-internal.c b/src/booting-internal.c
deleted file mode 100644 (file)
index d5148e0..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2020 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.
- */
-
-#include <errno.h>
-#include <dlfcn.h>
-#include <booting-internal.h>
-
-#include "common.h"
-
-#define BOOT_SO_PATH   "/usr/lib/deviced/bootmode.so"
-
-//LCOV_EXCL_START Not tested API
-int device_get_reboot_mode(void)
-{
-       int (*get_reboot_mode) (void);
-       void *handle;
-       int ret;
-
-       handle = dlopen(BOOT_SO_PATH, RTLD_NOW|RTLD_GLOBAL);
-
-       if (!handle) {
-//LCOV_EXCL_START System Error
-               _E("Failed to open module: %s", dlerror());
-               return NORMAL_BOOT;
-//LCOV_EXCL_STOP
-       }
-
-       get_reboot_mode = dlsym(handle, "get_reboot_mode");
-       if (!get_reboot_mode) {
-//LCOV_EXCL_START System Error
-               _E("Failed to get address of get_reboot_mode().");
-               dlclose(handle);
-               return NORMAL_BOOT;
-//LCOV_EXCL_STOP
-       }
-
-       ret = get_reboot_mode();
-
-       dlclose(handle);
-
-       return ret;
-}
-//LCOV_EXCL_STOP