Show debug message when incorrect role
[apps/agl-service-windowmanager.git] / src / wm_client.cpp
index 6f1aa20..e226791 100644 (file)
@@ -84,12 +84,23 @@ 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& [key, value] : this->role2surface)
+    {
+        if(value == surface){
+            return key;
+        }
+    }
+    return std::string("");
+}
+
 unsigned WMClient::layerID() const
 {
     return this->layer;