mirror of
https://github.com/openharmony/miscservices_inputmethod.git
synced 2026-07-18 17:24:37 -04:00
!162 miscservices_inputmethod dfx bugfix
Merge pull request !162 from GlaryCastle/master
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include "inputmethod_dump.h"
|
||||
#include "global.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
@@ -45,10 +46,14 @@ void InputmethodDump::AddErrorInfo(const std::string &error)
|
||||
|
||||
bool InputmethodDump::Dump(int fd, const std::vector<std::string> &args)
|
||||
{
|
||||
IMSA_HILOGI("InputmethodDump::Dump start.");
|
||||
std::string command = "";
|
||||
if (args.size() == CMD_ONE_PARAM) {
|
||||
command = args.at(SUB_CMD_NAME);
|
||||
} else if (command == CMD_HELP) {
|
||||
} else {
|
||||
ShowIllealInfomation(fd);
|
||||
}
|
||||
if (command == CMD_HELP) {
|
||||
ShowHelp(fd);
|
||||
} else if (command == CMD_ALL_DUMP) {
|
||||
if (!dumpAllMethod_) {
|
||||
@@ -58,6 +63,7 @@ bool InputmethodDump::Dump(int fd, const std::vector<std::string> &args)
|
||||
} else {
|
||||
ShowIllealInfomation(fd);
|
||||
}
|
||||
IMSA_HILOGI("InputmethodDump::Dump command=%{public}s.", command.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OHOS {
|
||||
namespace MiscServices {
|
||||
namespace {
|
||||
using HiSysEventNameSpace = OHOS::HiviewDFX::HiSysEvent;
|
||||
const std::string DOMAIN_STR = std::string(HiSysEventNameSpace::Domain::OTHERS);
|
||||
const std::string DOMAIN_STR = std::string(HiSysEventNameSpace::Domain::INPUTMETHOD);
|
||||
} // namespace
|
||||
|
||||
void FaultReporter(int32_t userId, std::string bundname, int32_t errCode)
|
||||
|
||||
@@ -27,6 +27,7 @@ void ValueTrace(const std::string &name, int64_t count)
|
||||
{
|
||||
CountTrace(HITRACE_TAG_MISC, name, count);
|
||||
}
|
||||
|
||||
InputmethodTrace::InputmethodTrace(const std::string &value)
|
||||
{
|
||||
StartTrace(HITRACE_TAG_MISC, value);
|
||||
|
||||
@@ -122,7 +122,6 @@ namespace MiscServices {
|
||||
}
|
||||
InitHiTrace();
|
||||
InputmethodTrace tracer("InputMethodController Attach trace.");
|
||||
ValueTrace("InputMethodController", -1);
|
||||
InputmethodDump::GetInstance().AddDumpAllMethod(
|
||||
std::bind(&InputMethodSystemAbility::DumpAllMethod, this, std::placeholders::_1));
|
||||
IMSA_HILOGI("Start ImsaService ErrorCode::NO_ERROR.");
|
||||
@@ -131,13 +130,12 @@ namespace MiscServices {
|
||||
|
||||
int InputMethodSystemAbility::Dump(int fd, const std::vector<std::u16string> &args)
|
||||
{
|
||||
IMSA_HILOGI("InputMethodSystemAbility::Dump");
|
||||
std::vector<std::string> argsStr;
|
||||
for (auto item : args) {
|
||||
argsStr.emplace_back(Str16ToStr8(item));
|
||||
}
|
||||
if (InputmethodDump::GetInstance().Dump(fd, argsStr)) {
|
||||
return ERR_OK;
|
||||
}
|
||||
InputmethodDump::GetInstance().Dump(fd, argsStr);
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user