--- /dev/null
+#include "update-manager.h"
+
+void common_storage_checker_callback(int storage_id, storage_dev_e dev, storage_state_e state, const char *fstype,
+ const char *fsuuid, const char *mount_path, bool primary, int flags, void *user_data)
+{
+ switch (state) {
+ case STORAGE_STATE_UNMOUNTABLE:
+ case STORAGE_STATE_REMOVED:
+ case STORAGE_STATE_MOUNTED_READ_ONLY:
+ _D("Storage %d status : not mounted", storage_id);
+ break;
+ case STORAGE_STATE_MOUNTED:
+ _I("Storage %d status : mounted", storage_id);
+ fota_storage_checker_process(mount_path);
+ break;
+ default:
+ _E("Unexpected state : %d", state);
+ }
+}
+
+int common_storage_checker_init()
+{
+ int ret = 0;
+
+ _I("Start process to get storage status");
+ ret = storage_set_changed_cb(STORAGE_TYPE_EXTERNAL, common_storage_checker_callback, NULL);
+ if (ret == STORAGE_ERROR_NOT_SUPPORTED) {
+ _I("External storage is not suppported, so local update will not be supported");
+ }
+ else if (ret != STORAGE_ERROR_NONE) {
+ _E("storage_set_changed_cb failed : %d", ret);
+ return -1;
+ }
+
+ return 0;
+}
+
+int common_storage_checker_fini()
+{
+ int ret = 0;
+
+ ret = storage_unset_changed_cb(STORAGE_TYPE_EXTERNAL, common_storage_checker_callback);
+ if (ret != STORAGE_ERROR_NONE) {
+ _W("failed storage_unset_changed_cb : %d", ret);
+ return -1;
+ }
+
+ return 0;
+}
process_destroy:
g_free(delta_path);
}
-
-void fota_storage_checker_callback(int storage_id, storage_dev_e dev, storage_state_e state, const char *fstype,
- const char *fsuuid, const char *mount_path, bool primary, int flags, void *user_data)
-{
- switch (state) {
- case STORAGE_STATE_UNMOUNTABLE:
- case STORAGE_STATE_REMOVED:
- case STORAGE_STATE_MOUNTED_READ_ONLY:
- _D("Storage %d status : not mounted", storage_id);
- break;
- case STORAGE_STATE_MOUNTED:
- _I("Storage %d status : mounted", storage_id);
- fota_storage_checker_process(mount_path);
- break;
- default:
- _E("Unexpected state : %d", state);
- }
-}
-
-int fota_storage_checker_init()
-{
- int ret = 0;
-
- _I("Start process to get storage status");
- ret = storage_set_changed_cb(STORAGE_TYPE_EXTERNAL, fota_storage_checker_callback, NULL);
- if (ret == STORAGE_ERROR_NOT_SUPPORTED) {
- _I("External storage is not suppported, so local update will not be supported");
- } else if (ret != STORAGE_ERROR_NONE) {
- _E("storage_set_changed_cb failed : %d", ret);
- return -1;
- }
-
- return 0;
-}
-
-int fota_storage_checker_fini()
-{
- int ret = 0;
-
- ret = storage_unset_changed_cb(STORAGE_TYPE_EXTERNAL, fota_storage_checker_callback);
- if (ret != STORAGE_ERROR_NONE) {
- _W("failed storage_unset_changed_cb : %d", ret);
- return -1;
- }
-
- return 0;
-}
goto main_destroy;
}
+ /* Common */
+ ret = common_storage_checker_init();
+ if (ret < 0) {
+ _E("Failed to initialize common storage checker : %d", ret);
+ goto main_destroy;
+ }
+
/* Fota */
ret = fota_info_checker_init();
if (ret < 0) {
goto main_destroy;
}
- ret = fota_storage_checker_init();
- if (ret < 0) {
- _E("Failed to initialize fota storage checker : %d", ret);
- goto main_destroy;
- }
-
/* Dbus */
ret = dbus_manager_init();
if (ret < 0) {
if (ret < 0)
_W("Failed to finalize client status checker : %d", ret);
+ /* Common */
+ ret = common_storage_checker_fini();
+ if (ret < 0)
+ _W("Failed to finalize common storage checker : %d", ret);
+
/* Fota */
ret = fota_info_checker_fini();
if (ret < 0)
if (ret < 0)
_E("Failed to finalize fota status checker : %d", ret);
- ret = fota_storage_checker_fini();
- if (ret < 0)
- _W("Failed to finalize fota storage checker : %d", ret);
-
/* Dbus */
ret = dbus_manager_fini();
if (ret < 0)
int client_controller_process_launch_request(void);
int client_controller_add_launch_request_with_data(char *, char *);
+int common_storage_checker_init(void);
+int common_storage_checker_fini(void);
+
int dbus_manager_init(void);
int dbus_manager_fini(void);
char *fota_info_get_build_id(void);
char *fota_info_get_platform_version(void);
-int fota_storage_checker_init(void);
-int fota_storage_checker_fini(void);
-
int fota_status_checker_init(void);
int fota_status_checker_fini(void);
char *fota_status_get_result(void);
int fota_controller_install(void);
int fota_controller_result(void);
+void fota_storage_checker_process(const char *);
+
int util_file_mkdir(const char *);
int util_file_read_line(const char *, char []);
int util_file_write_line(const char *, const char *);