diff --git a/frameworks/native/inputmethod_controller/src/input_method_controller.cpp b/frameworks/native/inputmethod_controller/src/input_method_controller.cpp index 10aa979cb3808a2dafb914c847a6aed074bb846b..8f006afdb07d6ea23bff92008fb4344577051316 100644 --- a/frameworks/native/inputmethod_controller/src/input_method_controller.cpp +++ b/frameworks/native/inputmethod_controller/src/input_method_controller.cpp @@ -380,7 +380,7 @@ int32_t InputMethodController::ShowTextInputInner(const AttachOptions &attachOpt IMSA_HILOGI("enter editable state."); return ret; } - +// LCOV_EXCL_START int32_t InputMethodController::HideTextInput() { InputMethodSyncTrace tracer("IMC_HideTextInput"); @@ -485,7 +485,7 @@ int32_t InputMethodController::RequestHideInput(bool isFocusTriggered) IMSA_HILOGD("InputMethodController start."); return proxy->RequestHideInput(isFocusTriggered); } - +// LCOV_EXCL_STOP int32_t InputMethodController::DisplayOptionalInputMethod() { IMSA_HILOGD("InputMethodController::DisplayOptionalInputMethod start."); @@ -565,7 +565,7 @@ int32_t InputMethodController::GetInputMethodConfig(OHOS::AppExecFwk::ElementNam } return proxy->GetInputMethodConfig(inputMethodConfig); } - +// LCOV_EXCL_START std::shared_ptr InputMethodController::GetCurrentInputMethod() { InputMethodSyncTrace tracer("IMC_GetCurrentInputMethod"); @@ -608,7 +608,7 @@ bool InputMethodController::IsDefaultImeSet() proxy->IsDefaultImeSet(ret); return ret; } - +// LCOV_EXCL_STOP int32_t InputMethodController::EnableIme( const std::string &bundleName, const std::string &extensionName, EnabledStatus status) { @@ -719,7 +719,7 @@ void InputMethodController::RestoreListenInfoInSaDied() AppExecFwk::EventQueue::Priority::VIP); } } - +// LCOV_EXCL_START void InputMethodController::RestoreClientInfoInSaDied() { if (!IsEditable()) { @@ -938,7 +938,7 @@ int32_t InputMethodController::GetTextIndexAtCursor(int32_t &index) index = listener->GetTextIndexAtCursorV2(); return ErrorCode::NO_ERROR; } - +// LCOV_EXCL_STOP void InputMethodController::PrintKeyEventLog() { std::lock_guard lock(logLock_); @@ -1300,7 +1300,7 @@ void InputMethodController::ClearEditorCache(bool isNewEditor, sptrHandleExtendActionV2(action); return ErrorCode::NO_ERROR; } - +// LCOV_EXCL_STOP sptr InputMethodController::GetTextListener() { std::lock_guard lock(textListenerLock_); @@ -1387,7 +1387,7 @@ bool InputMethodController::IsBound() } return true; } - +// LCOV_EXCL_START int32_t InputMethodController::InsertText(const std::u16string &text) { InputMethodSyncTrace tracer("IMC_InsertText"); @@ -1457,7 +1457,7 @@ int32_t InputMethodController::MoveCursor(Direction direction) listener->MoveCursorV2(direction); return ErrorCode::NO_ERROR; } - +// LCOV_EXCL_STOP void InputMethodController::SendKeyboardStatus(KeyboardStatus status) { IMSA_HILOGD("InputMethodController status: %{public}d.", static_cast(status)); @@ -1627,7 +1627,7 @@ void InputMethodController::PrintLogIfAceTimeout(int64_t start) IMSA_HILOGW("timeout: [%{public}" PRId64 ", %{public}" PRId64 "].", start, end); } } - +// LCOV_EXCL_START void InputMethodController::PrintTextChangeLog() { std::lock_guard lock(printTextChangeMutex_); @@ -1641,7 +1641,7 @@ void InputMethodController::PrintTextChangeLog() textChangeCountInPeriod_ = 0; } } - +// LCOV_EXCL_STOP int32_t InputMethodController::ReceivePrivateCommand( const std::unordered_map &privateCommand) { @@ -1689,7 +1689,7 @@ void InputMethodController::SetBindImeInfo(const std::pair std::lock_guard lock(bindImeInfoLock_); bindImeInfo_ = imeInfo; } - +// LCOV_EXCL_START std::pair InputMethodController::GetBindImeInfo() { std::lock_guard lock(bindImeInfoLock_); @@ -1835,7 +1835,7 @@ int32_t InputMethodController::ShowTextInput(ClientType type) AttachOptions attachOptions; return ShowTextInput(attachOptions, type); } - +// LCOV_EXCL_STOP int32_t InputMethodController::ShowTextInput(const AttachOptions &attachOptions, ClientType type) { auto ret = ShowTextInputInner(attachOptions, type); @@ -1856,7 +1856,7 @@ void InputMethodController::ReportClientShow(int32_t eventCode, int32_t errCode, HiSysOriginalInfo::Builder().SetClientType(type).SetEventCode(eventCode).SetErrCode(errCode).Build(); ImcHiSysEventReporter::GetInstance().ReportEvent(ImfEventType::CLIENT_SHOW, *evenInfo); } - +// LCOV_EXCL_START void InputMethodController::ReportBaseTextOperation(int32_t eventCode, int32_t errCode) { auto imeInfo = GetBindImeInfo(); @@ -1869,7 +1869,7 @@ void InputMethodController::ReportBaseTextOperation(int32_t eventCode, int32_t e .Build(); ImcHiSysEventReporter::GetInstance().ReportEvent(ImfEventType::BASE_TEXT_OPERATOR, *evenInfo); } - +// LCOV_EXCL_STOP void InputMethodController::UpdateTextPreviewState(bool isSupport) { if (textConfig_.inputAttribute.isTextPreviewSupported == isSupport) { @@ -1942,7 +1942,7 @@ void InputMethodController::ClearAgentInfo() IMSA_HILOGD("Clear all agent info"); agentInfoList_.clear(); } - +// LCOV_EXCL_START int32_t InputMethodController::SendRequestToAllAgents(std::function)> task) { std::lock_guard guard(agentLock_); @@ -2401,5 +2401,6 @@ void OnTextChangedListener::OnDetachV2() }; eventHandler->PostTask(task, "OnDetachV2", 0, AppExecFwk::EventQueue::Priority::VIP); } +// LCOV_EXCL_STOP } // namespace MiscServices } // namespace OHOS diff --git a/frameworks/native/inputmethod_controller/src/input_method_utils.cpp b/frameworks/native/inputmethod_controller/src/input_method_utils.cpp index fd4a01f401462d1af8c935f6c0624a54c8650901..57f713e3d2e8b8d5f897058d14ea70dfcc3123b6 100644 --- a/frameworks/native/inputmethod_controller/src/input_method_utils.cpp +++ b/frameworks/native/inputmethod_controller/src/input_method_utils.cpp @@ -193,7 +193,7 @@ ArrayBuffer *ArrayBuffer::Unmarshalling(Parcel &in) } return data; } - +// LCOV_EXCL_START bool PanelStatusInfoInner::Marshalling(Parcel &out) const { if (!out.WriteParcelable(&panelInfo)) { @@ -213,7 +213,7 @@ bool PanelStatusInfoInner::Marshalling(Parcel &out) const } return true; } - +// LCOV_EXCL_STOP bool TextSelectionInner::Marshalling(Parcel &out) const { if (!out.WriteInt32(oldBegin)) { @@ -233,7 +233,7 @@ bool TextSelectionInner::Marshalling(Parcel &out) const } return true; } - +// LCOV_EXCL_START bool Value::Marshalling(Parcel &out) const { if (!out.WriteUint32(valueMap.size())) { @@ -281,7 +281,7 @@ bool KeyEventValue::Marshalling(Parcel &out) const { return event->WriteToParcel(out); } - +// LCOV_EXCL_STOP bool TextTotalConfigInner::Marshalling(Parcel &out) const { if (!out.WriteParcelable(&inputAttribute)) { @@ -324,7 +324,7 @@ bool TextTotalConfigInner::Marshalling(Parcel &out) const } return true; } - +// LCOV_EXCL_START bool ArrayBuffer::Marshalling(Parcel &out) const { if (!out.WriteUint64(static_cast(jsArgc))) { @@ -390,5 +390,6 @@ bool ResponseDataInner::Marshalling(Parcel &out) const } } } +// LCOV_EXCL_STOP } // namespace MiscServices } // namespace OHOS diff --git a/frameworks/native/inputmethod_controller/src/key_event_result_handler.cpp b/frameworks/native/inputmethod_controller/src/key_event_result_handler.cpp index 2faaf423e11620f678e6530845968b19ec13fc6b..187b10d85a4974ee6e020dac2c0f9dd05e6922ed 100644 --- a/frameworks/native/inputmethod_controller/src/key_event_result_handler.cpp +++ b/frameworks/native/inputmethod_controller/src/key_event_result_handler.cpp @@ -20,6 +20,7 @@ #include "global.h" namespace OHOS { namespace MiscServices { +// LCOV_EXCL_START uint64_t KeyEventResultHandler::AddKeyEventCbInfo(const KeyEventCbInfo &cbInfo) { std::lock_guard lock(keyEventCbHandlersMutex_); @@ -28,7 +29,7 @@ uint64_t KeyEventResultHandler::AddKeyEventCbInfo(const KeyEventCbInfo &cbInfo) keyEventCbHandlers_.insert_or_assign(cbId, cbInfo); return cbId; } - +// LCOV_EXCL_STOP void KeyEventResultHandler::HandleKeyEventResult(uint64_t cbId, bool consumeResult) { IMSA_HILOGD("result:%{public}" PRIu64 "/%{public}d.", cbId, consumeResult); @@ -51,7 +52,7 @@ void KeyEventResultHandler::ClearKeyEventCbInfo() std::lock_guard lock(keyEventCbHandlersMutex_); keyEventCbHandlers_.clear(); } - +// LCOV_EXCL_START void KeyEventResultHandler::RemoveKeyEventCbInfo(uint64_t cbId) { std::lock_guard lock(keyEventCbHandlersMutex_); @@ -61,7 +62,7 @@ void KeyEventResultHandler::RemoveKeyEventCbInfo(uint64_t cbId) } keyEventCbHandlers_.erase(cbId); } - +// LCOV_EXCL_STOP int32_t KeyEventResultHandler::GetKeyEventCbInfo(uint64_t cbId, KeyEventCbInfo &info) { std::lock_guard lock(keyEventCbHandlersMutex_); @@ -72,10 +73,11 @@ int32_t KeyEventResultHandler::GetKeyEventCbInfo(uint64_t cbId, KeyEventCbInfo & } return ErrorCode::ERROR_BAD_PARAMETERS; } - +// LCOV_EXCL_START uint64_t KeyEventResultHandler::GenerateKeyEventCbId() { return maxCbId_.fetch_add(1); } +// LCOV_EXCL_STOP } // namespace MiscServices } // namespace OHOS \ No newline at end of file diff --git a/services/adapter/settings_data_provider/common/src/settings_data_utils.cpp b/services/adapter/settings_data_provider/common/src/settings_data_utils.cpp index 23518a17e8d9af933ae1e9d99868e665e4ff6137..6059b85066a29eec12ec9186edd3cc92976b57e7 100644 --- a/services/adapter/settings_data_provider/common/src/settings_data_utils.cpp +++ b/services/adapter/settings_data_provider/common/src/settings_data_utils.cpp @@ -27,7 +27,7 @@ SettingsDataUtils::~SettingsDataUtils() remoteObj_ = nullptr; } } - +// LCOV_EXCL_START void SettingsDataUtils::Release() { std::list> observerList; @@ -42,7 +42,7 @@ void SettingsDataUtils::Release() } } } - +// LCOV_EXCL_STOP SettingsDataUtils &SettingsDataUtils::GetInstance() { static SettingsDataUtils instance; diff --git a/services/src/client_group.cpp b/services/src/client_group.cpp index 4efe9df713c2836b3a1ec6d99f5d19d9a5434af5..a79a000039cf9f9370d66b4dd98f7579d606cf84 100644 --- a/services/src/client_group.cpp +++ b/services/src/client_group.cpp @@ -23,6 +23,7 @@ namespace OHOS { namespace MiscServices { +// LCOV_EXCL_START uint64_t ClientGroup::GetDisplayGroupId() { return displayGroupId_; @@ -72,7 +73,7 @@ int32_t ClientGroup::AddClientInfo( "add client with pid: %{public}d displayGroupId: %{public}" PRIu64 " end.", clientInfo.pid, displayGroupId_); return ErrorCode::NO_ERROR; } - +// LCOV_EXCL_STOP void ClientGroup::RemoveClientInfo(const sptr &client, bool isClientDied) { auto clientInfo = GetClientInfo(client); @@ -97,7 +98,7 @@ void ClientGroup::RemoveClientInfo(const sptr &client, bool isCli mapClients_.erase(client); IMSA_HILOGI("client[%{public}d] is removed.", clientInfo->pid); } - +// LCOV_EXCL_START void ClientGroup::UpdateClientInfo(const sptr &client, const std::unordered_map> &updateInfos) { @@ -150,7 +151,7 @@ void ClientGroup::UpdateClientInfo(const sptr &client, const std: } } } -// LCOV_EXCL_START + std::shared_ptr ClientGroup::GetClientInfo(pid_t pid) { auto iter = std::find_if( @@ -273,7 +274,7 @@ bool ClientGroup::IsCurClientUnFocused(int32_t pid, int32_t uid) } return clientInfo->pid == pid && clientInfo->uid == uid; } -// LCOV_EXCL_STOP + int32_t ClientGroup::NotifyInputStartToClients(uint32_t callingWndId, int32_t requestKeyboardReason) { IMSA_HILOGD("NotifyInputStartToClients enter"); @@ -313,7 +314,7 @@ int32_t ClientGroup::NotifyInputStopToClients() } return ErrorCode::NO_ERROR; } -// LCOV_EXCL_START + int32_t ClientGroup::NotifyPanelStatusChange(const InputWindowStatus &status, const ImeWindowInfo &info) { auto clientMap = GetClientMap(); diff --git a/services/src/full_ime_info_manager.cpp b/services/src/full_ime_info_manager.cpp index 73095cb39e71a9c7164b966e183fe6a6292984fd..e0e658c0f39a53217fb5aa7241f0cf5a1cadfa14 100644 --- a/services/src/full_ime_info_manager.cpp +++ b/services/src/full_ime_info_manager.cpp @@ -83,7 +83,7 @@ int32_t FullImeInfoManager::Switch(int32_t userId) ImeEnabledInfoManager::GetInstance().Switch(userId, infos); return ret; } - +// LCOV_EXCL_START int32_t FullImeInfoManager::Update() { { @@ -105,7 +105,7 @@ int32_t FullImeInfoManager::Update() } return ErrorCode::NO_ERROR; } - +// LCOV_EXCL_STOP int32_t FullImeInfoManager::Delete(int32_t userId) { { diff --git a/services/src/ime_state_manager.cpp b/services/src/ime_state_manager.cpp index 5024c6da5a6c2393f810ad9eaf47431d80acf5c0..2dc79ad7e35bb682d1174bafcaef629ce7ce005f 100644 --- a/services/src/ime_state_manager.cpp +++ b/services/src/ime_state_manager.cpp @@ -20,6 +20,7 @@ namespace OHOS { namespace MiscServices { std::shared_ptr ImeStateManager::eventHandler_ = nullptr; +// LCOV_EXCL_START bool ImeStateManager::IsIpcNeeded(RequestType type) { // If ime is in use, no need to request hide. @@ -73,5 +74,6 @@ bool ImeStateManager::IsImeInUse() std::lock_guard lock(mutex_); return isImeInUse_; } +// LCOV_EXCL_STOP } // namespace MiscServices } // namespace OHOS \ No newline at end of file diff --git a/services/src/input_method_system_ability.cpp b/services/src/input_method_system_ability.cpp index 4ee754329536c76472fd90f76ba2fae28272c239..d615f8b2bdf8de7347d41e145dbed8a6c9b48656 100644 --- a/services/src/input_method_system_ability.cpp +++ b/services/src/input_method_system_ability.cpp @@ -1953,7 +1953,7 @@ void InputMethodSystemAbility::DealSwitchRequest() // 0 means delay time is 0. serviceHandler_->PostTask(switchTask, "SwitchImeTask", 0, AppExecFwk::EventQueue::Priority::IMMEDIATE); } -// LCOV_EXCL_STOP + int32_t InputMethodSystemAbility::SwitchMode() { auto bundleName = ImeCfgManager::GetInstance().GetCurrentImeCfg(userId_)->bundleName; @@ -1990,7 +1990,7 @@ int32_t InputMethodSystemAbility::SwitchLanguage() auto condition = info->subProp.language == "chinese" ? Condition::ENGLISH : Condition::CHINESE; return SwitchByCondition(condition, info); } -// LCOV_EXCL_START + int32_t InputMethodSystemAbility::SwitchType() { SwitchInfo nextSwitchInfo = { std::chrono::system_clock::now(), "", "" }; @@ -2050,7 +2050,7 @@ void InputMethodSystemAbility::HandleDataShareReady() FullImeInfoManager::GetInstance().Init(); NumkeyAppsManager::GetInstance().Init(userId_); } - +// LCOV_EXCL_START int32_t InputMethodSystemAbility::InitAccountMonitor() { IMSA_HILOGI("InputMethodSystemAbility::InitAccountMonitor start."); @@ -2061,7 +2061,7 @@ int32_t InputMethodSystemAbility::InitAccountMonitor() } return imCommonEventManager->SubscribeAccountManagerService([this]() { HandleOsAccountStarted(); }); } - +// LCOV_EXCL_STOP int32_t InputMethodSystemAbility::InitKeyEventMonitor() { IMSA_HILOGI("InputMethodSystemAbility::InitKeyEventMonitor start."); @@ -2091,7 +2091,7 @@ bool InputMethodSystemAbility::InitWmsMonitor() } return imCommonEventManager->SubscribeWindowManagerService([this]() { HandleWmsStarted(); }); } - +// LCOV_EXCL_START bool InputMethodSystemAbility::InitMemMgrMonitor() { auto imCommonEventManager = ImCommonEventManager::GetInstance(); @@ -2109,7 +2109,7 @@ void InputMethodSystemAbility::InitWmsConnectionMonitor() isConnected ? HandleWmsConnected(userId, screenId) : HandleWmsDisconnected(userId, screenId); }); } -// LCOV_EXCL_START + void InputMethodSystemAbility::HandlePasteboardStarted() { IMSA_HILOGI("pasteboard started"); @@ -2145,7 +2145,7 @@ bool InputMethodSystemAbility::InitPasteboardMonitor() HandlePasteboardStarted(); }); } -// LCOV_EXCL_STOP + void InputMethodSystemAbility::InitSystemLanguageMonitor() { SystemParamAdapter::GetInstance().WatchParam(SystemParamAdapter::SYSTEM_LANGUAGE_KEY); @@ -2158,7 +2158,7 @@ void InputMethodSystemAbility::InitFocusChangedMonitor() HandleFocusChanged(isOnFocused, displayId, pid, uid); }); } -// LCOV_EXCL_START + void InputMethodSystemAbility::InitWindowDisplayChangedMonitor() { IMSA_HILOGD("enter."); @@ -2428,7 +2428,7 @@ void InputMethodSystemAbility::HandleWmsDisconnected(int32_t userId, int32_t scr } session->StopCurrentIme(); } - +// LCOV_EXCL_START void InputMethodSystemAbility::HandleWmsStarted() { // singleton, device boot, wms reboot @@ -2447,7 +2447,7 @@ void InputMethodSystemAbility::HandleWmsStarted() } RestartSessionIme(session); } - +// LCOV_EXCL_STOP void InputMethodSystemAbility::HandleFocusChanged(bool isFocused, uint64_t displayId, int32_t pid, int32_t uid) { int32_t userId = GetUserId(uid); @@ -2458,7 +2458,7 @@ void InputMethodSystemAbility::HandleFocusChanged(bool isFocused, uint64_t displ } isFocused ? session->OnFocused(displayId, pid, uid) : session->OnUnfocused(displayId, pid, uid); } - +// LCOV_EXCL_START void InputMethodSystemAbility::HandleMemStarted() { // singleton @@ -2504,7 +2504,7 @@ void InputMethodSystemAbility::StopImeInBackground() } serviceHandler_->PostTask(task, "StopImeInBackground", 0, AppExecFwk::EventQueue::Priority::IMMEDIATE); } - +// LCOV_EXCL_STOP int32_t InputMethodSystemAbility::GetUserId(int32_t uid) { IMSA_HILOGD("uid:%{public}d", uid);