回退 'Pull Request !1435 : imf E级别日志打印优化'

This commit is contained in:
鲍亚永 2024-09-09 07:46:24 +00:00 committed by Gitee
parent b9678368d4
commit 5cbcf3746f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
15 changed files with 131 additions and 131 deletions

View File

@ -205,7 +205,7 @@ std::shared_ptr<JsInputMethodEngineSetting> JsInputMethodEngineSetting::GetInput
if (inputMethodEngine_ == nullptr) {
auto engine = std::make_shared<JsInputMethodEngineSetting>();
if (engine == nullptr) {
IMSA_HILOGE("create engine failed!");
IMSA_HILOGE("create engine failed.");
return nullptr;
}
inputMethodEngine_ = engine;
@ -395,7 +395,7 @@ napi_value JsInputMethodEngineSetting::CreatePanel(napi_env env, napi_callback_i
PARAM_CHECK_RETURN(env, valueType == napi_object, "param info type must be PanelInfo.", TYPE_NONE,
napi_invalid_arg);
status = JsUtils::GetValue(env, argv[1], ctxt->panelInfo);
PARAM_CHECK_RETURN(env, status == napi_ok, "js param info covert failed!", TYPE_NONE, napi_invalid_arg);
PARAM_CHECK_RETURN(env, status == napi_ok, "js param info covert failed", TYPE_NONE, napi_invalid_arg);
return status;
};

View File

@ -199,7 +199,7 @@ void JsKeyboardDelegateSetting::UnRegisterListener(napi_value callback, std::str
if (callback == nullptr) {
jsCbMap_.erase(type);
IMSA_HILOGE("callback is nullptr!");
IMSA_HILOGE("callback is nullptr");
return;
}
@ -456,7 +456,7 @@ bool JsKeyboardDelegateSetting::OnKeyEvent(int32_t keyCode, int32_t keyStatus, s
JsCallbackHandler::Traverse(entry->vecCopy, { 1, getKeyEventProperty }, isConsumed);
auto consumer = entry->keyEvenetConsumer;
if (consumer != nullptr) {
IMSA_HILOGE("consumer result: %{public}d!", isConsumed);
IMSA_HILOGE("consumer result: %{public}d", isConsumed);
consumer->OnKeyCodeConsumeResult(isConsumed);
}
FinishAsync("OnKeyEvent", static_cast<int32_t>(TraceTaskId::ON_KEY_EVENT));

View File

@ -175,7 +175,7 @@ napi_value JsPanel::Resize(napi_env env, napi_callback_info info)
auto exec = [ctxt](AsyncCall::Context *ctx) {
jsQueue_.Wait(ctxt->info);
if (ctxt->inputMethodPanel == nullptr) {
IMSA_HILOGE("inputMethodPanel_ is nullptr!");
IMSA_HILOGE("inputMethodPanel_ is nullptr.");
jsQueue_.Pop();
return;
}
@ -217,7 +217,7 @@ napi_value JsPanel::MoveTo(napi_env env, napi_callback_info info)
jsQueue_.Wait(ctxt->info);
PrintEditorQueueInfoIfTimeout(start, ctxt->info);
if (ctxt->inputMethodPanel == nullptr) {
IMSA_HILOGE("inputMethodPanel_ is nullptr!");
IMSA_HILOGE("inputMethodPanel_ is nullptr.");
jsQueue_.Pop();
return;
}
@ -297,7 +297,7 @@ napi_value JsPanel::ChangeFlag(napi_env env, napi_callback_info info)
PARAM_CHECK_RETURN(env, status == napi_ok, "flag type must be PanelFlag!", TYPE_NONE, nullptr);
auto inputMethodPanel = UnwrapPanel(env, thisVar);
if (inputMethodPanel == nullptr) {
IMSA_HILOGE("inputMethodPanel is nullptr!");
IMSA_HILOGE("inputMethodPanel is nullptr");
return nullptr;
}
PARAM_CHECK_RETURN(env,
@ -327,7 +327,7 @@ napi_value JsPanel::SetPrivacyMode(napi_env env, napi_callback_info info)
CHECK_RETURN(status == napi_ok, "failed to get isPrivacyMode!", nullptr);
auto inputMethodPanel = UnwrapPanel(env, thisVar);
if (inputMethodPanel == nullptr) {
IMSA_HILOGE("inputMethodPanel is nullptr!");
IMSA_HILOGE("inputMethodPanel is nullptr");
return nullptr;
}
auto ret = inputMethodPanel->SetPrivacyMode(isPrivacyMode);
@ -394,7 +394,7 @@ napi_value JsPanel::UnSubscribe(napi_env env, napi_callback_info info)
std::shared_ptr<PanelListenerImpl> observer = PanelListenerImpl::GetInstance();
auto inputMethodPanel = UnwrapPanel(env, thisVar);
if (inputMethodPanel == nullptr) {
IMSA_HILOGE("inputMethodPanel is nullptr!");
IMSA_HILOGE("inputMethodPanel is nullptr");
return nullptr;
}
observer->RemoveInfo(type, inputMethodPanel->windowId_);
@ -448,7 +448,7 @@ napi_value JsPanel::AdjustPanelRect(napi_env env, napi_callback_info info)
auto exec = [ctxt](AsyncCall::Context *ctx) {
jsQueue_.Wait(ctxt->info);
if (ctxt->inputMethodPanel == nullptr) {
IMSA_HILOGE("inputMethodPanel_ is nullptr!");
IMSA_HILOGE("inputMethodPanel_ is nullptr.");
jsQueue_.Pop();
return;
}

View File

@ -1111,7 +1111,7 @@ void InputMethodAbility::NotifyKeyboardHeight(uint32_t panelHeight, PanelFlag pa
int32_t InputMethodAbility::SendPrivateCommand(const std::unordered_map<std::string, PrivateDataValue> &privateCommand)
{
if (!IsDefaultIme()) {
IMSA_HILOGE("current is not default ime!");
IMSA_HILOGE("current is not default ime.");
return ErrorCode::ERROR_NOT_DEFAULT_IME;
}
if (!TextConfig::IsPrivateCommandValid(privateCommand)) {

View File

@ -67,7 +67,7 @@ int32_t InputMethodPanel::CreatePanel(const std::shared_ptr<AbilityRuntime::Cont
WMError wmError = WMError::WM_OK;
window_ = OHOS::Rosen::Window::Create(GeneratePanelName(), winOption_, context, wmError);
if (wmError == WMError::WM_ERROR_INVALID_PERMISSION || wmError == WMError::WM_ERROR_NOT_SYSTEM_APP) {
IMSA_HILOGE("create window failed, permission denied, %{public}d!", wmError);
IMSA_HILOGE("create window failed, permission denied, %{public}d~", wmError);
return ErrorCode::ERROR_NOT_IME;
}
if (window_ == nullptr || wmError != WMError::WM_OK) {
@ -112,7 +112,7 @@ int32_t InputMethodPanel::SetPanelProperties()
} else if (panelType_ == SOFT_KEYBOARD && panelFlag_ == FLG_FLOATING) {
auto surfaceNode = window_->GetSurfaceNode();
if (surfaceNode == nullptr) {
IMSA_HILOGE("surfaceNode is nullptr!");
IMSA_HILOGE("surfaceNode is nullptr");
return ErrorCode::ERROR_OPERATE_PANEL;
}
surfaceNode->SetFrameGravity(Rosen::Gravity::TOP_LEFT);
@ -120,7 +120,7 @@ int32_t InputMethodPanel::SetPanelProperties()
} else if (panelType_ == STATUS_BAR) {
auto surfaceNo = window_->GetSurfaceNode();
if (surfaceNo == nullptr) {
IMSA_HILOGE("surfaceNo is nullptr!");
IMSA_HILOGE("surfaceNo is nullptr");
return ErrorCode::ERROR_OPERATE_PANEL;
}
surfaceNo->SetFrameGravity(Rosen::Gravity::TOP_LEFT);
@ -138,7 +138,7 @@ int32_t InputMethodPanel::SetPanelProperties()
keyboardLayoutParams_.gravity_ = gravity;
auto ret = window_->AdjustKeyboardLayout(keyboardLayoutParams_);
if (ret != WMError::WM_OK) {
IMSA_HILOGE("SetWindowGravity failed, wmError is %{public}d, start destroy window!", ret);
IMSA_HILOGE("SetWindowGravity failed, wmError is %{public}d, start destroy window.", ret);
return ErrorCode::ERROR_OPERATE_PANEL;
}
return ErrorCode::NO_ERROR;
@ -322,7 +322,7 @@ int32_t InputMethodPanel::ParsePanelRect(const PanelFlag panelFlag, const Layout
panelAdjust_.insert({ config.style, { config.top, config.left, config.right, config.bottom } });
}
} else {
IMSA_HILOGE("there is no configuration file!");
IMSA_HILOGE("there is no configuration file.");
auto ret = CalculateNoConfigRect(panelFlag, layoutParams);
if (ret != ErrorCode::NO_ERROR) {
IMSA_HILOGE("failed to calculate NoConfigRect, err: %{public}d!", ret);
@ -442,7 +442,7 @@ int32_t InputMethodPanel::CalculatePanelRect(const PanelFlag panelFlag, PanelAdj
}
auto displayInfo = defaultDisplay->GetDisplayInfo();
if (displayInfo == nullptr) {
IMSA_HILOGE("GetDisplayInfo failed!");
IMSA_HILOGE("GetDisplayInfo failed.");
return ErrorCode::ERROR_EX_SERVICE_SPECIFIC;
}
auto densityDpi = displayInfo->GetDensityInCurResolution();
@ -582,7 +582,7 @@ int32_t InputMethodPanel::ChangePanelFlag(PanelFlag panelFlag)
} else {
auto surfaceNode = window_->GetSurfaceNode();
if (surfaceNode == nullptr) {
IMSA_HILOGE("surfaceNode is nullptr!");
IMSA_HILOGE("surfaceNode is nullptr");
return ErrorCode::ERROR_NULL_POINTER;
}
surfaceNode->SetFrameGravity(Rosen::Gravity::TOP_LEFT);
@ -736,7 +736,7 @@ int32_t InputMethodPanel::SetPrivacyMode(bool isPrivacyMode)
{
IMSA_HILOGD("isPrivacyMode: %{public}d.", isPrivacyMode);
if (window_ == nullptr) {
IMSA_HILOGE("window_ is nullptr!");
IMSA_HILOGE("window_ is nullptr.");
return ErrorCode::ERROR_NULL_POINTER;
}
auto ret = window_->SetPrivacyMode(isPrivacyMode);
@ -805,7 +805,7 @@ int32_t InputMethodPanel::SetUiContent(const std::string &contentInfo, napi_env
std::shared_ptr<NativeReference> storage)
{
if (window_ == nullptr) {
IMSA_HILOGE("window_ is nullptr, can not SetUiContent!");
IMSA_HILOGE("window_ is nullptr, can not SetUiContent.");
return ErrorCode::ERROR_NULL_POINTER;
}
WMError ret = WMError::WM_OK;
@ -899,7 +899,7 @@ bool InputMethodPanel::MarkListener(const std::string &type, bool isRegister)
} else if (type == "sizeChange") {
sizeChangeRegistered_ = isRegister;
} else {
IMSA_HILOGE("type error!");
IMSA_HILOGE("type error.");
return false;
}
return true;
@ -922,7 +922,7 @@ bool InputMethodPanel::IsSizeValid(uint32_t width, uint32_t height)
}
auto defaultDisplay = Rosen::DisplayManager::GetInstance().GetDefaultDisplay();
if (defaultDisplay == nullptr) {
IMSA_HILOGE("GetDefaultDisplay failed!");
IMSA_HILOGE("GetDefaultDisplay failed.");
return false;
}
float ratio = panelType_ == PanelType::SOFT_KEYBOARD && panelFlag_ == PanelFlag::FLG_FIXED
@ -1002,7 +1002,7 @@ bool InputMethodPanel::GetDisplaySize(bool isPortrait, WindowSize &size)
{
auto defaultDisplay = Rosen::DisplayManager::GetInstance().GetDefaultDisplay();
if (defaultDisplay == nullptr) {
IMSA_HILOGE("GetDefaultDisplay failed!");
IMSA_HILOGE("GetDefaultDisplay failed.");
return false;
}
auto width = defaultDisplay->GetWidth();
@ -1020,7 +1020,7 @@ bool InputMethodPanel::IsDisplayPortrait()
{
auto defaultDisplay = Rosen::DisplayManager::GetInstance().GetDefaultDisplay();
if (defaultDisplay == nullptr) {
IMSA_HILOGE("GetDefaultDisplay failed!");
IMSA_HILOGE("GetDefaultDisplay failed.");
return false;
}
auto width = defaultDisplay->GetWidth();
@ -1032,7 +1032,7 @@ bool InputMethodPanel::CheckSize(PanelFlag panelFlag, uint32_t width, uint32_t h
{
WindowSize displaySize;
if (!GetDisplaySize(isDataPortrait, displaySize)) {
IMSA_HILOGE("GetDisplaySize failed!");
IMSA_HILOGE("GetDisplaySize failed.");
return false;
}
return IsSizeValid(panelFlag, width, height, displaySize.width, displaySize.height);

View File

@ -43,7 +43,7 @@ TaskManager &TaskManager::GetInstance()
uint64_t TaskManager::PostTask(task_ptr_t task, uint32_t delayMs)
{
if (!task) {
IMSA_HILOGE("task is NULL!");
IMSA_HILOGE("task is NULL");
return 0;
}
@ -68,11 +68,11 @@ void TaskManager::Complete(uint64_t seqId)
int32_t TaskManager::Pend(action_ptr_t action)
{
if (action == nullptr) {
IMSA_HILOGE("curTask_ is NULL or not runing, pend failed!");
IMSA_HILOGE("curTask_ is NULL or not runing, pend failed");
return ErrorCode::ERROR_NULL_POINTER;
}
if (curTask_ == nullptr || !curTask_->IsRunning()) {
IMSA_HILOGE("curTask_ is NULL or not runing, pend failed!");
IMSA_HILOGE("curTask_ is NULL or not runing, pend failed");
return ErrorCode::ERROR_TASK_MANAGER_PEND_FAILED;
}
return curTask_->Pend(std::move(action));
@ -109,7 +109,7 @@ void TaskManager::SetInited(bool flag)
void TaskManager::OnNewTask(task_ptr_t task)
{
if (task == nullptr) {
IMSA_HILOGE("task is NULL!");
IMSA_HILOGE("task is NULL");
return;
}
auto srcType = task->GetSourceType();
@ -127,7 +127,7 @@ void TaskManager::OnNewTask(task_ptr_t task)
innerTasks_.push_back(task);
break;
default:
IMSA_HILOGE("task type %{public}d unknown!", srcType);
IMSA_HILOGE("task type %{public}d unknown", srcType);
return;
}
Process();

View File

@ -80,7 +80,7 @@ int32_t InputClientProxy::SendRequest(int code, ParcelHandler input, ParcelHandl
}
ret = reply.ReadInt32();
if (ret != NO_ERROR) {
IMSA_HILOGE("reply error, ret: %{public}d!", ret);
IMSA_HILOGE("reply error, ret: %{public}d", ret);
return ret;
}
if (output != nullptr && (!output(reply))) {

View File

@ -118,7 +118,7 @@ int32_t InputMethodController::Initialize()
{
sptr<IInputClient> client = new (std::nothrow) InputClientStub();
if (client == nullptr) {
IMSA_HILOGE("failed to create client!");
IMSA_HILOGE("failed to create client");
return ErrorCode::ERROR_NULL_POINTER;
}
sptr<IInputDataChannel> channel = new (std::nothrow) InputDataChannelStub();
@ -262,7 +262,7 @@ int32_t InputMethodController::ShowTextInput()
{
InputMethodSyncTrace tracer("IMC_ShowTextInput");
if (!IsBound()) {
IMSA_HILOGE("not bound!");
IMSA_HILOGE("not bound.");
return ErrorCode::ERROR_CLIENT_NOT_BOUND;
}
IMSA_HILOGI("start.");
@ -1311,7 +1311,7 @@ int32_t InputMethodController::ReceivePrivateCommand(
{
auto listener = GetTextListener();
if (listener == nullptr) {
IMSA_HILOGE("listener is nullptr!");
IMSA_HILOGE("listener is nullptr.");
return ErrorCode::ERROR_EX_NULL_POINTER;
}
IMSA_HILOGD("IMC in.");

View File

@ -33,7 +33,7 @@ FullImeInfoManager::FullImeInfoManager()
{
uint32_t ret = timer_.Setup();
if (ret != Utils::TIMER_ERR_OK) {
IMSA_HILOGE("failed to create timer!");
IMSA_HILOGE("failed to create timer");
return;
}
timerId_ = timer_.Register([this]() { Init(); }, TIMER_TASK_INTERNAL, false);

View File

@ -331,17 +331,17 @@ void ImCommonEventManager::EventSubscriber::HandlePackageEvent(int32_t messageId
}
MessageParcel *parcel = new (std::nothrow) MessageParcel();
if (parcel == nullptr) {
IMSA_HILOGE("parcel is nullptr!");
IMSA_HILOGE("parcel is nullptr");
return;
}
if (!ITypesUtil::Marshal(*parcel, userId, bundleName)) {
IMSA_HILOGE("Failed to write message parcel!");
IMSA_HILOGE("Failed to write message parcel");
delete parcel;
return;
}
Message *msg = new (std::nothrow) Message(messageId, parcel);
if (msg == nullptr) {
IMSA_HILOGE("failed to create Message!");
IMSA_HILOGE("failed to create Message");
delete parcel;
return;
}

View File

@ -60,7 +60,7 @@ void ImeInfoInquirer::InitSystemConfig()
{
auto ret = SysCfgParser::ParseSystemConfig(systemConfig_);
if (!ret) {
IMSA_HILOGE("parse systemConfig failed!");
IMSA_HILOGE("parse systemConfig failed");
return;
}
}
@ -80,7 +80,7 @@ bool ImeInfoInquirer::QueryImeExtInfos(const int32_t userId, std::vector<Extensi
IMSA_HILOGD("userId: %{public}d.", userId);
auto bundleMgr = GetBundleMgr();
if (bundleMgr == nullptr) {
IMSA_HILOGE("failed to GetBundleMgr!");
IMSA_HILOGE("failed to GetBundleMgr");
return false;
}
if (!bundleMgr->QueryExtensionAbilityInfos(ExtensionAbilityType::INPUTMETHOD, userId, infos)) {
@ -138,7 +138,7 @@ std::shared_ptr<ImeInfo> ImeInfoInquirer::GetImeInfoFromCache(const int32_t user
auto iter = std::find_if(subProps.begin(), subProps.end(),
[&subName](const SubProperty &subProp) { return subProp.id == subName; });
if (iter == subProps.end()) {
IMSA_HILOGE("find subName: %{public}s failed!", subName.c_str());
IMSA_HILOGE("find subName: %{public}s failed", subName.c_str());
return nullptr;
}
info->subProp = *iter;
@ -188,7 +188,7 @@ std::shared_ptr<ImeInfo> ImeInfoInquirer::GetImeInfoFromBundleMgr(
auto it = std::find_if(subProps.begin(), subProps.end(),
[&subName](const SubProperty &subProp) { return subProp.id == subName; });
if (it == subProps.end()) {
IMSA_HILOGE("find subName: %{public}s failed!", subName.c_str());
IMSA_HILOGE("find subName: %{public}s failed", subName.c_str());
return nullptr;
}
info->subProp = *it;
@ -326,7 +326,7 @@ int32_t ImeInfoInquirer::ListEnabledInputMethod(const int32_t userId, std::vecto
std::vector<std::string> enableVec;
ret = EnableImeDataParser::GetInstance()->GetEnableIme(userId, enableVec);
if (ret != ErrorCode::NO_ERROR) {
IMSA_HILOGE("get enable data failed!");
IMSA_HILOGE("get enable data failed");
return ret;
}
auto info = GetDefaultIme();
@ -357,7 +357,7 @@ int32_t ImeInfoInquirer::ListDisabledInputMethod(const int32_t userId, std::vect
std::vector<std::string> enableVec;
ret = EnableImeDataParser::GetInstance()->GetEnableIme(userId, enableVec);
if (ret != ErrorCode::NO_ERROR) {
IMSA_HILOGE("get enable data failed!");
IMSA_HILOGE("get enable data failed");
return ret;
}
auto info = GetDefaultIme();
@ -383,7 +383,7 @@ int32_t ImeInfoInquirer::GetSwitchInfoBySwitchCount(SwitchInfo &switchInfo, int3
auto iter = std::find_if(props.begin(), props.end(),
[&currentImeBundle](const Property &property) { return property.name == currentImeBundle; });
if (iter == props.end()) {
IMSA_HILOGE("can not found current ime in enable list!");
IMSA_HILOGE("can not found current ime in enable list");
auto info = GetDefaultImeInfo(userId);
if (info != nullptr) {
switchInfo.bundleName = info->prop.name;
@ -444,13 +444,13 @@ int32_t ImeInfoInquirer::GetSubProperty(int32_t userId, const std::string &subNa
{
IMSA_HILOGD("oldIme, userId: %{public}d.", userId);
if (extInfos.empty()) {
IMSA_HILOGE("extInfos is empty!");
IMSA_HILOGE("extInfos is empty");
return ErrorCode::ERROR_PACKAGE_MANAGER;
}
auto extInfo = std::find_if(extInfos.begin(), extInfos.end(),
[&subName](const ExtensionAbilityInfo &info) { return info.name == subName; });
if (extInfo == extInfos.end()) {
IMSA_HILOGE("subtype %{public}s not found!", subName.c_str());
IMSA_HILOGE("subtype %{public}s not found", subName.c_str());
extInfo = extInfos.begin();
}
subProp.labelId = extInfo->labelId;
@ -500,13 +500,13 @@ int32_t ImeInfoInquirer::GetSubProperty(int32_t userId, const std::string &subNa
return ret;
}
if (subtypes.empty()) {
IMSA_HILOGE("subtypes is empty!");
IMSA_HILOGE("subtypes is empty");
return ErrorCode::ERROR_PACKAGE_MANAGER;
}
auto subtype = std::find_if(
subtypes.begin(), subtypes.end(), [&subName](const Subtype &subtype) { return subtype.id == subName; });
if (subtype == subtypes.end()) {
IMSA_HILOGE("subtype %{public}s not found!", subName.c_str());
IMSA_HILOGE("subtype %{public}s not found", subName.c_str());
subtype = subtypes.begin();
}
subProp.label = subtype->label;
@ -580,18 +580,18 @@ int32_t ImeInfoInquirer::ParseSubtype(const OHOS::AppExecFwk::ExtensionAbilityIn
auto iter = std::find_if(extInfo.metadata.begin(), extInfo.metadata.end(),
[](const Metadata &metadata) { return metadata.name == SUBTYPE_PROFILE_METADATA_NAME; });
if (iter == extInfo.metadata.end()) {
IMSA_HILOGE("find metadata name: SUBTYPE_PROFILE_METADATA_NAME failed!");
IMSA_HILOGE("find metadata name: SUBTYPE_PROFILE_METADATA_NAME failed");
return ErrorCode::ERROR_BAD_PARAMETERS;
}
OHOS::AppExecFwk::BundleMgrClientImpl clientImpl;
std::vector<std::string> profiles;
if (!clientImpl.GetResConfigFile(extInfo, iter->name, profiles)) {
IMSA_HILOGE("failed to GetProfileFromExtension!");
IMSA_HILOGE("failed to GetProfileFromExtension ");
return ErrorCode::ERROR_PACKAGE_MANAGER;
}
SubtypeCfg subtypeCfg;
if (!ParseSubtypeProfile(profiles, subtypeCfg)) {
IMSA_HILOGE("failed to ParseSubTypeCfg!");
IMSA_HILOGE("failed to ParseSubTypeCfg");
return ErrorCode::ERROR_BAD_PARAMETERS;
}
subtypes = subtypeCfg.subtypes;
@ -792,7 +792,7 @@ int32_t ImeInfoInquirer::GetDefaultInputMethod(const int32_t userId, std::shared
IMSA_HILOGD("userId: %{public}d.", userId);
auto defaultIme = GetDefaultImeCfgProp();
if (defaultIme == nullptr) {
IMSA_HILOGE("abnormal default ime cfg!");
IMSA_HILOGE("abnormal default ime cfg.");
return ErrorCode::ERROR_NULL_POINTER;
}
auto infos = FullImeInfoManager::GetInstance().Get(userId);
@ -939,18 +939,18 @@ std::shared_ptr<Property> ImeInfoInquirer::GetDefaultImeCfgProp()
std::shared_ptr<ResourceManager> ImeInfoInquirer::GetResMgr(const std::string &resourcePath)
{
if (resourcePath.empty()) {
IMSA_HILOGE("resourcePath is empty!");
IMSA_HILOGE("resourcePath is empty.");
return nullptr;
}
std::shared_ptr<ResourceManager> resMgr(CreateResourceManager());
if (resMgr == nullptr) {
IMSA_HILOGE("resMgr is nullptr!");
IMSA_HILOGE("resMgr is nullptr.");
return nullptr;
}
resMgr->AddResource(resourcePath.c_str());
std::unique_ptr<ResConfig> resConfig(CreateResConfig());
if (resConfig == nullptr) {
IMSA_HILOGE("resConfig is nullptr!");
IMSA_HILOGE("resConfig is nullptr.");
return nullptr;
}
std::map<std::string, std::string> configs;
@ -985,7 +985,7 @@ int32_t ImeInfoInquirer::QueryFullImeInfo(int32_t userId, std::vector<FullImeInf
std::vector<ExtensionAbilityInfo> extInfos;
auto ret = ImeInfoInquirer::GetInstance().QueryImeExtInfos(userId, extInfos);
if (!ret || extInfos.empty()) {
IMSA_HILOGE("%{public}d QueryImeExtInfos failed!", userId);
IMSA_HILOGE("%{public}d QueryImeExtInfos failed.", userId);
return ErrorCode::ERROR_PACKAGE_MANAGER;
}
std::map<std::string, std::vector<ExtensionAbilityInfo>> tempExtInfos;
@ -1041,7 +1041,7 @@ int32_t ImeInfoInquirer::GetFullImeInfo(
auto ret = imeInfo.isNewIme ? ListInputMethodSubtype(userId, extInfos[0], imeInfo.subProps)
: ListInputMethodSubtype(userId, extInfos, imeInfo.subProps);
if (ret != ErrorCode::NO_ERROR) {
IMSA_HILOGE("[%{public}d,%{public}s] list Subtype failed!", userId, extInfos[0].bundleName.c_str());
IMSA_HILOGE("[%{public}d,%{public}s] list Subtype failed.", userId, extInfos[0].bundleName.c_str());
return ret;
}
imeInfo.tokenId = extInfos[0].applicationInfo.accessTokenId;
@ -1052,7 +1052,7 @@ int32_t ImeInfoInquirer::GetFullImeInfo(
imeInfo.prop.labelId = extInfos[0].applicationInfo.labelId;
imeInfo.prop.iconId = extInfos[0].applicationInfo.iconId;
if (!GetAppIdByBundleName(userId, imeInfo.prop.name, imeInfo.appId)) {
IMSA_HILOGE("%{public}s failed to get app id!", imeInfo.prop.name.c_str());
IMSA_HILOGE("%{public}s failed to get app id", imeInfo.prop.name.c_str());
}
return ErrorCode::NO_ERROR;
}
@ -1125,7 +1125,7 @@ bool ImeInfoInquirer::GetAppIdByBundleName(int32_t userId, const std::string &bu
{
auto bundleMgr = GetBundleMgr();
if (bundleMgr == nullptr) {
IMSA_HILOGE("failed to get bundleMgr!");
IMSA_HILOGE("failed to get bundleMgr");
return false;
}
BundleInfo bundleInfo;

View File

@ -48,12 +48,12 @@ int32_t InputControlChannelProxy::HideKeyboardSelf()
}
auto remote = Remote();
if (remote == nullptr) {
IMSA_HILOGE("remote is nullptr!");
IMSA_HILOGE("remote is nullptr");
return ErrorCode::ERROR_EX_NULL_POINTER;
}
auto ret = remote->SendRequest(HIDE_KEYBOARD_SELF, data, reply, option);
if (ret != ErrorCode::NO_ERROR) {
IMSA_HILOGE("send request failed!");
IMSA_HILOGE("send request failed");
return ErrorCode::ERROR_EX_PARCELABLE;
}
return reply.ReadInt32();

View File

@ -175,7 +175,7 @@ void InputMethodSystemAbility::InitServiceHandler()
{
IMSA_HILOGI("InitServiceHandler start.");
if (serviceHandler_ != nullptr) {
IMSA_HILOGE("InputMethodSystemAbility already init!");
IMSA_HILOGE("InputMethodSystemAbility already init.");
return;
}
std::shared_ptr<AppExecFwk::EventRunner> runner = AppExecFwk::EventRunner::Create("OS_InputMethodSystemAbility");
@ -211,7 +211,7 @@ void InputMethodSystemAbility::SubscribeCommonEvent()
return;
}
IMSA_HILOGE("failed, try again 10s later!");
IMSA_HILOGE("failed, try again 10s later");
auto callback = [this]() { SubscribeCommonEvent(); };
serviceHandler_->PostTask(callback, INIT_INTERVAL);
}
@ -224,7 +224,7 @@ int32_t InputMethodSystemAbility::PrepareInput(int32_t userId, InputClientInfo &
}
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
return session->OnPrepareInput(clientInfo);
@ -261,7 +261,7 @@ int32_t InputMethodSystemAbility::ReleaseInput(sptr<IInputClient> client)
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
return session->OnReleaseInput(client);
@ -280,7 +280,7 @@ int32_t InputMethodSystemAbility::StartInput(InputClientInfo &inputClientInfo, s
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (session->GetCurrentClientPid() != IPCSkeleton::GetCallingPid()
@ -294,13 +294,13 @@ int32_t InputMethodSystemAbility::StartInput(InputClientInfo &inputClientInfo, s
if (!session->IsProxyImeEnable()) {
auto ret = CheckInputTypeOption(userId, inputClientInfo);
if (ret != ErrorCode::NO_ERROR) {
IMSA_HILOGE("%{public}d failed to CheckInputTypeOption!", userId);
IMSA_HILOGE("%{public}d failed to CheckInputTypeOption.", userId);
return ret;
}
}
int32_t ret = PrepareInput(userId, inputClientInfo);
if (ret != ErrorCode::NO_ERROR) {
IMSA_HILOGE("failed to PrepareInput!");
IMSA_HILOGE("failed to PrepareInput");
return ret;
}
return session->OnStartInput(inputClientInfo, agent);
@ -337,7 +337,7 @@ int32_t InputMethodSystemAbility::CheckInputTypeOption(int32_t userId, InputClie
}
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (InputTypeManager::GetInstance().IsStarted()) {
@ -353,7 +353,7 @@ int32_t InputMethodSystemAbility::ShowInput(sptr<IInputClient> client)
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (!identityChecker_->IsBroker(tokenId)) {
@ -362,7 +362,7 @@ int32_t InputMethodSystemAbility::ShowInput(sptr<IInputClient> client)
}
}
if (client == nullptr) {
IMSA_HILOGE("client is nullptr!");
IMSA_HILOGE("client is nullptr");
return ErrorCode::ERROR_CLIENT_NULL_POINTER;
}
return session->OnShowInput(client);
@ -374,7 +374,7 @@ int32_t InputMethodSystemAbility::HideInput(sptr<IInputClient> client)
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (!identityChecker_->IsBroker(tokenId)) {
@ -383,7 +383,7 @@ int32_t InputMethodSystemAbility::HideInput(sptr<IInputClient> client)
}
}
if (client == nullptr) {
IMSA_HILOGE("client is nullptr!");
IMSA_HILOGE("client is nullptr");
return ErrorCode::ERROR_CLIENT_NULL_POINTER;
}
return session->OnHideInput(client);
@ -395,7 +395,7 @@ int32_t InputMethodSystemAbility::StopInputSession()
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (!identityChecker_->IsBroker(tokenId)) {
@ -416,7 +416,7 @@ int32_t InputMethodSystemAbility::RequestShowInput()
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
return session->OnRequestShowInput();
@ -432,7 +432,7 @@ int32_t InputMethodSystemAbility::RequestHideInput()
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
return session->OnRequestHideInput();
@ -444,7 +444,7 @@ int32_t InputMethodSystemAbility::SetCoreAndAgent(const sptr<IInputMethodCore> &
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (identityChecker_->IsNativeSa(IPCSkeleton::GetCallingTokenID())) {
@ -463,7 +463,7 @@ int32_t InputMethodSystemAbility::InitConnect()
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (!IsCurrentIme(userId)) {
@ -478,7 +478,7 @@ int32_t InputMethodSystemAbility::HideCurrentInput()
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (identityChecker_->IsBroker(tokenId)) {
@ -496,7 +496,7 @@ int32_t InputMethodSystemAbility::ShowCurrentInput()
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (identityChecker_->IsBroker(tokenId)) {
@ -522,7 +522,7 @@ int32_t InputMethodSystemAbility::PanelStatusChange(const InputWindowStatus &sta
}
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
return session->OnPanelStatusChange(status, info);
@ -545,7 +545,7 @@ int32_t InputMethodSystemAbility::UpdateListenEventFlag(InputClientInfo &clientI
}
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
return session->OnUpdateListenEventFlag(clientInfo);
@ -571,12 +571,12 @@ int32_t InputMethodSystemAbility::ExitCurrentInputType()
auto userId = GetCallingUserId();
auto ret = IsDefaultImeFromTokenId(userId, IPCSkeleton::GetCallingTokenID());
if (ret != ErrorCode::NO_ERROR) {
IMSA_HILOGE("not default ime!");
IMSA_HILOGE("not default ime.");
return ErrorCode::ERROR_NOT_DEFAULT_IME;
}
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (session->CheckSecurityMode()) {
@ -619,7 +619,7 @@ bool InputMethodSystemAbility::IsCurrentImeByPid(int32_t pid)
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return false;
}
return session->IsCurrentImeByPid(pid);
@ -634,7 +634,7 @@ int32_t InputMethodSystemAbility::IsPanelShown(const PanelInfo &panelInfo, bool
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
return session->IsPanelShown(panelInfo, isShown);
@ -658,7 +658,7 @@ int32_t InputMethodSystemAbility::SwitchInputMethod(const std::string &bundleNam
int32_t userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (enableImeOn_.load() && !EnableImeDataParser::GetInstance()->CheckNeedSwitch(switchInfo, userId)) {
@ -682,7 +682,7 @@ int32_t InputMethodSystemAbility::OnSwitchInputMethod(int32_t userId, const Swit
InputMethodSysEvent::GetInstance().RecordEvent(IMEBehaviour::CHANGE_IME);
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (!session->GetSwitchQueue().IsReady(switchInfo)) {
@ -742,7 +742,7 @@ int32_t InputMethodSystemAbility::OnStartInputType(int32_t userId, const SwitchI
{
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (!session->GetSwitchQueue().IsReady(switchInfo)) {
@ -805,7 +805,7 @@ int32_t InputMethodSystemAbility::SwitchExtension(int32_t userId, const std::sha
{
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
std::string targetImeName = info->prop.name + "/" + info->prop.id;
@ -826,7 +826,7 @@ int32_t InputMethodSystemAbility::SwitchSubType(int32_t userId, const std::share
{
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
auto ret = session->SwitchSubtype(info->subProp);
@ -844,12 +844,12 @@ int32_t InputMethodSystemAbility::SwitchInputType(int32_t userId, const SwitchIn
{
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
auto targetImeProperty = ImeInfoInquirer::GetInstance().GetImeProperty(userId, switchInfo.bundleName);
if (targetImeProperty == nullptr) {
IMSA_HILOGE("GetImeProperty [%{public}d, %{public}s] failed!", userId, switchInfo.bundleName.c_str());
IMSA_HILOGE("GetImeProperty [%{public}d, %{public}s] failed", userId, switchInfo.bundleName.c_str());
return ErrorCode::ERROR_NULL_POINTER;
}
std::string targetName = switchInfo.bundleName + "/" + targetImeProperty->id;
@ -876,7 +876,7 @@ int32_t InputMethodSystemAbility::HideCurrentInputDeprecated()
int32_t userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (!identityChecker_->IsBroker(tokenId)) {
@ -893,7 +893,7 @@ int32_t InputMethodSystemAbility::ShowCurrentInputDeprecated()
int32_t userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (!identityChecker_->IsBroker(tokenId)) {
@ -1004,7 +1004,7 @@ void InputMethodSystemAbility::WorkThread()
int32_t InputMethodSystemAbility::OnUserStarted(const Message *msg)
{
if (msg->msgContent_ == nullptr) {
IMSA_HILOGE("msgContent_ is nullptr!");
IMSA_HILOGE("msgContent_ is nullptr.");
return ErrorCode::ERROR_NULL_POINTER;
}
auto newUserId = msg->msgContent_->ReadInt32();
@ -1023,7 +1023,7 @@ int32_t InputMethodSystemAbility::OnUserStarted(const Message *msg)
int32_t InputMethodSystemAbility::OnUserRemoved(const Message *msg)
{
if (msg == nullptr || msg->msgContent_ == nullptr) {
IMSA_HILOGE("Aborted! Message is nullptr!");
IMSA_HILOGE("Aborted! Message is nullptr.");
return ErrorCode::ERROR_NULL_POINTER;
}
auto userId = msg->msgContent_->ReadInt32();
@ -1041,13 +1041,13 @@ int32_t InputMethodSystemAbility::OnUserRemoved(const Message *msg)
int32_t InputMethodSystemAbility::OnUserStop(const Message *msg)
{
if (msg == nullptr || msg->msgContent_ == nullptr) {
IMSA_HILOGE("Aborted! Message is nullptr!");
IMSA_HILOGE("Aborted! Message is nullptr.");
return ErrorCode::ERROR_NULL_POINTER;
}
auto userId = msg->msgContent_->ReadInt32();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
session->StopCurrentIme();
@ -1057,13 +1057,13 @@ int32_t InputMethodSystemAbility::OnUserStop(const Message *msg)
int32_t InputMethodSystemAbility::OnHideKeyboardSelf(const Message *msg)
{
if (msg == nullptr || msg->msgContent_ == nullptr) {
IMSA_HILOGE("Aborted! Message is nullptr!");
IMSA_HILOGE("Aborted! Message is nullptr.");
return ErrorCode::ERROR_NULL_POINTER;
}
auto userId = msg->msgContent_->ReadInt32();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
session->OnHideSoftKeyBoardSelf();
@ -1080,7 +1080,7 @@ int32_t InputMethodSystemAbility::HandlePackageEvent(const Message *msg)
int32_t userId = 0;
std::string packageName;
if (!ITypesUtil::Unmarshal(*data, userId, packageName)) {
IMSA_HILOGE("Failed to read message parcel!");
IMSA_HILOGE("Failed to read message parcel");
return ErrorCode::ERROR_EX_PARCELABLE;
}
if (msg->msgId_ == MSG_ID_PACKAGE_CHANGED) {
@ -1145,7 +1145,7 @@ int32_t InputMethodSystemAbility::SwitchByCombinationKey(uint32_t state)
IMSA_HILOGD("InputMethodSystemAbility::SwitchByCombinationKey start.");
auto session = UserSessionManager::GetInstance().GetUserSession(userId_);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId_);
IMSA_HILOGE("%{public}d session is nullptr", userId_);
return ErrorCode::ERROR_NULL_POINTER;
}
if (session->IsProxyImeEnable()) {
@ -1172,7 +1172,7 @@ int32_t InputMethodSystemAbility::SwitchByCombinationKey(uint32_t state)
DealSwitchRequest();
return ErrorCode::NO_ERROR;
}
IMSA_HILOGE("keycode is undefined!");
IMSA_HILOGE("keycode is undefined");
return ErrorCode::ERROR_EX_UNSUPPORTED_OPERATION;
}
@ -1259,7 +1259,7 @@ int32_t InputMethodSystemAbility::SwitchMode()
SwitchInfo switchInfo = { std::chrono::system_clock::now(), target->name, target->id };
auto session = UserSessionManager::GetInstance().GetUserSession(userId_);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId_);
IMSA_HILOGE("%{public}d session is nullptr", userId_);
return ErrorCode::ERROR_NULL_POINTER;
}
session->GetSwitchQueue().Push(switchInfo);
@ -1291,7 +1291,7 @@ int32_t InputMethodSystemAbility::SwitchLanguage()
SwitchInfo switchInfo = { std::chrono::system_clock::now(), target->name, target->id };
auto session = UserSessionManager::GetInstance().GetUserSession(userId_);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId_);
IMSA_HILOGE("%{public}d session is nullptr", userId_);
return ErrorCode::ERROR_NULL_POINTER;
}
session->GetSwitchQueue().Push(switchInfo);
@ -1316,7 +1316,7 @@ int32_t InputMethodSystemAbility::SwitchType()
switchInfo.timestamp = std::chrono::system_clock::now();
auto session = UserSessionManager::GetInstance().GetUserSession(userId_);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId_);
IMSA_HILOGE("%{public}d session is nullptr", userId_);
return ErrorCode::ERROR_NULL_POINTER;
}
session->GetSwitchQueue().Push(switchInfo);
@ -1429,7 +1429,7 @@ void InputMethodSystemAbility::DatashareCallback(const std::string &key)
if (EnableImeDataParser::GetInstance()->CheckNeedSwitch(key, switchInfo, userId_)) {
auto session = UserSessionManager::GetInstance().GetUserSession(userId_);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId_);
IMSA_HILOGE("%{public}d session is nullptr", userId_);
return;
}
switchInfo.timestamp = std::chrono::system_clock::now();
@ -1460,7 +1460,7 @@ void InputMethodSystemAbility::OnSecurityModeChange()
static_cast<int32_t>(newMode));
auto session = UserSessionManager::GetInstance().GetUserSession(userId_);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId_);
IMSA_HILOGE("%{public}d session is nullptr", userId_);
return;
}
session->OnSecurityChange(static_cast<int32_t>(newMode));
@ -1494,7 +1494,7 @@ int32_t InputMethodSystemAbility::UnRegisteredProxyIme(UnRegisteredType type, co
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
if (type == UnRegisteredType::SWITCH_PROXY_IME_TO_IME) {
@ -1524,7 +1524,7 @@ int32_t InputMethodSystemAbility::CheckSwitchPermission(int32_t userId, const Sw
return ErrorCode::ERROR_STATUS_SYSTEM_PERMISSION;
}
if (!identityChecker_->HasPermission(IPCSkeleton::GetCallingTokenID(), PERMISSION_CONNECT_IME_ABILITY)) {
IMSA_HILOGE("have not PERMISSION_CONNECT_IME_ABILITY!");
IMSA_HILOGE("have not PERMISSION_CONNECT_IME_ABILITY");
return ErrorCode::ERROR_STATUS_PERMISSION_DENIED;
}
return ErrorCode::NO_ERROR;
@ -1534,7 +1534,7 @@ int32_t InputMethodSystemAbility::CheckSwitchPermission(int32_t userId, const Sw
if (identityChecker_->HasPermission(IPCSkeleton::GetCallingTokenID(), PERMISSION_CONNECT_IME_ABILITY)) {
return ErrorCode::NO_ERROR;
}
IMSA_HILOGE("have not PERMISSION_CONNECT_IME_ABILITY!");
IMSA_HILOGE("have not PERMISSION_CONNECT_IME_ABILITY");
// switchInfo.subName.empty() check temporarily reserved for application adaptation, will be deleted soon
auto currentBundleName = ImeCfgManager::GetInstance().GetCurrentImeCfg(userId)->bundleName;
if (identityChecker_->IsBundleNameValid(IPCSkeleton::GetCallingTokenID(), currentBundleName) &&
@ -1565,7 +1565,7 @@ bool InputMethodSystemAbility::IsStartInputTypePermitted(int32_t userId)
}
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return false;
}
return identityChecker_->IsFocused(IPCSkeleton::GetCallingPid(), tokenId) && session->IsBoundToClient();
@ -1575,13 +1575,13 @@ int32_t InputMethodSystemAbility::ConnectSystemCmd(const sptr<IRemoteObject> &ch
{
auto tokenId = IPCSkeleton::GetCallingTokenID();
if (!identityChecker_->HasPermission(tokenId, PERMISSION_CONNECT_IME_ABILITY)) {
IMSA_HILOGE("have not PERMISSION_CONNECT_IME_ABILITY!");
IMSA_HILOGE("have not PERMISSION_CONNECT_IME_ABILITY");
return ErrorCode::ERROR_STATUS_SYSTEM_PERMISSION;
}
auto userId = GetCallingUserId();
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
return session->OnConnectSystemCmd(channel, agent);
@ -1606,7 +1606,7 @@ void InputMethodSystemAbility::HandleScbStarted(int32_t userId, int32_t screenId
}
session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return;
}
session->AddRestartIme();
@ -1621,7 +1621,7 @@ void InputMethodSystemAbility::HandleUserSwitched(int32_t userId)
}
session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return;
}
auto imeData = session->GetReadyImeData(ImeType::IME);
@ -1669,7 +1669,7 @@ void InputMethodSystemAbility::HandleWmsStarted()
}
session = UserSessionManager::GetInstance().GetUserSession(userId_);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId_);
IMSA_HILOGE("%{public}d session is nullptr", userId_);
return;
}
session->AddRestartIme();
@ -1681,7 +1681,7 @@ void InputMethodSystemAbility::HandleFocusChanged(bool isFocused, int32_t pid, i
int32_t userId = GetUserId(uid);
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("[%{public}d, %{public}d] session is nullptr!", uid, userId);
IMSA_HILOGE("[%{public}d, %{public}d] session is nullptr", uid, userId);
return;
}
isFocused ? session->OnFocused(pid, uid) : session->OnUnfocused(pid, uid);
@ -1698,7 +1698,7 @@ void InputMethodSystemAbility::HandleMemStarted()
}
session = UserSessionManager::GetInstance().GetUserSession(userId_);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId_);
IMSA_HILOGE("%{public}d session is nullptr", userId_);
return;
}
session->AddRestartIme();
@ -1753,7 +1753,7 @@ bool InputMethodSystemAbility::IsCurrentIme(int32_t userId)
{
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return false;
}
auto bundleName = FullImeInfoManager::GetInstance().Get(userId, IPCSkeleton::GetCallingTokenID());
@ -1769,7 +1769,7 @@ int32_t InputMethodSystemAbility::StartInputType(int32_t userId, InputType type)
{
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
if (session == nullptr) {
IMSA_HILOGE("%{public}d session is nullptr!", userId);
IMSA_HILOGE("%{public}d session is nullptr", userId);
return ErrorCode::ERROR_NULL_POINTER;
}
ImeIdentification ime;

View File

@ -223,7 +223,7 @@ int32_t InputMethodSystemAbilityStub::GetCurrentInputMethodSubtypeOnRemote(Messa
: ErrorCode::ERROR_EX_PARCELABLE;
}
if (!ITypesUtil::Marshal(reply, ErrorCode::NO_ERROR, *property)) {
IMSA_HILOGE("marshal failed!");
IMSA_HILOGE("marshal failed");
return ErrorCode::ERROR_EX_PARCELABLE;
}
return ErrorCode::NO_ERROR;
@ -239,7 +239,7 @@ int32_t InputMethodSystemAbilityStub::ListInputMethodOnRemote(MessageParcel &dat
std::vector<Property> properties = {};
auto ret = ListInputMethod(InputMethodStatus(status), properties);
if (!ITypesUtil::Marshal(reply, ret, properties)) {
IMSA_HILOGE("marshal failed!");
IMSA_HILOGE("marshal failed");
return ErrorCode::ERROR_EX_PARCELABLE;
}
return ErrorCode::NO_ERROR;

View File

@ -1017,7 +1017,7 @@ bool PerUserSession::GetCurrentUsingImeId(ImeIdentification &imeId)
}
auto currentImeCfg = ImeCfgManager::GetInstance().GetCurrentImeCfg(userId_);
if (currentImeCfg == nullptr) {
IMSA_HILOGE("currentImeCfg is nullptr!");
IMSA_HILOGE("currentImeCfg is nullptr");
return false;
}
imeId.bundleName = currentImeCfg->bundleName;
@ -1132,7 +1132,7 @@ int32_t PerUserSession::OnUpdateListenEventFlag(const InputClientInfo &clientInf
auto remoteClient = clientInfo.client->AsObject();
auto ret = AddClientInfo(remoteClient, clientInfo, START_LISTENING);
if (ret != ErrorCode::NO_ERROR) {
IMSA_HILOGE("failed to AddClientInfo!");
IMSA_HILOGE("failed to AddClientInfo");
return ret;
}
auto info = GetClientInfo(remoteClient);
@ -1262,7 +1262,7 @@ int32_t PerUserSession::RequestIme(const std::shared_ptr<ImeData> &data, Request
return exec();
}
if (data == nullptr || data->freezeMgr == nullptr) {
IMSA_HILOGE("data is nullptr!");
IMSA_HILOGE("data is nullptr");
return ErrorCode::NO_ERROR;
}
data->freezeMgr->BeforeIpc(type);
@ -1308,7 +1308,7 @@ int32_t PerUserSession::RemoveCurrentClient()
{
auto currentClient = GetCurrentClient();
if (currentClient == nullptr) {
IMSA_HILOGE("currentClient is nullptr!");
IMSA_HILOGE("currentClient is nullptr");
return ErrorCode::ERROR_CLIENT_NULL_POINTER;
}
return RemoveClient(currentClient, false);
@ -1360,7 +1360,7 @@ bool PerUserSession::RestartIme()
if (IsReady(MEMORY_MANAGER_SA_ID) && IsWmsReady() && runningIme_.empty()) {
auto ret = StartCurrentIme(true);
if (!ret) {
IMSA_HILOGE("start ime failed!");
IMSA_HILOGE("start ime failed");
}
}
int32_t tasks = 0;
@ -1572,7 +1572,7 @@ bool PerUserSession::StopReadyCurrentIme()
return true;
}
if (imeData->core == nullptr) {
IMSA_HILOGE("core is nullptr!");
IMSA_HILOGE("core is nullptr.");
return ForceStopCurrentIme();
}
auto ret = RequestIme(imeData, RequestType::NORMAL, [&imeData] {