resource-manager: Add API for fine-tuned event listening 57/301657/1
authorYoungjae Cho <y0.cho@samsung.com>
Fri, 6 Oct 2023 07:23:04 +0000 (16:23 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Tue, 21 Nov 2023 07:47:01 +0000 (16:47 +0900)
commit69bdd0e59e3effe630388e3bf0e5af2fc67c83fe
tree6ad5af97111c819f73f59e8057d526e516e64cfd
parent65ab40566fb52306c42815346ce0c57b2d39ede8
resource-manager: Add API for fine-tuned event listening

The syscommon_resman_subscribe_resource_event() has been split into
3 variants, each of which can narrow down the range of events that
we want to listen to.
- syscommon_resman_subscribe_event(...)
  : It is identical to the existing one. Listen any events from any
    type of resources.

- syscommon_resman_subscribe_resource_event(resource_type, ...)
  : Listen any changes of attribute from specific type of resources.

- syscommon_resman_subscribe_resource_attribute_event(resource_type,
     attr_mask, ...)
  : Listen change of specific attributes from specific type of resources.

In addition, the event callback has been changed to receive an additional
parameter, void *user_data.

Change-Id: I41876fa746d1d042bc1595db55d29e3b8ff13e86
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
include/libsyscommon/resource-manager.h
src/resource-manager/resource-manager.c
tests/resource-manager/battery-interface.h [new file with mode: 0644]
tests/resource-manager/common-interface.h
tests/resource-manager/resource-battery.c [new file with mode: 0644]
tests/resource-manager/resource-battery.h [new file with mode: 0644]
tests/resource-manager/resource-display.c
tests/resource-manager/test.c