on xenial help sign in
Make id work, maybe?
d0e5e7aMichael Terry
qml/Greeter/Greeter.qml+19−11
@@ -16,7 +16,7 @@
16
16
17import QtQuick 2.4
17import QtQuick 2.4
18import AccountsService 0.1
18import AccountsService 0.1
19−import Biometryd 0.0 as Biometryd
19+import Biometryd 0.0
20import GSettings 1.0
20import GSettings 1.0
21import Ubuntu.Components 1.3
21import Ubuntu.Components 1.3
22import Ubuntu.SystemImage 0.1
22import Ubuntu.SystemImage 0.1
@@ -482,35 +482,43 @@ Showable {
482 onLanguageChanged: lightDM.infographic.readyForDataChange()
482 onLanguageChanged: lightDM.infographic.readyForDataChange()
483 }
483 }
484
484
485− Biometryd.Observer {
485+ Observer {
486 id: biometryd
486 id: biometryd
487 objectName: "biometryd"
487 objectName: "biometryd"
488
488
489− property var operation
489+ property var operation: null
490
490
491− Component.onCompleted: {
491+ function cancelOperation() {
492+ if (operation) {
493+ operation.cancel();
494+ operation = null;
495+ }
496+ }
497+
498+ function restartOperation() {
499+ cancelOperation();
500+
492− if (Biometryd.defaultDevice) {
501+ if (Biometryd.defaultDevice && true /* FIXME check AS */) {
493 var identifier = Biometryd.defaultDevice.identifier;
502 var identifier = Biometryd.defaultDevice.identifier;
494 operation = identifier.identifyUser();
503 operation = identifier.identifyUser();
495 operation.start(biometryd);
504 operation.start(biometryd);
496 }
505 }
497 }
506 }
498
507
508+ Component.onCompleted: restartOperation()
499− Component.onDestruction: {
509+ Component.onDestruction: cancelOperation()
500− if (operation)
501− operation.cancel();
502− }
503
510
504 onSucceeded: {
511 onSucceeded: {
505 // FIXME validate result.uid
512 // FIXME validate result.uid
506 d.fingerprintFailureCount = 0;
513 d.fingerprintFailureCount = 0;
507− operation.start(biometryd);
514+ restartOperation();
508 if (root.active)
515 if (root.active)
509 root.forcedUnlock = true;
516 root.forcedUnlock = true;
510 }
517 }
511 onFailed: {
518 onFailed: {
519+ console.log("Failed to identify user:", reason);
512 d.fingerprintFailureCount++;
520 d.fingerprintFailureCount++;
513− operation.start(biometryd);
521+ restartOperation();
514 if (loader.item)
522 if (loader.item)
515 loader.item.showErrorMessage(i18n.tr("Try again"));
523 loader.item.showErrorMessage(i18n.tr("Try again"));
516 }
524 }
tests/mocks/Biometryd/Biometryd.qmltypesdeleted−30
@@ -1,30 +0,0 @@
1−import QtQuick.tooling 1.2
2−
3−// This file describes the plugin-supplied types contained in the library.
4−// It is used for QML tooling purposes only.
5−//
6−// This file was auto-generated by:
7−// 'qmlplugindump -notrelocatable Biometryd 0.0 tests/mocks'
8−
9−Module {
10− dependencies: []
11− Component {
12− name: "MockObserver"
13− prototype: "QObject"
14− exports: ["Biometryd/Observer 0.0"]
15− exportMetaObjectRevisions: [0]
16− Signal {
17− name: "succeeded"
18− Parameter { name: "result"; type: "QVariant" }
19− }
20− Signal {
21− name: "failed"
22− Parameter { name: "reason"; type: "string" }
23− }
24− Method {
25− name: "mockIdentification"
26− Parameter { name: "uid"; type: "int" }
27− Parameter { name: "error"; type: "string" }
28− }
29− }
30−}