Commit da8b1277 authored by Laurent Bigonville's avatar Laurent Bigonville
Browse files

d/p: Remove the remaining differences between system app and flatpak ones

This fix an issue when geoclue is D-Bus activated by a client and also
make sure that a running client is disconnected when the user disables
the location services (set the accuracy to 0)

Gbp-Dch: Full
parent 430df506
From: Laurent Bigonville <bigon@bigon.be>
Date: Fri, 25 Dec 2020 13:55:44 +0100
Subject: Revert "Fixed hang on startup when client app is a system app: avoid
wasting 20s waiting on agent."
Now that we are requesting the allowed accuracy from the agent again for
the system apps, we need to be sure the agent is started and connected
before denying the request.
This reverts commit 57efed15b09c5c78891f6fa1bfe5a7aee64a8fb8.
Fixes: #139
---
src/gclue-service-manager.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/gclue-service-manager.c b/src/gclue-service-manager.c
index 849debd..020c2af 100644
--- a/src/gclue-service-manager.c
+++ b/src/gclue-service-manager.c
@@ -271,7 +271,6 @@ on_client_info_new_ready (GObject *source_object,
GError *error = NULL;
guint32 user_id;
gint64 now;
- gboolean system_app;
info = gclue_client_info_new_finish (res, &error);
if (info == NULL) {
@@ -291,10 +290,7 @@ on_client_info_new_ready (GObject *source_object,
agent_proxy = g_hash_table_lookup (priv->agents,
GINT_TO_POINTER (user_id));
now = g_get_monotonic_time ();
-
- system_app = (gclue_client_info_get_xdg_id (info) == NULL);
if (agent_proxy == NULL &&
- !system_app &&
now < (priv->init_time + AGENT_WAIT_TIMEOUT_USEC)) {
/* Its possible that geoclue was just launched on GetClient
* call, in which case agents need some time to register
From: Laurent Bigonville <bigon@bigon.be>
Date: Fri, 25 Dec 2020 14:13:05 +0100
Subject: service: Stop the client for system applications when accuracy is
set to 0
Now that the accuracy set by the agent is used again for system
applications, we should again stop the client when the accuracy is set
to 0
---
src/gclue-service-client.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/gclue-service-client.c b/src/gclue-service-client.c
index 62ea932..3e68f55 100644
--- a/src/gclue-service-client.c
+++ b/src/gclue-service-client.c
@@ -330,7 +330,6 @@ on_agent_props_changed (GDBusProxy *agent_proxy,
while (g_variant_iter_loop (iter, "{&sv}", &key, &value)) {
GClueAccuracyLevel max_accuracy;
const char *id;
- gboolean system_app;
if (strcmp (key, "MaxAccuracyLevel") != 0)
continue;
@@ -338,8 +337,6 @@ on_agent_props_changed (GDBusProxy *agent_proxy,
gdbus_client = GCLUE_DBUS_CLIENT (client);
id = gclue_dbus_client_get_desktop_id (gdbus_client);
max_accuracy = g_variant_get_uint32 (value);
- system_app = (gclue_client_info_get_xdg_id
- (client->priv->client_info) == NULL);
/* FIXME: We should be handling all values of max accuracy
* level here, not just 0 and non-0.
*/
@@ -354,8 +351,7 @@ on_agent_props_changed (GDBusProxy *agent_proxy,
start_client (client, accuracy);
g_debug ("Re-started '%s'.", id);
} else if (max_accuracy == 0 &&
- gclue_dbus_client_get_active (gdbus_client) &&
- !system_app) {
+ gclue_dbus_client_get_active (gdbus_client)) {
stop_client (client);
client->priv->agent_stopped = TRUE;
g_debug ("Stopped '%s'.", id);
0002-config-Make-the-Mozilla-API-key-configurable.patch
0003-service-Sync-in_use-property-when-apps-get-connected.patch
0003-Revert-Fixed-hang-on-startup-when-client-app-is-a-sy.patch
0004-service-Stop-the-client-for-system-applications-when.patch
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment