Change function name
[apps/agl-service-windowmanager.git] / src / wm_client.cpp
index 6f1aa20..72517bd 100644 (file)
@@ -84,12 +84,24 @@ unsigned WMClient::surfaceID(const string &role) const
 {
     if (0 == this->role2surface.count(role))
     {
-        HMI_WARNING("wm", "invalid role");
+        HMI_NOTICE("wm", "invalid role %s : appID : %s", role.c_str(), this->id.c_str());
         return INVALID_SURFACE_ID;
     }
     return this->role2surface.at(role);
 }
 
+std::string WMClient::role(unsigned surface) const
+{
+    for(const auto& x : this->role2surface)
+    {
+        if(x.second == surface)
+        {
+            return x.first;
+        }
+    }
+    return std::string("");
+}
+
 unsigned WMClient::layerID() const
 {
     return this->layer;
@@ -118,6 +130,8 @@ bool WMClient::removeSurfaceIfExist(unsigned surface)
     {
         if (surface == x.second)
         {
+            HMI_INFO("wm", "Remove surface from client %s: role %s, surface: %d",
+                                this->id.c_str(), x.first.c_str(), x.second);
             this->role2surface.erase(x.first);
             ret = true;
             break;
@@ -137,6 +151,7 @@ bool WMClient::removeRole(const string &role)
     return ret;
 }
 
+#ifndef GTEST_ENABLED
 bool WMClient::subscribe(afb_req req, const string &evname)
 {
     if(evname != kKeyError){
@@ -169,6 +184,7 @@ void WMClient::emitError(WM_CLIENT_ERROR_EVENT ev)
         HMI_DEBUG("wm", "afb_event_push failed: %m");
     }
 }
+#endif
 
 void WMClient::dumpInfo()
 {