display: Add display capability setting 96/312796/2
authorYunhee Seo <yuni.seo@samsung.com>
Fri, 14 Jun 2024 07:29:31 +0000 (16:29 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Fri, 14 Jun 2024 08:05:42 +0000 (17:05 +0900)
Sets powerkey/homekey display capability according to the policy of mobile profile.

Change-Id: I0d216442dbe73a7a9cf930d12fe2f499075d3f90
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
src/display/display.c

index 9fbc6ea8ac236e60bf976839c85a099970d0e02e..dd3708c3b6ea22f4788ce46b487110c7dbd88ea8 100644 (file)
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+#include <libsyscommon/resource-manager.h>
 #include <system/syscommon-plugin-common-interface.h>
 #include <system/syscommon-plugin-deviced-common-interface.h>
 #include <system/syscommon-plugin-deviced-display.h>
@@ -77,6 +78,32 @@ static int deviced_display_init(void **data)
 
        *data = (void *)&g_display_funcs;
 
+       /*
+       * Default capability setting
+       * powerkey := LCDON | LCDOFF | POWEROFF
+       * homekey  := LCDON
+       */
+       syscommon_resman_set_resource_attr_uint64_3(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
+                               DEVICED_DISPLAY_ATTR_TUPLE3_ACTOR_CAPABILITY,
+                               SYSCOMMON_DEVICED_DISPLAY_ACTOR_POWER_KEY,
+                               SYSCOMMON_DEVICED_DISPLAY_CAPA_LCDON,
+                               1);
+       syscommon_resman_set_resource_attr_uint64_3(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
+                               DEVICED_DISPLAY_ATTR_TUPLE3_ACTOR_CAPABILITY,
+                               SYSCOMMON_DEVICED_DISPLAY_ACTOR_POWER_KEY,
+                               SYSCOMMON_DEVICED_DISPLAY_CAPA_LCDOFF,
+                               1);
+       syscommon_resman_set_resource_attr_uint64_3(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
+                               DEVICED_DISPLAY_ATTR_TUPLE3_ACTOR_CAPABILITY,
+                               SYSCOMMON_DEVICED_DISPLAY_ACTOR_POWER_KEY,
+                               SYSCOMMON_DEVICED_DISPLAY_CAPA_POWEROFF,
+                               1);
+       syscommon_resman_set_resource_attr_uint64_3(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
+                               DEVICED_DISPLAY_ATTR_TUPLE3_ACTOR_CAPABILITY,
+                               SYSCOMMON_DEVICED_DISPLAY_ACTOR_MENU_KEY,
+                               SYSCOMMON_DEVICED_DISPLAY_CAPA_LCDON,
+                               1);
+
        return 0;
 }