mirror of
https://gitee.com/openharmony/inputmethod_imf
synced 2024-11-23 06:40:06 +00:00
commit
d1c333a063
@ -171,11 +171,11 @@ sptr<IInputMethodSystemAbility> InputMethodController::GetSystemAbilityProxy()
|
||||
void InputMethodController::RemoveDeathRecipient()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(abilityLock_);
|
||||
if (abilityManager_ == nullptr || deathRecipient_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (abilityManager_ != nullptr && abilityManager_->AsObject() != nullptr && deathRecipient_ != nullptr) {
|
||||
abilityManager_->AsObject()->RemoveDeathRecipient(deathRecipient_);
|
||||
}
|
||||
deathRecipient_ = nullptr;
|
||||
abilityManager_ = nullptr;
|
||||
}
|
||||
|
||||
void InputMethodController::DeactivateClient()
|
||||
@ -356,6 +356,12 @@ int32_t InputMethodController::Close()
|
||||
return ReleaseInput(clientInfo_.client);
|
||||
}
|
||||
|
||||
void InputMethodController::Reset()
|
||||
{
|
||||
Close();
|
||||
RemoveDeathRecipient();
|
||||
}
|
||||
|
||||
int32_t InputMethodController::RequestShowInput()
|
||||
{
|
||||
auto proxy = GetSystemAbilityProxy();
|
||||
@ -498,7 +504,6 @@ int32_t InputMethodController::ReleaseInput(sptr<IInputClient> &client)
|
||||
if (ret == ErrorCode::NO_ERROR) {
|
||||
OnInputStop();
|
||||
}
|
||||
RemoveDeathRecipient();
|
||||
SetTextListener(nullptr);
|
||||
return ret;
|
||||
}
|
||||
|
@ -778,6 +778,16 @@ public:
|
||||
*/
|
||||
IMF_API bool IsCurrentImeByPid(int32_t pid);
|
||||
|
||||
/**
|
||||
* @brief Reset controller.
|
||||
*
|
||||
* This function is used to reset controller.
|
||||
* Do not call this interface unless you know what you are doing
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
IMF_API void Reset();
|
||||
|
||||
private:
|
||||
InputMethodController();
|
||||
~InputMethodController();
|
||||
|
Loading…
Reference in New Issue
Block a user