summaryrefslogtreecommitdiffstats
path: root/src/policy.c
AgeCommit message (Collapse)AuthorFilesLines
2021-12-22agl-compositor:Add NULL check after zalloc in src directorymarlin_12.91.0marlin/12.91.012.91.0AndyZhou1-4/+24
There's no NULL check in zalloc. Add a NULL check after zalloc. And add memory free before return error. Bug-AGL: SPEC-4178 Signed-off-by: ZhouMingying <zhoumy@cn.fujitsu.com> Change-Id: Ic0e0e2007b2897a451507aed100ad01b65695383
2020-03-11policy: Init policy framework APIMarius Vlad1-0/+333
This patch adds the policy framework, comprised from hooks which a policy engine can further customize, and which are checked upon surface creation, commit and activation. Users should create specialized versions of these callbacks when creating/desining a policy engine. Further more, it adds the posibility to further customize the policy engine by adding new states, events and policy rules. By default, the policy API is aware of known states like 'start' or 'stop', but also 'show' and 'hide' as events. A policy rule would allow to define the setup in which an event can happen based on the state of the rule compared to that of the system, the action event itself, the application and (optional) an timeout. The policy rules are there to specify the state, the event, and application, but it is ultimately handled by a hook which will be called to handle the event. The compositor will arrange to pass all that information back to the handler, so the policy engine is in control to check in what circumstances the policy can be satisfied. These policy rules allow to handle transitional states which are common in AGL. For instance: If one would want to display the application 'navigation' in 3 seconds after and state has been changed to 'start', it should do add the following rule: ('navigation', STATE_START, EVENT_SHOW, timeout, main_output) Then, when a 'STATE_START' state is propagated to the compositor the policy API will trigger a state change signal which in turn wil arm an timer to execute the event handler after a timeout 'timeout'. Bug-AGL: SPEC-3217 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ie03c5f9b1ddb964949e4f9797cbbe2dd2b32a6b6