#include <glib.h>
#include <libsyscommon/libgdbus.h>
#include <libsyscommon/libsystemd.h>
-#include <device/booting-internal.h>
+#include <device/board-internal.h>
#include <argos.h>
#include "display/core.h"
int ret;
dbus_handle_h handle = NULL;
guint timer;
+ char bootmode[32] = "normal";
+ int retval;
CRITICAL_LOG("Initializing deviced.");
mainloop = g_main_loop_new(NULL, FALSE);
load_plugins();
- silent_boot = device_get_reboot_mode();
+ retval = device_board_get_boot_mode(bootmode, sizeof(bootmode));
+ silent_boot = (retval == 0 && strncmp(bootmode, "silent", sizeof("silent")) == 0);
+ CRITICAL_LOG("bootmode=%s", bootmode);
devices_init(NULL);
* limitations under the License.
*/
#include "test.h"
-#include <device/booting-internal.h>
+#include <device/board-internal.h>
#define METHOD_GET_REBOOT_MODE "GetRebootMode"
-static bool get_reboot_mode(void)
+static bool get_boot_mode(void)
{
- int ret;
+ int retval;
+ char bootmode[32] = {0, };
- ret = device_get_reboot_mode();
+ retval = device_board_get_boot_mode(bootmode, sizeof(bootmode));
+ if (retval != 0) {
+ _E("bootmode not supported.");
+ return 1;
+ }
+
+ if (strncmp(bootmode, "normal", sizeof("normal")) == 0)
+ return 1;
+ if (strncmp(bootmode, "silent", sizeof("silent")) == 0)
+ return 1;
+ if (strncmp(bootmode, "fota", sizeof("fota")) == 0)
+ return 1;
+ if (strncmp(bootmode, "recovery", sizeof("recovery")) == 0)
+ return 1;
+ if (strncmp(bootmode, "download", sizeof("download")) == 0)
+ return 1;
- return capi_reboot_result(METHOD_GET_REBOOT_MODE, ret);
+ _E("Invalid bootmode=%s", bootmode);
+
+ return 0;
}
static void booting_test_all(int *success, int *fail)
int s = 0;
int f = 0;
- (get_reboot_mode()) ? s++ : f++;
+ (get_boot_mode()) ? s++ : f++;
if (NULL != success) *success = s;
if (NULL != fail) *fail = f;
booting_test_all(&success, &fail);
_I("Total: %d, Success: %d, Fail: %d", success+fail, success, fail);
} else if (0 == strcasecmp(argv[3], METHOD_GET_REBOOT_MODE)) {
- get_reboot_mode();
+ get_boot_mode();
} else {
_E("Unknown test case!!!");
}
#include <libsyscommon/libgdbus.h>
#include <libsyscommon/list.h>
#include <device-error.h>
-#include <device/booting-internal.h>
+#include <device/board-internal.h>
#include "shared/common.h"
#include "core/udev.h"
void _R(const char *format, ...);
void __cb(GVariant *result, void *data, GError *err);
bool capi_result(const char *method, int val);
-bool capi_reboot_result(const char *method, int val);
int feature_supported(const char *feature);
#endif