From: lokilee73 Date: Fri, 2 Feb 2018 13:42:50 +0000 (+0900) Subject: Cool-down: remove enum value LOW for temperature and change strings X-Git-Tag: accepted/tizen/unified/20180208.163643~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ec30bfd50bb7e687e563cbe4051d35ec7c77e57;p=platform%2Fcore%2Fsystem%2Fdeviced.git Cool-down: remove enum value LOW for temperature and change strings Change-Id: Icd34da6e36989139fd2eaf292fd8d8d867891838 Signed-off-by: lokilee73 --- diff --git a/src/thermal/thermal.c b/src/thermal/thermal.c index 44dca03..06e2207 100755 --- a/src/thermal/thermal.c +++ b/src/thermal/thermal.c @@ -30,37 +30,31 @@ static int noti; -/* Core service: get/set device status operations about device */ +/* Core service: get/set device status operations about device + PASS can be enabled/disabled in deviced.spec file + Then you have to set PATH, INTERFACE and METHOD */ #ifdef PASS #define THERMAL_PATH "/Org/Tizen/System/Pass/Monitor/Thermal" #define THERMAL_INTERFACE "org.tizen.system.pass.monitor.thermal" -#define THERMAL_METHOD_TEMP_CHANGED "ChangedSiop" +#define THERMAL_METHOD_TEMP_CHANGED "ChangedCooldownMode" #else #define THERMAL_PATH "/Org/Tizen/Trm/Siop" #define THERMAL_INTERFACE "org.tizen.trm.siop" -#define THERMAL_METHOD_TEMP_CHANGED "ChangedSiop" +#define THERMAL_METHOD_TEMP_CHANGED "ChangedCooldownMode" #endif #define SIGNAL_OVERHEAT_TIME "TimeUpdate" #define OVERHEAT_CALLBACK_TIME 1 //seconds #define OVERHEAT_POWEROFF_TIME 30 -/* Temp level */ -#define LEVEL_DANGER "Danger" -#define LEVEL_CRITICAL "Critical" -#define LEVEL_HIGH "High" -#define LEVEL_LOW "Low" -#define LEVEL_NORMAL "Normal" - -/* Action type */ -#define SHUTDOWN_ACTION "ShutDownAction" -#define LIMIT_ACTION "LimitAction" -#define WARNING_ACTION "WarningAction" +/* Action type + Below ACTION strings have to be checked, if those are the same from PASS or SIOP */ #define RELEASE_ACTION "ReleaseAction" -#define NORMAL_ACTION "NormalAction" +#define WARNING_ACTION "WarningAction" +#define LIMIT_ACTION "LimitAction" +#define SHUTDOWN_ACTION "ShutDownAction" enum thermal_enum_type { - LOW, NORMAL, WARNING, CRITICAL, @@ -185,15 +179,13 @@ static int change_templevel_to_enum(char *string) return temp; } - if (!strncmp(string, LEVEL_NORMAL, strlen(LEVEL_NORMAL))) + if (!strncmp(string, RELEASE_ACTION, strlen(RELEASE_ACTION))) temp = NORMAL; - else if (!strncmp(string, LEVEL_LOW, strlen(LEVEL_LOW))) - temp = LOW; - else if (!strncmp(string, LEVEL_HIGH, strlen(LEVEL_HIGH))) + else if (!strncmp(string, WARNING_ACTION, strlen(WARNING_ACTION))) temp = WARNING; - else if (!strncmp(string, LEVEL_CRITICAL, strlen(LEVEL_CRITICAL))) + else if (!strncmp(string, LIMIT_ACTION, strlen(LIMIT_ACTION))) temp = CRITICAL; - else if (!strncmp(string, LEVEL_DANGER, strlen(LEVEL_DANGER))) + else if (!strncmp(string, SHUTDOWN_ACTION, strlen(SHUTDOWN_ACTION))) temp = DANGER; return temp; @@ -217,13 +209,11 @@ static void thermal_action(char *state) switch (new_state) { case NORMAL: - case LOW: if (old_state == WARNING || old_state == CRITICAL) { thermal_remove_noti(); thermal_add_recovery_popup(); + } action = strdup(RELEASE_ACTION); - } else - action = strdup(NORMAL_ACTION); break; case WARNING: