From 824cdc9177a5ba7a813265a493c6f024543edd58 Mon Sep 17 00:00:00 2001 From: Razze Date: Sat, 30 Jan 2021 20:10:03 +0100 Subject: [PATCH] fingerprint: Use makeProxyWrapper for fprintManager The reason this wasn't using the Gio.DBus.makeProxyWrapper() convenience API is that it passes custom flags to the proxy, and that wasn't supported by the wrapper at the time. As this is now possible, this commit migrates us to the new API. Part-of: --- .../net.reactivated.Fprint.Manager.xml | 18 ++++++++++ .../gnome-shell-dbus-interfaces.gresource.xml | 1 + js/gdm/fingerprint.js | 33 ------------------- js/gdm/util.js | 12 +++++-- js/js-resources.gresource.xml | 1 - 5 files changed, 29 insertions(+), 36 deletions(-) create mode 100644 data/dbus-interfaces/net.reactivated.Fprint.Manager.xml delete mode 100644 js/gdm/fingerprint.js diff --git a/data/dbus-interfaces/net.reactivated.Fprint.Manager.xml b/data/dbus-interfaces/net.reactivated.Fprint.Manager.xml new file mode 100644 index 000000000..21e03f2c0 --- /dev/null +++ b/data/dbus-interfaces/net.reactivated.Fprint.Manager.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/data/gnome-shell-dbus-interfaces.gresource.xml b/data/gnome-shell-dbus-interfaces.gresource.xml index e74070039..c705a2284 100644 --- a/data/gnome-shell-dbus-interfaces.gresource.xml +++ b/data/gnome-shell-dbus-interfaces.gresource.xml @@ -2,6 +2,7 @@ net.hadess.SensorProxy.xml + net.reactivated.Fprint.Manager.xml org.freedesktop.Application.xml org.freedesktop.bolt1.Device.xml org.freedesktop.bolt1.Manager.xml diff --git a/js/gdm/fingerprint.js b/js/gdm/fingerprint.js deleted file mode 100644 index e23a77beb..000000000 --- a/js/gdm/fingerprint.js +++ /dev/null @@ -1,33 +0,0 @@ -// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- -/* exported FprintManager */ - -const Gio = imports.gi.Gio; - -const FprintManagerIface = ` - - - - - - -`; - -const FprintManagerInfo = Gio.DBusInterfaceInfo.new_for_xml(FprintManagerIface); - -function FprintManager() { - var self = new Gio.DBusProxy({ g_connection: Gio.DBus.system, - g_interface_name: FprintManagerInfo.name, - g_interface_info: FprintManagerInfo, - g_name: 'net.reactivated.Fprint', - g_object_path: '/net/reactivated/Fprint/Manager', - g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES }); - - try { - self.init(null); - } catch (e) { - log(`Failed to connect to Fprint service: ${e.message}`); - return null; - } - - return self; -} diff --git a/js/gdm/util.js b/js/gdm/util.js index af1357466..bcf8a514c 100644 --- a/js/gdm/util.js +++ b/js/gdm/util.js @@ -6,13 +6,16 @@ const { Clutter, Gdm, Gio, GLib } = imports.gi; const Signals = imports.signals; const Batch = imports.gdm.batch; -const Fprint = imports.gdm.fingerprint; const OVirt = imports.gdm.oVirt; const Vmware = imports.gdm.vmware; const Main = imports.ui.main; +const { loadInterfaceXML } = imports.misc.fileUtils; const Params = imports.misc.params; const SmartcardManager = imports.misc.smartcardManager; +const FprintManagerIface = loadInterfaceXML('net.reactivated.Fprint.Manager'); +const FprintManagerProxy = Gio.DBusProxy.makeProxyWrapper(FprintManagerIface); + Gio._promisify(Gdm.Client.prototype, 'open_reauthentication_channel', 'open_reauthentication_channel_finish'); Gio._promisify(Gdm.Client.prototype, @@ -138,7 +141,12 @@ var ShellUserVerifier = class { this._updateDefaultService.bind(this)); this._updateDefaultService(); - this._fprintManager = Fprint.FprintManager(); + this._fprintManager = new FprintManagerProxy(Gio.DBus.system, + 'net.reactivated.Fprint', + '/net/reactivated/Fprint/Manager', + null, + null, + Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES); this._smartcardManager = SmartcardManager.getSmartcardManager(); // We check for smartcards right away, since an inserted smartcard diff --git a/js/js-resources.gresource.xml b/js/js-resources.gresource.xml index 30582aad0..45b5de436 100644 --- a/js/js-resources.gresource.xml +++ b/js/js-resources.gresource.xml @@ -3,7 +3,6 @@ gdm/authPrompt.js gdm/batch.js - gdm/fingerprint.js gdm/loginDialog.js gdm/oVirt.js gdm/credentialManager.js