From: Jeon Sang-Heon Date: Fri, 5 Jun 2020 10:23:22 +0000 (+0900) Subject: Enhance dbus policy X-Git-Tag: submit/tizen/20200605.111029^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25c4508a631f7d7998b342dc8da21b461998362a;p=platform%2Fcore%2Fsystem%2Fupdate-control.git Enhance dbus policy - Allow org.freedesktop.DBus.Properties - Create proxy once - Check not support external device Change-Id: I5cd3ad41ef6d6cee8fee9ecf1cfcd10454938156 Signed-off-by: Jeon Sang-Heon --- diff --git a/packaging/update-manager.conf b/packaging/update-manager.conf index d92dcfe..2eaf90b 100644 --- a/packaging/update-manager.conf +++ b/packaging/update-manager.conf @@ -7,7 +7,8 @@ - - + + + \ No newline at end of file diff --git a/src/update_control.c b/src/update_control.c index 9960fb0..6f4ce60 100644 --- a/src/update_control.c +++ b/src/update_control.c @@ -168,36 +168,38 @@ API int update_control_download_package(void) API int update_control_do_update(void) { - CHECK_FEATURE_SUPPORTED(DEVICE_UPDATE_FEATURE); - _I("Try to start update ..."); + CHECK_FEATURE_SUPPORTED(DEVICE_UPDATE_FEATURE); + _I("Try to start update ..."); - OrgTizenUpdateManager *proxy = NULL; + static OrgTizenUpdateManager *proxy = NULL; gint status = 0; - GError *error = NULL; - - proxy = org_tizen_update_manager_proxy_new_for_bus_sync( - G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, - "org.tizen.update.manager", "/org/tizen/update/manager", NULL, &error); - if (error == NULL) { - _I("Success to get proxy for org.tizen.update.manager"); - } else { - _E("Failed get proxy for org.tizen.update.manager : %s", error->message); - return UPDATE_CONTROL_ERROR_SYSTEM_ERROR; - } - - org_tizen_update_manager_call_install_sync(proxy, &status, NULL, &error); - if (error == NULL) { - _I("Success to call install to daemon"); - if (status < 0) { - _E("Failed to do update : %d", status); - return UPDATE_CONTROL_ERROR_INVALID_OPERATION; - } - } else { - _E("Failed to call install to daemon : %s", error->message); - return UPDATE_CONTROL_ERROR_SYSTEM_ERROR; - } - - return UPDATE_CONTROL_ERROR_NONE; + GError *error = NULL; + + if (proxy == NULL) { + proxy = org_tizen_update_manager_proxy_new_for_bus_sync( + G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, + "org.tizen.update.manager", "/org/tizen/update/manager", NULL, &error); + if (error == NULL) { + _I("Success to get proxy for org.tizen.update.manager"); + } else { + _E("Failed get proxy for org.tizen.update.manager : %s", error->message); + return UPDATE_CONTROL_ERROR_SYSTEM_ERROR; + } + } + + org_tizen_update_manager_call_install_sync(proxy, &status, NULL, &error); + if (error == NULL) { + _I("Success to call install to daemon"); + if (status < 0) { + _E("Failed to do update : %d", status); + return UPDATE_CONTROL_ERROR_INVALID_OPERATION; + } + } else { + _E("Failed to call install to daemon : %s", error->message); + return UPDATE_CONTROL_ERROR_SYSTEM_ERROR; + } + + return UPDATE_CONTROL_ERROR_NONE; } API int update_control_make_reservation(struct tm *reservation_time) diff --git a/update-manager/fota-storage-checker.c b/update-manager/fota-storage-checker.c index d3a046c..709c81b 100644 --- a/update-manager/fota-storage-checker.c +++ b/update-manager/fota-storage-checker.c @@ -50,7 +50,9 @@ int fota_storage_checker_init() _I("Start process to get storage status"); ret = storage_set_changed_cb(STORAGE_TYPE_EXTERNAL, fota_storage_checker_callback, NULL); - if (ret != STORAGE_ERROR_NONE) { + 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; }