!103 fix warning

Merge pull request !103 from demon/master
This commit is contained in:
openharmony_ci
2022-03-26 03:03:35 +00:00
committed by Gitee
101 changed files with 370 additions and 347 deletions
+4 -3
View File
@@ -24,12 +24,13 @@ namespace OHOS {
virtual ~ParaHandle() = default;
static bool SetDefaultIme(int32_t userId, const std::string &imeName);
static std::string GetDefaultIme(int32_t userId);
private:
static const char *DEFAULT_IME_KEY;
static const char *DEFAULT_IME_NAME;
static constexpr int CONFIG_LEN = 128;
static const int32_t main_userId = 100;
};
}
}
#endif // OHOS_MISCSERVICES_INPUTMETHOD_PARA_HANDLE_H
} // namespace MiscServices
} // namespace OHOS
#endif // ETC_PARA_INCLUDE_PARA_HANDLE_H
+2 -2
View File
@@ -44,5 +44,5 @@ namespace OHOS {
SetDefaultIme(userId, DEFAULT_IME_NAME);
return DEFAULT_IME_NAME;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -40,6 +40,6 @@ namespace MiscServices {
virtual void OnSelectionChange(std::u16string text, int32_t oldBegin, int32_t oldEnd,
int32_t newBegin, int32_t newEnd) = 0;
};
}
}
#endif // FM_IMMS_PROJECT_IINPUTMETHODAGENT_H
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_I_INPUT_METHOD_AGENT_H
@@ -61,6 +61,6 @@ namespace MiscServices {
virtual void SetClientState(bool state) = 0;
virtual void StopInputService(std::string imeId) = 0;
};
}
}
#endif // FM_IMMS_PROJECT_IINPUTMETHODCORE_H
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_I_INPUT_METHOD_CORE_H
@@ -105,6 +105,6 @@ namespace MiscServices {
void ShowInputWindow();
void DissmissInputWindow();
};
}
}
#endif // FM_IMMS_PROJECT_INPUTMETHODABILITY_H
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_INPUT_METHOD_ABILITY_H
@@ -31,9 +31,10 @@ namespace MiscServices {
void OnCursorUpdate(int32_t positionX, int32_t positionY, int32_t height) override;
void OnSelectionChange(std::u16string text, int32_t oldBegin, int32_t oldEnd,
int32_t newBegin, int32_t newEnd) override;
private:
static inline BrokerDelegator<InputMethodAgentProxy> delegator_;
};
}
}
#endif // FM_IMC_PROJECT_INPUTMETHODAGENTPROXY_H
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_INPUT_METHOD_AGENT_PROXY_H
@@ -28,18 +28,19 @@ namespace MiscServices {
public:
explicit InputMethodAgentStub();
virtual ~InputMethodAgentStub();
virtual int32_t OnRemoteRequest(uint32_t code,
int32_t OnRemoteRequest(uint32_t code,
MessageParcel &data,
MessageParcel &reply,
MessageOption &option) override;
virtual bool DispatchKeyEvent(MessageParcel &data) override;
virtual void OnCursorUpdate(int32_t positionX, int32_t positionY, int height) override;
virtual void OnSelectionChange(std::u16string text, int32_t oldBegin, int32_t oldEnd,
bool DispatchKeyEvent(MessageParcel &data) override;
void OnCursorUpdate(int32_t positionX, int32_t positionY, int height) override;
void OnSelectionChange(std::u16string text, int32_t oldBegin, int32_t oldEnd,
int32_t newBegin, int32_t newEnd) override;
void SetMessageHandler(MessageHandler *msgHandler);
private:
MessageHandler *msgHandler_;
};
}
}
#endif // FM_IMC_PROJECT_INPUTMETHODAGENTSTUB_H
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_INPUT_METHOD_AGENT_STUB_H
@@ -34,22 +34,23 @@ namespace MiscServices {
DISALLOW_COPY_AND_MOVE(InputMethodCoreProxy);
virtual int32_t initializeInput(sptr<IRemoteObject>& startInputToken, int32_t displayId,
int32_t initializeInput(sptr<IRemoteObject>& startInputToken, int32_t displayId,
sptr<IInputControlChannel>& inputControlChannel) override;
virtual bool startInput(const sptr<IInputDataChannel>& inputDataChannel,
bool startInput(const sptr<IInputDataChannel>& inputDataChannel,
const InputAttribute& editorAttribute,
bool supportPhysicalKbd) override;
virtual int32_t stopInput() override;
virtual bool showKeyboard(const sptr<IInputDataChannel>& inputDataChannel) override;
virtual bool hideKeyboard(int32_t flags) override;
virtual int32_t setKeyboardType(const KeyboardType& type) override;
virtual int32_t getKeyboardWindowHeight(int32_t retHeight) override;
virtual int32_t InitInputControlChannel(sptr<IInputControlChannel> &inputControlChannel) override;
virtual void SetClientState(bool state) override;
virtual void StopInputService(std::string imeId) override;
int32_t stopInput() override;
bool showKeyboard(const sptr<IInputDataChannel>& inputDataChannel) override;
bool hideKeyboard(int32_t flags) override;
int32_t setKeyboardType(const KeyboardType& type) override;
int32_t getKeyboardWindowHeight(int32_t retHeight) override;
int32_t InitInputControlChannel(sptr<IInputControlChannel> &inputControlChannel) override;
void SetClientState(bool state) override;
void StopInputService(std::string imeId) override;
private:
static inline BrokerDelegator<InputMethodCoreProxy> delegator_;
};
}
}
#endif // FM_IMC_PROJECT_INPUTMETHODCOREPROXY_H
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_INPUT_METHOD_CORE_PROXY_H
@@ -38,30 +38,30 @@ namespace MiscServices {
DISALLOW_COPY_AND_MOVE(InputMethodCoreStub);
explicit InputMethodCoreStub(int userId);
virtual ~InputMethodCoreStub();
virtual int OnRemoteRequest(uint32_t code,
int OnRemoteRequest(uint32_t code,
MessageParcel &data,
MessageParcel &reply,
MessageOption &option) override;
virtual int32_t initializeInput(sptr<IRemoteObject>& startInputToken, int32_t displayId,
int32_t initializeInput(sptr<IRemoteObject>& startInputToken, int32_t displayId,
sptr<IInputControlChannel>& inputControlChannel) override;
virtual bool startInput(const sptr<IInputDataChannel>& inputDataChannel,
bool startInput(const sptr<IInputDataChannel>& inputDataChannel,
const InputAttribute& editorAttribute,
bool supportPhysicalKbd) override;
virtual int32_t stopInput() override;
virtual bool showKeyboard(const sptr<IInputDataChannel>& inputDataChannel) override;
virtual bool hideKeyboard(int32_t flags)override;
virtual int32_t setKeyboardType(const KeyboardType& type) override;
virtual int32_t getKeyboardWindowHeight(int32_t retHeight) override;
virtual int32_t InitInputControlChannel(sptr<IInputControlChannel> &inputControlChannel) override;
virtual void SetClientState(bool state) override;
virtual void StopInputService(std::string imeId) override;
int32_t stopInput() override;
bool showKeyboard(const sptr<IInputDataChannel>& inputDataChannel) override;
bool hideKeyboard(int32_t flags)override;
int32_t setKeyboardType(const KeyboardType& type) override;
int32_t getKeyboardWindowHeight(int32_t retHeight) override;
int32_t InitInputControlChannel(sptr<IInputControlChannel> &inputControlChannel) override;
void SetClientState(bool state) override;
void StopInputService(std::string imeId) override;
void SetMessageHandler(MessageHandler *msgHandler);
private:
int userId_;
MessageHandler *msgHandler_;
};
}
}
#endif // FM_IMMS_PROJECT_INPUTCONTROLCHANNEL_SK_H
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_INPUT_METHOD_CORE_STUB_H
@@ -458,5 +458,5 @@ namespace MiscServices {
}
inputDataChannel->StopInput();
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -73,5 +73,5 @@ namespace MiscServices {
Remote()->SendRequest(ON_SELECTION_CHANGE, data, reply, option);
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -116,5 +116,5 @@ namespace MiscServices {
{
msgHandler_ = msgHandler;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -311,5 +311,5 @@ namespace MiscServices {
retHeight = reply.ReadInt32();
return ErrorCode::NO_ERROR;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -304,5 +304,5 @@ namespace MiscServices {
{
msgHandler_ = msgHandler;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -41,6 +41,6 @@ namespace MiscServices {
virtual int32_t onInputReleased(int32_t retValue) = 0;
virtual int32_t setDisplayMode(int32_t mode) = 0;
};
}
}
#endif // FM_IMMS_PROJECT_IINPUTCLIENT_H
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_I_INPUT_CLIENT_H
@@ -58,6 +58,6 @@ namespace MiscServices {
virtual int32_t GetInputPattern() = 0;
virtual void StopInput() = 0;
};
}
}
#endif // FM_IMMS_PROJECT_IINPUTDATACHANNEL_H
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_I_INPUT_DATA_CHANNEL_H
@@ -35,6 +35,6 @@ namespace MiscServices {
private:
static inline BrokerDelegator<InputClientProxy> delegator_;
};
}
}
#endif
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_CLIENT_PROXY_H
@@ -36,9 +36,10 @@ namespace MiscServices {
int32_t onInputReady(const sptr<IInputMethodAgent>& agent) override;
int32_t onInputReleased(int32_t retValue) override;
int32_t setDisplayMode(int32_t mode) override;
private:
MessageHandler *msgHandler = nullptr;
};
}
}
#endif
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_CLIENT_STUB_H
@@ -44,6 +44,6 @@ namespace MiscServices {
private:
static inline BrokerDelegator<InputDataChannelProxy> delegator_;
};
}
}
#endif
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_DATA_CHANNEL_PROXY_H
@@ -48,9 +48,10 @@ namespace MiscServices {
int32_t GetEnterKeyType() override;
int32_t GetInputPattern() override;
void StopInput() override;
private:
MessageHandler *msgHandler;
};
}
}
#endif
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_DATA_CHANNEL_STUB_H
@@ -71,6 +71,7 @@ namespace MiscServices {
int32_t GetEnterKeyType();
int32_t GetInputPattern();
void HideCurrentInput();
private:
InputMethodController();
~InputMethodController();
@@ -106,6 +107,6 @@ namespace MiscServices {
int32_t enterKeyType_ = 0;
int32_t inputPattern_ = 0;
};
}
}
#endif
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_METHOD_CONTROLLER_H
@@ -36,12 +36,12 @@ namespace MiscServices {
~InputMethodSystemAbilityProxy() = default;
DISALLOW_COPY_AND_MOVE(InputMethodSystemAbilityProxy);
virtual void prepareInput(MessageParcel& data) override;
virtual void releaseInput(MessageParcel& data) override;
virtual void startInput(MessageParcel& data) override;
virtual void stopInput(MessageParcel& data) override;
virtual void SetCoreAndAgent(MessageParcel& data) override;
virtual void HideCurrentInput(MessageParcel& data) override;
void prepareInput(MessageParcel& data) override;
void releaseInput(MessageParcel& data) override;
void startInput(MessageParcel& data) override;
void stopInput(MessageParcel& data) override;
void SetCoreAndAgent(MessageParcel& data) override;
void HideCurrentInput(MessageParcel& data) override;
int32_t Prepare(int32_t displayId, sptr<InputClientStub> &client, sptr<InputDataChannelStub> &channel,
InputAttribute &attribute);
@@ -49,17 +49,17 @@ namespace MiscServices {
int32_t Start(sptr<InputClientStub> &client);
int32_t Stop(sptr<InputClientStub> &client);
virtual void displayOptionalInputMethod(MessageParcel& data) override;
virtual int32_t getDisplayMode(int32_t retMode) override;
virtual int32_t getKeyboardWindowHeight(int32_t retHeight) override;
virtual int32_t getCurrentKeyboardType(KeyboardType *retType) override;
virtual int32_t listInputMethodEnabled(std::vector<InputMethodProperty*> *properties) override;
virtual int32_t listInputMethod(std::vector<InputMethodProperty*> *properties) override;
virtual int32_t listKeyboardType(const std::u16string& imeId, std::vector<KeyboardType*> *types) override;
void displayOptionalInputMethod(MessageParcel& data) override;
int32_t getDisplayMode(int32_t retMode) override;
int32_t getKeyboardWindowHeight(int32_t retHeight) override;
int32_t getCurrentKeyboardType(KeyboardType *retType) override;
int32_t listInputMethodEnabled(std::vector<InputMethodProperty*> *properties) override;
int32_t listInputMethod(std::vector<InputMethodProperty*> *properties) override;
int32_t listKeyboardType(const std::u16string& imeId, std::vector<KeyboardType*> *types) override;
private:
static inline BrokerDelegator<InputMethodSystemAbilityProxy> delegator_;
};
}
}
#endif
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_METHOD_SYSTEM_ABILITY_PROXY_H
@@ -93,10 +93,12 @@ namespace MiscServices {
HIDE,
SHOW
};
enum class FunctionKey {
NONE = 0,
CONFIRM
};
class KeyboardInfo {
public:
KeyboardStatus GetKeyboardStatus() const
@@ -118,10 +120,11 @@ namespace MiscServices {
{
functionKey = static_cast<FunctionKey>(key);
}
private:
KeyboardStatus keyboardStatus = KeyboardStatus::NONE;
FunctionKey functionKey = FunctionKey::NONE;
};
}
}
#endif // FM_IMC_PROJECT_INPUT_METHOD_UTILS_H
} // namespace MiscServices
} // namespace OHOS
#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_METHOD_UTILS_H
@@ -63,5 +63,5 @@ using namespace ErrorCode;
auto status = Remote()->SendRequest(SET_DISPLAY_MODE, data, reply, option);
return status;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -91,5 +91,5 @@ namespace MiscServices {
{
msgHandler = handler;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -177,5 +177,5 @@ namespace MiscServices {
Remote()->SendRequest(STOP_INPUT, data, reply, option);
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -212,5 +212,5 @@ namespace MiscServices {
{
msgHandler = handler;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -420,5 +420,5 @@ using namespace MessageID;
IMSA_HILOGI("InputMethodController::GetInputPattern");
return inputPattern_;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -437,5 +437,5 @@ namespace MiscServices {
}
return NO_ERROR;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -15,6 +15,5 @@
#include "input_method_utils.h"
namespace OHOS {
namespace MiscServices {
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -28,9 +28,10 @@ namespace OHOS {
static void Finalizer(NativeEngine *engine, void *data, void *hint);
static NativeValue* StopInput(NativeEngine* engine, NativeCallbackInfo* info);
private:
NativeValue* OnStopInput(NativeEngine& engine, NativeCallbackInfo& info);
};
}
}
#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_SETTING_H
} // namespace MiscServices
} // namespace OHOS
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHOD_INCLUDE_JS_INPUT_METHOD_CONTROLLER_H
@@ -26,7 +26,7 @@
namespace OHOS {
namespace MiscServices {
NativeValue* JsInputMethodRegistryInit(NativeEngine* engine, NativeValue* exportObj);
}
}
} // namespace MiscServices
} // namespace OHOS
#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_REGISTRY_H
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHOD_INCLUDE_JS_INPUT_METHOD_REGISTRY_H
@@ -29,10 +29,11 @@ namespace OHOS {
static void Finalizer(NativeEngine *engine, void *data, void *hint);
static NativeValue* DisplayOptionalInputMethod(NativeEngine* engine, NativeCallbackInfo* info);
static NativeValue* ListInputMethod(NativeEngine* engine, NativeCallbackInfo* info);
private:
NativeValue* OnDisplayOptionalInputMethod(NativeEngine& engine, NativeCallbackInfo& info);
NativeValue* OnListInputMethod(NativeEngine& engine, NativeCallbackInfo& info);
};
}
}
#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_SETTING_H
} // namespace MiscServices
} // namespace OHOS
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHOD_INCLUDE_JS_INPUT_METHOD_SETTING_H
@@ -24,6 +24,6 @@ namespace OHOS {
namespace MiscServices {
NativeValue *CreateInputMethodSetting(NativeEngine& engine);
NativeValue *CreateInputMethodController(NativeEngine& engine);
}
}
#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_SETTING_UTILS_H
} // namespace MiscServices
} // namespace OHOS
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHOD_INCLUDE_JS_INPUT_METHOD_UTILS_H
@@ -26,4 +26,4 @@ extern "C" __attribute__((constructor)) void NAPI_inputMethod_AutoRegister()
};
moduleManager->Register(&newModuleInfo);
}
}
@@ -50,5 +50,5 @@ namespace MiscServices {
return result;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -107,5 +107,5 @@ namespace MiscServices {
return engine->CreateUndefined();
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -84,5 +84,5 @@ namespace MiscServices {
return arrayValue;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -57,5 +57,5 @@ namespace OHOS {
BindNativeFunction(engine, *object, "stopInput", JsInputMethodController::StopInput);
return objValue;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -25,8 +25,7 @@ namespace OHOS {
JsEditorAttribute() = default;
~JsEditorAttribute() = default;
static void Finalizer(NativeEngine* engine, void* data, void* hint);
private:
};
}
}
#endif // OHOS_MISCSERVICES_JS_EDITOR_ATTRIBUTE_H
} // namespace MiscServices
} // namespace OHOS
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_EDITOR_ATTRIBUTE_H
@@ -30,6 +30,7 @@ namespace OHOS {
static void Finalizer(NativeEngine* engine, void* data, void* hint);
static NativeValue* RegisterCallback(NativeEngine* engine, NativeCallbackInfo* info);
static NativeValue* UnRegisterCallback(NativeEngine* engine, NativeCallbackInfo* info);
private:
sptr<JsInputMethodEngineListener> imeListener_;
std::mutex mtx_;
@@ -38,6 +39,6 @@ namespace OHOS {
std::shared_ptr<AppExecFwk::EventHandler> GetMainHandler();
std::shared_ptr<AppExecFwk::EventHandler> mainHandler_ = nullptr;
};
}
}
#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_ENGINE_H
} // namespace MiscServices
} // namespace OHOS
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_INPUT_METHOD_ENGINE_H
@@ -39,6 +39,7 @@ namespace MiscServices {
void OnKeyboardStatus(bool isShow);
void OnInputStart();
void OnInputStop(std::string imeId);
private:
void AddCallback(std::string type, NativeValue* jsListenerObject);
void CallJsMethod(std::string methodName, NativeValue* const* argv = nullptr, size_t argc = 0);
@@ -50,6 +51,6 @@ namespace MiscServices {
std::map<std::string, std::vector<std::unique_ptr<NativeReference>>> jsCbMap_;
std::shared_ptr<AppExecFwk::EventHandler> mainHandler_ = nullptr;
};
}
}
#endif // FM_IMMS_PROJECT_JS_INPUT_METHOD_ENGINE_LISTENER_H
} // namespace MiscServices
} // namespace OHOS
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_INPUT_METHOD_ENGINE_LISTENER_H
@@ -27,7 +27,7 @@
namespace OHOS {
namespace MiscServices {
NativeValue* JsInputMethodEngineRegistryInit(NativeEngine* engine, NativeValue* exportObj);
}
}
} // namespace MiscServices
} // namespace OHOS
#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_ENGINE_REGISTRY_H
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_INPUT_METHOD_ENGINE_REGISTRY_H
@@ -32,6 +32,6 @@ namespace OHOS {
NativeValue *CreateTextInputClient(NativeEngine& engine);
NativeValue *CreateKeyboardDelegate(NativeEngine& engine);
NativeValue *CreateEditorAttribute(NativeEngine& engine);
}
}
#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_ENGINE_UTILS_H
} // namespace MiscServices
} // namespace OHOS
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_INPUT_METHOD_UTILS_H
@@ -26,9 +26,10 @@ namespace OHOS {
~JsKeyboardController() = default;
static void Finalizer(NativeEngine* engine, void* data, void* hint);
static NativeValue* HideKeyboardSelf(NativeEngine* engine, NativeCallbackInfo* info);
private:
NativeValue* OnHideKeyboardSelf(NativeEngine& engine, NativeCallbackInfo& info);
};
}
}
#endif // OHOS_MISCSERVICES_JS_KEYBOARD_CONTROLLER_H
} // namespace MiscServices
} // namespace OHOS
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_KEYBOARD_CONTROLLER_H
@@ -32,6 +32,7 @@ namespace OHOS {
static void Finalizer(NativeEngine* engine, void* data, void* hint);
static NativeValue* RegisterCallback(NativeEngine* engine, NativeCallbackInfo* info);
static NativeValue* UnRegisterCallback(NativeEngine* engine, NativeCallbackInfo* info);
private:
sptr<JsKeyboardDelegateListener> kdListener_;
std::mutex mtx_;
@@ -40,6 +41,6 @@ namespace OHOS {
std::shared_ptr<AppExecFwk::EventHandler> GetMainHandler();
std::shared_ptr<AppExecFwk::EventHandler> mainHandler_ = nullptr;
};
}
}
#endif // OHOS_MISCSERVICES_JS_KEYBOARD_DELEGATE_H
} // namespace MiscServices
} // namespace OHOS
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_KEYBOARD_DELEGATE_H
@@ -40,6 +40,7 @@ namespace MiscServices {
void OnCursorUpdate(int32_t positionX, int32_t positionY, int height);
void OnSelectionChange(int32_t oldBegin, int32_t oldEnd, int32_t newBegin, int32_t newEnd);
void OnTextChange(std::string text);
private:
void AddCallback(std::string type, NativeValue* jsListenerObject);
void CallJsMethod(std::string methodName, NativeValue* const* argv = nullptr, size_t argc = 0);
@@ -51,6 +52,6 @@ namespace MiscServices {
std::map<std::string, std::vector<std::unique_ptr<NativeReference>>> jsCbMap_;
std::shared_ptr<AppExecFwk::EventHandler> mainHandler_ = nullptr;
};
}
}
#endif // FM_IMMS_PROJECT_JS_KEYBOARD_DELEGATE_LISTENER_H
} // namespace MiscServices
} // namespace OHOS
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_KEYBOARD_DELEGATE_LISTENER_H
@@ -32,6 +32,7 @@ namespace OHOS {
static NativeValue* GetForward(NativeEngine* engine, NativeCallbackInfo* info);
static NativeValue* GetBackward(NativeEngine* engine, NativeCallbackInfo* info);
static NativeValue* GetEditorAttribute(NativeEngine* engine, NativeCallbackInfo* info);
private:
NativeValue* OnInsertText(NativeEngine& engine, NativeCallbackInfo& info);
NativeValue* OnDeleteForward(NativeEngine& engine, NativeCallbackInfo& info);
@@ -41,6 +42,6 @@ namespace OHOS {
NativeValue* OnGetBackward(NativeEngine& engine, NativeCallbackInfo& info);
NativeValue* OnGetEditorAttribute(NativeEngine& engine, NativeCallbackInfo& info);
};
}
}
#endif // OHOS_MISCSERVICES_JS_TEXT_INPUT_CLIENT_H
} // namespace MiscServices
} // namespace OHOS
#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_TEXT_INPUT_CLIENT_H
@@ -26,4 +26,4 @@ extern "C" __attribute__((constructor)) void NAPI_inputMethodEngine_AutoRegister
};
moduleManager->Register(&newModuleInfo);
}
}
@@ -27,5 +27,5 @@ namespace MiscServices {
IMSA_HILOGI("JsEditorAttribute::Finalizer is called");
std::unique_ptr<JsEditorAttribute>(static_cast<JsEditorAttribute*>(data));
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -107,5 +107,5 @@ namespace MiscServices {
}
return engine.CreateUndefined();
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -198,5 +198,5 @@ namespace MiscServices {
};
mainHandler_->PostTask(task);
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -170,5 +170,5 @@ namespace MiscServices {
object->SetProperty("CURSOR_RIGHT", CreateJsValue(*engine, static_cast<uint32_t>(4)));
return engine->CreateUndefined();
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -122,5 +122,5 @@ namespace OHOS {
return objValue;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -48,5 +48,5 @@ namespace MiscServices {
return engine.CreateUndefined();
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -108,5 +108,5 @@ namespace MiscServices {
}
return engine.CreateUndefined();
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -223,5 +223,5 @@ namespace MiscServices {
mainHandler_->PostTask(task);
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -229,5 +229,5 @@ namespace MiscServices {
return CreateEditorAttribute(engine);
}
}
}
} // namespace MiscServices
} // namespace OHOS
+4 -4
View File
@@ -62,7 +62,7 @@ namespace CommonEvent {
COMMON_EVENT_PACKAGE_ADDED = 10006, // a package is installed.
COMMON_EVENT_PACKAGE_REMOVED = 10007, // a package is removed
};
};
}; // namespace CommonEvent
// User State
namespace UserState {
@@ -72,7 +72,7 @@ namespace UserState {
USER_STATE_STARTED = 0, // a user is started.
USER_STATE_UNLOCKED, // a user is unlocked.
};
};
}; // namespace UserState
// Error Code
namespace ErrorCode {
@@ -147,7 +147,7 @@ namespace ErrorCode {
ERROR_CLIENT_NOT_FOUND, // client is not found
};
const char* ToString(int errorCode);
};
}; // namespace ErrorCode
static constexpr HiviewDFX::HiLogLabel g_SMALL_SERVICES_LABEL = {
LOG_CORE,
@@ -167,4 +167,4 @@ static constexpr HiviewDFX::HiLogLabel g_SMALL_SERVICES_LABEL = {
"line: %d, function: %s," fmt, __LINE__, __FUNCTION__, ##__VA_ARGS__)
}
}
#endif // FM_IMMS_PROJECT_GLOBAL_H
#endif // SERVICES_INCLUDE_GLOBAL_H
+3 -3
View File
@@ -39,6 +39,6 @@ namespace OHOS {
virtual void setDisplayMode(int mode) = 0;
virtual void onKeyboardShowed() = 0;
};
}
}
#endif // FM_IMMS_PROJECT_IINPUTCONTROLCHANNEL_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_I_INPUT_CONTROL_CHANNEL_H
@@ -66,6 +66,6 @@ namespace MiscServices {
virtual int32_t listInputMethod(std::vector<InputMethodProperty*> *properties) = 0;
virtual int32_t listKeyboardType(const std::u16string& imeId, std::vector<KeyboardType*> *types) = 0;
};
}
}
#endif // FM_IMMS_PROJECT_IINPUTMETHODSYSTEMABILITY_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_I_INPUT_METHOD_SYSTEM_ABILITY_H
+3 -3
View File
@@ -57,6 +57,6 @@ namespace OHOS {
virtual int32_t getInputMethodSetting(int userId, InputMethodSetting *inputMethodSetting) = 0;
virtual int32_t setInputMethodSetting(int userId, const InputMethodSetting& inputMethodSetting) = 0;
};
}
}
#endif // FM_IMMS_PROJECT_IPLATFORMAPI_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_I_PLATFORM_API_H
+3 -3
View File
@@ -34,6 +34,6 @@ namespace MiscServices {
virtual void notifyEvent(int eventId, int userId, const std::vector<std::u16string>& eventContent) = 0;
};
}
}
#endif // FM_IMMS_PROJECT_IPLATFORMCALLBACK_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_I_PLATFORM_CALLBACK_H
+1 -1
View File
@@ -46,4 +46,4 @@ private:
};
} // namespace MiscServices
} // namespace OHOS
#endif // FM_IMMS_PROJECT_IPLATFORMCALLBACK_H
#endif // SERVICES_INCLUDE_IM_COMMON_EVENT_MANAGER_H
+5 -4
View File
@@ -25,18 +25,19 @@ namespace MiscServices {
InputAttribute(const InputAttribute& attribute);
InputAttribute& operator =(const InputAttribute& attribute);
~InputAttribute();
virtual bool Marshalling(Parcel &parcel) const override;
bool Marshalling(Parcel &parcel) const override;
static InputAttribute *Unmarshalling(Parcel &parcel);
void SetInputPattern(int32_t pattern);
bool GetSecurityFlag();
static const int32_t PATTERN_TEXT = 0x00000001;
static const int32_t PATTERN_PASSWORD = 0x00000007;
private:
int32_t inputPattern;
int32_t enterKeyType;
int32_t inputOption;
};
}
}
} // namespace MiscServices
} // namespace OHOS
#endif // FM_IMMS_PROJECT_INPUTATTRIBUTE_H
#endif // SERVICES_INCLUDE_INPUT_ATTRIBUTE_H
+5 -4
View File
@@ -26,14 +26,15 @@ namespace MiscServices {
public:
InputChannel();
~InputChannel();
virtual bool Marshalling(Parcel &parcel) const override;
bool Marshalling(Parcel &parcel) const override;
static InputChannel *Unmarshalling(Parcel &parcel);
private:
std::u16string name;
MessageParcel inputChannelParcel;
InputChannel(const InputChannel& channel);
InputChannel& operator =(const InputChannel& channel);
};
}
}
#endif // INPUTMETHODSYSTEMSERVICE_INPUTCHANNEL_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_INPUT_CHANNEL_H
@@ -33,11 +33,11 @@ namespace MiscServices {
InputControlChannelProxy(const sptr<IRemoteObject> &impl);
~InputControlChannelProxy();
virtual void hideKeyboardSelf(int flags) override;
virtual bool advanceToNext(bool isCurrentIme) override;
virtual void setDisplayMode(int mode) override;
virtual void onKeyboardShowed() override;
void hideKeyboardSelf(int flags) override;
bool advanceToNext(bool isCurrentIme) override;
void setDisplayMode(int mode) override;
void onKeyboardShowed() override;
};
}
}
#endif // FM_IMMS_PROJECT_INPUTCONTROLCHANNELPROXY_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_INPUT_CONTROL_CHANNEL_PROXY_H
@@ -31,17 +31,18 @@ namespace OHOS {
public:
explicit InputControlChannelStub(int userId);
virtual ~InputControlChannelStub();
virtual int OnRemoteRequest(uint32_t code,
int OnRemoteRequest(uint32_t code,
MessageParcel &data,
MessageParcel &reply,
MessageOption &option) override;
virtual void hideKeyboardSelf(int flags) override;
virtual bool advanceToNext(bool isCurrentIme) override;
virtual void setDisplayMode(int mode) override;
virtual void onKeyboardShowed() override;
void hideKeyboardSelf(int flags) override;
bool advanceToNext(bool isCurrentIme) override;
void setDisplayMode(int mode) override;
void onKeyboardShowed() override;
void ResetFlag();
bool WaitKeyboardReady();
private:
int userId_;
@@ -51,6 +52,6 @@ namespace OHOS {
bool keyboardReadyFlag = false;
const int32_t sleepTime = 300;
};
}
}
#endif // FM_IMMS_PROJECT_INPUTCONTROLCHANNELSTUB_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_INPUT_CONTROL_CHANNEL_STUB_H
@@ -41,6 +41,6 @@ namespace MiscServices {
MessageHandler *messageHandler;
int mIndex;
};
}
}
#endif // SERVICES_INPUTMETHODABILITYCONNECTIONSTUB_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_INPUT_METHOD_ABILITY_CONNECTION_STUB_H
+4 -4
View File
@@ -40,9 +40,9 @@ namespace MiscServices {
~InputMethodProperty();
InputMethodProperty(const InputMethodProperty& property);
InputMethodProperty& operator =(const InputMethodProperty& property);
virtual bool Marshalling(Parcel &parcel) const override;
bool Marshalling(Parcel &parcel) const override;
static InputMethodProperty *Unmarshalling(Parcel &parcel);
};
}
}
#endif // FM_IMMS_PROJECT_INPUTMETHODPROPERTY_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_INPUT_METHOD_PROPERTY_H
+4 -4
View File
@@ -55,7 +55,7 @@ namespace MiscServices {
void ClearData();
bool FindKey(const std::u16string& key) const;
virtual bool Marshalling(Parcel &parcel) const override;
bool Marshalling(Parcel &parcel) const override;
static InputMethodSetting *Unmarshalling(Parcel &parcel);
private:
@@ -65,6 +65,6 @@ namespace MiscServices {
std::vector<std::u16string> Split(const std::u16string& str, char16_t delim);
std::u16string BuildString(const std::vector<std::u16string>& vector, char16_t delim);
};
}
}
#endif // FM_IMMS_PROJECT_INPUTMETHODSETTING_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_INPUT_METHOD_SETTING_H
+12 -10
View File
@@ -47,16 +47,18 @@ namespace MiscServices {
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
MessageOption &option) override;
virtual int32_t getDisplayMode(int32_t retMode) override;
virtual int32_t getKeyboardWindowHeight(int32_t retHeight) override;
virtual int32_t getCurrentKeyboardType(KeyboardType *retType) override;
virtual int32_t listInputMethodEnabled(std::vector<InputMethodProperty*> *properties) override;
virtual int32_t listInputMethod(std::vector<InputMethodProperty*> *properties) override;
virtual int32_t listInputMethodByUserId(int32_t userId, std::vector<InputMethodProperty*> *properties) override;
virtual int32_t listKeyboardType(const std::u16string& imeId, std::vector<KeyboardType*> *types) override;
int32_t getDisplayMode(int32_t retMode) override;
int32_t getKeyboardWindowHeight(int32_t retHeight) override;
int32_t getCurrentKeyboardType(KeyboardType *retType) override;
int32_t listInputMethodEnabled(std::vector<InputMethodProperty*> *properties) override;
int32_t listInputMethod(std::vector<InputMethodProperty*> *properties) override;
int32_t listInputMethodByUserId(int32_t userId, std::vector<InputMethodProperty*> *properties) override;
int32_t listKeyboardType(const std::u16string& imeId, std::vector<KeyboardType*> *types) override;
protected:
void OnStart() override;
void OnStop() override;
private:
int32_t Init();
void Initialize();
@@ -96,6 +98,6 @@ namespace MiscServices {
static std::shared_ptr<AppExecFwk::EventHandler> serviceHandler_;
int32_t userId_;
};
}
}
#endif // FM_IMMS_PROJECT_INPUTMETHODSYSTEMABILITY_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_INPUT_METHOD_SYSTEM_ABILITY_H
@@ -29,19 +29,20 @@ namespace MiscServices {
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
MessageOption &option) override;
virtual void prepareInput(MessageParcel& data) override;
virtual void releaseInput(MessageParcel& data) override;
virtual void startInput(MessageParcel& data) override;
virtual void stopInput(MessageParcel& data) override;
virtual void SetCoreAndAgent(MessageParcel& data) override;
virtual void HideCurrentInput(MessageParcel& data) override;
virtual void displayOptionalInputMethod(MessageParcel& data) override;
void prepareInput(MessageParcel& data) override;
void releaseInput(MessageParcel& data) override;
void startInput(MessageParcel& data) override;
void stopInput(MessageParcel& data) override;
void SetCoreAndAgent(MessageParcel& data) override;
void HideCurrentInput(MessageParcel& data) override;
void displayOptionalInputMethod(MessageParcel& data) override;
virtual int32_t listInputMethodByUserId(int32_t userId, std::vector<InputMethodProperty*> *properties) = 0;
protected:
int32_t getUserId(int32_t uid);
int USER_ID_CHANGE_VALUE = 200000; // user range
};
}
}
} // namespace MiscServices
} // namespace OHOS
#endif // FM_IMMS_PROJECT_INPUTMETHODSYSTEMABILITY_SK_H
#endif // SERVICES_INCLUDE_INPUT_METHOD_SYSTEM_ABILITY_STUB_H
+4 -4
View File
@@ -28,7 +28,7 @@ namespace MiscServices {
KeyboardType(const KeyboardType& type);
~KeyboardType();
KeyboardType& operator =(const KeyboardType& type);
virtual bool Marshalling(Parcel &parcel) const override;
bool Marshalling(Parcel &parcel) const override;
static KeyboardType *Unmarshalling(Parcel &parcel);
void setId(int32_t typeId);
void setLabelId(int32_t labelId);
@@ -58,6 +58,6 @@ namespace MiscServices {
const int32_t ID_NONE = 0;
};
}
}
#endif // FM_IMMS_PROJECT_KEYBOARDTYPE_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_KEYBOARD_TYPE_H
+4 -3
View File
@@ -29,11 +29,12 @@ namespace MiscServices {
explicit Message(const Message& msg);
Message& operator =(const Message& msg);
~Message();
private:
Message(const Message&&);
Message& operator =(const Message&&);
};
}
}
} // namespace MiscServices
} // namespace OHOS
#endif // FM_IMMS_PROJECT_MESSAGE_H
#endif // SERVICES_INCLUDE_MESSAGE_H
+3 -3
View File
@@ -104,6 +104,6 @@ namespace MessageID {
MessageHandler(const MessageHandler&&);
MessageHandler& operator =(const MessageHandler&&);
};
}
}
#endif // FM_IMMS_PROJECT_MESSAGEHANDLER_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_MESSAGE_HANDLER_H
+5 -3
View File
@@ -46,6 +46,7 @@ namespace MiscServices {
RemoteObjectDeathRecipient(int userId, int msgId);
~RemoteObjectDeathRecipient();
void OnRemoteDied(const wptr<IRemoteObject>& who) override;
private:
int userId_; // the id of the user to whom the object is linking
int msgId_; // the message id can be MessageID::MSG_ID_CLIENT_DIED and MessageID::MSG_ID_IMS_DIED
@@ -114,6 +115,7 @@ namespace MiscServices {
void JoinWorkThread();
void StopInputService(std::string imeId);
static bool StartInputService();
private:
int userId_; // the id of the user to whom the object is linking
int userState; // the state of the user to whom the object is linking
@@ -186,6 +188,6 @@ namespace MiscServices {
void InitInputControlChannel();
void SendAgentToAllClients();
};
}
}
#endif // FM_IMMS_PROJECT_PERUSERSESSION_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_PERUSER_SESSION_H
+3 -3
View File
@@ -69,6 +69,6 @@ namespace MiscServices {
std::u16string GetKeyboardTypeLanguage(const InputMethodProperty *property, int32_t hashCode);
std::u16string GetImeId(const std::u16string& packageName);
};
}
}
#endif // FM_IMMS_PROJECT_PERUSERSETTING_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_PERUSER_SETTING_H
+3 -3
View File
@@ -60,6 +60,6 @@ namespace MiscServices {
Platform(const Platform&&);
Platform& operator =(const Platform&&);
};
}
}
#endif // FM_IMMS_PROJECT_PLATFORMAPI_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_PLATFORM_H
+5 -5
View File
@@ -29,10 +29,10 @@ namespace MiscServices {
PlatformCallbackStub();
~PlatformCallbackStub();
virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
MessageOption &option) override;
virtual void notifyEvent(int eventId, int userId, const std::vector<std::u16string>& eventContent) override;
void notifyEvent(int eventId, int userId, const std::vector<std::u16string>& eventContent) override;
};
}
}
#endif // FM_IMMS_PROJECT_PLATFORMCALLBACK_SK_H
} // namespace MiscServices
} // namespace OHOS
#endif // SERVICES_INCLUDE_PLATFORM_CALLBACK_STUB_H
+3 -3
View File
@@ -36,7 +36,7 @@ namespace MiscServices {
return std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> {}.from_bytes(str);
}
};
}
}
} // namespace MiscServices
} // namespace OHOS
#endif
#endif // SERVICES_INCLUDE_UTILS_H
+3 -4
View File
@@ -216,7 +216,6 @@ namespace MiscServices {
}
return "error is out of definition";
};
}
}
}
} // namespace ErrorCode
} // namespace MiscServices
} // namespace OHOS
+2 -2
View File
@@ -100,5 +100,5 @@ namespace MiscServices {
MessageHandler::Instance()->SendMessage(msg);
IMSA_HILOGI("ImCommonEventManager::startUser 3");
}
}
}
} // namespace MiscServices
} // namespace OHOS
+2 -2
View File
@@ -103,5 +103,5 @@ namespace MiscServices {
{
inputPattern = pattern;
}
}
}
} // namespace MiscServices
} // namespace OHOS
+2 -2
View File
@@ -58,5 +58,5 @@ namespace MiscServices {
inputChannel->inputChannelParcel.RewindRead(0);
return inputChannel;
}
}
}
} // namespace MiscServices
} // namespace OHOS
+2 -2
View File
@@ -82,5 +82,5 @@ namespace MiscServices {
Remote()->SendRequest(ON_KEYBOARD_SHOWED, data, reply, option);
IMSA_HILOGI("InputControlChannelProxy::onKeyboardShowed.");
}
}
}
} // namespace MiscServices
} // namespace OHOS
+2 -2
View File
@@ -182,5 +182,5 @@ namespace MiscServices {
}
return ret;
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -59,5 +59,5 @@ namespace MiscServices {
{
messageHandler = handler;
}
}
}
} // namespace MiscServices
} // namespace OHOS
+2 -2
View File
@@ -139,5 +139,5 @@ namespace MiscServices {
}
return info;
}
}
}
} // namespace MiscServices
} // namespace OHOS
+5 -5
View File
@@ -172,7 +172,7 @@ namespace MiscServices {
break;
}
}
if (flag == false) {
if (!flag) {
imeList.push_back(imeStr);
}
@@ -200,7 +200,7 @@ namespace MiscServices {
break;
}
}
if (flag == true) {
if (flag) {
std::u16string value = BuildString(imeList, DELIM_IME);
SetValue(ENABLED_INPUT_METHODS_TAG, value);
}
@@ -227,7 +227,7 @@ namespace MiscServices {
}
}
tmpVector.clear();
if (flag == false) {
if (!flag) {
return retValue;
}
@@ -340,5 +340,5 @@ namespace MiscServices {
}
return retValue;
}
}
}
} // namespace MiscServices
} // namespace OHOS
+4 -4
View File
@@ -765,7 +765,7 @@ namespace MiscServices {
IMSA_HILOGI("End...\n");
return ret;
}
if (securityImeFlag == true) {
if (securityImeFlag) {
InputMethodProperty *securityIme = setting->GetSecurityInputMethod();
InputMethodProperty *defaultIme = setting->GetCurrentInputMethod();
GetUserSession(userId)->ResetIme(defaultIme, securityIme);
@@ -814,7 +814,7 @@ namespace MiscServices {
IMSA_HILOGI("End...\n");
return ret;
}
if (securityImeFlag == true) {
if (securityImeFlag) {
InputMethodProperty *securityIme = setting->GetSecurityInputMethod();
InputMethodProperty *defaultIme = setting->GetCurrentInputMethod();
GetUserSession(userId)->ResetIme(defaultIme, securityIme);
@@ -1019,5 +1019,5 @@ namespace MiscServices {
}
return iface_cast<AAFwk::IAbilityManager>(abilityMsObj);
}
}
}
} // namespace MiscServices
} // namespace OHOS
@@ -312,5 +312,5 @@ namespace MiscServices {
{
return uid / USER_ID_CHANGE_VALUE;
}
}
}
} // namespace MiscServices
} // namespace OHOS
+2 -2
View File
@@ -182,5 +182,5 @@ namespace MiscServices {
{
return mCustomizedValue;
}
}
}
} // namespace MiscServices
} // namespace OHOS
+2 -2
View File
@@ -72,5 +72,5 @@ namespace MiscServices {
msgContent_ = nullptr;
}
}
}
}
} // namespace MiscServices
} // namespace OHOS
+2 -3
View File
@@ -76,6 +76,5 @@ namespace MiscServices {
}
return handler;
}
}
}
} // namespace MiscServices
} // namespace OHOS
+9 -9
View File
@@ -257,8 +257,8 @@ namespace MiscServices {
std::map<sptr<IRemoteObject>, ClientInfo*>::const_iterator it;
bool flag = false;
for (it = mapClients.cbegin(); it != mapClients.cend(); ++it) {
if ((i == DEFAULT_IME && it->second->attribute.GetSecurityFlag() == false) ||
(i == SECURITY_IME && it->second->attribute.GetSecurityFlag() == true)) {
if ((i == DEFAULT_IME && !it->second->attribute.GetSecurityFlag()) ||
(i == SECURITY_IME && it->second->attribute.GetSecurityFlag())) {
flag = true;
break;
}
@@ -607,7 +607,7 @@ namespace MiscServices {
break;
}
}
if (flag == false) {
if (!flag) {
IMSA_HILOGW("Aborted! The client died is not found! [%{public}d]\n", userId_);
return;
}
@@ -936,7 +936,7 @@ namespace MiscServices {
{
static int errorNum[2] = {0, 0};
static time_t past[2] = {time(0), time(0)};
if (resetFlag == true) {
if (resetFlag) {
errorNum[imeIndex] = 0;
past[imeIndex] = 0;
return 0;
@@ -1026,7 +1026,7 @@ namespace MiscServices {
}
}
}
if (flag == false) {
if (!flag) {
IMSA_HILOGW("The current keyboard type is not found in the current IME. Reset it!");
type = GetKeyboardType(imeIndex, currentKbdIndex[imeIndex]);
} else if (imsCore[imeIndex] == imsCore[1 - imeIndex]) {
@@ -1071,7 +1071,7 @@ namespace MiscServices {
return -1;
}
if (clientInfo->attribute.GetSecurityFlag() == true) {
if (clientInfo->attribute.GetSecurityFlag()) {
return SECURITY_IME;
}
return DEFAULT_IME;
@@ -1264,7 +1264,7 @@ namespace MiscServices {
imsCore[0] = core;
sptr<IRemoteObject> agentObject = data->ReadRemoteObject();
sptr<InputMethodAgentProxy> proxy=new InputMethodAgentProxy(agentObject);
sptr<InputMethodAgentProxy> proxy = new InputMethodAgentProxy(agentObject);
imsAgent = proxy;
InitInputControlChannel();
@@ -1321,5 +1321,5 @@ namespace MiscServices {
imsCore[0]->StopInputService(imeId);
}
}
}
}
} // namespace MiscServices
} // namespace OHOS
+12 -12
View File
@@ -141,7 +141,7 @@ namespace MiscServices {
for (it = inputMethodProperties.begin(); it < inputMethodProperties.end(); ++it) {
InputMethodProperty *node = (InputMethodProperty*)*it;
if (node->mImeId == imeId) {
if (CheckIfSecurityIme(*node) == true) {
if (CheckIfSecurityIme(*node)) {
securityFlag = true;
}
inputMethodProperties.erase(it);
@@ -162,7 +162,7 @@ namespace MiscServices {
imSetting.SetValue(key, inputMethodSetting.GetValue(key));
bool flag = imSetting.RemoveEnabledInputMethod(imeId);
if (flag == false) {
if (!flag) {
IMSA_HILOGI("The package removed is not an enabled IME. [%d]\n", userId_);
return ErrorCode::NO_ERROR;
}
@@ -219,7 +219,7 @@ namespace MiscServices {
if (imeId == currentImeId) {
flag = true;
} else if (enabledInputMethods.find(imeId) != std::string::npos) {
if (flag == true) {
if (flag) {
nextImeId = imeId;
break;
} else if (firstEnabledProperty == nullptr) {
@@ -338,7 +338,7 @@ namespace MiscServices {
std::u16string systemLocales = inputMethodSetting.GetValue(InputMethodSetting::SYSTEM_LOCALE_TAG);
for (int i = 0; i < (int)inputMethodProperties.size(); i++) {
InputMethodProperty *imp = inputMethodProperties[i];
if (CheckIfSecurityIme(*imp) == false) {
if (!CheckIfSecurityIme(*imp)) {
continue;
}
// if systemLocales is not setting, return the first security ime
@@ -375,7 +375,7 @@ namespace MiscServices {
if (imeId == currentImeId) {
flag = true;
} else if (enabledInputMethods.find(imeId) != std::string::npos) {
if (flag == true) {
if (flag) {
return inputMethodProperties[i];
} else if (firstEnabledProperty == nullptr) {
firstEnabledProperty = inputMethodProperties[i];
@@ -476,9 +476,9 @@ namespace MiscServices {
void PerUserSetting::InitInputMethodSetting()
{
bool flag = inputMethodSetting.FindKey(InputMethodSetting::ENABLED_INPUT_METHODS_TAG);
if (flag == false) {
if (!flag) {
for (int i = 0; i < (int)inputMethodProperties.size(); i++) {
if (CheckIfSecurityIme(*inputMethodProperties[i]) == true) {
if (CheckIfSecurityIme(*inputMethodProperties[i])) {
continue;
}
std::vector<int> types;
@@ -492,13 +492,13 @@ namespace MiscServices {
flag = inputMethodSetting.FindKey(InputMethodSetting::CURRENT_INPUT_METHOD_TAG);
std::u16string imeId = inputMethodSetting.GetCurrentInputMethod();
if (flag == false) {
if (!flag) {
ResetCurrentInputMethod();
} else {
currentImeId = imeId;
}
flag = inputMethodSetting.FindKey(InputMethodSetting::CURRENT_SYS_KEYBOARD_TYPE_TAG);
if (flag == false) {
if (!flag) {
inputMethodSetting.SetCurrentSysKeyboardType(-1);
}
Platform::Instance()->SetInputMethodSetting(userId_, inputMethodSetting);
@@ -543,7 +543,7 @@ namespace MiscServices {
// if we cannot find any keyboard type which belongs to system locales,
// we will use the first enabled ime as current ime.
if (flag == false) {
if (!flag) {
if (firstEnabledIme) {
currentImeId = firstEnabledIme->mImeId;
} else {
@@ -577,5 +577,5 @@ namespace MiscServices {
{
return property.isSystemIme;
}
}
}
} // namespace MiscServices
} // namespace OHOS
+2 -2
View File
@@ -185,5 +185,5 @@ namespace MiscServices {
(void)displayId;
return true;
}
}
}
} // namespace MiscServices
} // namespace OHOS
+2 -2
View File
@@ -104,5 +104,5 @@ namespace MiscServices {
Message *msg = new Message(msgId, parcel);
MessageHandler::Instance()->SendMessage(msg);
}
}
}
} // namespace MiscServices
} // namespace OHOS
+2 -2
View File
@@ -139,5 +139,5 @@ namespace MiscServices {
EXPECT_TRUE(deserialization != nullptr);
EXPECT_TRUE(deserialization->getId() == def_value);
}
}
}
} // namespace MiscServices
} // namespace OHOS

Some files were not shown because too many files have changed in this diff Show More