config: enable removing some applications from regulation.
authorIsmo Puustinen <ismo.puustinen@intel.com>
Thu, 6 Nov 2014 11:00:53 +0000 (13:00 +0200)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Thu, 8 Jan 2015 16:37:19 +0000 (18:37 +0200)
Change-Id: I82b3d552cb0e5b22fd88e4c02789829df62296b1

packaging.in/murphy.lua

index b286740..82d2e07 100644 (file)
@@ -576,12 +576,24 @@ end
 function regulateApplications(t, regulation)
     for k,v in pairs(ft(t)) do
 
-        -- iterate through the undefined and entertainment apps, see if
-        -- they have been overruled in local config
+        whitelisted = false
 
+        -- our local application config, which takes precedence
         local conf = getApplication(v.appid)
 
-        if conf and conf.resource_class ~= "player" then
+        if conf then
+            if conf.resource_class ~= "player" then
+                whitelisted = true
+            end
+
+              if conf.requisites and conf.requisites.screen then
+                if conf.requisites.screen.driving then
+                    whitelisted = true
+                end
+            end
+        end
+
+        if whitelisted then
             -- override, don't disable
             resmgr:disable_screen_by_appid("*", "*", v.appid, false, false)
         else
@@ -934,15 +946,28 @@ resmgr = resource_manager {
                                     -- our local application config, which takes precedence
                                     local conf = getApplication(ev.appid)
 
-                                    -- disable only non-whitelisted applications
-                                    if not conf or conf.resource_class == "player" then
-                                        if blacklisted then
-                                            if verbose > 0 then
-                                                print("disabling screen for " .. ev.appid)
+                                    if not conf then
+                                        blacklisted = true
+                                    else
+                                        if conf.resource_class == "player" then
+                                            blacklisted = true
+                                        end
+
+                                        -- check the exceptions
+                                        if conf.requisites and conf.requisites.screen then
+                                            if conf.requisites.screen.driving then
+                                                blacklisted = false
                                             end
-                                            resmgr:disable_screen_by_appid("*", "*", ev.appid, true, true)
                                         end
                                     end
+
+                                    -- disable only non-whitelisted applications
+                                                   if blacklisted then
+                                        if verbose > 0 then
+                                            print("disabling screen for " .. ev.appid)
+                                        end
+                                        resmgr:disable_screen_by_appid("*", "*", ev.appid, true, true)
+                                    end
                                 end
 
                              elseif event == "destroy" then
@@ -1575,9 +1600,48 @@ application {
     area            = "Center.Full",
     privileges      = { screen = "none", audio = "none" },
     resource_class  = "system",
+    requisites      = { screen = "driving", audio = "none" },
     screen_priority = 30
 }
 
+application {
+    appid           = "MediaPlayer",
+    area            = "Center.Full",
+    privileges      = { screen = "none", audio = "none" },
+    requisites      = { screen = "driving", audio = "none" },
+    resource_class  = "player",
+    screen_priority = 0
+}
+
+application {
+    appid           = "MyMediaPlayer",
+    area            = "Center.Full",
+    privileges      = { screen = "none", audio = "none" },
+    requisites      = { screen = "driving", audio = "none" },
+    resource_class  = "player",
+    screen_priority = 0
+}
+
+application {
+    appid           = "MeterWidget",
+    area            = "Center.Full",
+    privileges      = { screen = "none", audio = "none" },
+    requisites      = { screen = "driving", audio = "none" },
+    resource_class  = "player",
+    screen_priority = 0
+}
+
+application {
+    appid           = "org.tizen.ico.app-soundsample",
+    area            = "Center.Full",
+    privileges      = { screen = "none", audio = "none" },
+    -- uncomment the next line to make the app exempt from regulation
+    -- requisites      = { screen = "driving", audio = "none" },
+    resource_class  = "player",
+    screen_priority = 0
+}
+
+
 if sc then
     sc.client_handler = function (self, cid, msg)
         local command = msg.command