local regulation = mdb.select.select_driving_mode.single_value
- if regulation then
+ if regulation == 1 then
conf = getApplication(ev.appid)
-- disable only non-whitelisted applications
if not conf or conf.resource_class == "player" then
- resmgr:disable_screen_by_appid("*", "*", v.appid, true)
+ resmgr:disable_screen_by_appid("*", "*", ev.appid, true)
end
end
if msg.arg.anim_time then
local t = msg.arg.anim_time
time = m:AND(t, time_mask)
- nores = m:AND(t, nores_mask)
+ nores = not m:AND(t, nores_mask)
if m:AND(t, raise_mask) then
msg.arg.raise = 1
elseif m:AND(t, lower_mask) then
if msg.arg.anim_time then
local t = msg.arg.anim_time
time = m:AND(t, time_mask)
- nores = m:AND(t, nores_mask)
+ nores = not m:AND(t, nores_mask)
end
if msg.arg.anim_name then
a.hide = { msg.arg.anim_name, time }
SCREEN_EVENT_HANDLER,
/* 22 */ DISABLE_AUDIO_BY_APPID,
/* 23 */ DISABLE_SCREEN_BY_APPID,
+ /* 25 */ DISABLE_SCREEN_BY_SURFACE,
/* 26 */ DISABLE_AUDIO_BY_REQUISITE,
/* 27 */ DISABLE_SCREEN_BY_REQUISITE,
};
mrp_resmgr_notifier_queue_audio_event(audio->resmgr, ar->zoneid, zonename,
MRP_RESMGR_EVENTID_CREATE,
- app->appid, ar->audioid);
+ appid, ar->audioid);
mrp_resmgr_notifier_flush_audio_events(audio->resmgr, ar->zoneid);
return ar;
MRP_RESMGR_DISABLE_REQUISITE,
MRP_RESMGR_DISABLE_APPID,
+ MRP_RESMGR_DISABLE_SURFACEID,
MRP_RESMGR_DISABLE_MAX
};
union {
const char *appid;
mrp_application_requisite_t req;
+ uint32_t surfaceid;
};
uint32_t zones;
int counter;
goto disable;
break;
+ case MRP_RESMGR_DISABLE_SURFACEID:
+ goto disable;
+
disable:
disable = sr->disable & it->mask;
if (it->disable) {
char fullname[1024];
uint32_t mask;
uint32_t z;
+ void *hk, *obj;
MRP_ASSERT(screen && data, "invalid argument");
dit.areaid = area_id;
dit.disable = disable;
dit.type = type;
- dit.mask = BIT(type - 1);
dit.zones = 0;
dit.counter = 0;
-
+
switch (type) {
case MRP_RESMGR_DISABLE_REQUISITE:
+ dit.mask = BIT(MRP_RESMGR_DISABLE_REQUISITE - 1);
dit.req = *(mrp_application_requisite_t *)data;
+ mrp_htbl_foreach(screen->resources, screen_disable_cb, &dit);
break;
-
+
case MRP_RESMGR_DISABLE_APPID:
+ dit.mask = BIT(MRP_RESMGR_DISABLE_APPID - 1);
dit.appid = (const char *)data;
+ mrp_htbl_foreach(screen->resources, screen_disable_cb, &dit);
+ break;
+
+ case MRP_RESMGR_DISABLE_SURFACEID:
+ dit.mask = BIT(MRP_RESMGR_DISABLE_APPID - 1);
+ dit.surfaceid = *(uint32_t *)data;
+ hk = NULL + dit.surfaceid;
+ if (!(obj = mrp_htbl_lookup(screen->resources, hk))) {
+ mrp_log_error("system-controller: failed to disable screen: "
+ "can't find surface %u", dit.surfaceid);
+ return -1;
+ }
+ screen_disable_cb(hk, obj, &dit);
break;
default:
return -1;
}
- mrp_htbl_foreach(screen->resources, screen_disable_cb, &dit);
-
for (z = 0; dit.zones && z < MRP_ZONE_MAX; z++) {
mask = (((uint32_t)1) << z);
-
+
if ((mask & dit.zones)) {
dit.zones &= ~mask;
mrp_resource_owner_recalc(z);
static mrp_funcbridge_t *area_create;
static mrp_funcbridge_t *window_raise;
+static mrp_funcbridge_t *disable_screen_by_surface;
static mrp_funcbridge_t *disable_screen_by_appid;
static mrp_funcbridge_t *disable_screen_by_requisite;
static mrp_funcbridge_t *disable_audio_by_appid;
mrp_funcbridge_push(L, window_raise);
break;
+ case DISABLE_SCREEN_BY_SURFACE:
+ mrp_funcbridge_push(L, disable_screen_by_surface);
+ break;
+
case DISABLE_SCREEN_BY_APPID:
mrp_funcbridge_push(L, disable_screen_by_appid);
break;
*ret_type = MRP_FUNCBRIDGE_NO_DATA;
- if (!strcmp((const char *)data, "app")) {
+ if (!strcmp((const char *)data, "sur")) {
+ if (strcmp(signature, "ossdb")) {
+ mrp_log_error("bad signature: expected 'ossdb' got '%s'",
+ signature);
+ return false;
+ }
+ type = MRP_RESMGR_DISABLE_SURFACEID;
+ data = (void *)&args[3].integer;
+ }
+ else if (!strcmp((const char *)data, "app")) {
if (strcmp(signature, "osssb")) {
mrp_log_error("bad signature: expected 'osssb' got '%s'",
signature);
static funcbridge_def_t funcbridge_defs[] = {
FUNCBRIDGE(area_create , area_create , "oos" , NULL),
FUNCBRIDGE(window_raise , window_raise , "osdd" , NULL),
+ FUNCBRIDGE(disable_screen_by_surface , disable_screen, "ossdb","sur"),
FUNCBRIDGE(disable_screen_by_appid , disable_screen, "osssb","app"),
FUNCBRIDGE(disable_screen_by_requisite, disable_screen, "ossob","req"),
FUNCBRIDGE(disable_audio_by_appid , disable_audio , "ossb" ,"app"),
return DISABLE_SCREEN_BY_APPID;
break;
+ case 25:
+ if (!strcmp(name, "disable_screen_by_surface"))
+ return DISABLE_SCREEN_BY_SURFACE;
+ break;
+
case 26:
if (!strcmp(name, "disable_audio_by_requisite"))
return DISABLE_AUDIO_BY_REQUISITE;