diff --git a/profile/10-qemu-settings.xml b/profile/10-qemu-settings.xml new file mode 100644 index 0000000..3294c0d --- /dev/null +++ b/profile/10-qemu-settings.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/urf-arbitrator.c b/src/urf-arbitrator.c index ac9b958..4d45c89 100644 --- a/src/urf-arbitrator.c +++ b/src/urf-arbitrator.c @@ -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 */ diff --git a/src/urf-device-ofono.c b/src/urf-device-ofono.c index eb67684..c52ac60 100644 --- a/src/urf-device-ofono.c +++ b/src/urf-device-ofono.c @@ -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);