mirror of
https://gitee.com/openharmony/inputmethod_imf
synced 2025-02-17 05:38:18 +00:00
commit
da7bc35868
@ -27,7 +27,9 @@ public:
|
||||
virtual void OnKeyboardStatus(bool isShow) = 0;
|
||||
virtual void OnInputStart() = 0;
|
||||
virtual void OnInputStop() = 0;
|
||||
virtual void OnSecurityChange(int32_t security) = 0;
|
||||
virtual void OnSecurityChange(int32_t security)
|
||||
{
|
||||
};
|
||||
virtual void OnSetCallingWindow(uint32_t windowId) = 0;
|
||||
virtual void OnSetSubtype(const SubProperty &property) = 0;
|
||||
virtual void ReceivePrivateCommand(const std::unordered_map<std::string, PrivateDataValue> &privateCommand) = 0;
|
||||
|
@ -75,8 +75,12 @@ export default class ServiceExtAbility extends ServiceExtensionAbility {
|
||||
|
||||
commonEvent.createSubscriber(subscribeInfo, (error: BusinessError, subcriber: commonEvent.CommonEventSubscriber) => {
|
||||
commonEvent.subscribe(subcriber, (error: BusinessError, commonEventData: commonEvent.CommonEventData) => {
|
||||
console.log(TAG + 'commonEvent:' + JSON.stringify(commonEventData.event));
|
||||
if (commonEventData.event === PACKAGE_ADDED || commonEventData.event === PACKAGE_REMOVED) {
|
||||
if (error) {
|
||||
console.log(TAG + `commonEvent subscribe error, errorCode: ${error}`);
|
||||
return;
|
||||
}
|
||||
console.log(TAG + 'commonEvent:' + JSON.stringify(commonEventData?.event));
|
||||
if (commonEventData?.event === PACKAGE_ADDED || commonEventData?.event === PACKAGE_REMOVED) {
|
||||
this.updateImeList();
|
||||
}
|
||||
});
|
||||
|
@ -209,6 +209,22 @@ HWTEST_F(VirtualListenerTest, testInputMethodEngineListener_001, TestSize.Level0
|
||||
EXPECT_FALSE(isEnable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: testInputMethodEngineListener_002
|
||||
* @tc.desc: Cover non-pure virtual function in class: InputMethodEngineListener.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require:
|
||||
*/
|
||||
HWTEST_F(VirtualListenerTest, testInputMethodEngineListener_002, TestSize.Level0)
|
||||
{
|
||||
IMSA_HILOGI("VirtualListenerTest testInputMethodEngineListener_002 START");
|
||||
ASSERT_NE(VirtualListenerTest::engineListener_, nullptr);
|
||||
int32_t security = 1;
|
||||
VirtualListenerTest::engineListener_->OnSecurityChange(security);
|
||||
bool isEnable = VirtualListenerTest::engineListener_->IsEnable();
|
||||
EXPECT_FALSE(isEnable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: testImeEventListener_001
|
||||
* @tc.desc: Cover non-pure virtual function in class: ImeEventListener.
|
||||
|
Loading…
x
Reference in New Issue
Block a user