Skip to content
Open
11 changes: 11 additions & 0 deletions profile/10-qemu-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<profile version="0.1">
<device>
<match key="bios_vendor" contains_ncase="qemu">
<option key="key_control" type="bool">false</option>
<option key="master_key" type="bool">false</option>
<option key="force_sync" type="bool">false</option>
</match>
</device>
</profile>
68 changes: 34 additions & 34 deletions src/urf-arbitrator.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,50 +563,50 @@ urf_arbitrator_startup (UrfArbitrator *arbitrator,
if (fd < 0) {
if (errno == EACCES)
g_warning ("Could not open RFKILL control device, please verify your installation");
return FALSE;
}
} else {
/* Disable rfkill input */
ioctl(fd, RFKILL_IOCTL_NOINPUT);

/* Set initial flight mode state from persistence */
if (priv->persist)
urf_arbitrator_set_flight_mode (arbitrator,
urf_config_get_persist_state (config, RFKILL_TYPE_ALL));
priv->fd = fd;

/* Disable rfkill input */
ioctl(fd, RFKILL_IOCTL_NOINPUT);
while (1) {
ssize_t len;

priv->fd = fd;
len = read(fd, &event, sizeof(event));
if (len < 0) {
if (errno == EAGAIN)
break;
g_debug ("Reading of RFKILL events failed");
break;
}

while (1) {
ssize_t len;
if (len != RFKILL_EVENT_SIZE_V1) {
g_warning("Wrong size of RFKILL event\n");
continue;
}

len = read(fd, &event, sizeof(event));
if (len < 0) {
if (errno == EAGAIN)
break;
g_debug ("Reading of RFKILL events failed");
break;
}
if (event.op != RFKILL_OP_ADD)
continue;
if (event.type >= NUM_RFKILL_TYPES)
continue;

if (len != RFKILL_EVENT_SIZE_V1) {
g_warning("Wrong size of RFKILL event\n");
continue;
add_killswitch (arbitrator, event.idx, event.type, event.soft, event.hard);
}

if (event.op != RFKILL_OP_ADD)
continue;
if (event.type >= NUM_RFKILL_TYPES)
continue;

add_killswitch (arbitrator, event.idx, event.type, event.soft, event.hard);
/* Setup monitoring */
priv->channel = g_io_channel_unix_new (priv->fd);
g_io_channel_set_encoding (priv->channel, NULL, NULL);
priv->watch_id = g_io_add_watch (priv->channel,
G_IO_IN | G_IO_HUP | G_IO_ERR,
(GIOFunc) event_cb,
arbitrator);
}

/* Setup monitoring */
priv->channel = g_io_channel_unix_new (priv->fd);
g_io_channel_set_encoding (priv->channel, NULL, NULL);
priv->watch_id = g_io_add_watch (priv->channel,
G_IO_IN | G_IO_HUP | G_IO_ERR,
(GIOFunc) event_cb,
arbitrator);
/* Set initial flight mode state from persistence */
if (priv->persist)
urf_arbitrator_set_flight_mode (arbitrator,
urf_config_get_persist_state (config, RFKILL_TYPE_ALL));


if (priv->persist) {
/* Set all the devices that had saved state to what was saved */
Expand Down
5 changes: 5 additions & 0 deletions src/urf-device-ofono.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ get_properties_cb (GObject *source_object,

g_variant_iter_init (&iter, properties);
while (g_variant_iter_next (&iter, "{sv}", &key, &variant)) {
if (g_strcmp0 ("Powered", key) == 0 &&
g_variant_get_boolean (variant) == TRUE) {
set_soft (URF_DEVICE (modem), priv->soft);
}

g_hash_table_insert (priv->properties, g_strdup (key),
g_variant_ref (variant));
g_variant_unref (variant);
Expand Down