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

Commit caba31c6 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6981746 from ba59ee15 to sc-release

Change-Id: I640bd2ed35052cc1d61c737d959d675532fb69de
parents 0503db8f ba59ee15
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@ package android.hardware.biometrics.face;
@VintfStability
interface ISessionCallback {
  void onStateChanged(in int cookie, in android.hardware.biometrics.face.SessionState state);
  void onChallengeGenerated(in int sensorId, in int userId, in long challenge);
  void onChallengeRevoked(in int sensorId, in int userId, in long challenge);
  void onChallengeGenerated(in long challenge);
  void onChallengeRevoked(in long challenge);
  void onAcquired(in android.hardware.biometrics.face.AcquiredInfo info, in int vendorCode);
  void onError(in android.hardware.biometrics.face.Error error, in int vendorCode);
  void onEnrollmentProgress(in int enrollmentId, int remaining);
+2 −2
Original line number Diff line number Diff line
@@ -31,12 +31,12 @@ interface ISessionCallback {
    /**
     * Notifies the framework when a challenge is successfully generated.
     */
    void onChallengeGenerated(in int sensorId, in int userId, in long challenge);
    void onChallengeGenerated(in long challenge);

    /**
     * Notifies the framework when a challenge has been revoked.
     */
    void onChallengeRevoked(in int sensorId, in int userId, in long challenge);
    void onChallengeRevoked(in long challenge);

    /**
     * This method must only be used to notify the framework during the following states:
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
namespace aidl::android::hardware::biometrics::face {

const int kSensorId = 0;
const common::SensorStrength kSensorStrength = common::SensorStrength::WEAK;
const common::SensorStrength kSensorStrength = common::SensorStrength::STRONG;
const int kMaxEnrollmentsPerUser = 5;
const FaceSensorType kSensorType = FaceSensorType::RGB;
const bool kHalControlsPreview = true;
+41 −3
Original line number Diff line number Diff line
@@ -21,17 +21,35 @@
namespace aidl::android::hardware::biometrics::face {

class CancellationSignal : public common::BnCancellationSignal {
  private:
    std::shared_ptr<ISessionCallback> cb_;
  public:
    ndk::ScopedAStatus cancel() override { return ndk::ScopedAStatus::ok(); }
    explicit CancellationSignal(std::shared_ptr<ISessionCallback> cb) : cb_(std::move(cb)) {}

    ndk::ScopedAStatus cancel() override {
        cb_->onError(Error::CANCELED, 0 /* vendorCode */);
        cb_->onStateChanged(0, SessionState::IDLING);
        return ndk::ScopedAStatus::ok();
    }
};

Session::Session(std::shared_ptr<ISessionCallback> cb) : cb_(std::move(cb)) {}

ndk::ScopedAStatus Session::generateChallenge(int32_t /*cookie*/, int32_t /*timeoutSec*/) {
    if (cb_) {
        cb_->onStateChanged(0, SessionState::GENERATING_CHALLENGE);
        cb_->onChallengeGenerated(0);
        cb_->onStateChanged(0, SessionState::IDLING);
    }
    return ndk::ScopedAStatus::ok();
}

ndk::ScopedAStatus Session::revokeChallenge(int32_t /*cookie*/, int64_t /*challenge*/) {
ndk::ScopedAStatus Session::revokeChallenge(int32_t /*cookie*/, int64_t challenge) {
    if (cb_) {
        cb_->onStateChanged(0, SessionState::REVOKING_CHALLENGE);
        cb_->onChallengeRevoked(challenge);
        cb_->onStateChanged(0, SessionState::IDLING);
    }
    return ndk::ScopedAStatus::ok();
}

@@ -47,7 +65,7 @@ ndk::ScopedAStatus Session::authenticate(int32_t /*cookie*/, int64_t /*keystoreO
    if (cb_) {
        cb_->onStateChanged(0, SessionState::AUTHENTICATING);
    }
    *return_val = SharedRefBase::make<CancellationSignal>();
    *return_val = SharedRefBase::make<CancellationSignal>(cb_);
    return ndk::ScopedAStatus::ok();
}

@@ -57,15 +75,30 @@ ndk::ScopedAStatus Session::detectInteraction(
}

ndk::ScopedAStatus Session::enumerateEnrollments(int32_t /*cookie*/) {
    if (cb_) {
        cb_->onStateChanged(0, SessionState::ENUMERATING_ENROLLMENTS);
        cb_->onEnrollmentsEnumerated(std::vector<int32_t>());
        cb_->onStateChanged(0, SessionState::IDLING);
    }
    return ndk::ScopedAStatus::ok();
}

ndk::ScopedAStatus Session::removeEnrollments(int32_t /*cookie*/,
                                              const std::vector<int32_t>& /*enrollmentIds*/) {
    if (cb_) {
      cb_->onStateChanged(0, SessionState::REMOVING_ENROLLMENTS);
      cb_->onEnrollmentsRemoved(std::vector<int32_t>());
      cb_->onStateChanged(0, SessionState::IDLING);
    }
    return ndk::ScopedAStatus::ok();
}

ndk::ScopedAStatus Session::getAuthenticatorId(int32_t /*cookie*/) {
    if (cb_) {
        cb_->onStateChanged(0, SessionState::GETTING_AUTHENTICATOR_ID);
        cb_->onAuthenticatorIdRetrieved(0 /* authenticatorId */);
        cb_->onStateChanged(0, SessionState::IDLING);
    }
    return ndk::ScopedAStatus::ok();
}

@@ -75,6 +108,11 @@ ndk::ScopedAStatus Session::invalidateAuthenticatorId(int32_t /*cookie*/) {

ndk::ScopedAStatus Session::resetLockout(int32_t /*cookie*/,
                                         const keymaster::HardwareAuthToken& /*hat*/) {
    if (cb_) {
        cb_->onStateChanged(0, SessionState::RESETTING_LOCKOUT);
        cb_->onLockoutCleared();
        cb_->onStateChanged(0, SessionState::IDLING);
    }
    return ndk::ScopedAStatus::ok();
}
}  // namespace aidl::android::hardware::biometrics::face
+2 −4
Original line number Diff line number Diff line
@@ -51,13 +51,11 @@ class SessionCallback : public BnSessionCallback {
        return ndk::ScopedAStatus::ok();
    }

    ndk::ScopedAStatus onChallengeGenerated(int32_t /*sensorId*/, int32_t /*userId*/,
                                            int64_t /*challenge*/) override {
    ndk::ScopedAStatus onChallengeGenerated(int64_t /*challenge*/) override {
        return ndk::ScopedAStatus::ok();
    }

    ndk::ScopedAStatus onChallengeRevoked(int32_t /*sensorId*/, int32_t /*userId*/,
                                          int64_t /*challenge*/) override {
    ndk::ScopedAStatus onChallengeRevoked(int64_t /*challenge*/) override {
        return ndk::ScopedAStatus::ok();
    }