Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bca835e authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Remove GenerateChallengeBlocking from FingerprintManager

Test: Builds
Bug: 162533680
Change-Id: I28c01bf977d32a5decd941c0449081577069d174
parent cd52980d
Loading
Loading
Loading
Loading
+0 −31
Original line number Original line Diff line number Diff line
@@ -580,37 +580,6 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
        }
        }
    }
    }


    /**
     * Same as {@link #generateChallenge(GenerateChallengeCallback)}, except blocks until the
     * TEE/hardware operation is complete.
     * @return challenge generated in the TEE/hardware
     * @hide
     */
    @RequiresPermission(MANAGE_FINGERPRINT)
    public long generateChallengeBlocking() {
        final AtomicReference<Long> result = new AtomicReference<>();
        final CountDownLatch latch = new CountDownLatch(1);
        final GenerateChallengeCallback callback = new InternalGenerateChallengeCallback() {
            @Override
            public void onChallengeGenerated(long challenge) {
                result.set(challenge);
                latch.countDown();
            }
        };

        generateChallenge(callback);

        try {
            latch.await(1, TimeUnit.SECONDS);
        } catch (InterruptedException e) {
            Slog.e(TAG, "Interrupted while generatingChallenge", e);
            e.printStackTrace();
        }

        return result.get();
    }


    /**
    /**
     * Generates a unique random challenge in the TEE. A typical use case is to have it wrapped in a
     * Generates a unique random challenge in the TEE. A typical use case is to have it wrapped in a
     * HardwareAuthenticationToken, minted by Gatekeeper upon PIN/Pattern/Password verification.
     * HardwareAuthenticationToken, minted by Gatekeeper upon PIN/Pattern/Password verification.