diff options
author | Yuta Doi <yuta-d@witz-inc.co.jp> | 2018-07-09 17:23:31 +0900 |
---|---|---|
committer | Yuta Doi <yuta-d@witz-inc.co.jp> | 2018-08-15 10:46:04 +0900 |
commit | c1d85371b1eb693128cf9553c356ea77e609d9a3 (patch) | |
tree | f4e69885b1c7c5e4116cf4eea7e5237412ce82c0 /policy_manager/db | |
parent | 38255dcda8e7e9462ed3b16ebe39c638bc9b349f (diff) |
Readd Policy Manager as plugin
This patch reverts commit c6f9a9b8468b3746a3dec7ee2a0b7d84ec9fb44a
and update it.
Policy Manager decides next layout by inputed event and current state
based on the policy table.
And Policy Manager is plugin for Window Manager.
Therefore the OEMs can replace it.
This patch provides Policy Manager I/F as reference implementation
and does not have policy table.
Therefore Policy Manager updates each layers
to draw the applications in requested area
in accordance with just like activate/deactivate request.
[APIs of Policy Manager class]
- int initialize(void)
Initialize Policy Manger.
in: none
out: 0(success), -1(error)
- void registerCallback(CallbackTable callback_table)
Register callback functions.
in: the pointers of callback handlers
out: none
"CallbackTable" type is as follows:
typedef struct
{
Handler onStateTransitioned;
Handler onError;
} CallbackTable;
"Handler" type is as follows:
using Handler = std::function<void(json_object *)>;
- int setInputEventData(json_object *json_in)
Set input event data for the policy table.
in: input event data as json_object
out: 0(success), -1(error)
- int executeStateTransition(void)
Execute state transition by using set input event data.
in: none
out: 0(success), -1(error)
- void undoState(void)
Undo state only once per once state transition.
in: none
out: none
[Callbacks of Policy Manager class]
- void onStateTransitioned(json_object *json_out)
When state transition succeeds, this callback is called.
The argument json_out has the state after transition.
- void onError(json_object *json_out)
When state transition fails, this callback is called.
The argument json_out has the error information
like message, inputed event datas and etc..
Bug-AGL: SPEC-1537
Change-Id: Ib8c71f2e544cb90b6763d07fad56dc1c453e9a97
Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'policy_manager/db')
-rw-r--r-- | policy_manager/db/roles.db | 40 | ||||
-rw-r--r-- | policy_manager/db/states.db | 174 |
2 files changed, 214 insertions, 0 deletions
diff --git a/policy_manager/db/roles.db b/policy_manager/db/roles.db new file mode 100644 index 0000000..5d31aea --- /dev/null +++ b/policy_manager/db/roles.db @@ -0,0 +1,40 @@ +{ + "roles":[ + { + "category": "homescreen", + "role": "homescreen", + "area": "fullscreen", + "layer": "homescreen", + }, + { + "category": "debug", + "role": "launcher | map | poi | browser | sdl | mixer | radio | hvac | debug | phone | video | music | settings | dashboard | fallback", + "area": "normal.full | split.main | split.sub | fullscreen", + "layer": "apps", + }, + { + "category": "software_keyboard", + "role": "software_keyboard", + "area": "software_keyboard", + "layer": "near_homescreen", + }, + { + "category": "restriction", + "role": "restriction", + "area": "restriction.normal | restriction.split.main | restriction.split.sub", + "layer": "restriction", + }, + { + "category": "pop_up", + "role": "on_screen | on_screen_phone", + "area": "on_screen", + "layer": "on_screen", + }, + { + "category": "system_alert", + "role": "system_alert", + "area": "on_screen", + "layer": "on_screen", + } + ] +} diff --git a/policy_manager/db/states.db b/policy_manager/db/states.db new file mode 100644 index 0000000..371be3b --- /dev/null +++ b/policy_manager/db/states.db @@ -0,0 +1,174 @@ +{ + "states": [ + { + "name": "homescreen", + "areas": [ + { + "name": "fullscreen", + "category": "homescreen" + } + ] + }, + { + "name": "map.normal", + "areas": [ + { + "name": "normal.full", + "category": "map" + } + ] + }, + { + "name": "map.split", + "areas": [ + { + "name": "split.main", + "category": "map" + }, + { + "name": "split.sub", + "category": "splitable" + } + ] + }, + { + "name": "map.fullscreen", + "areas": [ + { + "name": "fullscreen", + "category": "map" + } + ] + }, + { + "name": "splitable.normal", + "areas": [ + { + "name": "normal.full", + "category": "splitable" + } + ] + }, + { + "name": "splitable.split", + "areas": [ + { + "name": "split.main", + "category": "splitable" + }, + { + "name": "split.sub", + "category": "splitable" + } + ] + }, + { + "name": "general.normal", + "areas": [ + { + "name": "normal.full", + "category": "general" + } + ] + }, + { + "name": "system.normal", + "areas": [ + { + "name": "normal.full", + "category": "system" + } + ] + }, + { + "name": "software_keyboard", + "areas": [ + { + "name": "software_keyboard", + "category": "software_keyboard" + } + ] + }, + { + "name": "restriction.normal", + "areas": [ + { + "name": "restriction.normal", + "category": "restriction" + } + ] + }, + { + "name": "restriction.split.main", + "areas": [ + { + "name": "restriction.split.main", + "category": "restriction" + } + ] + }, + { + "name": "restriction.split.sub", + "areas": [ + { + "name": "restriction.split.sub", + "category": "restriction" + } + ] + }, + { + "name": "pop_up", + "areas": [ + { + "name": "on_screen", + "category": "pop_up" + } + ] + }, + { + "name": "system_alert", + "areas": [ + { + "name": "on_screen", + "category": "system_alert" + } + ] + }, + { + "name": "debug.normal", + "areas": [ + { + "name": "normal.full", + "category": "debug" + } + ] + }, + { + "name": "debug.split.main", + "areas": [ + { + "name": "split.main", + "category": "debug" + } + ] + }, + { + "name": "debug.split.sub", + "areas": [ + { + "name": "split.sub", + "category": "debug" + } + ] + }, + { + "name": "debug.fullscreen", + "areas": [ + { + "name": "fullscreen", + "category": "debug" + } + ] + } + ] +} |