Plugin: checking version comparison result for download 14/191914/1 accepted/tizen_5.0_unified accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.0/unified/20190226.075151 accepted/tizen/5.5/unified/20191031.015334 accepted/tizen/5.5/unified/mobile/hotfix/20201027.075431 accepted/tizen/5.5/unified/wearable/hotfix/20201027.110511 accepted/tizen/unified/20190221.084223 submit/tizen/20190221.045132 submit/tizen_5.0/20190219.014427 submit/tizen_5.5/20191031.000005 submit/tizen_5.5_mobile_hotfix/20201026.185105 submit/tizen_5.5_wearable_hotfix/20201026.184305 tizen_5.5.m2_release
authorSunmin Lee <sunm.lee@samsung.com>
Mon, 8 Oct 2018 01:21:41 +0000 (10:21 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Thu, 25 Oct 2018 08:19:05 +0000 (17:19 +0900)
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 <sunm.lee@samsung.com>
src/plugin/plugin.c

index a32276435754b5e47653ee851bab6d76de46d097..c37d41d6ee57281e4c9fcd9085bd51186227eeef 100644 (file)
@@ -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) {