Add stop_timer and revert the function name
[apps/agl-service-windowmanager.git] / src / app.cpp
index e64b248..9e27ea8 100644 (file)
@@ -414,7 +414,7 @@ void App::set_timer(){
                                     CLOCK_REALTIME, time(NULL) + TIME_OUT, 0, processTimerHandler, this);
         if (ret < 0)
         {
-            HMI_ERROR("wm", "Can't set timer");
+            HMI_ERROR("wm", "Could't set timer");
         }
     }
     else
@@ -425,6 +425,15 @@ void App::set_timer(){
     }
 }
 
+void App::stop_timer(){
+    unsigned seq = app_list.currentSequenceNumber();
+    HMI_SEQ_DEBUG(seq, "Timer stop");
+    int rc = sd_event_source_set_enabled(timer_ev_src, SD_EVENT_OFF);
+    if(rc < 0){
+        HMI_SEQ_ERROR(seq, "Timer stop failed");
+    }
+}
+
 bool App::do_allocate_window_resource(unsigned request_seq)
 {
     /*
@@ -459,7 +468,7 @@ bool App::do_allocate_window_resource(unsigned request_seq)
     return ret;
 }
 
-void App::lm_layout_change(unsigned req, const char* drawing_name)
+void App::lm_layout_change(unsigned req_num, const char* drawing_name)
 {
     auto const &surface_id = this->lookup_id(drawing_name);
     auto layer_id = this->layers.get_layer_id(*surface_id);
@@ -604,7 +613,7 @@ void App::lm_layout_change(unsigned req, const char* drawing_name)
     }
 }
 
-const char* App::check_surface_exist(unsigned req, const char* drawing_name)
+const char* App::check_surface_exist(unsigned req_num, const char* drawing_name)
 {
     auto const &surface_id = this->lookup_id(drawing_name);
     if (!surface_id)
@@ -711,7 +720,7 @@ void App::api_deactivate_surface(char const *appid, char const *drawing_name, co
 
     std::string id = appid;
 
-    if(app_list.contains(id)){
+    if(!app_list.contains(id)){
         reply("app doesn't request 'requestSurface' yet");
         return;
     }