summaryrefslogtreecommitdiffstats
path: root/src/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-12 09:24:56 +0900
commit99b6f4d2fcd421d3a760a88a67e511fb6fc98068 (patch)
tree12c17f502e37b6742ead94e2d5bba07822300328 /src/policy_manager/db
parent8ab10aaafc6fb3dc7bbad755dce9b4bdaa41f287 (diff)
Add PolicyManager as plugin
PolicyManager decides next layout by using occured event and current state based on the policy table. And PolicyManager is plugin for WindowManager. Therefore the OEMs can replace it. This patch provides PolicyManager I/F as reference implementation and does not have policy table. Therefore PolicyManager updates each layers to draw the applications in normal.full area in accordance with just like activate/deactivate request. [APIs of PolicyManager class] - int initialize(void) Initialize PolicyManger. 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 PolicyManager 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 'src/policy_manager/db')
-rw-r--r--src/policy_manager/db/layouts.db152
-rw-r--r--src/policy_manager/db/roles.db44
-rw-r--r--src/policy_manager/db/roles.db.split51
3 files changed, 247 insertions, 0 deletions
diff --git a/src/policy_manager/db/layouts.db b/src/policy_manager/db/layouts.db
new file mode 100644
index 0000000..da78b31
--- /dev/null
+++ b/src/policy_manager/db/layouts.db
@@ -0,0 +1,152 @@
+{
+ "layouts": [
+ {
+ "name": "homescreen",
+ "layer": "far_homescreen",
+ "areas": [
+ {
+ "name": "fullscreen",
+ "category": "homescreen"
+ }
+ ]
+ },
+ {
+ "name": "map.normal",
+ "layer": "apps",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "map"
+ }
+ ]
+ },
+ {
+ "name": "map.split",
+ "layer": "apps",
+ "areas": [
+ {
+ "name": "split.main",
+ "category": "map"
+ },
+ {
+ "name": "split.sub",
+ "category": "splitable"
+ }
+ ]
+ },
+ {
+ "name": "map.fullscreen",
+ "layer": "apps",
+ "areas": [
+ {
+ "name": "fullscreen",
+ "category": "map"
+ }
+ ]
+ },
+ {
+ "name": "splitable.normal",
+ "layer": "apps",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "splitable"
+ }
+ ]
+ },
+ {
+ "name": "splitable.split",
+ "layer": "apps",
+ "areas": [
+ {
+ "name": "split.main",
+ "category": "splitable"
+ },
+ {
+ "name": "split.sub",
+ "category": "splitable"
+ }
+ ]
+ },
+ {
+ "name": "general.normal",
+ "layer": "apps",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "general"
+ }
+ ]
+ },
+ {
+ "name": "system.normal",
+ "layer": "apps",
+ "areas": [
+ {
+ "name": "normal.full",
+ "category": "system"
+ }
+ ]
+ },
+ {
+ "name": "software_keyboard",
+ "layer": "near_homescreen",
+ "areas": [
+ {
+ "name": "software_keyboard",
+ "category": "software_keyboard"
+ }
+ ]
+ },
+ {
+ "name": "restriction.normal",
+ "layer": "restriction",
+ "areas": [
+ {
+ "name": "restriction.normal",
+ "category": "restriction"
+ }
+ ]
+ },
+ {
+ "name": "restriction.split.main",
+ "layer": "restriction",
+ "areas": [
+ {
+ "name": "restriction.split.main",
+ "category": "restriction"
+ }
+ ]
+ },
+ {
+ "name": "restriction.split.sub",
+ "layer": "restriction",
+ "areas": [
+ {
+ "name": "restriction.split.sub",
+ "category": "restriction"
+ }
+ ]
+ },
+ {
+ "name": "pop_up",
+ "layer": "on_screen",
+ "areas": [
+ {
+ "name": "on_screen",
+ "category": "pop_up"
+ }
+ ]
+ },
+ {
+ "name": "system_alert",
+ "layer": "on_screen",
+ "areas": [
+ {
+ "name": "on_screen",
+ "category": "system_alert"
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/policy_manager/db/roles.db b/src/policy_manager/db/roles.db
new file mode 100644
index 0000000..d0d911a
--- /dev/null
+++ b/src/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/src/policy_manager/db/roles.db.split b/src/policy_manager/db/roles.db.split
new file mode 100644
index 0000000..2776ce5
--- /dev/null
+++ b/src/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",
+ }
+ ]
+}