Set the minimum value of tracker_type_e 11/151411/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 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_unified tizen tizen_5.0 tizen_5.5 tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix tizen_6.0 tizen_6.0_hotfix tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/5.0/unified/20181102.020825 accepted/tizen/5.5/unified/20191031.022032 accepted/tizen/5.5/unified/mobile/hotfix/20201027.085949 accepted/tizen/5.5/unified/wearable/hotfix/20201027.112635 accepted/tizen/6.0/unified/20201030.115643 accepted/tizen/6.0/unified/hotfix/20201103.001209 accepted/tizen/6.5/unified/20211028.115150 accepted/tizen/7.0/unified/20221110.063012 accepted/tizen/7.0/unified/hotfix/20221116.105743 accepted/tizen/8.0/unified/20231005.093816 accepted/tizen/unified/20170922.065131 submit/tizen/20170921.012444 submit/tizen_5.0/20181101.000004 submit/tizen_5.5/20191031.000004 submit/tizen_5.5_mobile_hotfix/20201026.185104 submit/tizen_5.5_wearable_hotfix/20201026.184304 submit/tizen_6.0/20201029.205104 submit/tizen_6.0_hotfix/20201102.192505 submit/tizen_6.0_hotfix/20201103.114805 submit/tizen_6.5/20211028.162501 tizen_5.5.m2_release tizen_6.0.m2_release tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release
authorKichan Kwon <k_c.kwon@samsung.com>
Mon, 18 Sep 2017 10:01:57 +0000 (19:01 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Thu, 21 Sep 2017 01:03:40 +0000 (10:03 +0900)
Change-Id: I9ee780ff0f5297922b5469cb78804df1ff38942f
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
include/tracker.h
src/tracker.c

index a9e2519..8181e68 100644 (file)
@@ -53,6 +53,7 @@ typedef enum {
 } tracker_service_e;
 
 typedef enum {
+       TRACKER_TYPE_INVALID = -1,
        TRACKER_TYPE_POWER_LOCK = 0,
        TRACKER_TYPE_MAX
 } tracker_type_e;
index 4b34711..8f55549 100644 (file)
@@ -24,7 +24,7 @@ API int tracker_get_ref_counter(tracker_type_e type, int *cnt)
 {
        int ref;
 
-       if (type < 0 || type >= TRACKER_TYPE_MAX || !trackers[type]) {
+       if (type <= TRACKER_TYPE_INVALID || type >= TRACKER_TYPE_MAX || !trackers[type]) {
                _E("Try to access not existed tracker %d", type);
                return TRACKER_ERROR_INVALID_PARAMETER;
        }
@@ -43,7 +43,7 @@ API int tracker_get_tick(tracker_type_e type, int *cnt)
 {
        int count;
 
-       if (type < 0 || type >= TRACKER_TYPE_MAX || !trackers[type]) {
+       if (type <= TRACKER_TYPE_INVALID || type >= TRACKER_TYPE_MAX || !trackers[type]) {
                _E("Try to access not existed tracker %d", type);
                return TRACKER_ERROR_INVALID_PARAMETER;
        }