battery : add PROFILE_MOBILE to distinguish low battery noti between mobile and wearable 50/110350/2 accepted/tizen/3.0/common/20170117.075710 accepted/tizen/3.0/ivi/20170117.005554 accepted/tizen/3.0/mobile/20170117.005507 accepted/tizen/3.0/tv/20170117.005521 accepted/tizen/3.0/wearable/20170117.005537 submit/tizen_3.0/20170116.085702 submit/tizen_3.0/20170116.085712
authorlokilee73 <changjoo.lee@samsung.com>
Mon, 16 Jan 2017 04:52:53 +0000 (13:52 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Mon, 16 Jan 2017 06:02:09 +0000 (15:02 +0900)
active and event noti are sent for mobile and only active noti is sent for wearable.

Change-Id: Ia2ea7fcbba91de4603e1f4db542366284feb3722
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
CMakeLists.txt
src/battery/lowbat-handler.c

index dbda9c6..9f87c5a 100755 (executable)
@@ -228,6 +228,9 @@ ADD_DEFINITIONS("-DENABLE_PM_LOG")
 IF(ENGINEER_MODE STREQUAL on)
 ADD_DEFINITIONS("-DENGINEER_MODE")
 ENDIF(ENGINEER_MODE STREQUAL on)
+IF(PROFILE STREQUAL mobile)
+       ADD_DEFINITIONS("-DPROFILE_MOBILE")
+ENDIF()
 IF(PROFILE STREQUAL tv)
        ADD_DEFINITIONS("-DPROFILE_TV")
 ENDIF()
index 1a108ae..2a0032a 100755 (executable)
@@ -251,13 +251,21 @@ static int get_lowbat_noti_value(int low_battery_type, char **actvie_noti, char
 
        len = strlen(battery.power_source_s);
        if (!strncmp(battery.power_source_s, POWER_SOURCE_NONE, len)) {
-               if (low_battery_type == LOW_BATTERY) {
+               if (low_battery_type == LOW_BATTERY)
                        *actvie_noti = "BatteryLowActNotiOn";
-                       *event_noti = "BatteryLowNotiOn";
-               } else if (low_battery_type == CRITICAL_BATTERY) {
+               else if (low_battery_type == CRITICAL_BATTERY)
                        *actvie_noti = "BatteryCriticalActNotiOn";
+#ifdef PROFILE_MOBILE
+               if (low_battery_type == LOW_BATTERY)
+                       *event_noti = "BatteryLowNotiOn";
+               else if (low_battery_type == CRITICAL_BATTERY)
                        *event_noti = "BatteryCriticalNotiOn";
-               }
+#else
+               if (low_battery_type == LOW_BATTERY)
+                       *event_noti = NULL;
+               else if (low_battery_type == CRITICAL_BATTERY)
+                       *event_noti = NULL;
+#endif
                ret = 0;
        } else if (!strncmp(battery.power_source_s, POWER_SOURCE_AC, len) ||
                                !strncmp(battery.power_source_s, POWER_SOURCE_WIRELESS, len)) {