From b6be034c672eb70f5e67eabf55998097c1e2aee4 Mon Sep 17 00:00:00 2001 From: Ismo Puustinen Date: Thu, 6 Nov 2014 13:00:53 +0200 Subject: [PATCH] config: enable removing some applications from regulation. Change-Id: I82b3d552cb0e5b22fd88e4c02789829df62296b1 --- packaging.in/murphy.lua | 82 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 9 deletions(-) diff --git a/packaging.in/murphy.lua b/packaging.in/murphy.lua index b286740..82d2e07 100644 --- a/packaging.in/murphy.lua +++ b/packaging.in/murphy.lua @@ -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 -- 2.7.4