From: Sunmin Lee Date: Mon, 8 Oct 2018 01:21:41 +0000 (+0900) Subject: Plugin: checking version comparison result for download X-Git-Tag: submit/tizen/20190221.045132^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_5.5_unified;p=platform%2Fcore%2Fsystem%2Fupdate-control.git Plugin: checking version comparison result for download To prevent downgrade, checking the updatable flag which is the result of version comparison. In addition to this, add a log for cancel_reservation Change-Id: I6df0d7f5706438547dd4d9e5eefe8cd694d3efc5 Signed-off-by: Sunmin Lee --- diff --git a/src/plugin/plugin.c b/src/plugin/plugin.c index a322764..c37d41d 100644 --- a/src/plugin/plugin.c +++ b/src/plugin/plugin.c @@ -627,6 +627,12 @@ API int update_control_download_package(void) return UPDATE_CONTROL_ERROR_INVALID_URI; } + /* Check if the found version is newer */ + if (!update_info->updatable) { + _D("Already latest version"); + return UPDATE_CONTROL_ERROR_SYSTEM_ERROR; + } + /* Downloading state */ _D("Download package from [%s]", update_info->package_uri); @@ -793,6 +799,7 @@ API int update_control_cancel_reservation(void) _I("No reserved update"); return UPDATE_CONTROL_ERROR_NONE; } + _D("Update reservation found. Cancel it"); ret = alarmmgr_remove_alarm(reserved_update_alarm_id); if (ret < 0) {