aboutsummaryrefslogtreecommitdiffstats
path: root/policy_manager/db
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-07-09 17:23:31 +0900
committerYuta Doi <yuta-d@witz-inc.co.jp>2018-07-23 21:58:33 +0900
commitd5fbf53aa76dbba9316b08c1ca499d4639d9db1b (patch)
tree0f0cfc4b603ffded4de71f29871282952f93a81c /policy_manager/db
parentc7366c3b3ad816d1ac5e46f8e2b71b35ac291d67 (diff)
Add Policy Manager as plugin
Policy Manager decides next layout by using occured 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 normal.full area in accordance with just like activate/deactivate request. [APIs of Policy Manager class] - int initialize(void) Initialize Policy Manger. input: none output: 0(success), -1(error) - void registerCallback(CallbackTable callback_table) Register callback functions. input: the pointers of callback handlers output: 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. input: input event data as json_object output: 0(success), -1(error) - int executeStateTransition(void) Execute state transition by using set input event data. input: none output: 0(success), -1(error) - void undoState(void) Undo state only once per once state transition. input: none output: 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: I44b771d4145078bf3ea05e26165bb9c1a03b10c3 Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'policy_manager/db')
-rw-r--r--policy_manager/db/roles.db44
-rw-r--r--policy_manager/db/roles.db.split51
-rw-r--r--policy_manager/db/states.db138
3 files changed, 233 insertions, 0 deletions
diff --git a/policy_manager/db/roles.db b/policy_manager/db/roles.db
new file mode 100644
index 0000000..d0d911a
--- /dev/null
+++ b/policy_manager/db/roles.db
@@ -0,0 +1,44 @@
+{
+ "roles":[
+ {
+ "category": "homescreen",
+ "role": "homescreen",
+ "area": "fullscreen",
+ },
+ {
+ "category": "map",
+ "role": "map",
+ "area": "normal.full | split.main",
+ },
+ {
+ "category": "general",
+ "role": "launcher | poi | browser | sdl | mixer | radio | hvac | debug | phone | video | music | fallback",
+ "area": "normal.full",
+ },
+ {
+ "category": "system",
+ "role": "settings | dashboard",
+ "area": "normal.full",
+ },
+ {
+ "category": "software_keyboard",
+ "role": "software_keyboard",
+ "area": "software_keyboard",
+ },
+ {
+ "category": "restriction",
+ "role": "restriction",
+ "area": "restriction.normal | restriction.split.main | restriction.split.sub",
+ },
+ {
+ "category": "pop_up",
+ "role": "on_screen | on_screen_phone",
+ "area": "on_screen",
+ },
+ {
+ "category": "system_alert",
+ "role": "system_alert",
+ "area": "on_screen",
+ }
+ ]
+}
diff --git a/policy_manager/db/roles.db.split b/policy_manager/db/roles.db.split
new file mode 100644
index 0000000..2776ce5
--- /dev/null
+++ b/policy_manager/db/roles.db.split
@@ -0,0 +1,51 @@
+{
+ "roles":[
+ {
+ "category": "homescreen",
+ "role": "homescreen",
+ "area": "fullscreen",
+ },
+ {
+ "category": "map",
+ "role": "map",
+ "area": "normal.full | split.main",
+ },
+ {
+ "category": "general",
+ "role": "launcher | poi | browser | sdl | mixer | radio | hvac | debug | phone | fallback",
+ "area": "normal.full",
+ "description": "For split test, video and music are moved to category:splitable",
+ },
+ {
+ "category": "system",
+ "role": "settings | dashboard",
+ "area": "normal.full",
+ },
+ {
+ "category": "splitable",
+ "role": "video | music",
+ "area": "normal.full | split.main | split.sub",
+ "description": "For split test, video and music are included here",
+ },
+ {
+ "category": "software_keyboard",
+ "role": "software_keyboard",
+ "area": "software_keyboard",
+ },
+ {
+ "category": "restriction",
+ "role": "restriction",
+ "area": "restriction.normal | restriction.split.main | restriction.split.sub",
+ },
+ {
+ "category": "pop_up",
+ "role": "on_screen | on_screen_phone",
+ "area": "on_screen",
+ },
+ {
+ "category": "system_alert",
+ "role": "system_alert",
+ "area": "on_screen",
+ }
+ ]
+}
diff --git a/policy_manager/db/states.db b/policy_manager/db/states.db
new file mode 100644
index 0000000..fa40ce1
--- /dev/null
+++ b/policy_manager/db/states.db
@@ -0,0 +1,138 @@
+{
+ "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"
+ }
+ ]
+ }
+ ]
+}