return true
end,
update = function(self)
- send_night_mode_to_home_screen()
+ send_night_mode_to(homescreen)
end
}
end
end
-- tell homescreen that driving mode was updated
- send_driving_mode_to_home_screen()
+ send_driving_mode_to(homescreen)
regulateApplications(ft(mdb.select.entertainment_applications), data)
regulateApplications(ft(mdb.select.undefined_applications), data)
end
local arg = m:JSON({ surface = win.surface,
- winname = win.name,
+ winname = win.name
})
local command = 0
if verbose > 0 then
print("### <== sending " ..
command_name(msg.command) ..
- " window message to '" .. win.name .. "'")
+ " window message to '" .. homescreen .. "'")
if verbose > 1 then
print(msg)
end
special_screen_sets[win.surface] = true
end
end
+
+ if onscreen and win.appid == onscreen then
+ local resmsg = m:JSON({
+ command = 0x40006, -- window_id_res
+ appid = win.appid,
+ pid = win.pid,
+ res = m:JSON({
+ window = m:JSON({
+ ECU = "",
+ display = "",
+ layer = "",
+ layout = "",
+ area = "",
+ dispatchApp = "",
+ role = win.name,
+ resourceId = win.surface
+ })
+ })
+ })
+ if verbose > 0 then
+ print("### <== sending " ..
+ command_name(resmsg.command) ..
+ " message to '" .. onscreen .. "'")
+ if verbose > 1 then
+ print(resmsg)
+ end
+ end
+ sc:send_message(onscreen, resmsg);
+ end
elseif oper == 2 then -- destroy
resclnt:resource_set_destroy("screen", win.surface)
special_screen_sets[win.surface] = nil
print('Setting homescreen='..appid)
homescreen = appid
if command and command == 1 then
- send_driving_mode_to_home_screen()
- send_night_mode_to_home_screen()
+ send_driving_mode_to(homescreen)
+ send_night_mode_to(homescreen)
end
elseif appid == "org.tizen.ico.onscreen" then
onscreen = appid
+ if command and command == 1 then
+ send_driving_mode_to(onscreen)
+ send_night_mode_to(onscreen)
+ end
end
if not connected and appid == "org.tizen.ico.homescreen" then
end
end
end
+
+ sc.notify_handler = function (self, cid, msg)
+ if verbose > 0 then
+ print('### notify handler: ' .. command_name(msg.command))
+ if verbose > 1 then
+ print(msg)
+ end
+ end
+ end
end
-function send_driving_mode_to_home_screen()
- if homescreen == "" then
+function send_driving_mode_to(client)
+ if client == "" then
return
end
end
end
- sc:send_message(homescreen, reply)
+ sc:send_message(client, reply)
end
-function send_night_mode_to_home_screen()
- if homescreen == "" then
+function send_night_mode_to(client)
+ if client == "" then
return
end
end
end
- sc:send_message(homescreen, reply)
+ sc:send_message(client, reply)
end
-- we should have 'audio_playback' defined by now
mrp_funcbridge_t *user;
mrp_funcbridge_t *resource;
mrp_funcbridge_t *inputdev;
+ mrp_funcbridge_t *notify;
} handler;
} sysctl_t;
SYSCTL_IDX_USER,
SYSCTL_IDX_RESOURCE,
SYSCTL_IDX_INPUTDEV,
+ SYSCTL_IDX_NOTIFY
} sysctl_lua_index_t;
s = mrp_json_object_to_string(msg);
- mrp_debug("sending system controller message to client #%d:", c->id);
+ mrp_debug("sending system controller message to client #%d (%s):",
+ c->id, c->app ? c->app : "<unknown>");
mrp_debug(" %s", s);
return mrp_transport_sendcustom(c->t, msg);
[2] = sc->handler.input,
[3] = sc->handler.user,
[4] = sc->handler.resource,
- [5] = sc->handler.inputdev
+ [5] = sc->handler.inputdev,
+ [6] = sc->handler.notify,
}, *h;
mrp_funcbridge_value_t args[4];
mrp_funcbridge_value_t ret;
else {
type = (cmd & 0xffff0000) >> 16;
- if (0 <= type && type <= 5)
+ if (0 <= type && type <= 6)
h = handlers[type];
else
h = NULL;
MAP("user_handler" , USER);
MAP("resource_handler", RESOURCE);
MAP("inputdev_handler", INPUTDEV);
+ MAP("notify_handler" , NOTIFY);
return 0;
#undef MAP
}
case SYSCTL_IDX_INPUTDEV:
mrp_funcbridge_push(L, scl->sc->handler.inputdev);
break;
+ case SYSCTL_IDX_NOTIFY:
+ mrp_funcbridge_push(L, scl->sc->handler.notify);
+ break;
default:
lua_pushnil(L);
}
case SYSCTL_IDX_USER: hptr = &scl->sc->handler.user; break;
case SYSCTL_IDX_RESOURCE: hptr = &scl->sc->handler.resource; break;
case SYSCTL_IDX_INPUTDEV: hptr = &scl->sc->handler.inputdev; break;
+ case SYSCTL_IDX_NOTIFY: hptr = &scl->sc->handler.notify; break;
default:
luaL_error(L, "unknown system-controller handler '%s'", name);
}