Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

device-generic-goldfish: Commit

device/generic/goldfish


Commit MetaInfo

Revisioncf08e5e8a3a8b67480a664a4e9967835efe21a4a (tree)
Time2017-02-16 09:31:14
AuthorKevin Chyn <kchyn@goog...>
CommiterKevin Chyn

Log Message

implemented enumerate method in fingerprintservice
fixes bug 35358801
Test: ran enumeration in template with
1) more fingerprints in fingerprintd
2) more fingerprints in framework
3) no fingerprints in fingerprintd, but fingerprints in framework
4) no fingerprints in framework, but fingerprints in fingerprintd

Change-Id: If876ad0867360d1d05d6b12866a529024860d88a

Change Summary

Incremental Difference

--- a/fingerprint/fingerprint.c
+++ b/fingerprint/fingerprint.c
@@ -417,13 +417,21 @@ static int fingerprint_enumerate(struct fingerprint_device *device) {
417417 fingerprint_msg_t message = {0, {0}};
418418 message.type = FINGERPRINT_TEMPLATE_ENUMERATING;
419419 message.data.enumerated.finger.gid = qdev->group_id;
420- for (int i = 0; i < MAX_NUM_FINGERS; i++) {
421- if (qdev->listener.secureid[i] != 0 ||
422- qdev->listener.fingerid[i] != 0) {
423- template_count--;
424- message.data.enumerated.remaining_templates = template_count;
425- message.data.enumerated.finger.fid = qdev->listener.fingerid[i];
426- qdev->device.notify(&message);
420+
421+ if(template_count == 0) {
422+ message.data.enumerated.remaining_templates = 0;
423+ message.data.enumerated.finger.fid = 0;
424+ qdev->device.notify(&message);
425+ }
426+ else {
427+ for (int i = 0; i < MAX_NUM_FINGERS; i++) {
428+ if (qdev->listener.secureid[i] != 0 ||
429+ qdev->listener.fingerid[i] != 0) {
430+ template_count--;
431+ message.data.enumerated.remaining_templates = template_count;
432+ message.data.enumerated.finger.fid = qdev->listener.fingerid[i];
433+ qdev->device.notify(&message);
434+ }
427435 }
428436 }
429437
Show on old repository browser