demo agent failing if started after geoclue service
If started before the service, the demo agent doesn't do his job. This is a problem because under systemd, geoclue is started on demand while the agent is started when the user logs in (at least in the current packaging of geoclue-2-demo in debian sid).
Steps to reproduce (with the geoclue systemd service stopped so we can test it):
- Failure:
/usr/lib/geoclue-2.0/demos/agent &
/usr/lib/geoclue-2.0/geoclue -t 0 &
/usr/lib/geoclue-2.0/demos/where-am-i
gives Failed to connect to GeoClue2 service: GDBus.Error:org.freedesktop/DBus.Error.AccessDenied: 'geoclue-where-am-i' disallowed, no agent for UID 1000
- Success:
/usr/lib/geoclue-2.0/geoclue -t 0 &
/usr/lib/geoclue-2.0/demos/agent &
/usr/lib/geoclue-2.0/demos/where-am-i
gives Client object: /org/freedesktop/GeoClue2/Client/
...