Fixed review comments
authorsaerome kim <saerome.kim@samsung.com>
Fri, 4 Jan 2019 08:47:31 +0000 (17:47 +0900)
committer김새롬/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <saerome.kim@samsung.com>
Fri, 4 Jan 2019 15:19:31 +0000 (00:19 +0900)
Signed-off-by: saerome kim <saerome.kim@samsung.com>
ua-daemon/include/ua-power-plugin-manager.h
ua-daemon/src/pm/ua-light-plugin-handler.c
ua-daemon/src/pm/ua-motion-plugin-handler.c
ua-daemon/src/pm/ua-power-plugin-handler.c

index ff7018f..750d454 100644 (file)
@@ -28,8 +28,6 @@ int _uam_ppm_init(void);
 
 void _uam_ppm_deinit(void);
 
-unsigned int _uam_pm_get_avaliable_sensors(void);
-
 gboolean _uam_ppm_is_ready();
 
 int _uam_ppm_handler_init(void);
index 09c7a13..5cc4974 100644 (file)
@@ -40,6 +40,14 @@ void light_detection_callback(uas_detection_type_e type)
 
        UAM_DBG("Light: %s", type == UAS_PRESENCE ? "PRESENCE" : "ABSENCE");
 
+       if (UAS_PRESENCE == type) {
+               UAM_DBG("Presence detected by light sensor");
+               _uam_core_handle_presence_detected(UAM_SENSOR_BITMASK_LIGHT, 0, NULL);
+       } else {
+               UAM_DBG("Absence detected by light sensor");
+               _uam_core_handle_absence_detected(UAM_SENSOR_BITMASK_LIGHT, 0, NULL);
+       }
+
        FUNC_EXIT;
 }
 
index da6308d..c2c36b7 100644 (file)
@@ -40,6 +40,14 @@ void motion_detection_callback(uas_detection_type_e type)
 
        UAM_DBG("Motion: %s", type == UAS_PRESENCE ? "PRESENCE" : "ABSENCE");
 
+       if (UAS_PRESENCE == type) {
+               UAM_DBG("Presence detected by motion sensor");
+               _uam_core_handle_presence_detected(UAM_SENSOR_BITMASK_MOTION, 0, NULL);
+       } else {
+               UAM_DBG("Absence detected by motion sensor");
+               _uam_core_handle_absence_detected(UAM_SENSOR_BITMASK_MOTION, 0, NULL);
+       }
+
        FUNC_EXIT;
 }
 
index 6850564..6b6b781 100644 (file)
@@ -29,7 +29,7 @@ typedef struct {
        presence_cb cb; /**< presence_cb */
 } _uam_req_cb_s;
 
-static GList *ppm_reqs = NULL; /**< list of requests from power plugin */
+static GSList *ppm_reqs = NULL; /**< list of requests from power plugin */
 
 static void __uam_clear_ppm_reqs(void)
 {
@@ -131,7 +131,7 @@ int stop_presence_check_callback(uas_plugin_id_e ids)
                        con->tid = TIMER_OFF;
 
                        ppm_reqs = g_list_remove(ppm_reqs, con);
-                       g_free(con);
+                       free(con);
                        con = NULL;
 
                        UAM_DBG("[%d] request canceled", ids);