WIP: fix vintf, aidl
diff --git a/adapter/Android.bp b/adapter/Android.bp
index e359de2..ecfd6aa 100644
--- a/adapter/Android.bp
+++ b/adapter/Android.bp
@@ -18,24 +18,20 @@
name: "android.hardware.biometrics.face@1.0-service.lmodroid",
defaults: ["hidl_defaults"],
init_rc: ["android.hardware.biometrics.face@1.0-service.lmodroid.rc"],
- vintf_fragments: ["manifest_face_lmodroid.xml"],
relative_install_path: "hw",
srcs: [
"BiometricsFace.cpp",
"FaceHalServiceCallback.cpp",
"service.cpp",
- "binder-interfaces/IFaceHalService.cpp",
- "binder-interfaces/IFaceHalServiceCallback.cpp"
- ],
- local_include_dirs: [
- "binder-interfaces/include"
],
vendor: true,
shared_libs: [
"libbinder",
+ "libbinder_ndk",
"libhidlbase",
"libutils",
"liblog",
"android.hardware.biometrics.face@1.0",
+ "LMOFaceClient_aidl-V1-ndk",
],
}
diff --git a/adapter/BiometricsFace.cpp b/adapter/BiometricsFace.cpp
index 0f97eb6..92d279f 100644
--- a/adapter/BiometricsFace.cpp
+++ b/adapter/BiometricsFace.cpp
@@ -19,7 +19,7 @@
namespace android::hardware::biometrics::face::implementation {
-BiometricsFace::BiometricsFace(sp<IFaceHalService> faceHalService) : mFaceHalService(faceHalService) {}
+BiometricsFace::BiometricsFace(IFaceHalService faceHalService) : mFaceHalService(faceHalService) {}
Return<Status> intToStatus(int32_t error) {
switch (error) {
@@ -50,7 +50,7 @@
Return<Status> BiometricsFace::setActiveUser(int32_t userId, const hidl_string& storePath) {
int32_t ret = 0;
- mFaceHalService->setActiveUser(userId, android::String16(storePath.c_str()), &ret);
+ mFaceHalService->setActiveUser(userId, storePath.c_str(), &ret);
return intToStatus(ret);
}
diff --git a/adapter/BiometricsFace.h b/adapter/BiometricsFace.h
index 4fc6ffc..7e415a7 100644
--- a/adapter/BiometricsFace.h
+++ b/adapter/BiometricsFace.h
@@ -21,9 +21,9 @@
#include <hidl/Status.h>
#include <random>
-#include <com/libremobileos/faceunlock/client/IFaceHalService.h>
-#include <com/libremobileos/faceunlock/client/IFaceHalServiceCallback.h>
-#include <com/libremobileos/faceunlock/client/BnFaceHalServiceCallback.h>
+#include <aidl/com/libremobileos/faceunlock/client/IFaceHalService.h>
+#include <aidl/com/libremobileos/faceunlock/client/IFaceHalServiceCallback.h>
+#include <aidl/com/libremobileos/faceunlock/client/BnFaceHalServiceCallback.h>
namespace android::hardware::biometrics::face::implementation {
@@ -38,13 +38,13 @@
using ::android::hardware::biometrics::face::V1_0::IBiometricsFaceClientCallback;
using ::android::hardware::biometrics::face::V1_0::Status;
-using ::com::libremobileos::faceunlock::client::BnFaceHalServiceCallback;
-using ::com::libremobileos::faceunlock::client::IFaceHalService;
-using ::com::libremobileos::faceunlock::client::IFaceHalServiceCallback;
+using ::aidl::com::libremobileos::faceunlock::client::BnFaceHalServiceCallback;
+using ::aidl::com::libremobileos::faceunlock::client::IFaceHalService;
+using ::aidl::com::libremobileos::faceunlock::client::IFaceHalServiceCallback;
class BiometricsFace : public V1_0::IBiometricsFace {
public:
- BiometricsFace(sp<IFaceHalService>);
+ BiometricsFace(IFaceHalService);
// Methods from ::android::hardware::biometrics::face::V1_0::IBiometricsFace follow.
Return<void> setCallback(const sp<IBiometricsFaceClientCallback>& clientCallback,
diff --git a/adapter/FaceHalServiceCallback.cpp b/adapter/FaceHalServiceCallback.cpp
index d1d6142..3415e8e 100644
--- a/adapter/FaceHalServiceCallback.cpp
+++ b/adapter/FaceHalServiceCallback.cpp
@@ -24,41 +24,41 @@
FaceHalServiceCallback::FaceHalServiceCallback(sp<IBiometricsFaceClientCallback> biometricsFaceClientCallback) : mBiometricsFaceClientCallback(biometricsFaceClientCallback) {}
// Methods from ::com::libremobileos::faceunlock::client::IFaceHalServiceCallback follow.
-::android::binder::Status FaceHalServiceCallback::onEnrollResult(int64_t deviceId, int32_t faceId, int32_t userId, int32_t remaining) {
+::ndk::ScopedAStatus FaceHalServiceCallback::onEnrollResult(int64_t deviceId, int32_t faceId, int32_t userId, int32_t remaining) {
mBiometricsFaceClientCallback->onEnrollResult(deviceId, faceId, userId, remaining);
- return ::android::binder::Status::ok();
+ return ::ndk::ScopedAStatus::ok();
}
-::android::binder::Status FaceHalServiceCallback::onAuthenticated(int64_t deviceId, int32_t faceId, int32_t userId, const ::std::vector<uint8_t> &token) {
+::ndk::ScopedAStatus FaceHalServiceCallback::onAuthenticated(int64_t deviceId, int32_t faceId, int32_t userId, const ::std::vector<uint8_t> &token) {
mBiometricsFaceClientCallback->onAuthenticated(deviceId, faceId, userId, token);
- return ::android::binder::Status::ok();
+ return ::ndk::ScopedAStatus::ok();
}
-::android::binder::Status FaceHalServiceCallback::onAcquired(int64_t deviceId, int32_t userId, int32_t acquiredInfo, int32_t vendorCode) {
+::ndk::ScopedAStatus FaceHalServiceCallback::onAcquired(int64_t deviceId, int32_t userId, int32_t acquiredInfo, int32_t vendorCode) {
mBiometricsFaceClientCallback->onAcquired(deviceId, userId, static_cast<FaceAcquiredInfo>(acquiredInfo), vendorCode);
- return ::android::binder::Status::ok();
+ return ::ndk::ScopedAStatus::ok();
}
-::android::binder::Status FaceHalServiceCallback::onError(int64_t deviceId, int32_t userId, int32_t error, int32_t vendorCode) {
+::ndk::ScopedAStatus FaceHalServiceCallback::onError(int64_t deviceId, int32_t userId, int32_t error, int32_t vendorCode) {
mBiometricsFaceClientCallback->onError(deviceId, userId, static_cast<FaceError>(error), vendorCode);
- return ::android::binder::Status::ok();
+ return ::ndk::ScopedAStatus::ok();
}
-::android::binder::Status FaceHalServiceCallback::onRemoved(int64_t deviceId, const ::std::vector<int32_t> &faceIds, int32_t userId) {
+::ndk::ScopedAStatus FaceHalServiceCallback::onRemoved(int64_t deviceId, const ::std::vector<int32_t> &faceIds, int32_t userId) {
std::vector<uint32_t> ufaceIds(begin(faceIds), end(faceIds));
mBiometricsFaceClientCallback->onRemoved(deviceId, ufaceIds, userId);
- return ::android::binder::Status::ok();
+ return ::ndk::ScopedAStatus::ok();
}
-::android::binder::Status FaceHalServiceCallback::onEnumerate(int64_t deviceId, const ::std::vector<int32_t> &faceIds, int32_t userId) {
+::ndk::ScopedAStatus FaceHalServiceCallback::onEnumerate(int64_t deviceId, const ::std::vector<int32_t> &faceIds, int32_t userId) {
std::vector<uint32_t> ufaceIds(begin(faceIds), end(faceIds));
mBiometricsFaceClientCallback->onEnumerate(deviceId, ufaceIds, userId);
- return ::android::binder::Status::ok();
+ return ::ndk::ScopedAStatus::ok();
}
-::android::binder::Status FaceHalServiceCallback::onLockoutChanged(int64_t duration) {
+::ndk::ScopedAStatus FaceHalServiceCallback::onLockoutChanged(int64_t duration) {
mBiometricsFaceClientCallback->onLockoutChanged(duration);
- return ::android::binder::Status::ok();
+ return ::ndk::ScopedAStatus::ok();
}
} // namespace android::hardware::biometrics::face::implementation
diff --git a/adapter/FaceHalServiceCallback.h b/adapter/FaceHalServiceCallback.h
index 8db0200..abf44df 100644
--- a/adapter/FaceHalServiceCallback.h
+++ b/adapter/FaceHalServiceCallback.h
@@ -24,20 +24,20 @@
public:
FaceHalServiceCallback(sp<IBiometricsFaceClientCallback>);
- // Methods from ::com::libremobileos::faceunlock::client::IFaceHalServiceCallback follow.
- ::android::binder::Status onEnrollResult(int64_t deviceId, int32_t faceId, int32_t userId, int32_t remaining) override;
+ // Methods from ::aidl::com::libremobileos::faceunlock::client::IFaceHalServiceCallback follow.
+ ::ndk::ScopedAStatus onEnrollResult(int64_t deviceId, int32_t faceId, int32_t userId, int32_t remaining) override;
- ::android::binder::Status onAuthenticated(int64_t deviceId, int32_t faceId, int32_t userId, const ::std::vector<uint8_t> &token) override;
+ ::ndk::ScopedAStatus onAuthenticated(int64_t deviceId, int32_t faceId, int32_t userId, const ::std::vector<uint8_t> &token) override;
- ::android::binder::Status onAcquired(int64_t deviceId, int32_t userId, int32_t acquiredInfo, int32_t vendorCode) override;
+ ::ndk::ScopedAStatus onAcquired(int64_t deviceId, int32_t userId, int32_t acquiredInfo, int32_t vendorCode) override;
- ::android::binder::Status onError(int64_t deviceId, int32_t userId, int32_t error, int32_t vendorCode) override;
+ ::ndk::ScopedAStatus onError(int64_t deviceId, int32_t userId, int32_t error, int32_t vendorCode) override;
- ::android::binder::Status onRemoved(int64_t deviceId, const ::std::vector<int32_t> &faceIds, int32_t userId) override;
+ ::ndk::ScopedAStatus onRemoved(int64_t deviceId, const ::std::vector<int32_t> &faceIds, int32_t userId) override;
- ::android::binder::Status onEnumerate(int64_t deviceId, const ::std::vector<int32_t> &faceIds, int32_t userId) override;
+ ::ndk::ScopedAStatus onEnumerate(int64_t deviceId, const ::std::vector<int32_t> &faceIds, int32_t userId) override;
- ::android::binder::Status onLockoutChanged(int64_t duration) override;
+ ::ndk::ScopedAStatus onLockoutChanged(int64_t duration) override;
private:
sp<IBiometricsFaceClientCallback> mBiometricsFaceClientCallback;
diff --git a/adapter/binder-interfaces/IFaceHalService.cpp b/adapter/binder-interfaces/IFaceHalService.cpp
deleted file mode 100644
index e672760..0000000
--- a/adapter/binder-interfaces/IFaceHalService.cpp
+++ /dev/null
@@ -1,1014 +0,0 @@
-#include <com/libremobileos/faceunlock/client/IFaceHalService.h>
-#include <com/libremobileos/faceunlock/client/BpFaceHalService.h>
-
-namespace com {
-
-namespace libremobileos {
-
-namespace faceunlock {
-
-namespace client {
-
-DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(FaceHalService, "com.libremobileos.faceunlock.client.IFaceHalService")
-
-} // namespace client
-
-} // namespace faceunlock
-
-} // namespace libremobileos
-
-} // namespace com
-#include <com/libremobileos/faceunlock/client/BpFaceHalService.h>
-#include <com/libremobileos/faceunlock/client/BnFaceHalService.h>
-#include <binder/Parcel.h>
-#include <android-base/macros.h>
-
-namespace com {
-
-namespace libremobileos {
-
-namespace faceunlock {
-
-namespace client {
-
-BpFaceHalService::BpFaceHalService(const ::android::sp<::android::IBinder>& _aidl_impl)
- : BpInterface<IFaceHalService>(_aidl_impl){
-}
-
-::android::binder::Status BpFaceHalService::getDeviceId(int64_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_getDeviceId, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->getDeviceId(_aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt64(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::setCallback(const ::android::sp<::com::libremobileos::faceunlock::client::IFaceHalServiceCallback>& callback) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeStrongBinder(::com::libremobileos::faceunlock::client::IFaceHalServiceCallback::asBinder(callback));
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_setCallback, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_ONEWAY);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->setCallback(callback);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::setActiveUser(int32_t userId, const ::android::String16& storePath, int32_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeString16(storePath);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_setActiveUser, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->setActiveUser(userId, storePath, _aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::generateChallenge(int32_t timeout, int64_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(timeout);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_generateChallenge, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->generateChallenge(timeout, _aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt64(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::enroll(const ::std::vector<uint8_t>& token, int32_t timeout, const ::std::vector<int32_t>& disabledFeatures, int32_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeByteVector(token);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(timeout);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32Vector(disabledFeatures);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_enroll, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->enroll(token, timeout, disabledFeatures, _aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::revokeChallenge(int32_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_revokeChallenge, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->revokeChallenge(_aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::setFeature(int32_t feature, bool enable, const ::std::vector<uint8_t>& token, int32_t faceId, int32_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(feature);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeBool(enable);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeByteVector(token);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(faceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_setFeature, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->setFeature(feature, enable, token, faceId, _aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::getFeature(int32_t feature, int32_t faceId, bool* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(feature);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(faceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_getFeature, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->getFeature(feature, faceId, _aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::getAuthenticatorId(int64_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_getAuthenticatorId, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->getAuthenticatorId(_aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt64(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::cancel(int32_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_cancel, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->cancel(_aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::enumerate(int32_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_enumerate, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->enumerate(_aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::remove(int32_t faceId, int32_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(faceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_remove, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->remove(faceId, _aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::authenticate(int64_t operationId, int32_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt64(operationId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_authenticate, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->authenticate(operationId, _aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::userActivity(int32_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_userActivity, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->userActivity(_aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalService::resetLockout(const ::std::vector<uint8_t>& token, int32_t* _aidl_return) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeByteVector(token);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalService::TRANSACTION_resetLockout, _aidl_data, &_aidl_reply, 0);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalService::getDefaultImpl())) {
- return IFaceHalService::getDefaultImpl()->resetLockout(token, _aidl_return);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- if (!_aidl_status.isOk()) {
- return _aidl_status;
- }
- _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-} // namespace client
-
-} // namespace faceunlock
-
-} // namespace libremobileos
-
-} // namespace com
-#include <com/libremobileos/faceunlock/client/BnFaceHalService.h>
-#include <binder/Parcel.h>
-#include <binder/Stability.h>
-
-namespace com {
-
-namespace libremobileos {
-
-namespace faceunlock {
-
-namespace client {
-
-BnFaceHalService::BnFaceHalService()
-{
- ::android::internal::Stability::markCompilationUnit(this);
-}
-
-::android::status_t BnFaceHalService::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
- ::android::status_t _aidl_ret_status = ::android::OK;
- switch (_aidl_code) {
- case BnFaceHalService::TRANSACTION_getDeviceId:
- {
- int64_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- ::android::binder::Status _aidl_status(getDeviceId(&_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt64(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_setCallback:
- {
- ::android::sp<::com::libremobileos::faceunlock::client::IFaceHalServiceCallback> in_callback;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readStrongBinder(&in_callback);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(setCallback(in_callback));
- }
- break;
- case BnFaceHalService::TRANSACTION_setActiveUser:
- {
- int32_t in_userId;
- ::android::String16 in_storePath;
- int32_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readString16(&in_storePath);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(setActiveUser(in_userId, in_storePath, &_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_generateChallenge:
- {
- int32_t in_timeout;
- int64_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_timeout);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(generateChallenge(in_timeout, &_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt64(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_enroll:
- {
- ::std::vector<uint8_t> in_token;
- int32_t in_timeout;
- ::std::vector<int32_t> in_disabledFeatures;
- int32_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readByteVector(&in_token);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_timeout);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32Vector(&in_disabledFeatures);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(enroll(in_token, in_timeout, in_disabledFeatures, &_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_revokeChallenge:
- {
- int32_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- ::android::binder::Status _aidl_status(revokeChallenge(&_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_setFeature:
- {
- int32_t in_feature;
- bool in_enable;
- ::std::vector<uint8_t> in_token;
- int32_t in_faceId;
- int32_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_feature);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readBool(&in_enable);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readByteVector(&in_token);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_faceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(setFeature(in_feature, in_enable, in_token, in_faceId, &_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_getFeature:
- {
- int32_t in_feature;
- int32_t in_faceId;
- bool _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_feature);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_faceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(getFeature(in_feature, in_faceId, &_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_getAuthenticatorId:
- {
- int64_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- ::android::binder::Status _aidl_status(getAuthenticatorId(&_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt64(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_cancel:
- {
- int32_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- ::android::binder::Status _aidl_status(cancel(&_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_enumerate:
- {
- int32_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- ::android::binder::Status _aidl_status(enumerate(&_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_remove:
- {
- int32_t in_faceId;
- int32_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_faceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(remove(in_faceId, &_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_authenticate:
- {
- int64_t in_operationId;
- int32_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt64(&in_operationId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(authenticate(in_operationId, &_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_userActivity:
- {
- int32_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- ::android::binder::Status _aidl_status(userActivity(&_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- case BnFaceHalService::TRANSACTION_resetLockout:
- {
- ::std::vector<uint8_t> in_token;
- int32_t _aidl_return;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readByteVector(&in_token);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(resetLockout(in_token, &_aidl_return));
- _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- if (!_aidl_status.isOk()) {
- break;
- }
- _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- }
- break;
- default:
- {
- _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
- }
- break;
- }
- if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
- _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeToParcel(_aidl_reply);
- }
- return _aidl_ret_status;
-}
-
-} // namespace client
-
-} // namespace faceunlock
-
-} // namespace libremobileos
-
-} // namespace com
diff --git a/adapter/binder-interfaces/IFaceHalServiceCallback.cpp b/adapter/binder-interfaces/IFaceHalServiceCallback.cpp
deleted file mode 100644
index 5de5f1c..0000000
--- a/adapter/binder-interfaces/IFaceHalServiceCallback.cpp
+++ /dev/null
@@ -1,507 +0,0 @@
-#include <com/libremobileos/faceunlock/client/IFaceHalServiceCallback.h>
-#include <com/libremobileos/faceunlock/client/BpFaceHalServiceCallback.h>
-
-namespace com {
-
-namespace libremobileos {
-
-namespace faceunlock {
-
-namespace client {
-
-DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(FaceHalServiceCallback, "com.libremobileos.faceunlock.client.IFaceHalServiceCallback")
-
-} // namespace client
-
-} // namespace faceunlock
-
-} // namespace libremobileos
-
-} // namespace com
-#include <com/libremobileos/faceunlock/client/BpFaceHalServiceCallback.h>
-#include <com/libremobileos/faceunlock/client/BnFaceHalServiceCallback.h>
-#include <binder/Parcel.h>
-#include <android-base/macros.h>
-
-namespace com {
-
-namespace libremobileos {
-
-namespace faceunlock {
-
-namespace client {
-
-BpFaceHalServiceCallback::BpFaceHalServiceCallback(const ::android::sp<::android::IBinder>& _aidl_impl)
- : BpInterface<IFaceHalServiceCallback>(_aidl_impl){
-}
-
-::android::binder::Status BpFaceHalServiceCallback::onEnrollResult(int64_t deviceId, int32_t faceId, int32_t userId, int32_t remaining) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt64(deviceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(faceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(remaining);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalServiceCallback::TRANSACTION_onEnrollResult, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_ONEWAY);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalServiceCallback::getDefaultImpl())) {
- return IFaceHalServiceCallback::getDefaultImpl()->onEnrollResult(deviceId, faceId, userId, remaining);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalServiceCallback::onAuthenticated(int64_t deviceId, int32_t faceId, int32_t userId, const ::std::vector<uint8_t>& token) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt64(deviceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(faceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeByteVector(token);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalServiceCallback::TRANSACTION_onAuthenticated, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_ONEWAY);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalServiceCallback::getDefaultImpl())) {
- return IFaceHalServiceCallback::getDefaultImpl()->onAuthenticated(deviceId, faceId, userId, token);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalServiceCallback::onAcquired(int64_t deviceId, int32_t userId, int32_t acquiredInfo, int32_t vendorCode) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt64(deviceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(acquiredInfo);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(vendorCode);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalServiceCallback::TRANSACTION_onAcquired, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_ONEWAY);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalServiceCallback::getDefaultImpl())) {
- return IFaceHalServiceCallback::getDefaultImpl()->onAcquired(deviceId, userId, acquiredInfo, vendorCode);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalServiceCallback::onError(int64_t deviceId, int32_t userId, int32_t error, int32_t vendorCode) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt64(deviceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(error);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(vendorCode);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalServiceCallback::TRANSACTION_onError, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_ONEWAY);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalServiceCallback::getDefaultImpl())) {
- return IFaceHalServiceCallback::getDefaultImpl()->onError(deviceId, userId, error, vendorCode);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalServiceCallback::onRemoved(int64_t deviceId, const ::std::vector<int32_t>& faceIds, int32_t userId) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt64(deviceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32Vector(faceIds);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalServiceCallback::TRANSACTION_onRemoved, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_ONEWAY);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalServiceCallback::getDefaultImpl())) {
- return IFaceHalServiceCallback::getDefaultImpl()->onRemoved(deviceId, faceIds, userId);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalServiceCallback::onEnumerate(int64_t deviceId, const ::std::vector<int32_t>& faceIds, int32_t userId) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt64(deviceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32Vector(faceIds);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt32(userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalServiceCallback::TRANSACTION_onEnumerate, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_ONEWAY);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalServiceCallback::getDefaultImpl())) {
- return IFaceHalServiceCallback::getDefaultImpl()->onEnumerate(deviceId, faceIds, userId);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-::android::binder::Status BpFaceHalServiceCallback::onLockoutChanged(int64_t duration) {
- ::android::Parcel _aidl_data;
- _aidl_data.markForBinder(remoteStrong());
- ::android::Parcel _aidl_reply;
- ::android::status_t _aidl_ret_status = ::android::OK;
- ::android::binder::Status _aidl_status;
- _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = _aidl_data.writeInt64(duration);
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_ret_status = remote()->transact(BnFaceHalServiceCallback::TRANSACTION_onLockoutChanged, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_ONEWAY);
- if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFaceHalServiceCallback::getDefaultImpl())) {
- return IFaceHalServiceCallback::getDefaultImpl()->onLockoutChanged(duration);
- }
- if (((_aidl_ret_status) != (::android::OK))) {
- goto _aidl_error;
- }
- _aidl_error:
- _aidl_status.setFromStatusT(_aidl_ret_status);
- return _aidl_status;
-}
-
-} // namespace client
-
-} // namespace faceunlock
-
-} // namespace libremobileos
-
-} // namespace com
-#include <com/libremobileos/faceunlock/client/BnFaceHalServiceCallback.h>
-#include <binder/Parcel.h>
-#include <binder/Stability.h>
-
-namespace com {
-
-namespace libremobileos {
-
-namespace faceunlock {
-
-namespace client {
-
-BnFaceHalServiceCallback::BnFaceHalServiceCallback()
-{
- ::android::internal::Stability::markCompilationUnit(this);
-}
-
-::android::status_t BnFaceHalServiceCallback::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
- ::android::status_t _aidl_ret_status = ::android::OK;
- switch (_aidl_code) {
- case BnFaceHalServiceCallback::TRANSACTION_onEnrollResult:
- {
- int64_t in_deviceId;
- int32_t in_faceId;
- int32_t in_userId;
- int32_t in_remaining;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt64(&in_deviceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_faceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_remaining);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(onEnrollResult(in_deviceId, in_faceId, in_userId, in_remaining));
- }
- break;
- case BnFaceHalServiceCallback::TRANSACTION_onAuthenticated:
- {
- int64_t in_deviceId;
- int32_t in_faceId;
- int32_t in_userId;
- ::std::vector<uint8_t> in_token;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt64(&in_deviceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_faceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readByteVector(&in_token);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(onAuthenticated(in_deviceId, in_faceId, in_userId, in_token));
- }
- break;
- case BnFaceHalServiceCallback::TRANSACTION_onAcquired:
- {
- int64_t in_deviceId;
- int32_t in_userId;
- int32_t in_acquiredInfo;
- int32_t in_vendorCode;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt64(&in_deviceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_acquiredInfo);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_vendorCode);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(onAcquired(in_deviceId, in_userId, in_acquiredInfo, in_vendorCode));
- }
- break;
- case BnFaceHalServiceCallback::TRANSACTION_onError:
- {
- int64_t in_deviceId;
- int32_t in_userId;
- int32_t in_error;
- int32_t in_vendorCode;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt64(&in_deviceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_error);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_vendorCode);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(onError(in_deviceId, in_userId, in_error, in_vendorCode));
- }
- break;
- case BnFaceHalServiceCallback::TRANSACTION_onRemoved:
- {
- int64_t in_deviceId;
- ::std::vector<int32_t> in_faceIds;
- int32_t in_userId;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt64(&in_deviceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32Vector(&in_faceIds);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(onRemoved(in_deviceId, in_faceIds, in_userId));
- }
- break;
- case BnFaceHalServiceCallback::TRANSACTION_onEnumerate:
- {
- int64_t in_deviceId;
- ::std::vector<int32_t> in_faceIds;
- int32_t in_userId;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt64(&in_deviceId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32Vector(&in_faceIds);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- _aidl_ret_status = _aidl_data.readInt32(&in_userId);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(onEnumerate(in_deviceId, in_faceIds, in_userId));
- }
- break;
- case BnFaceHalServiceCallback::TRANSACTION_onLockoutChanged:
- {
- int64_t in_duration;
- if (!(_aidl_data.checkInterface(this))) {
- _aidl_ret_status = ::android::BAD_TYPE;
- break;
- }
- _aidl_ret_status = _aidl_data.readInt64(&in_duration);
- if (((_aidl_ret_status) != (::android::OK))) {
- break;
- }
- ::android::binder::Status _aidl_status(onLockoutChanged(in_duration));
- }
- break;
- default:
- {
- _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
- }
- break;
- }
- if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
- _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeToParcel(_aidl_reply);
- }
- return _aidl_ret_status;
-}
-
-} // namespace client
-
-} // namespace faceunlock
-
-} // namespace libremobileos
-
-} // namespace com
diff --git a/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/BnFaceHalService.h b/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/BnFaceHalService.h
deleted file mode 100644
index 6845397..0000000
--- a/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/BnFaceHalService.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#pragma once
-
-#include <binder/IInterface.h>
-#include <com/libremobileos/faceunlock/client/IFaceHalService.h>
-
-namespace com {
-
-namespace libremobileos {
-
-namespace faceunlock {
-
-namespace client {
-
-class BnFaceHalService : public ::android::BnInterface<IFaceHalService> {
-public:
- static constexpr uint32_t TRANSACTION_getDeviceId = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
- static constexpr uint32_t TRANSACTION_setCallback = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
- static constexpr uint32_t TRANSACTION_setActiveUser = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
- static constexpr uint32_t TRANSACTION_generateChallenge = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
- static constexpr uint32_t TRANSACTION_enroll = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
- static constexpr uint32_t TRANSACTION_revokeChallenge = ::android::IBinder::FIRST_CALL_TRANSACTION + 5;
- static constexpr uint32_t TRANSACTION_setFeature = ::android::IBinder::FIRST_CALL_TRANSACTION + 6;
- static constexpr uint32_t TRANSACTION_getFeature = ::android::IBinder::FIRST_CALL_TRANSACTION + 7;
- static constexpr uint32_t TRANSACTION_getAuthenticatorId = ::android::IBinder::FIRST_CALL_TRANSACTION + 8;
- static constexpr uint32_t TRANSACTION_cancel = ::android::IBinder::FIRST_CALL_TRANSACTION + 9;
- static constexpr uint32_t TRANSACTION_enumerate = ::android::IBinder::FIRST_CALL_TRANSACTION + 10;
- static constexpr uint32_t TRANSACTION_remove = ::android::IBinder::FIRST_CALL_TRANSACTION + 11;
- static constexpr uint32_t TRANSACTION_authenticate = ::android::IBinder::FIRST_CALL_TRANSACTION + 12;
- static constexpr uint32_t TRANSACTION_userActivity = ::android::IBinder::FIRST_CALL_TRANSACTION + 13;
- static constexpr uint32_t TRANSACTION_resetLockout = ::android::IBinder::FIRST_CALL_TRANSACTION + 14;
- explicit BnFaceHalService();
- ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
-}; // class BnFaceHalService
-
-} // namespace client
-
-} // namespace faceunlock
-
-} // namespace libremobileos
-
-} // namespace com
diff --git a/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/BnFaceHalServiceCallback.h b/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/BnFaceHalServiceCallback.h
deleted file mode 100644
index aa3be49..0000000
--- a/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/BnFaceHalServiceCallback.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#pragma once
-
-#include <binder/IInterface.h>
-#include <com/libremobileos/faceunlock/client/IFaceHalServiceCallback.h>
-
-namespace com {
-
-namespace libremobileos {
-
-namespace faceunlock {
-
-namespace client {
-
-class BnFaceHalServiceCallback : public ::android::BnInterface<IFaceHalServiceCallback> {
-public:
- static constexpr uint32_t TRANSACTION_onEnrollResult = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
- static constexpr uint32_t TRANSACTION_onAuthenticated = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
- static constexpr uint32_t TRANSACTION_onAcquired = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
- static constexpr uint32_t TRANSACTION_onError = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
- static constexpr uint32_t TRANSACTION_onRemoved = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
- static constexpr uint32_t TRANSACTION_onEnumerate = ::android::IBinder::FIRST_CALL_TRANSACTION + 5;
- static constexpr uint32_t TRANSACTION_onLockoutChanged = ::android::IBinder::FIRST_CALL_TRANSACTION + 6;
- explicit BnFaceHalServiceCallback();
- ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
-}; // class BnFaceHalServiceCallback
-
-} // namespace client
-
-} // namespace faceunlock
-
-} // namespace libremobileos
-
-} // namespace com
diff --git a/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/BpFaceHalService.h b/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/BpFaceHalService.h
deleted file mode 100644
index f21a52d..0000000
--- a/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/BpFaceHalService.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#pragma once
-
-#include <binder/IBinder.h>
-#include <binder/IInterface.h>
-#include <utils/Errors.h>
-#include <com/libremobileos/faceunlock/client/IFaceHalService.h>
-
-namespace com {
-
-namespace libremobileos {
-
-namespace faceunlock {
-
-namespace client {
-
-class BpFaceHalService : public ::android::BpInterface<IFaceHalService> {
-public:
- explicit BpFaceHalService(const ::android::sp<::android::IBinder>& _aidl_impl);
- virtual ~BpFaceHalService() = default;
- ::android::binder::Status getDeviceId(int64_t* _aidl_return) override;
- ::android::binder::Status setCallback(const ::android::sp<::com::libremobileos::faceunlock::client::IFaceHalServiceCallback>& callback) override;
- ::android::binder::Status setActiveUser(int32_t userId, const ::android::String16& storePath, int32_t* _aidl_return) override;
- ::android::binder::Status generateChallenge(int32_t timeout, int64_t* _aidl_return) override;
- ::android::binder::Status enroll(const ::std::vector<uint8_t>& token, int32_t timeout, const ::std::vector<int32_t>& disabledFeatures, int32_t* _aidl_return) override;
- ::android::binder::Status revokeChallenge(int32_t* _aidl_return) override;
- ::android::binder::Status setFeature(int32_t feature, bool enable, const ::std::vector<uint8_t>& token, int32_t faceId, int32_t* _aidl_return) override;
- ::android::binder::Status getFeature(int32_t feature, int32_t faceId, bool* _aidl_return) override;
- ::android::binder::Status getAuthenticatorId(int64_t* _aidl_return) override;
- ::android::binder::Status cancel(int32_t* _aidl_return) override;
- ::android::binder::Status enumerate(int32_t* _aidl_return) override;
- ::android::binder::Status remove(int32_t faceId, int32_t* _aidl_return) override;
- ::android::binder::Status authenticate(int64_t operationId, int32_t* _aidl_return) override;
- ::android::binder::Status userActivity(int32_t* _aidl_return) override;
- ::android::binder::Status resetLockout(const ::std::vector<uint8_t>& token, int32_t* _aidl_return) override;
-}; // class BpFaceHalService
-
-} // namespace client
-
-} // namespace faceunlock
-
-} // namespace libremobileos
-
-} // namespace com
diff --git a/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/BpFaceHalServiceCallback.h b/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/BpFaceHalServiceCallback.h
deleted file mode 100644
index 4cfa324..0000000
--- a/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/BpFaceHalServiceCallback.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#pragma once
-
-#include <binder/IBinder.h>
-#include <binder/IInterface.h>
-#include <utils/Errors.h>
-#include <com/libremobileos/faceunlock/client/IFaceHalServiceCallback.h>
-
-namespace com {
-
-namespace libremobileos {
-
-namespace faceunlock {
-
-namespace client {
-
-class BpFaceHalServiceCallback : public ::android::BpInterface<IFaceHalServiceCallback> {
-public:
- explicit BpFaceHalServiceCallback(const ::android::sp<::android::IBinder>& _aidl_impl);
- virtual ~BpFaceHalServiceCallback() = default;
- ::android::binder::Status onEnrollResult(int64_t deviceId, int32_t faceId, int32_t userId, int32_t remaining) override;
- ::android::binder::Status onAuthenticated(int64_t deviceId, int32_t faceId, int32_t userId, const ::std::vector<uint8_t>& token) override;
- ::android::binder::Status onAcquired(int64_t deviceId, int32_t userId, int32_t acquiredInfo, int32_t vendorCode) override;
- ::android::binder::Status onError(int64_t deviceId, int32_t userId, int32_t error, int32_t vendorCode) override;
- ::android::binder::Status onRemoved(int64_t deviceId, const ::std::vector<int32_t>& faceIds, int32_t userId) override;
- ::android::binder::Status onEnumerate(int64_t deviceId, const ::std::vector<int32_t>& faceIds, int32_t userId) override;
- ::android::binder::Status onLockoutChanged(int64_t duration) override;
-}; // class BpFaceHalServiceCallback
-
-} // namespace client
-
-} // namespace faceunlock
-
-} // namespace libremobileos
-
-} // namespace com
diff --git a/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/IFaceHalService.h b/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/IFaceHalService.h
deleted file mode 100644
index 3905045..0000000
--- a/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/IFaceHalService.h
+++ /dev/null
@@ -1,98 +0,0 @@
-#pragma once
-
-#include <binder/IBinder.h>
-#include <binder/IInterface.h>
-#include <binder/Status.h>
-#include <com/libremobileos/faceunlock/client/IFaceHalServiceCallback.h>
-#include <cstdint>
-#include <utils/String16.h>
-#include <utils/StrongPointer.h>
-#include <vector>
-
-namespace com {
-
-namespace libremobileos {
-
-namespace faceunlock {
-
-namespace client {
-
-class IFaceHalService : public ::android::IInterface {
-public:
- DECLARE_META_INTERFACE(FaceHalService)
- virtual ::android::binder::Status getDeviceId(int64_t* _aidl_return) = 0;
- virtual ::android::binder::Status setCallback(const ::android::sp<::com::libremobileos::faceunlock::client::IFaceHalServiceCallback>& callback) = 0;
- virtual ::android::binder::Status setActiveUser(int32_t userId, const ::android::String16& storePath, int32_t* _aidl_return) = 0;
- virtual ::android::binder::Status generateChallenge(int32_t timeout, int64_t* _aidl_return) = 0;
- virtual ::android::binder::Status enroll(const ::std::vector<uint8_t>& token, int32_t timeout, const ::std::vector<int32_t>& disabledFeatures, int32_t* _aidl_return) = 0;
- virtual ::android::binder::Status revokeChallenge(int32_t* _aidl_return) = 0;
- virtual ::android::binder::Status setFeature(int32_t feature, bool enable, const ::std::vector<uint8_t>& token, int32_t faceId, int32_t* _aidl_return) = 0;
- virtual ::android::binder::Status getFeature(int32_t feature, int32_t faceId, bool* _aidl_return) = 0;
- virtual ::android::binder::Status getAuthenticatorId(int64_t* _aidl_return) = 0;
- virtual ::android::binder::Status cancel(int32_t* _aidl_return) = 0;
- virtual ::android::binder::Status enumerate(int32_t* _aidl_return) = 0;
- virtual ::android::binder::Status remove(int32_t faceId, int32_t* _aidl_return) = 0;
- virtual ::android::binder::Status authenticate(int64_t operationId, int32_t* _aidl_return) = 0;
- virtual ::android::binder::Status userActivity(int32_t* _aidl_return) = 0;
- virtual ::android::binder::Status resetLockout(const ::std::vector<uint8_t>& token, int32_t* _aidl_return) = 0;
-}; // class IFaceHalService
-
-class IFaceHalServiceDefault : public IFaceHalService {
-public:
- ::android::IBinder* onAsBinder() override {
- return nullptr;
- }
- ::android::binder::Status getDeviceId(int64_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status setCallback(const ::android::sp<::com::libremobileos::faceunlock::client::IFaceHalServiceCallback>&) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status setActiveUser(int32_t, const ::android::String16&, int32_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status generateChallenge(int32_t, int64_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status enroll(const ::std::vector<uint8_t>&, int32_t, const ::std::vector<int32_t>&, int32_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status revokeChallenge(int32_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status setFeature(int32_t, bool, const ::std::vector<uint8_t>&, int32_t, int32_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status getFeature(int32_t, int32_t, bool*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status getAuthenticatorId(int64_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status cancel(int32_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status enumerate(int32_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status remove(int32_t, int32_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status authenticate(int64_t, int32_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status userActivity(int32_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status resetLockout(const ::std::vector<uint8_t>&, int32_t*) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
-}; // class IFaceHalServiceDefault
-
-} // namespace client
-
-} // namespace faceunlock
-
-} // namespace libremobileos
-
-} // namespace com
diff --git a/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/IFaceHalServiceCallback.h b/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/IFaceHalServiceCallback.h
deleted file mode 100644
index 544a5fd..0000000
--- a/adapter/binder-interfaces/include/com/libremobileos/faceunlock/client/IFaceHalServiceCallback.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#pragma once
-
-#include <binder/IBinder.h>
-#include <binder/IInterface.h>
-#include <binder/Status.h>
-#include <cstdint>
-#include <utils/StrongPointer.h>
-#include <vector>
-
-namespace com {
-
-namespace libremobileos {
-
-namespace faceunlock {
-
-namespace client {
-
-class IFaceHalServiceCallback : public ::android::IInterface {
-public:
- DECLARE_META_INTERFACE(FaceHalServiceCallback)
- virtual ::android::binder::Status onEnrollResult(int64_t deviceId, int32_t faceId, int32_t userId, int32_t remaining) = 0;
- virtual ::android::binder::Status onAuthenticated(int64_t deviceId, int32_t faceId, int32_t userId, const ::std::vector<uint8_t>& token) = 0;
- virtual ::android::binder::Status onAcquired(int64_t deviceId, int32_t userId, int32_t acquiredInfo, int32_t vendorCode) = 0;
- virtual ::android::binder::Status onError(int64_t deviceId, int32_t userId, int32_t error, int32_t vendorCode) = 0;
- virtual ::android::binder::Status onRemoved(int64_t deviceId, const ::std::vector<int32_t>& faceIds, int32_t userId) = 0;
- virtual ::android::binder::Status onEnumerate(int64_t deviceId, const ::std::vector<int32_t>& faceIds, int32_t userId) = 0;
- virtual ::android::binder::Status onLockoutChanged(int64_t duration) = 0;
-}; // class IFaceHalServiceCallback
-
-class IFaceHalServiceCallbackDefault : public IFaceHalServiceCallback {
-public:
- ::android::IBinder* onAsBinder() override {
- return nullptr;
- }
- ::android::binder::Status onEnrollResult(int64_t, int32_t, int32_t, int32_t) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status onAuthenticated(int64_t, int32_t, int32_t, const ::std::vector<uint8_t>&) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status onAcquired(int64_t, int32_t, int32_t, int32_t) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status onError(int64_t, int32_t, int32_t, int32_t) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status onRemoved(int64_t, const ::std::vector<int32_t>&, int32_t) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status onEnumerate(int64_t, const ::std::vector<int32_t>&, int32_t) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
- ::android::binder::Status onLockoutChanged(int64_t) override {
- return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
- }
-}; // class IFaceHalServiceCallbackDefault
-
-} // namespace client
-
-} // namespace faceunlock
-
-} // namespace libremobileos
-
-} // namespace com
diff --git a/adapter/service.cpp b/adapter/service.cpp
index 27a6280..1614511 100644
--- a/adapter/service.cpp
+++ b/adapter/service.cpp
@@ -17,11 +17,10 @@
#define LOG_TAG "android.hardware.biometrics.face@1.0-service.lmodroid"
#include "BiometricsFace.h"
-#include <binder/IBinder.h>
-#include <binder/IServiceManager.h>
#include <android/hardware/biometrics/face/1.0/IBiometricsFace.h>
#include <android/hardware/biometrics/face/1.0/types.h>
#include <android/log.h>
+#include <android/binder_manager.h>
#include <binder/ProcessState.h>
#include <hidl/HidlSupport.h>
#include <hidl/HidlTransportSupport.h>
@@ -32,31 +31,17 @@
using android::hardware::joinRpcThreadpool;
using android::hardware::biometrics::face::implementation::BiometricsFace;
using android::hardware::biometrics::face::V1_0::IBiometricsFace;
-using ::com::libremobileos::faceunlock::client::IFaceHalService;
+using ::aidl::com::libremobileos::faceunlock::client::IFaceHalService;
int main() {
- sp<IBinder> binderFaceHal;
- sp<IFaceHalService> faceHalService = nullptr;
-
ALOGI("LMODroid BiometricsFace HAL is being started.");
// the conventional HAL might start binder services
android::ProcessState::self()->setThreadPoolMaxThreadCount(4);
android::ProcessState::self()->startThreadPool();
configureRpcThreadpool(4, true /*callerWillJoin*/);
- unsigned int lastSleep = 1;
- while (faceHalService == nullptr) {
- // wait for faceunlockhal service to start
- ALOGI("Waiting for faceunlockhal service to start...");
- sleep(lastSleep++);
- binderFaceHal = android::defaultServiceManager()->getService(android::String16("faceunlockhal"));
- if (binderFaceHal != nullptr)
- faceHalService = android::interface_cast<IFaceHalService>(binderFaceHal);
- else if (lastSleep < 1 || lastSleep > 100) {
- ALOGI("Gave up waiting for faceunlockhal service to start. Sleeping for a long time...");
- lastSleep = 999999;
- }
- }
+ ALOGI("Waiting for faceunlockhal service to start...");
+ IFaceHalService faceHalService = IFaceHalService::fromBinder(SpAIBinder(AServiceManager_waitForService("faceunlockhal")));
android::sp<IBiometricsFace> face = new BiometricsFace(faceHalService);
const android::status_t status = face->registerAsService("lmodroid");
diff --git a/app/src/main/Android.bp b/app/src/main/Android.bp
index b45527c..abc147e 100644
--- a/app/src/main/Android.bp
+++ b/app/src/main/Android.bp
@@ -19,4 +19,5 @@
required: ["LMOFaceUnlockSettingsOverlay"],
jni_libs: ["libtensorflowlite_jni"],
init_rc: ["LMOFaceUnlock.rc"],
+ vintf_fragments: ["manifest_face_lmodroid.xml"],
}
diff --git a/adapter/manifest_face_lmodroid.xml b/app/src/main/manifest_face_lmodroid.xml
similarity index 100%
rename from adapter/manifest_face_lmodroid.xml
rename to app/src/main/manifest_face_lmodroid.xml
diff --git a/framework/Android.bp b/framework/Android.bp
index 6353d1a..546ec1b 100644
--- a/framework/Android.bp
+++ b/framework/Android.bp
@@ -1,12 +1,35 @@
+aidl_interface {
+ name: "LMOFaceClient_aidl",
+ vendor_available: true,
+ srcs: [
+ "client/**/*.aidl",
+ ],
+ local_include_dir: "client",
+ stability: "vintf",
+ // cheat around setting a version
+ owner: "libremobileos",
+ backend: {
+ java: {
+ enabled: true,
+ // markVintfStability() is a platform API
+ platform_apis: true,
+ },
+ cpp: {
+ enabled: true,
+ },
+ ndk: {
+ enabled: true,
+ },
+ },
+}
+
java_library_static {
name: "LMOFaceClient",
platform_apis: true,
- srcs: ["client/**/*.java", "client/**/*.aidl"],
- aidl: {
- include_dirs: [
- "packages/apps/FaceUnlock/framework/client",
- ],
- },
+ srcs: ["client/**/*.java"],
+ static_libs: [
+ "LMOFaceClient_aidl-V1-java",
+ ],
}
java_library_static {
@@ -18,4 +41,4 @@
"LMOFaceShared_java",
"android.hardware.biometrics.face-V1.0-java",
],
-}
\ No newline at end of file
+}
diff --git a/framework/aidl_api/LMOFaceClient_aidl/current/com/libremobileos/faceunlock/client/IFaceHalService.aidl b/framework/aidl_api/LMOFaceClient_aidl/current/com/libremobileos/faceunlock/client/IFaceHalService.aidl
new file mode 100644
index 0000000..c68ed3a
--- /dev/null
+++ b/framework/aidl_api/LMOFaceClient_aidl/current/com/libremobileos/faceunlock/client/IFaceHalService.aidl
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2023 LibreMobileOS Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package com.libremobileos.faceunlock.client;
+@VintfStability
+interface IFaceHalService {
+ long getDeviceId();
+ oneway void setCallback(in com.libremobileos.faceunlock.client.IFaceHalServiceCallback callback);
+ int setActiveUser(int userId, String storePath);
+ long generateChallenge(int timeout);
+ int enroll(in byte[] token, int timeout, in int[] disabledFeatures);
+ int revokeChallenge();
+ int setFeature(int feature, boolean enable, in byte[] token, int faceId);
+ boolean getFeature(int feature, int faceId);
+ long getAuthenticatorId();
+ int cancel();
+ int enumerate();
+ int remove(int faceId);
+ int authenticate(long operationId);
+ int userActivity();
+ int resetLockout(in byte[] token);
+}
diff --git a/framework/aidl_api/LMOFaceClient_aidl/current/com/libremobileos/faceunlock/client/IFaceHalServiceCallback.aidl b/framework/aidl_api/LMOFaceClient_aidl/current/com/libremobileos/faceunlock/client/IFaceHalServiceCallback.aidl
new file mode 100644
index 0000000..f6fbae6
--- /dev/null
+++ b/framework/aidl_api/LMOFaceClient_aidl/current/com/libremobileos/faceunlock/client/IFaceHalServiceCallback.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2023 LibreMobileOS Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package com.libremobileos.faceunlock.client;
+@VintfStability
+interface IFaceHalServiceCallback {
+ oneway void onEnrollResult(long deviceId, int faceId, int userId, int remaining);
+ oneway void onAuthenticated(long deviceId, int faceId, int userId, in byte[] token);
+ oneway void onAcquired(long deviceId, int userId, int acquiredInfo, int vendorCode);
+ oneway void onError(long deviceId, int userId, int error, int vendorCode);
+ oneway void onRemoved(long deviceId, in int[] faceIds, int userId);
+ oneway void onEnumerate(long deviceId, in int[] faceIds, int userId);
+ oneway void onLockoutChanged(long duration);
+}
diff --git a/framework/aidl_api/LMOFaceClient_aidl/current/com/libremobileos/faceunlock/client/IFaceUnlockManager.aidl b/framework/aidl_api/LMOFaceClient_aidl/current/com/libremobileos/faceunlock/client/IFaceUnlockManager.aidl
new file mode 100644
index 0000000..615eb2d
--- /dev/null
+++ b/framework/aidl_api/LMOFaceClient_aidl/current/com/libremobileos/faceunlock/client/IFaceUnlockManager.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2023 LibreMobileOS Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package com.libremobileos.faceunlock.client;
+@VintfStability
+interface IFaceUnlockManager {
+ void enrollResult(int remaining);
+ void error(int error);
+ void finishEnroll(String encodedFaces, in byte[] token);
+}
diff --git a/framework/client/com/libremobileos/faceunlock/client/IFaceHalService.aidl b/framework/client/com/libremobileos/faceunlock/client/IFaceHalService.aidl
index 33b396c..55a79dd 100644
--- a/framework/client/com/libremobileos/faceunlock/client/IFaceHalService.aidl
+++ b/framework/client/com/libremobileos/faceunlock/client/IFaceHalService.aidl
@@ -18,6 +18,7 @@
import com.libremobileos.faceunlock.client.IFaceHalServiceCallback;
+@VintfStability
interface IFaceHalService {
long getDeviceId();
@@ -48,4 +49,4 @@
int userActivity();
int resetLockout(in byte[] token);
-}
\ No newline at end of file
+}
diff --git a/framework/client/com/libremobileos/faceunlock/client/IFaceHalServiceCallback.aidl b/framework/client/com/libremobileos/faceunlock/client/IFaceHalServiceCallback.aidl
index 5713d98..379ab42 100644
--- a/framework/client/com/libremobileos/faceunlock/client/IFaceHalServiceCallback.aidl
+++ b/framework/client/com/libremobileos/faceunlock/client/IFaceHalServiceCallback.aidl
@@ -16,6 +16,7 @@
package com.libremobileos.faceunlock.client;
+@VintfStability
oneway interface IFaceHalServiceCallback {
void onEnrollResult(long deviceId, int faceId, int userId, int remaining);
@@ -30,4 +31,4 @@
void onEnumerate(long deviceId, in int[] faceIds, int userId);
void onLockoutChanged(long duration);
-}
\ No newline at end of file
+}
diff --git a/framework/client/com/libremobileos/faceunlock/client/IFaceUnlockManager.aidl b/framework/client/com/libremobileos/faceunlock/client/IFaceUnlockManager.aidl
index 39909b1..389c82d 100644
--- a/framework/client/com/libremobileos/faceunlock/client/IFaceUnlockManager.aidl
+++ b/framework/client/com/libremobileos/faceunlock/client/IFaceUnlockManager.aidl
@@ -16,6 +16,7 @@
package com.libremobileos.faceunlock.client;
+@VintfStability
interface IFaceUnlockManager {
void enrollResult(int remaining);
void error(int error);
diff --git a/framework/server/com/libremobileos/faceunlock/server/FaceUnlockServer.java b/framework/server/com/libremobileos/faceunlock/server/FaceUnlockServer.java
index 8c96a0f..eaa1889 100644
--- a/framework/server/com/libremobileos/faceunlock/server/FaceUnlockServer.java
+++ b/framework/server/com/libremobileos/faceunlock/server/FaceUnlockServer.java
@@ -75,6 +75,13 @@
private String mStorePath = "/data/vendor_de/0/facedata";
private final IBinder mFaceUnlockHalBinder = new IFaceHalService.Stub() {
+
+ @Override
+ public final int getInterfaceVersion() { return super.VERSION; }
+
+ @Override
+ public final String getInterfaceHash() { return super.HASH; }
+
@Override
public long getDeviceId() {
return kDeviceId;
@@ -376,6 +383,13 @@
}
private final IBinder mFaceUnlockManagerBinder = new IFaceUnlockManager.Stub() {
+
+ @Override
+ public final int getInterfaceVersion() { return super.VERSION; }
+
+ @Override
+ public final String getInterfaceHash() { return super.HASH; }
+
@Override
public void enrollResult(int remaining) throws RemoteException {
if (mCallback != null) {