diff --git a/README.md b/README.md index 8569932..4ad66d7 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ useriam_faceauth是用户身份认证与访问控制子系统的人脸认证组 ## 编译构建 -useriam_faceauth是Open Harmony标准系统的组件,安装依赖工具、获取源码、编译流程请参考Open Harmony官方构建文档。链接如下: +useriam_faceauth是OpenHarmony标准系统的组件,安装依赖工具、获取源码、编译流程请参考OpenHarmony官方构建文档。链接如下: [搭建Windows开发环境](https://www.openharmony.cn/pages/00010101/) @@ -31,14 +31,14 @@ useriam_faceauth是Open Harmony标准系统的组件,安装依赖工具、获 在完成全量构建后,可以单独构建faceauth组件,命令如下: ```bash -# ./build.sh $platform_build_comand --build-target faceauth +# ./build.sh $platform_build_command --build-target faceauth # 以Hi3516DV300为例,其他产品构建命令有所不同 ./build.sh --product-name Hi3516DV300 --build-target faceauth ``` ## 使用说明 -本模块实现了Harmony OS用户认证接口,接口说明请参考[用户认证 JSAPI参考](https://developer.harmonyos.com/cn/docs/documentation/doc-references/js-apis-useriam-userauth-0000001168311785)。 +本模块实现了用户认证接口,接口说明请参考[用户认证 JSAPI参考](https://developer.harmonyos.com/cn/docs/documentation/doc-references/js-apis-useriam-userauth-0000001168311785)。 使用示例: @@ -99,7 +99,7 @@ export default { 1. 在完成全量构建后,构建人脸faceauth UT测试例 ```bash -# ./build.sh $platform_build_comand --build-target faceauth_build_module_standard_test +# ./build.sh $platform_build_command --build-target faceauth_build_module_standard_test # 以Hi3516DV300为例,其他产品构建命令有所不同 ./build.sh --product-name Hi3516DV300 --build-target faceauth_build_module_standard_test ``` diff --git a/interfaces/kits/napi/faceauth_mgr/faceauth_mgr.cpp b/interfaces/kits/napi/faceauth_mgr/faceauth_mgr.cpp index 44d610d..cc7f480 100755 --- a/interfaces/kits/napi/faceauth_mgr/faceauth_mgr.cpp +++ b/interfaces/kits/napi/faceauth_mgr/faceauth_mgr.cpp @@ -194,7 +194,7 @@ static int64_t GetTimestamp() t.tv_sec = 0; t.tv_nsec = 0; clock_gettime(CLOCK_REALTIME, &t); - int64_t elapsedTime{((t.tv_sec) * SEC_TO_NANOSEC + t.tv_nsec)}; + int64_t elapsedTime { ((t.tv_sec) * SEC_TO_NANOSEC + t.tv_nsec) }; return elapsedTime; } @@ -380,7 +380,7 @@ napi_value FaceauthMgr::CreateExecutePromise(napi_env env, AsyncFaceAuthCallback napi_value FaceauthMgr::Execute(napi_env env, napi_callback_info info) { size_t argc = ARGS_NUMBER_THREE; - napi_value argv[ARGS_NUMBER_THREE] = {nullptr}; + napi_value argv[ARGS_NUMBER_THREE] = { nullptr }; napi_value thisArg; void *data = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisArg, &data)); @@ -391,11 +391,11 @@ napi_value FaceauthMgr::Execute(napi_env env, napi_callback_info info) ParseString(env, type, argv[0]); ParseString(env, level, argv[1]); uint64_t reqId = GetTimestamp() % MAX_REQ_ID_COUNT; - AsyncFaceAuthCallbackInfo *asyncCallbackInfo = new AsyncFaceAuthCallbackInfo {.env = env, + AsyncFaceAuthCallbackInfo *asyncCallbackInfo = new AsyncFaceAuthCallbackInfo { .env = env, .asyncWork = nullptr, .deferred = nullptr, .type = type, - .level = level}; + .level = level }; InsertMap(reqId, asyncCallbackInfo); if (argc == ARGS_NUMBER_THREE) { @@ -433,7 +433,7 @@ napi_value FaceauthMgr::CheckAvailability(napi_env env, napi_callback_info info) { FACEAUTH_LABEL_LOGI("Enter CheckAvailability."); size_t argc = ARGS_NUMBER_THREE; - napi_value argv[ARGS_NUMBER_THREE] = {nullptr}; + napi_value argv[ARGS_NUMBER_THREE] = { nullptr }; napi_value thisArg; void *data = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisArg, &data)); @@ -468,7 +468,7 @@ napi_value FaceauthMgr::JsOn(napi_env env, napi_callback_info info) { FACEAUTH_LABEL_LOGI("JsOn in"); size_t argc = ARGS_NUMBER_TWO; - napi_value argv[ARGS_NUMBER_TWO] = {nullptr}; + napi_value argv[ARGS_NUMBER_TWO] = { nullptr }; napi_value thisArg; void *data = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisArg, &data)); @@ -504,7 +504,7 @@ napi_value FaceauthMgr::JsOff(napi_env env, napi_callback_info info) { FACEAUTH_LABEL_LOGI("JsOff in"); size_t argc = ARGS_NUMBER_TWO; - napi_value argv[ARGS_NUMBER_TWO] = {nullptr}; + napi_value argv[ARGS_NUMBER_TWO] = { nullptr }; napi_value thisArg; void *data = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisArg, &data)); @@ -666,7 +666,7 @@ void FaceauthMgr::CreateEnrollAsynch(napi_env env, uint64_t reqId, napi_value ca { FACEAUTH_LABEL_LOGI("CreateEnrollAsynch reqId = xxxx%04llu", reqId); AsyncFaceAuthCallbackInfo *asyncCallbackInfo = - new AsyncFaceAuthCallbackInfo {.env = env, .asyncWork = nullptr, .deferred = nullptr, .reqId = reqId}; + new AsyncFaceAuthCallbackInfo { .env = env, .asyncWork = nullptr, .deferred = nullptr, .reqId = reqId }; InsertMap(reqId, asyncCallbackInfo); FACEAUTH_LABEL_LOGI("Enroll asyncCallback."); @@ -704,7 +704,7 @@ void FaceauthMgr::CreateEnrollAsynch(napi_env env, uint64_t reqId, napi_value ca napi_value FaceauthMgr::Enroll(napi_env env, napi_callback_info info) { size_t argc = ARGS_NUMBER_TWO; - napi_value argv[ARGS_NUMBER_TWO] = {nullptr}; + napi_value argv[ARGS_NUMBER_TWO] = { nullptr }; napi_value thisArg; void *data = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisArg, &data)); @@ -859,7 +859,7 @@ napi_value FaceauthMgr::Remove(napi_env env, napi_callback_info info) { FACEAUTH_LABEL_LOGI("Enter Remove."); size_t argc = ARGS_NUMBER_TWO; - napi_value argv[ARGS_NUMBER_TWO] = {nullptr}; + napi_value argv[ARGS_NUMBER_TWO] = { nullptr }; napi_value thisArg; void *data = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisArg, &data)); @@ -872,7 +872,7 @@ napi_value FaceauthMgr::Remove(napi_env env, napi_callback_info info) removeParam.reqId = reqId; removeParam.faceId = faceId; AsyncFaceAuthCallbackInfo *asyncCallbackInfo = - new AsyncFaceAuthCallbackInfo {.env = env, .asyncWork = nullptr, .deferred = nullptr}; + new AsyncFaceAuthCallbackInfo { .env = env, .asyncWork = nullptr, .deferred = nullptr }; InsertMap(reqId, asyncCallbackInfo); if (argc == ARGS_NUMBER_TWO) { @@ -901,7 +901,7 @@ napi_value FaceauthMgr::GetEnrolledFaceIds(napi_env env, napi_callback_info info FACEAUTH_LABEL_LOGI("Enter GetEnrolledFaceIds."); size_t argc = ARGS_NUMBER_ONE; - napi_value argv[ARGS_NUMBER_ONE] = {nullptr}; + napi_value argv[ARGS_NUMBER_ONE] = { nullptr }; napi_value thisArg; void *data = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisArg, &data)); @@ -953,13 +953,13 @@ EXTERN_C_END /* * Module define */ -static napi_module _module = {.nm_version = 1, +static napi_module _module = { .nm_version = 1, .nm_flags = 0, .nm_filename = nullptr, .nm_register_func = Init, .nm_modname = "userIAM.userAuth", .nm_priv = ((void *) 0), - .reserved = {0}}; + .reserved = { 0 } }; /* * Module register function */ @@ -970,5 +970,4 @@ extern "C" __attribute__((constructor)) void RegisterModule(void) } } // namespace FaceAuth } // namespace UserIAM -} // namespace OHOS - +} // namespace OHOS \ No newline at end of file diff --git a/services/BUILD.gn b/service/BUILD.gn similarity index 100% rename from services/BUILD.gn rename to service/BUILD.gn diff --git a/services/faceauth/BUILD.gn b/service/faceauth/BUILD.gn similarity index 97% rename from services/faceauth/BUILD.gn rename to service/faceauth/BUILD.gn index 8c59d72..aa06a41 100755 --- a/services/faceauth/BUILD.gn +++ b/service/faceauth/BUILD.gn @@ -38,6 +38,7 @@ config("face_auth_services_public_config") { "${face_auth_innerkits_path}/include", "${face_auth_services_path}/include", "${face_auth_services_path}/mock/include", + "${face_auth_services_path}/test/mock/include", "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include", "//utils/native/base/include", @@ -67,6 +68,7 @@ ohos_shared_library("face_auth_services") { "${face_auth_services_path}/mock/src/face_auth_algo_adapter.cpp", "${face_auth_services_path}/mock/src/face_auth_ca.cpp", "${face_auth_services_path}/mock/src/face_auth_algo_impl.cpp", + "${face_auth_services_path}/src/face_auth_bms_adapter.cpp", ] configs = [ ":face_auth_services_config" ] diff --git a/services/faceauth/include/face_auth_algo_dispatcher.h b/service/faceauth/include/face_auth_algo_dispatcher.h similarity index 100% rename from services/faceauth/include/face_auth_algo_dispatcher.h rename to service/faceauth/include/face_auth_algo_dispatcher.h diff --git a/services/faceauth/test/mock/include/mock_distributed_permission_kit.h b/service/faceauth/include/face_auth_bms_adapter.h similarity index 50% rename from services/faceauth/test/mock/include/mock_distributed_permission_kit.h rename to service/faceauth/include/face_auth_bms_adapter.h index 10b8b26..8888868 100644 --- a/services/faceauth/test/mock/include/mock_distributed_permission_kit.h +++ b/service/faceauth/include/face_auth_bms_adapter.h @@ -13,20 +13,29 @@ * limitations under the License. */ -#ifndef DISRIBUTED_PERMISSION_KIT_H -#define DISRIBUTED_PERMISSION_KIT_H +#ifndef FACE_AUTH_BMS_ADAPTER_H +#define FACE_AUTH_BMS_ADAPTER_H -#include +#include +#include "bundle_mgr_interface.h" namespace OHOS { -namespace Security { -namespace Permission { -class DistributedPermissionKit { +namespace UserIAM { +namespace FaceAuth { +class FaceAuthBmsAdapter { public: - static int32_t CheckPermission(const std::string &permissionName, const std::string &appIdInfo); -}; -} // namespace Permission -} // namespace Security -} // namespace OHOS + FaceAuthBmsAdapter() = default; + virtual ~FaceAuthBmsAdapter() = default; + static std::shared_ptr GetInstance(); + std::string GetCallingBundleName(); -#endif // DISRIBUTED_PERMISSION_KIT_H +private: + sptr GetBundleManager(); + static std::mutex mutex_; + static std::shared_ptr instance_; + sptr iBundleManager_; +}; +} // namespace FaceAuth +} // namespace UserIAM +} // namespace OHOS +#endif // FACE_AUTH_BMS_ADAPTER_H diff --git a/services/faceauth/include/face_auth_camera.h b/service/faceauth/include/face_auth_camera.h similarity index 100% rename from services/faceauth/include/face_auth_camera.h rename to service/faceauth/include/face_auth_camera.h diff --git a/services/faceauth/include/face_auth_camera_buffer_listener.h b/service/faceauth/include/face_auth_camera_buffer_listener.h similarity index 100% rename from services/faceauth/include/face_auth_camera_buffer_listener.h rename to service/faceauth/include/face_auth_camera_buffer_listener.h diff --git a/services/faceauth/include/face_auth_event.h b/service/faceauth/include/face_auth_event.h similarity index 100% rename from services/faceauth/include/face_auth_event.h rename to service/faceauth/include/face_auth_event.h diff --git a/services/faceauth/include/face_auth_event_handler.h b/service/faceauth/include/face_auth_event_handler.h similarity index 100% rename from services/faceauth/include/face_auth_event_handler.h rename to service/faceauth/include/face_auth_event_handler.h diff --git a/services/faceauth/include/face_auth_manager.h b/service/faceauth/include/face_auth_manager.h old mode 100755 new mode 100644 similarity index 99% rename from services/faceauth/include/face_auth_manager.h rename to service/faceauth/include/face_auth_manager.h index 86dcd2f..cdad4d9 --- a/services/faceauth/include/face_auth_manager.h +++ b/service/faceauth/include/face_auth_manager.h @@ -72,7 +72,6 @@ private: void Prepare(HWExeType type); void SetChallenge(int64_t challenge); int32_t VerifyAuthToken(std::unique_ptr authToken, uint32_t length, int type); - std::string GetCallingBundleName(); bool CheckFaceIDValidity(int32_t faceId); uint32_t SwitchFaceErrorCode(int32_t authErrorCode); bool CheckLockOutMode(const uint64_t reqId, const sptr &callback); diff --git a/services/faceauth/include/face_auth_req.h b/service/faceauth/include/face_auth_req.h similarity index 100% rename from services/faceauth/include/face_auth_req.h rename to service/faceauth/include/face_auth_req.h diff --git a/services/faceauth/include/face_auth_service.h b/service/faceauth/include/face_auth_service.h similarity index 100% rename from services/faceauth/include/face_auth_service.h rename to service/faceauth/include/face_auth_service.h diff --git a/services/faceauth/include/face_auth_thread_pool.h b/service/faceauth/include/face_auth_thread_pool.h similarity index 100% rename from services/faceauth/include/face_auth_thread_pool.h rename to service/faceauth/include/face_auth_thread_pool.h diff --git a/services/faceauth/include/iface_auth_algo_adaptee.h b/service/faceauth/include/iface_auth_algo_adaptee.h similarity index 100% rename from services/faceauth/include/iface_auth_algo_adaptee.h rename to service/faceauth/include/iface_auth_algo_adaptee.h diff --git a/services/faceauth/include/iface_auth_algo_target.h b/service/faceauth/include/iface_auth_algo_target.h similarity index 100% rename from services/faceauth/include/iface_auth_algo_target.h rename to service/faceauth/include/iface_auth_algo_target.h diff --git a/services/faceauth/include/iface_auth_ca.h b/service/faceauth/include/iface_auth_ca.h similarity index 100% rename from services/faceauth/include/iface_auth_ca.h rename to service/faceauth/include/iface_auth_ca.h diff --git a/services/faceauth/mock/include/face_auth_algo_adapter.h b/service/faceauth/mock/include/face_auth_algo_adapter.h similarity index 100% rename from services/faceauth/mock/include/face_auth_algo_adapter.h rename to service/faceauth/mock/include/face_auth_algo_adapter.h diff --git a/services/faceauth/mock/include/face_auth_algo_impl.h b/service/faceauth/mock/include/face_auth_algo_impl.h similarity index 100% rename from services/faceauth/mock/include/face_auth_algo_impl.h rename to service/faceauth/mock/include/face_auth_algo_impl.h diff --git a/services/faceauth/mock/include/face_auth_ca.h b/service/faceauth/mock/include/face_auth_ca.h similarity index 100% rename from services/faceauth/mock/include/face_auth_ca.h rename to service/faceauth/mock/include/face_auth_ca.h diff --git a/services/faceauth/mock/include/mock_common.h b/service/faceauth/mock/include/mock_common.h similarity index 100% rename from services/faceauth/mock/include/mock_common.h rename to service/faceauth/mock/include/mock_common.h diff --git a/services/faceauth/mock/src/face_auth_algo_adapter.cpp b/service/faceauth/mock/src/face_auth_algo_adapter.cpp similarity index 100% rename from services/faceauth/mock/src/face_auth_algo_adapter.cpp rename to service/faceauth/mock/src/face_auth_algo_adapter.cpp diff --git a/services/faceauth/mock/src/face_auth_algo_impl.cpp b/service/faceauth/mock/src/face_auth_algo_impl.cpp similarity index 100% rename from services/faceauth/mock/src/face_auth_algo_impl.cpp rename to service/faceauth/mock/src/face_auth_algo_impl.cpp diff --git a/services/faceauth/mock/src/face_auth_ca.cpp b/service/faceauth/mock/src/face_auth_ca.cpp similarity index 100% rename from services/faceauth/mock/src/face_auth_ca.cpp rename to service/faceauth/mock/src/face_auth_ca.cpp diff --git a/services/faceauth/src/face_auth_algo_dispatcher.cpp b/service/faceauth/src/face_auth_algo_dispatcher.cpp similarity index 100% rename from services/faceauth/src/face_auth_algo_dispatcher.cpp rename to service/faceauth/src/face_auth_algo_dispatcher.cpp diff --git a/service/faceauth/src/face_auth_bms_adapter.cpp b/service/faceauth/src/face_auth_bms_adapter.cpp new file mode 100644 index 0000000..ff98bbd --- /dev/null +++ b/service/faceauth/src/face_auth_bms_adapter.cpp @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + +#include "face_auth_bms_adapter.h" +#include "constant.h" +#include "ipc_skeleton.h" +#include "if_system_ability_manager.h" +#include "iservice_registry.h" +#include "faceauth_log_wrapper.h" +#include "sa_mgr_client.h" + +namespace OHOS { +namespace UserIAM { +namespace FaceAuth { +std::mutex FaceAuthBmsAdapter::mutex_; +std::shared_ptr FaceAuthBmsAdapter::instance_ = nullptr; +std::shared_ptr FaceAuthBmsAdapter::GetInstance() +{ + if (instance_ == nullptr) { + std::lock_guard lock_l(mutex_); + if (instance_ == nullptr) { + instance_ = std::make_shared(); + } + } + return instance_; +} +sptr FaceAuthBmsAdapter::GetBundleManager() +{ + auto bundleObj = OHOS::DelayedSingleton::GetInstance()->GetSystemAbility( + Constant::BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); + if (bundleObj == nullptr) { + FACEAUTH_LABEL_LOGE("failed to get bundle manager service."); + return nullptr; + } + iBundleManager_ = iface_cast(bundleObj); + if (iBundleManager_ == nullptr) { + FACEAUTH_LABEL_LOGI("iBundleMgr is null"); + return nullptr; + } + return iBundleManager_; +} + +std::string FaceAuthBmsAdapter::GetCallingBundleName() +{ + FACEAUTH_LABEL_LOGI("FaceAuthBmsAdapter GetCallingBundleName start"); + int32_t uid = IPCSkeleton::GetCallingUid(); + FACEAUTH_LABEL_LOGI("uid is %{public}d", uid); + if (iBundleManager_ == nullptr) { + iBundleManager_ = GetBundleManager(); + } + std::string bundleName; + bool result = iBundleManager_->GetBundleNameForUid(uid, bundleName); + FACEAUTH_LABEL_LOGI("bundleName is %{public}s", bundleName.c_str()); + FACEAUTH_LABEL_LOGI("result is %{public}d", result); + if (!result) { + FACEAUTH_LABEL_LOGE("cannot get bundle name by uid %{public}d", uid); + return ""; + } + FACEAUTH_LABEL_LOGI("FaceAuthBmsAdapter GetCallingBundleName end"); + return bundleName; +} +} // namespace FaceAuth +} // namespace UserIAM +} // namespace OHOS diff --git a/services/faceauth/src/face_auth_camera.cpp b/service/faceauth/src/face_auth_camera.cpp similarity index 100% rename from services/faceauth/src/face_auth_camera.cpp rename to service/faceauth/src/face_auth_camera.cpp diff --git a/services/faceauth/src/face_auth_camera_buffer_listener.cpp b/service/faceauth/src/face_auth_camera_buffer_listener.cpp similarity index 100% rename from services/faceauth/src/face_auth_camera_buffer_listener.cpp rename to service/faceauth/src/face_auth_camera_buffer_listener.cpp diff --git a/services/faceauth/src/face_auth_event.cpp b/service/faceauth/src/face_auth_event.cpp similarity index 100% rename from services/faceauth/src/face_auth_event.cpp rename to service/faceauth/src/face_auth_event.cpp diff --git a/services/faceauth/src/face_auth_event_handler.cpp b/service/faceauth/src/face_auth_event_handler.cpp similarity index 100% rename from services/faceauth/src/face_auth_event_handler.cpp rename to service/faceauth/src/face_auth_event_handler.cpp diff --git a/services/faceauth/src/face_auth_manager.cpp b/service/faceauth/src/face_auth_manager.cpp similarity index 91% rename from services/faceauth/src/face_auth_manager.cpp rename to service/faceauth/src/face_auth_manager.cpp index d6f71d6..f53175b 100755 --- a/services/faceauth/src/face_auth_manager.cpp +++ b/service/faceauth/src/face_auth_manager.cpp @@ -28,6 +28,7 @@ #include "iservice_registry.h" #include "ipc_skeleton.h" #include "sa_mgr_client.h" +#include "face_auth_bms_adapter.h" using namespace OHOS::AAFwk; @@ -58,8 +59,8 @@ FaceAuthManager::~FaceAuthManager() int32_t FaceAuthManager::Enroll(const EnrollParam ¶m, const sptr &callback) { - FACEAUTH_LABEL_LOGI( - "reqId: xxxx%04llu, challenge: %{private}lld,faceId: %{private}d", param.reqId, param.challenge, param.faceId); + FACEAUTH_LABEL_LOGI("reqId: xxxx%04llu, challenge: %{private}lld,faceId: %{private}d", param.reqId, param.challenge, + param.faceId); if (CheckEnrollParam(param, callback) != FA_RET_OK) { return FA_RET_ERROR; } @@ -122,10 +123,7 @@ int32_t FaceAuthManager::Authenticate(const AuthParam ¶m, const sptrGetCallingBundleName(); if (bundleName == "") { FACEAUTH_LABEL_LOGE("FaceAuthManager::Init GetCallingBundleName Fail!"); return FA_RET_ERROR; @@ -200,7 +198,7 @@ int32_t FaceAuthManager::Init() int32_t FaceAuthManager::Release() { FACEAUTH_LABEL_LOGI("FaceAuthManager::Release"); - std::string bundleName = GetCallingBundleName(); + std::string bundleName = FaceAuthBmsAdapter::GetInstance()->GetCallingBundleName(); if (bundleName == "") { FACEAUTH_LABEL_LOGE("FaceAuthManager::Release GetCallingBundleName Fail!"); return FA_RET_ERROR; @@ -218,9 +216,7 @@ void FaceAuthManager::HandleCallEnroll(const EnrollParam ¶m, const sptrAddTask( - [&promiseobj, &producer]() { promiseobj.set_value(FaceAuthCamera::GetInstance()->OpenCamera(producer)); }); + FaceAuthThreadPool::GetInstance()->AddTask([&promiseobj, &producer]() { + promiseobj.set_value(FaceAuthCamera::GetInstance()->OpenCamera(producer)); + }); Prepare(HW_EXEC_TYPE_ENROOL); CallBackParam cbParam; cbParam.reqId = param.reqId; @@ -271,10 +268,7 @@ void FaceAuthManager::HandleCallAuthenticate(const AuthParam ¶m, const sptr< { FACEAUTH_LABEL_LOGI("reqId: xxxx%04llu, flags: %{public}d, challenge: %{private}lld, " "faceId: %{private}d", - param.reqId, - param.flags, - param.challenge, - param.faceId); + param.reqId, param.flags, param.challenge, param.faceId); if (CheckAuthParam(param, callback) != FA_RET_OK) { return; @@ -285,8 +279,9 @@ void FaceAuthManager::HandleCallAuthenticate(const AuthParam ¶m, const sptr< std::future futureobj = promiseobj.get_future(); FaceReqType reqType = CreateAuthReqInfo(param.reqId, param.flags); FACEAUTH_LABEL_LOGI("FaceAuthCurTaskNum is %{public}d ", FaceAuthThreadPool::GetInstance()->GetCurTaskNum()); - FaceAuthThreadPool::GetInstance()->AddTask( - [&promiseobj, &producer]() { promiseobj.set_value(FaceAuthCamera::GetInstance()->OpenCamera(producer)); }); + FaceAuthThreadPool::GetInstance()->AddTask([&promiseobj, &producer]() { + promiseobj.set_value(FaceAuthCamera::GetInstance()->OpenCamera(producer)); + }); Prepare(HW_EXEC_TYPE_UNLOCK); SetChallenge(param.challenge); CallBackParam cbParam; @@ -332,8 +327,8 @@ void FaceAuthManager::HandleCallRemove(const RemoveParam ¶m, const sptr token, const sptr &callback) +void FaceAuthManager::ExecuteEnrollEvent(uint64_t reqId, int32_t faceId, std::vector token, + const sptr &callback) { int32_t authErrorCode; FICode code; @@ -467,8 +462,8 @@ void FaceAuthManager::ExecuteAuthEvent(const uint64_t reqId, const int32_t flags return; } -void FaceAuthManager::HandleExceptionCallback( - const FIResultType type, CallBackParam cbParam, const int32_t resetValue, const sptr &callback) +void FaceAuthManager::HandleExceptionCallback(const FIResultType type, CallBackParam cbParam, const int32_t resetValue, + const sptr &callback) { FaceReqType reqType; reqType.reqId = cbParam.reqId; @@ -496,7 +491,9 @@ bool FaceAuthManager::CheckLockOutMode(const uint64_t reqId, const sptr= AUTH_FAIL_MAX_TIMES) { isLockOutMode_ = true; FACEAUTH_LABEL_LOGI("FaceAuthCurTaskNum is %{public}d ", FaceAuthThreadPool::GetInstance()->GetCurTaskNum()); - FaceAuthThreadPool::GetInstance()->AddTask([this]() { StartTimer(); }); + FaceAuthThreadPool::GetInstance()->AddTask([this]() { + StartTimer(); + }); CallBackParam cbParam; cbParam.reqId = reqId; cbParam.code = CODE_CALLBACK_RESULT; @@ -644,14 +641,11 @@ int32_t FaceAuthManager::Remove(const RemoveParam ¶m, const sptr return FA_RET_OK; } -void FaceAuthManager::SendCallback( - const FIResultType type, const CallBackParam cbParam, const sptr &callback) +void FaceAuthManager::SendCallback(const FIResultType type, const CallBackParam cbParam, + const sptr &callback) { - FACEAUTH_LABEL_LOGI("type: %{public}d, reqId: xxxx%04llu, code: %{public}d, errorCode: %{public}d", - type, - cbParam.reqId, - cbParam.code, - cbParam.errorCode); + FACEAUTH_LABEL_LOGI("type: %{public}d, reqId: xxxx%04llu, code: %{public}d, errorCode: %{public}d", type, + cbParam.reqId, cbParam.code, cbParam.errorCode); Bundle bundleInfo; for (std::vector::const_iterator iter = cbParam.authtoken.begin(); iter != cbParam.authtoken.end(); ++iter) { @@ -743,36 +737,6 @@ int32_t FaceAuthManager::SendCameraImage(std::unique_ptr img) return FA_RET_OK; } -std::string FaceAuthManager::GetCallingBundleName() -{ - FACEAUTH_LABEL_LOGI("FaceAuthManager GetCallingBundleName start"); - int32_t uid = IPCSkeleton::GetCallingUid(); - FACEAUTH_LABEL_LOGI("uid is %{public}d", uid); - if (iBundleMgr_ == nullptr) { - auto bundleObj = - OHOS::DelayedSingleton::GetInstance()->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); - if (bundleObj == nullptr) { - FACEAUTH_LABEL_LOGE("failed to get bundle manager service."); - return nullptr; - } - iBundleMgr_ = iface_cast(bundleObj); - if (iBundleMgr_ == nullptr) { - FACEAUTH_LABEL_LOGI("iBundleMgr is null"); - return ""; - } - } - std::string bundleName; - bool result = iBundleMgr_->GetBundleNameForUid(uid, bundleName); - FACEAUTH_LABEL_LOGI("bundleName is %{public}s", bundleName.c_str()); - FACEAUTH_LABEL_LOGI("result is %{public}d", result); - if (!result) { - FACEAUTH_LABEL_LOGE("cannot get bundle name by uid %{public}d", uid); - return ""; - } - FACEAUTH_LABEL_LOGI("FaceAuthManager GetCallingBundleName end"); - return bundleName; -} - std::list FaceAuthManager::GetEnrolledFaceIDs(const int32_t userId) { std::list faceInfolist; @@ -787,10 +751,8 @@ std::list FaceAuthManager::GetEnrolledFaceIDs(const int32_t userId) bool FaceAuthManager::CheckFaceIDValidity(int32_t faceId) { std::list enrolled_faceids = GetEnrolledFaceIDs(USER_ID_DEFAULT); - FACEAUTH_LABEL_LOGI("faceId: %{public}d,enrolled_faceids size: %{public}d,enrolled_faceids[0]:%{public}d", - faceId, - enrolled_faceids.front(), - enrolled_faceids.size()); + FACEAUTH_LABEL_LOGI("faceId: %{public}d,enrolled_faceids size: %{public}d,enrolled_faceids[0]:%{public}d", faceId, + enrolled_faceids.front(), enrolled_faceids.size()); if (std::find(enrolled_faceids.begin(), enrolled_faceids.end(), faceId) != enrolled_faceids.end()) { return true; } @@ -867,12 +829,12 @@ uint32_t FaceAuthManager::GenerateEventId() t.tv_sec = 0; t.tv_nsec = 0; clock_gettime(CLOCK_REALTIME, &t); - int64_t elapsedTime {((t.tv_sec) * SEC_TO_NANOSEC + t.tv_nsec)}; + int64_t elapsedTime { ((t.tv_sec) * SEC_TO_NANOSEC + t.tv_nsec) }; size_t elapsedHash = std::hash()(std::to_string(elapsedTime)); uint32_t eventId = static_cast(elapsedHash); FACEAUTH_LABEL_LOGI("GenerateEventId generate eventId %{public}u", eventId); return eventId; } -} // namespace FaceAuth -} // namespace UserIAM -} // namespace OHOS \ No newline at end of file +} // namespace FaceAuth +} // namespace UserIAM +} // namespace OHOS \ No newline at end of file diff --git a/services/faceauth/src/face_auth_req.cpp b/service/faceauth/src/face_auth_req.cpp similarity index 100% rename from services/faceauth/src/face_auth_req.cpp rename to service/faceauth/src/face_auth_req.cpp diff --git a/services/faceauth/src/face_auth_service.cpp b/service/faceauth/src/face_auth_service.cpp similarity index 100% rename from services/faceauth/src/face_auth_service.cpp rename to service/faceauth/src/face_auth_service.cpp diff --git a/services/faceauth/src/face_auth_thread_pool.cpp b/service/faceauth/src/face_auth_thread_pool.cpp similarity index 100% rename from services/faceauth/src/face_auth_thread_pool.cpp rename to service/faceauth/src/face_auth_thread_pool.cpp diff --git a/services/faceauth/test/BUILD.gn b/service/faceauth/test/BUILD.gn similarity index 100% rename from services/faceauth/test/BUILD.gn rename to service/faceauth/test/BUILD.gn diff --git a/services/faceauth/test/mock/include/i_bundle_mgr_mock.h b/service/faceauth/test/mock/include/i_bundle_mgr_mock.h similarity index 100% rename from services/faceauth/test/mock/include/i_bundle_mgr_mock.h rename to service/faceauth/test/mock/include/i_bundle_mgr_mock.h diff --git a/services/faceauth/test/mock/include/mock_bundle_mgr.h b/service/faceauth/test/mock/include/mock_bundle_mgr.h similarity index 100% rename from services/faceauth/test/mock/include/mock_bundle_mgr.h rename to service/faceauth/test/mock/include/mock_bundle_mgr.h diff --git a/service/faceauth/test/mock/src/mock_bms_adapter.cpp b/service/faceauth/test/mock/src/mock_bms_adapter.cpp new file mode 100644 index 0000000..d1488cf --- /dev/null +++ b/service/faceauth/test/mock/src/mock_bms_adapter.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + +#include "face_auth_bms_adapter.h" +#include "faceauth_log_wrapper.h" + +namespace OHOS { +namespace UserIAM { +namespace FaceAuth { +std::mutex FaceAuthBmsAdapter::mutex_; +std::shared_ptr FaceAuthBmsAdapter::instance_ = nullptr; +std::shared_ptr FaceAuthBmsAdapter::GetInstance() +{ + if (instance_ == nullptr) { + std::lock_guard lock_l(mutex_); + if (instance_ == nullptr) { + instance_ = std::make_shared(); + } + } + return instance_; +} +std::string FaceAuthBmsAdapter::GetCallingBundleName() +{ + FACEAUTH_LABEL_LOGI("MOCK FaceAuthBmsAdapter::GetCallingBundleName bundle_name"); + return "bundle_name"; +} +} // namespace FaceAuth +} // namespace UserIAM +} // namespace OHOS diff --git a/services/faceauth/test/mock/src/mock_bundle_mgr.cpp b/service/faceauth/test/mock/src/mock_bundle_mgr.cpp similarity index 100% rename from services/faceauth/test/mock/src/mock_bundle_mgr.cpp rename to service/faceauth/test/mock/src/mock_bundle_mgr.cpp diff --git a/services/faceauth/test/unittest/face_auth_manager_test/BUILD.gn b/service/faceauth/test/unittest/face_auth_manager_test/BUILD.gn similarity index 97% rename from services/faceauth/test/unittest/face_auth_manager_test/BUILD.gn rename to service/faceauth/test/unittest/face_auth_manager_test/BUILD.gn index 2228d2a..2673a21 100644 --- a/services/faceauth/test/unittest/face_auth_manager_test/BUILD.gn +++ b/service/faceauth/test/unittest/face_auth_manager_test/BUILD.gn @@ -24,6 +24,7 @@ ohos_unittest("face_auth_manager_auth_test") { "src/face_auth_manager_auth_test.cpp", "${face_auth_services_path}/src/face_auth_service.cpp", "../../mock/src/mock_bundle_mgr.cpp", + "../../mock/src/mock_bms_adapter.cpp", ] configs = [ @@ -69,6 +70,7 @@ ohos_unittest("face_auth_manager_enroll_test") { "src/face_auth_manager_enroll_test.cpp", "${face_auth_services_path}/src/face_auth_service.cpp", "../../mock/src/mock_bundle_mgr.cpp", + "../../mock/src/mock_bms_adapter.cpp", ] configs = [ @@ -115,6 +117,7 @@ ohos_unittest("face_auth_manager_scenario_test") { "src/face_auth_manager_scenario_test.cpp", "${face_auth_services_path}/src/face_auth_service.cpp", "../../mock/src/mock_bundle_mgr.cpp", + "../../mock/src/mock_bms_adapter.cpp", ] configs = [ diff --git a/services/faceauth/test/unittest/face_auth_manager_test/include/face_auth_manager_auth_test.h b/service/faceauth/test/unittest/face_auth_manager_test/include/face_auth_manager_auth_test.h similarity index 100% rename from services/faceauth/test/unittest/face_auth_manager_test/include/face_auth_manager_auth_test.h rename to service/faceauth/test/unittest/face_auth_manager_test/include/face_auth_manager_auth_test.h diff --git a/services/faceauth/test/unittest/face_auth_manager_test/include/face_auth_manager_enroll_test.h b/service/faceauth/test/unittest/face_auth_manager_test/include/face_auth_manager_enroll_test.h similarity index 100% rename from services/faceauth/test/unittest/face_auth_manager_test/include/face_auth_manager_enroll_test.h rename to service/faceauth/test/unittest/face_auth_manager_test/include/face_auth_manager_enroll_test.h diff --git a/services/faceauth/test/unittest/face_auth_manager_test/include/face_auth_manager_scenario_test.h b/service/faceauth/test/unittest/face_auth_manager_test/include/face_auth_manager_scenario_test.h similarity index 100% rename from services/faceauth/test/unittest/face_auth_manager_test/include/face_auth_manager_scenario_test.h rename to service/faceauth/test/unittest/face_auth_manager_test/include/face_auth_manager_scenario_test.h diff --git a/services/faceauth/test/unittest/face_auth_manager_test/src/face_auth_manager_auth_test.cpp b/service/faceauth/test/unittest/face_auth_manager_test/src/face_auth_manager_auth_test.cpp similarity index 100% rename from services/faceauth/test/unittest/face_auth_manager_test/src/face_auth_manager_auth_test.cpp rename to service/faceauth/test/unittest/face_auth_manager_test/src/face_auth_manager_auth_test.cpp diff --git a/services/faceauth/test/unittest/face_auth_manager_test/src/face_auth_manager_enroll_test.cpp b/service/faceauth/test/unittest/face_auth_manager_test/src/face_auth_manager_enroll_test.cpp similarity index 100% rename from services/faceauth/test/unittest/face_auth_manager_test/src/face_auth_manager_enroll_test.cpp rename to service/faceauth/test/unittest/face_auth_manager_test/src/face_auth_manager_enroll_test.cpp diff --git a/services/faceauth/test/unittest/face_auth_manager_test/src/face_auth_manager_scenario_test.cpp b/service/faceauth/test/unittest/face_auth_manager_test/src/face_auth_manager_scenario_test.cpp similarity index 100% rename from services/faceauth/test/unittest/face_auth_manager_test/src/face_auth_manager_scenario_test.cpp rename to service/faceauth/test/unittest/face_auth_manager_test/src/face_auth_manager_scenario_test.cpp diff --git a/services/faceauth/test/mock/src/mock_distributed_permission_kit.cpp b/services/faceauth/test/mock/src/mock_distributed_permission_kit.cpp deleted file mode 100644 index b733a55..0000000 --- a/services/faceauth/test/mock/src/mock_distributed_permission_kit.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * 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. - */ - -#include "distributed_permission_kit.h" - -namespace OHOS { -namespace Security { -namespace Permission { -int32_t DistributedPermissionKit::CheckPermission(const std::string &permissionName, const std::string &appIdInfo) -{ - return 0; -} -} // namespace Permission -} // namespace Security -} // namespace OHOS \ No newline at end of file diff --git a/ux/faceenroll/.gitattributes b/ui/faceenroll/.gitattributes similarity index 100% rename from ux/faceenroll/.gitattributes rename to ui/faceenroll/.gitattributes diff --git a/ux/faceenroll/.gitignore b/ui/faceenroll/.gitignore similarity index 100% rename from ux/faceenroll/.gitignore rename to ui/faceenroll/.gitignore diff --git a/ux/faceenroll/build.gradle b/ui/faceenroll/build.gradle similarity index 100% rename from ux/faceenroll/build.gradle rename to ui/faceenroll/build.gradle diff --git a/ux/faceenroll/common/src/main/config.json b/ui/faceenroll/common/src/main/config.json similarity index 100% rename from ux/faceenroll/common/src/main/config.json rename to ui/faceenroll/common/src/main/config.json diff --git a/ux/faceenroll/common/src/main/ets/default/Log.ets b/ui/faceenroll/common/src/main/ets/default/Log.ets similarity index 100% rename from ux/faceenroll/common/src/main/ets/default/Log.ets rename to ui/faceenroll/common/src/main/ets/default/Log.ets diff --git a/ux/faceenroll/common/src/main/resources/base/element/string.json b/ui/faceenroll/common/src/main/resources/base/element/string.json similarity index 100% rename from ux/faceenroll/common/src/main/resources/base/element/string.json rename to ui/faceenroll/common/src/main/resources/base/element/string.json diff --git a/ux/faceenroll/gradle.properties b/ui/faceenroll/gradle.properties similarity index 100% rename from ux/faceenroll/gradle.properties rename to ui/faceenroll/gradle.properties diff --git a/ux/faceenroll/gradlew b/ui/faceenroll/gradlew similarity index 100% rename from ux/faceenroll/gradlew rename to ui/faceenroll/gradlew diff --git a/ux/faceenroll/gradlew.bat b/ui/faceenroll/gradlew.bat similarity index 100% rename from ux/faceenroll/gradlew.bat rename to ui/faceenroll/gradlew.bat diff --git a/ux/faceenroll/product/phone/build.gradle b/ui/faceenroll/product/phone/build.gradle similarity index 100% rename from ux/faceenroll/product/phone/build.gradle rename to ui/faceenroll/product/phone/build.gradle diff --git a/ux/faceenroll/product/phone/src/main/config.json b/ui/faceenroll/product/phone/src/main/config.json similarity index 100% rename from ux/faceenroll/product/phone/src/main/config.json rename to ui/faceenroll/product/phone/src/main/config.json diff --git a/ux/faceenroll/product/phone/src/main/ets/default/app.ets b/ui/faceenroll/product/phone/src/main/ets/default/app.ets similarity index 100% rename from ux/faceenroll/product/phone/src/main/ets/default/app.ets rename to ui/faceenroll/product/phone/src/main/ets/default/app.ets diff --git a/ux/faceenroll/product/phone/src/main/ets/default/common/constant.ets b/ui/faceenroll/product/phone/src/main/ets/default/common/constant.ets similarity index 100% rename from ux/faceenroll/product/phone/src/main/ets/default/common/constant.ets rename to ui/faceenroll/product/phone/src/main/ets/default/common/constant.ets diff --git a/ux/faceenroll/product/phone/src/main/ets/default/model_2D.ets b/ui/faceenroll/product/phone/src/main/ets/default/model_2D.ets similarity index 100% rename from ux/faceenroll/product/phone/src/main/ets/default/model_2D.ets rename to ui/faceenroll/product/phone/src/main/ets/default/model_2D.ets diff --git a/ux/faceenroll/product/phone/src/main/ets/default/model_3D.ets b/ui/faceenroll/product/phone/src/main/ets/default/model_3D.ets similarity index 100% rename from ux/faceenroll/product/phone/src/main/ets/default/model_3D.ets rename to ui/faceenroll/product/phone/src/main/ets/default/model_3D.ets diff --git a/ux/faceenroll/product/phone/src/main/ets/default/pages/aperture.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/aperture.ets similarity index 100% rename from ux/faceenroll/product/phone/src/main/ets/default/pages/aperture.ets rename to ui/faceenroll/product/phone/src/main/ets/default/pages/aperture.ets diff --git a/ux/faceenroll/product/phone/src/main/ets/default/pages/declare.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/declare.ets similarity index 100% rename from ux/faceenroll/product/phone/src/main/ets/default/pages/declare.ets rename to ui/faceenroll/product/phone/src/main/ets/default/pages/declare.ets diff --git a/ux/faceenroll/product/phone/src/main/ets/default/pages/enroll_2D.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/enroll_2D.ets similarity index 100% rename from ux/faceenroll/product/phone/src/main/ets/default/pages/enroll_2D.ets rename to ui/faceenroll/product/phone/src/main/ets/default/pages/enroll_2D.ets diff --git a/ux/faceenroll/product/phone/src/main/ets/default/pages/enroll_3D.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/enroll_3D.ets similarity index 100% rename from ux/faceenroll/product/phone/src/main/ets/default/pages/enroll_3D.ets rename to ui/faceenroll/product/phone/src/main/ets/default/pages/enroll_3D.ets diff --git a/ux/faceenroll/product/phone/src/main/ets/default/pages/index.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/index.ets similarity index 100% rename from ux/faceenroll/product/phone/src/main/ets/default/pages/index.ets rename to ui/faceenroll/product/phone/src/main/ets/default/pages/index.ets diff --git a/ux/faceenroll/product/phone/src/main/ets/default/pages/startViews_2D.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/startViews_2D.ets similarity index 100% rename from ux/faceenroll/product/phone/src/main/ets/default/pages/startViews_2D.ets rename to ui/faceenroll/product/phone/src/main/ets/default/pages/startViews_2D.ets diff --git a/ux/faceenroll/product/phone/src/main/ets/default/pages/startViews_3D.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/startViews_3D.ets similarity index 100% rename from ux/faceenroll/product/phone/src/main/ets/default/pages/startViews_3D.ets rename to ui/faceenroll/product/phone/src/main/ets/default/pages/startViews_3D.ets diff --git a/ux/faceenroll/product/phone/src/main/ets/default/pages/success.ets b/ui/faceenroll/product/phone/src/main/ets/default/pages/success.ets similarity index 100% rename from ux/faceenroll/product/phone/src/main/ets/default/pages/success.ets rename to ui/faceenroll/product/phone/src/main/ets/default/pages/success.ets diff --git a/ux/faceenroll/product/phone/src/main/resources/base/element/color.json b/ui/faceenroll/product/phone/src/main/resources/base/element/color.json similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/element/color.json rename to ui/faceenroll/product/phone/src/main/resources/base/element/color.json diff --git a/ux/faceenroll/product/phone/src/main/resources/base/element/float.json b/ui/faceenroll/product/phone/src/main/resources/base/element/float.json similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/element/float.json rename to ui/faceenroll/product/phone/src/main/resources/base/element/float.json diff --git a/ux/faceenroll/product/phone/src/main/resources/base/element/string.json b/ui/faceenroll/product/phone/src/main/resources/base/element/string.json similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/element/string.json rename to ui/faceenroll/product/phone/src/main/resources/base/element/string.json diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/aperture1.png b/ui/faceenroll/product/phone/src/main/resources/base/media/aperture1.png similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/aperture1.png rename to ui/faceenroll/product/phone/src/main/resources/base/media/aperture1.png diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/aperture2.png b/ui/faceenroll/product/phone/src/main/resources/base/media/aperture2.png similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/aperture2.png rename to ui/faceenroll/product/phone/src/main/resources/base/media/aperture2.png diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/aperture3.png b/ui/faceenroll/product/phone/src/main/resources/base/media/aperture3.png similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/aperture3.png rename to ui/faceenroll/product/phone/src/main/resources/base/media/aperture3.png diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/aperture4.png b/ui/faceenroll/product/phone/src/main/resources/base/media/aperture4.png similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/aperture4.png rename to ui/faceenroll/product/phone/src/main/resources/base/media/aperture4.png diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/aperture5.png b/ui/faceenroll/product/phone/src/main/resources/base/media/aperture5.png similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/aperture5.png rename to ui/faceenroll/product/phone/src/main/resources/base/media/aperture5.png diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/back.png b/ui/faceenroll/product/phone/src/main/resources/base/media/back.png similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/back.png rename to ui/faceenroll/product/phone/src/main/resources/base/media/back.png diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/icon.png b/ui/faceenroll/product/phone/src/main/resources/base/media/icon.png similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/icon.png rename to ui/faceenroll/product/phone/src/main/resources/base/media/icon.png diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/image.jpg b/ui/faceenroll/product/phone/src/main/resources/base/media/image.jpg similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/image.jpg rename to ui/faceenroll/product/phone/src/main/resources/base/media/image.jpg diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/shelter.png b/ui/faceenroll/product/phone/src/main/resources/base/media/shelter.png similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/shelter.png rename to ui/faceenroll/product/phone/src/main/resources/base/media/shelter.png diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/startImage1_3D.png b/ui/faceenroll/product/phone/src/main/resources/base/media/startImage1_3D.png similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/startImage1_3D.png rename to ui/faceenroll/product/phone/src/main/resources/base/media/startImage1_3D.png diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/startImage2_3D.png b/ui/faceenroll/product/phone/src/main/resources/base/media/startImage2_3D.png similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/startImage2_3D.png rename to ui/faceenroll/product/phone/src/main/resources/base/media/startImage2_3D.png diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/startImage_2D.png b/ui/faceenroll/product/phone/src/main/resources/base/media/startImage_2D.png similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/startImage_2D.png rename to ui/faceenroll/product/phone/src/main/resources/base/media/startImage_2D.png diff --git a/ux/faceenroll/product/phone/src/main/resources/base/media/success.png b/ui/faceenroll/product/phone/src/main/resources/base/media/success.png similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/base/media/success.png rename to ui/faceenroll/product/phone/src/main/resources/base/media/success.png diff --git a/ux/faceenroll/product/phone/src/main/resources/en_AS/element/string.json b/ui/faceenroll/product/phone/src/main/resources/en_AS/element/string.json similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/en_AS/element/string.json rename to ui/faceenroll/product/phone/src/main/resources/en_AS/element/string.json diff --git a/ux/faceenroll/product/phone/src/main/resources/zh_CN/element/string.json b/ui/faceenroll/product/phone/src/main/resources/zh_CN/element/string.json similarity index 100% rename from ux/faceenroll/product/phone/src/main/resources/zh_CN/element/string.json rename to ui/faceenroll/product/phone/src/main/resources/zh_CN/element/string.json diff --git a/ux/faceenroll/settings.gradle b/ui/faceenroll/settings.gradle similarity index 100% rename from ux/faceenroll/settings.gradle rename to ui/faceenroll/settings.gradle diff --git a/useriam.gni b/useriam.gni index f1ddd8e..7eb80e0 100755 --- a/useriam.gni +++ b/useriam.gni @@ -15,7 +15,7 @@ useriam_path = "//base/useriam/faceauth" useriam_common_path = "${useriam_path}/common" face_auth_innerkits_path = "${useriam_path}/interfaces/innerkits/faceauth" useriam_auth_kits_path = "${useriam_path}/interfaces/kits" -face_auth_services_path = "${useriam_path}/services/faceauth" +face_auth_services_path = "${useriam_path}/service/faceauth" useriam_sa_path="${useriam_path}/sa_profile" aafwk_path = "//foundation/aafwk/standard" appexecfwk_path = "//foundation/appexecfwk/standard"