diff options
author | Ickhee Woo <ickhee.woo@samsung.com> | 2015-08-14 14:25:48 +0900 |
---|---|---|
committer | Ickhee Woo <ickhee.woo@samsung.com> | 2015-08-14 14:25:48 +0900 |
commit | 58b972037b5a434c09e447ee966c8d3d0e37b1aa (patch) | |
tree | 95b14f255be48506b87c4a269716d74a43d6893b | |
parent | daf7bb13f028658cc664a8af926242094ae6867d (diff) | |
download | sync-manager-58b972037b5a434c09e447ee966c8d3d0e37b1aa.tar.gz sync-manager-58b972037b5a434c09e447ee966c8d3d0e37b1aa.tar.bz2 sync-manager-58b972037b5a434c09e447ee966c8d3d0e37b1aa.zip |
reverted modification of period enum values.submit/tizen_mobile/20150817.013757accepted/tizen/mobile/20150817.024703
Change-Id: I6105cb95b563893504edeadbca072055e6176b85
Signed-off-by: Ickhee Woo <ickhee.woo@samsung.com>
-rw-r--r-- | include/sync_manager.h | 7 | ||||
-rw-r--r-- | src/sync-client/sync_manager.c | 32 | ||||
-rw-r--r-- | src/sync-service/SyncManager_SyncManager.cpp | 6 |
3 files changed, 40 insertions, 5 deletions
diff --git a/include/sync_manager.h b/include/sync_manager.h index e1e1f84..a1256de 100644 --- a/include/sync_manager.h +++ b/include/sync_manager.h @@ -61,7 +61,12 @@ extern "C" */ typedef enum { - SYNC_PERIOD_INTERVAL_30MIN = 0, /**< Sync within 30 minutes */ + SYNC_PERIOD_INTERVAL_5MIN = 0, /**< Sync within 5 minutes */ + SYNC_PERIOD_INTERVAL_10MIN, /**< Sync within 10 minutes */ + SYNC_PERIOD_INTERVAL_15MIN, /**< Sync within 15 minutes */ + SYNC_PERIOD_INTERVAL_20MIN, /**< Sync within 20 minutes */ + SYNC_PERIOD_INTERVAL_30MIN, /**< Sync within 30 minutes */ + SYNC_PERIOD_INTERVAL_45MIN, /**< Sync within 45 minutes */ SYNC_PERIOD_INTERVAL_1H, /**< Sync within 1 hour */ SYNC_PERIOD_INTERVAL_2H, /**< Sync within 2 hours */ SYNC_PERIOD_INTERVAL_3H, /**< Sync within 3 hours */ diff --git a/src/sync-client/sync_manager.c b/src/sync-client/sync_manager.c index a8a442c..fbc357b 100644 --- a/src/sync-client/sync_manager.c +++ b/src/sync-client/sync_manager.c @@ -238,12 +238,42 @@ int get_interval(sync_period_e period) { int frequency = 0; switch (period) { + case SYNC_PERIOD_INTERVAL_5MIN: + { + LOG_LOGD("SYNC_PERIOD_INTERVAL_5MIN"); + frequency = 5; + break; + } + case SYNC_PERIOD_INTERVAL_10MIN: + { + LOG_LOGD("SYNC_PERIOD_INTERVAL_10MIN"); + frequency = 10; + break; + } + case SYNC_PERIOD_INTERVAL_15MIN: + { + LOG_LOGD("SYNC_PERIOD_INTERVAL_15MIN"); + frequency = 15; + break; + } + case SYNC_PERIOD_INTERVAL_20MIN: + { + LOG_LOGD("SYNC_PERIOD_INTERVAL_20MIN"); + frequency = 20; + break; + } case SYNC_PERIOD_INTERVAL_30MIN: { LOG_LOGD("SYNC_PERIOD_INTERVAL_30MIN"); frequency = 30; break; } + case SYNC_PERIOD_INTERVAL_45MIN: + { + LOG_LOGD("SYNC_PERIOD_INTERVAL_45MIN"); + frequency = 45; + break; + } case SYNC_PERIOD_INTERVAL_1H: { LOG_LOGD("SYNC_PERIOD_INTERVAL_1H"); @@ -296,7 +326,7 @@ int sync_manager_add_periodic_sync_job(account_h account, const char *capability { SYNC_LOGE_RET_RES(g_sync_manager != NULL, SYNC_ERROR_SYSTEM, "sync_manager_connected should be called first"); SYNC_LOGE_RET_RES(g_sync_manager->ipcObj != NULL, SYNC_ERROR_SYSTEM, "sync manager is not connected"); - SYNC_LOGE_RET_RES((sync_period >= SYNC_PERIOD_INTERVAL_30MIN && sync_period < SYNC_PERIOD_INTERVAL_MAX), SYNC_ERROR_INVALID_PARAMETER, "Time interval not supported %d", sync_period); + SYNC_LOGE_RET_RES((sync_period >= SYNC_PERIOD_INTERVAL_5MIN && sync_period < SYNC_PERIOD_INTERVAL_MAX), SYNC_ERROR_INVALID_PARAMETER, "Time interval not supported %d", sync_period); bool is_account_less_sync = false; if (account == NULL && capability == NULL) diff --git a/src/sync-service/SyncManager_SyncManager.cpp b/src/sync-service/SyncManager_SyncManager.cpp index 5f166fa..f08e014 100644 --- a/src/sync-service/SyncManager_SyncManager.cpp +++ b/src/sync-service/SyncManager_SyncManager.cpp @@ -99,10 +99,10 @@ SyncManager::CancelSync(string appId, account_h account, const char* capability) int SyncManager::AddPeriodicSyncJob(string appId, int accountId, const char* capability, bundle* pExtras, long period) { - if (period < 1800) + if (period < 300) { - LOG_LOGD("Requested period %d, rounding up to 1800 sec", period); - period = 1800; + LOG_LOGD("Requested period %d, rounding up to 300 sec", period); + period = 300; } long defaultFlexTime = __pSyncRepositoryEngine->CalculateDefaultFlexTime(period); |