diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/sa_profile/942.xml b/sa_profile/942.xml old mode 100644 new mode 100755 diff --git a/sa_profile/face_auth_service.cfg b/sa_profile/face_auth_service.cfg index 28b51af6e99c290c72b32a1a3c689ee42caef1a1..8dabe669abcf768ee1876eb3aa26c93e4342813a 100644 --- a/sa_profile/face_auth_service.cfg +++ b/sa_profile/face_auth_service.cfg @@ -1,17 +1,9 @@ { - "jobs" : [{ - "name" : "late-fs", - "cmds" : [ - "start face_service" - ] - } - ], "services" : [{ "name" : "face_service", "path" : ["/system/bin/sa_main", "/system/profile/face_service.xml"], - "importance" : -20, "uid" : "system", - "gid" : ["system"], + "gid" : ["system", "shell"], "secon" : "u:r:face_service:s0" } ] diff --git a/sa_profile/face_auth_service.rc b/sa_profile/face_auth_service.rc old mode 100644 new mode 100755 diff --git a/services/faceauth/include/face_auth_event_handler.h b/services/faceauth/include/face_auth_event_handler.h old mode 100644 new mode 100755 diff --git a/services/faceauth/include/face_auth_service.h b/services/faceauth/include/face_auth_service.h old mode 100644 new mode 100755 diff --git a/services/faceauth/src/face_auth_camera.cpp b/services/faceauth/src/face_auth_camera.cpp index 9c1e030e54c801f9e3baddbc0f735f2c30e70cab..417daec1caecd5dde7ecf9304054353b61189710 100644 --- a/services/faceauth/src/face_auth_camera.cpp +++ b/services/faceauth/src/face_auth_camera.cpp @@ -96,6 +96,8 @@ int32_t FaceAuthCamera::CreateCamera(sptr surface) int32_t intResult = PrepareCamera(surface); if (intResult != 0) { FACEAUTH_HILOGE(MODULE_SERVICE, "Prepare Camera Failed"); + camInput_->Release(); + camInput_ = nullptr; return FA_RET_ERROR; } FACEAUTH_HILOGI(MODULE_SERVICE, "Create Camera end."); @@ -187,7 +189,6 @@ void FaceAuthCamera::Stop() void FaceAuthCamera::Release() { FACEAUTH_HILOGI(MODULE_SERVICE, "FaceAuthCamera::Release Start."); - camInput_ = nullptr; if (previewOutput_ != nullptr) { ((sptr &) previewOutput_)->Release(); FACEAUTH_HILOGI(MODULE_SERVICE, "FaceAuthCamera::previewOutput_ Release End."); @@ -205,6 +206,10 @@ void FaceAuthCamera::Release() capSession_->Release(); capSession_ = nullptr; } + if (camInput_ != nullptr) { + camInput_->Release(); + camInput_ = nullptr; + } if (instance_ != nullptr) { instance_.reset(); } diff --git a/services/faceauth/src/face_auth_event_handler.cpp b/services/faceauth/src/face_auth_event_handler.cpp old mode 100644 new mode 100755 diff --git a/services/faceauth/src/face_auth_manager.cpp b/services/faceauth/src/face_auth_manager.cpp old mode 100644 new mode 100755 index 638e8d1da2972806e7d0998db074cfd187f3ddeb..df951e2b45824db5904b1e800685cd2aeda29b33 --- a/services/faceauth/src/face_auth_manager.cpp +++ b/services/faceauth/src/face_auth_manager.cpp @@ -47,7 +47,7 @@ std::shared_ptr FaceAuthManager::GetInstance() void CheckSystemAbility() { - const int CHECK_TIMES = 3; + const int CHECK_TIMES = 20; const int SLEEP_TIME = 1; sptr sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (sam == nullptr) { @@ -384,17 +384,13 @@ FIRetCode FaceAuthManager::OperForAlgorithm(uint64_t scheduleID) FACEAUTH_HILOGI(MODULE_SERVICE, "faceAuthCA is null."); return FI_RC_INVALID_ARGUMENT; } - int32_t retCode = 0; - std::vector retCoauthMsg; - std::vector m_msg; - std::shared_ptr msgInstance = std::make_shared(m_msg); - if (msgInstance == nullptr) { - return FI_RC_INVALID_ARGUMENT; - } + while (1) { + int32_t retCode = 0; + std::vector retCoauthMsg; faceAuthCA->GetAlgorithmState(retCode, retCoauthMsg); FACEAUTH_HILOGI(MODULE_SERVICE, "receive new co auth message."); - std::shared_ptr msg(msgInstance->FromUint8Array(retCoauthMsg)); + std::shared_ptr msg = std::make_shared(retCoauthMsg); if (msg != nullptr) { SendData(scheduleID, 0, TYPE_ALL_IN_ONE, TYPE_CO_AUTH, msg); } @@ -502,6 +498,7 @@ void FaceAuthManager::Finish(uint64_t scheduleId, { if (executorMessenger_ != nullptr) { executorMessenger_->Finish(scheduleId, srcType, resultCode, finalResult); + FACEAUTH_HILOGI(MODULE_SERVICE, "executorMessenger_ finish called."); } else { FACEAUTH_HILOGI(MODULE_SERVICE, "executorMessenger_ is null."); } diff --git a/services/faceauth/src/face_auth_service.cpp b/services/faceauth/src/face_auth_service.cpp old mode 100644 new mode 100755 diff --git a/services/temp/include/buffer.h b/services/temp/include/buffer.h index 49113ad84dbfbc64f92ffab24a74de25ba81c89c..1684b148cfa885191e381c9b88d9e1e8b335960b 100644 --- a/services/temp/include/buffer.h +++ b/services/temp/include/buffer.h @@ -34,7 +34,6 @@ ResultCode InitBuffer(Buffer *buffer, const uint8_t *buf, const uint32_t bufSize void DestoryBuffer(Buffer *buffer); Buffer *CopyBuffer(const Buffer *buffer); bool CompareBuffer(const Buffer *buffer1, const Buffer *buffer2); -Buffer *CreateBufferByData(const uint8_t *data, const uint32_t dataSize); ResultCode GetBufferData(const Buffer *buffer, uint8_t *data, uint32_t *dataSize); bool CheckBufferWithSize(const Buffer *buffer, const uint32_t size); } // namespace FaceAuth diff --git a/services/temp/src/buffer.cpp b/services/temp/src/buffer.cpp index 52e9676ea4392027a72be5a1f6d9f4c429e8c21e..925271ecf98e2c14cdf2e78b51a65fdcab67cedc 100644 --- a/services/temp/src/buffer.cpp +++ b/services/temp/src/buffer.cpp @@ -48,7 +48,7 @@ Buffer *CreateBuffer(const uint32_t size) return nullptr; } - Buffer *buffer = new Buffer; + Buffer *buffer = (Buffer *)malloc(sizeof(Buffer)); if (buffer == nullptr) { FACEAUTH_HILOGE(MODULE_SERVICE, "Get buffer struct error"); return nullptr; @@ -57,13 +57,13 @@ Buffer *CreateBuffer(const uint32_t size) buffer->buf = (uint8_t *)malloc(size); if (buffer->buf == nullptr) { FACEAUTH_HILOGE(MODULE_SERVICE, "Get buffer error"); - delete buffer; + free(buffer); return nullptr; } if (memset_s(buffer->buf, size, 0, size) != EOK) { - delete buffer->buf; - delete buffer; + free(buffer->buf); + free(buffer); return nullptr; } buffer->maxSize = size; @@ -72,37 +72,6 @@ Buffer *CreateBuffer(const uint32_t size) return buffer; } -Buffer *CreateBufferByData(const uint8_t *data, const uint32_t dataSize) -{ - if ((data == nullptr) || (dataSize == 0) || (dataSize > MAX_BUFFER_SIZE)) { - FACEAUTH_HILOGE(MODULE_SERVICE, "Bad param size:%u", dataSize); - return nullptr; - } - - Buffer *buffer = new Buffer; - if (buffer == nullptr) { - FACEAUTH_HILOGE(MODULE_SERVICE, "Get buffer struct error"); - return nullptr; - } - - buffer->buf = new uint8_t; - if (buffer->buf == nullptr) { - FACEAUTH_HILOGE(MODULE_SERVICE, "Get buffer error"); - delete buffer; - return nullptr; - } - - if (memcpy_s(buffer->buf, dataSize, data, dataSize) != EOK) { - FACEAUTH_HILOGE(MODULE_SERVICE, "Cpy buffer error"); - DestoryBuffer(buffer); - return nullptr; - } - buffer->maxSize = dataSize; - buffer->contentSize = dataSize; - - return buffer; -} - ResultCode InitBuffer(Buffer *buffer, const uint8_t *buf, const uint32_t bufSize) { if (!IsBufferValid(buffer) || (buf == nullptr) || (bufSize == 0)) { @@ -126,12 +95,12 @@ void DestoryBuffer(Buffer *buffer) if (memset_s(buffer->buf, buffer->contentSize, 0, buffer->contentSize) != EOK) { FACEAUTH_HILOGE(MODULE_SERVICE, "DestoryBuffer memset fail!"); } - delete buffer->buf; + free(buffer->buf); buffer->buf = nullptr; buffer->contentSize = 0; buffer->maxSize = 0; } - delete buffer; + free(buffer); } } diff --git a/useriam.gni b/useriam.gni old mode 100644 new mode 100755