Add category "system" for showing specific app on restriction mode ON
authorYuta Doi <yuta-d@witz-inc.co.jp>
Tue, 12 Jun 2018 16:37:46 +0000 (01:37 +0900)
committerYuta Doi <yuta-d@witz-inc.co.jp>
Tue, 12 Jun 2018 16:37:46 +0000 (01:37 +0900)
Change-Id: Ic4d63045f98cd18b33876e4cde8d1d0a315706f0
Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
src/policy_manager/db/role.db
src/policy_manager/zipc/dummy_stm.c
src/policy_manager/zipc/dummy_stm.h

index f41ead4..6806b9a 100644 (file)
     },
     {
         "category": "general",
-        "role": "launcher | poi | music | browser | sdl | settings | mixer | radio | hvac | dashboard | debug | phone | als-meter-demo",
+        "role": "launcher | poi | music | browser | sdl | mixer | radio | hvac | debug | phone",
         "area": "normal",
         "description": "For ALS, role:video is moved to category:splitable",
     },
+    {
+        "category": "system",
+        "role": "settings | dashboard | als-meter-demo",
+        "area": "normal",
+    },
     {
         "category": "splitable",
         "role": "splitable1 | splitable2 | video",
index 3be9964..1a0a8d8 100644 (file)
@@ -46,6 +46,7 @@ const char* gStmCategoryName[] = {
     "popup",
     "system_alert",
     "restriction",
+    "system",
 };
 
 const int gStmCategoryNo[] = {
@@ -56,6 +57,7 @@ const int gStmCategoryNo[] = {
     STM_CTG_NO_POPUP,
     STM_CTG_NO_SYSTEM_ALERT,
     STM_CTG_NO_RESTRICTION,
+    STM_CTG_NO_SYSTEM,
 };
 
 const char* gStmAreaName[] = {
@@ -130,6 +132,7 @@ const char* gStmLayoutNo2Name[] = {
     "restriction",
     "restriction.split.main",
     "restriction.split.sub",
+    "system",
 };
 
 stm_state_t g_crr_state;
@@ -304,7 +307,8 @@ int stmTransitionState(int event, stm_state_t* state) {
 
         // Update apps layer
         g_prv_apps_state_car_stop = apps_state;
-        if (STM_TRUE == g_map_is_activated) {
+        if ((STM_TRUE == g_map_is_activated)
+           && (gStmLayoutNoSystem != apps_state)) {
             g_crr_state.layer.apps.state = gStmLayoutNoM1;
             g_crr_state.layer.apps.is_changed = STM_TRUE;
         }
@@ -405,6 +409,25 @@ int stmTransitionState(int event, stm_state_t* state) {
                     break;
                 }
                 break;
+            case STM_CTG_NO_SYSTEM:
+                switch (area_no) {
+                case STM_ARA_NO_NORMAL:
+                    // Apps layer
+                    switch (apps_state) {
+                    case gStmLayoutNoMf:
+                        // nop
+                        break;
+                    default:
+                        g_crr_state.layer.apps.state = gStmLayoutNoSystem;
+                        g_crr_state.layer.apps.is_changed = STM_TRUE;
+                        break;
+                    }
+                    break;
+                default:
+                    // nop
+                    break;
+                }
+                break;
             case STM_CTG_NO_SPLITABLE:
                 switch (area_no) {
                 case STM_ARA_NO_NORMAL:
@@ -475,6 +498,46 @@ int stmTransitionState(int event, stm_state_t* state) {
             }
             break;
         }
+       else {  // (gStmRestrictionModeStateNoOn == restriction_mode_state)
+            switch (category_no) {
+            case STM_CTG_NO_MAP:
+                switch (area_no) {
+                case STM_ARA_NO_FULL:
+                case STM_ARA_NO_NORMAL:
+                case STM_ARA_NO_SPLIT_MAIN:
+                    // Apps layer
+                    switch (apps_state) {
+                    case gStmLayoutNoM1:
+                        // nop
+                        break;
+                    default:
+                        g_crr_state.layer.apps.state = gStmLayoutNoM1;
+                        g_crr_state.layer.apps.is_changed = STM_TRUE;
+                    }
+                    break;
+                }
+                break;
+            case STM_CTG_NO_SYSTEM:
+                switch (area_no) {
+                case STM_ARA_NO_NORMAL:
+                    // Apps layer
+                    switch (apps_state) {
+                    case gStmLayoutNoMf:
+                        // nop
+                        break;
+                    default:
+                        g_crr_state.layer.apps.state = gStmLayoutNoSystem;
+                        g_crr_state.layer.apps.is_changed = STM_TRUE;
+                        break;
+                    }
+                    break;
+                default:
+                    // nop
+                    break;
+                }
+                break;
+           }
+       }
     case STM_EVT_NO_DEACTIVATE:
         switch (category_no) {
         default:
index e848628..5e7ac70 100644 (file)
@@ -48,6 +48,7 @@
 #define STM_CTG_NO_POPUP        0x0500
 #define STM_CTG_NO_SYSTEM_ALERT 0x0600
 #define STM_CTG_NO_RESTRICTION  0x0700
+#define STM_CTG_NO_SYSTEM       0x0800
 
 // Area number
 #define STM_ARA_NO_FULL                   0x010000
@@ -66,7 +67,7 @@
 
 // Number of events, categories and areas
 #define STM_NUM_EVT 15
-#define STM_NUM_CTG  7
+#define STM_NUM_CTG  8
 #define STM_NUM_ARA  8
 
 // Enum for state
@@ -119,6 +120,7 @@ enum stm_layout_ {
     gStmLayoutNoRestriction,
     gStmLayoutNoRestrictionSplitMain,
     gStmLayoutNoRestrictionSplitSub,
+    gStmLayoutNoSystem,
 };