libc.hook模式关闭超时处理任务

Signed-off-by: jiangyuan0000 <jiangyuan29@huawei.com>
This commit is contained in:
jiangyuan0000 2022-07-18 16:56:37 +08:00
parent eee81229fd
commit 7099d9d38a

View File

@ -24,6 +24,7 @@
#include "hitrace_meter.h"
#include "hilog_wrapper.h"
#include "in_process_call_wrapper.h"
#include "parameter.h"
namespace OHOS {
namespace AAFwk {
@ -675,6 +676,16 @@ void AbilityConnectManager::PostTimeOutTask(const std::shared_ptr<AbilityRecord>
delayTime = AbilityManagerService::CONNECT_TIMEOUT;
}
// check libc.hook_mode
const int bufferLen = 128;
char paramOutBuf[bufferLen] = {0};
const char *hook_mode = "startup:";
int ret = GetParameter("libc.hook_mode", "", paramOutBuf, bufferLen - 1);
if (ret > 0 && strncmp(paramOutBuf, hook_mode, strlen(hook_mode)) == 0) {
HILOG_DEBUG("Hook_mode: no timeoutTask");
return;
}
auto timeoutTask = [abilityRecord, connectManager = shared_from_this(), resultCode]() {
HILOG_WARN("Connect or load ability timeout.");
connectManager->HandleStartTimeoutTask(abilityRecord, resultCode);