Commit d72c59ae authored by spiiroin's avatar spiiroin

[devicelock] Make devicelock state tracking asynchronous. MER#1694

Usb-moded is making repeated blocking devicelock state queries even when
the component providing the service is not running.

Use cached devicelock state and keep it up to date fully asynchronously
by tracking devicelock service availability and state changes it signals.
Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
parent cb8fd5a9
This diff is collapsed.
/*
Copyright (C) 2010 Nokia Corporation. All rights reserved.
Copyright (C) 2013-2016 Jolla Ltd.
Author: Philippe De Swert <philippe.de-swert@nokia.com>
Author: Vesa Halttunen <vesa.halttunen@jollamobile.com>
Author: Simo Piiroinen <simo.piiroinen@jollamobile.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the Lesser GNU General Public License
......@@ -23,15 +26,20 @@
/*============================================================================= */
#define DEVICELOCK_SERVICE "org.nemomobile.lipstick"
#define DEVICELOCK_REQUEST_PATH "/devicelock"
#define DEVICELOCK_REQUEST_IF "org.nemomobile.lipstick.devicelock"
#define DEVICELOCK_STATE_REQ "state"
#define DEVICELOCK_LOCKED "Locked"
#define MATCH_DEVICELOCK_SIGNALS\
"type='signal'"\
",interface='"DEVICELOCK_REQUEST_IF"'"\
",path='"DEVICELOCK_REQUEST_PATH"'"
#define DEVICELOCK_SERVICE "org.nemomobile.lipstick"
#define DEVICELOCK_OBJECT "/devicelock"
#define DEVICELOCK_INTERFACE "org.nemomobile.lipstick.devicelock"
#define DEVICELOCK_GET_STATE_REQ "state"
#define DEVICELOCK_STATE_CHANGED_SIG "stateChanged"
#define DEVICELOCK_STATE_CHANGED_MATCH\
"type='signal'"\
",interface='"DEVICELOCK_INTERFACE"'"\
",path='"DEVICELOCK_OBJECT"'"\
",member='"DEVICELOCK_STATE_CHANGED_SIG"'"
#define DEVICELOCK_NAME_OWNER_CHANGED_MATCH\
"type='signal'"\
",interface='"DBUS_INTERFACE_DBUS"'"\
",member='"DBUS_NAME_OWNER_CHANGED_SIG"'"\
",arg0='"DEVICELOCK_SERVICE"'"
/*
Copyright (C) 2012 Nokia Corporation. All rights reserved.
Copyright (C) 2013-2016 Jolla Ltd.
Author: Philippe De Swert <philippe.de-swert@nokia.com>
Author: Philippe De Swert <philippe.deswert@jollamobile.com>
Author: Simo Piiroinen <simo.piiroinen@jollamobile.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the Lesser GNU General Public License
......@@ -23,6 +26,6 @@
*/
/*============================================================================= */
int usb_moded_get_export_permission(void);
int start_devicelock_listener(void);
int stop_devicelock_listener(void);
int usb_moded_get_export_permission(void);
gboolean start_devicelock_listener(void);
void stop_devicelock_listener(void);
Markdown is supported
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