callback is null add log Created-by: zhangsaiyang Commit-by: zhangsaiyang Merged-by: openharmony_ci Description: * **IssueNo**: * **Description**: * **Sig**: SIG_DataManagement * **Feature or Bugfix**: * **Binary Source**:No/Yes * **TDD**:Pass/Fail/NA * **XTS**:Pass/Fail/NA * **Pretest**:Pass/Fail/NA ### 稳定性排查: - [ ] 【规则】禁止在锁内向其他进程发送IPC(进程间通信); - [ ] 【规则】禁止将捕获**栈变量引用**的lambda函数**异步到其他线程执行**; - [ ] 【规则】禁止传递this指针至其他模块或线程(特别是eventhandler任务); - [ ] 【规则】禁止存储string的c_str()方法获取到的指针; - [ ] 【规则】成员变量进行赋值或创建需要排查并发; - [ ] 【规则】谨慎在未经拷贝的情况下使用外部传入的string、C字符串; - [ ] 【规则】map\vector\list\set等stl模板类使用时需要排查并发; - [ ] 【规则】谨慎考虑加锁范围,尽可能的小范围加锁; - [ ] 【规则】在IPC通信中谨慎使用同步通信方式; - [ ] 【规则】禁止将外部传入的裸指针在内部直接构造智能指针; - [ ] 【规则】禁止多个独立创建的智能指针管理同一地址; - [ ] 【规则】禁止在析构函数中抛异步任务; - [ ] 【规则】禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁; - [ ] 【规则】禁止在对外接口中未经判空直接使用外部传入的指针; - [ ] 【规则】监听回调要确保,回调触发和取消注册并发时无生命周期问题; - [ ] 【规则】遍历容器进行删除或插入时注意迭代器失效问题; ### 日志打印排查: - [ ] 【规则】禁止打印内存地址,如:%p; - [ ] 【规则】禁止打印密钥、文件路径、数据库名称、udidhash、设备名称、账号id等敏感信息; - [ ] 【规则】禁止不作匿名化直接打印udid/networkid/uuid/ip/mac等敏感信息; - [ ] 【规则】非必要不要在循环内打印日志,防止日志超限; ### 安全编码自检: - [ ] 【内存管理】内存申请前必须对内存大小进行合法性校验; - [ ] 【内存管理】内存申请后必须判空,判断内存申请是否成功; - [ ] 【内存管理】分配和释放内存(or fd等资源)的函数需要成对出现; - [ ] 【内存管理】申请内存后异常退出前需要及时进行内存释放; - [ ] 【内存管理】禁止使用realloc、alloca函数; - [ ] 【内存管理】strdup使用需要注意内存释放; - [ ] 【内存管理】正则表达式构造后需释放资源,regcomp/regexec与regfree必须成对使用; - [ ] 【内存管理】realpath使用时如果resolved_path为NULL需要注意内存释放; - [ ] 【外部输入校验】外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验; - [ ] 【外部输入校验】按TLV格式解析时需校验解析长度值是否小于等于缓冲区实际值,并校验是否符合业务数据范围; - [ ] 【外部输入校验】解析数据后拷贝时需校验源buffer实际缓冲区大小,避免越界读写; - [ ] 【外部输入校验】使用外部输入作为循环变量时,需要校验循环变量上限是否合理,防止出现超大循环; - [ ] 【外部输入校验】禁止直接使用外部输入作为数组下标,防止出现内存越界; - [ ] 【敏感信息】堆、栈中保存密钥、口令(包括加密后的变量)变量使用完后必须显式覆盖或清空; - [ ] 【加密算法】禁止使用私有加密算法或不安全加密算法; - [ ] 【变量初始化】指针变量、表示资源描述符的变量、bool变量必须赋初值; - [ ] 【指针】IPC流程中ReadCString、ReadRawData、readParcelable等结果必须判空; - [ ] 【整数运算】整数之间运算时必须严格检查,确保不会出现溢出、反转、除0; - [ ] 【整数运算】禁止对有符号整数进行位操作符运算; - [ ] 【循环变量】循环次数如果受外部数据控制,需要检验其合法性; - [ ] 【循环变量】循环变量和中止条件的数据类型定义保持一致; - [ ] 【安全函数】安全函数必须检查返回值,并进行正确处理; - [ ] 【安全函数】安全函数目标缓冲区入参大小与目标缓冲区实际大小必须一致; - [ ] 【安全函数】禁止封装或者自定义安全函数; - [ ] 【常见问题】修改单个函数时,如果涉及新增异常返回分支,必须排查是否需要释放锁、内存、fd等资源; - [ ] 【常见问题】函数返回值需与函数签名相同,参数定义需在同一范畴(不能定义bool,返回int32_t),或同一枚举类型; - [ ] 【常见问题】格式化打印类型需匹配,例如:int32_t %d; uint32_t %u; long %ld; unsigned long %lu; long long PRId64;<br> unsigned long long PRIu64; See merge request: openharmony/inputmethod_imf!2726
inputmethod_imf
Introduction
Input Method Framework, is used to connect the application and input method. the application can input text through the input method
Warehouse path
/base/inputmethod/imf
Introduction to framework code
The input method framework currently has four modules, as follows:
- Application client
Path: /base/inputmethod/imf/frameworks/inputmethod_controller
Function: realize the service delivery of application and input method framework, including the binding between application and input method service, application display and hiding request for input method, etc
- Input method client
Path: /base/inputmethod/imf/frameworks/inputmethod_ability
Function: the intermediate bridge between input method framework service and input method delivery, including monitoring the current status of input method, etc
- Input method service
Path: /base/inputmethod/imf/services
Function: as the core of the input method framework, the main processing logic of the input method is completed here
- Input method JS interface
Path: /base/inputmethod/imf/interfaces/kits/JS
Function: the temporarily exposed JS interface is mainly reserved for calling input methods
Main functions supported by the framework
-
Click in the edit attribute control to invoke the default input method application through the input method framework
-
Typing can be carried out through the input method application, and characters can be input to the application client on the screen
Debugging method
- Compile command
./build.sh --product-name (Fill in the specific product name, such as:Hi3516DV300) --build-target imf
- push so file
in $root\out\ohos-arm-release\inputmethod\imf, push libinputmethod_client.z.so libinputmethod_ability.z.so libinputmethod_service.z.so libinputmethod_para.z.so to system/lib,and push libinputmethodengine.z.so libinputmethod.z.so to system/lib/module, and make sure the six so files is readable at least.
- reboot
Participation contribution
- Fork warehouse
- Submission code
- Create a new pull request
- Commit is complete
