mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-26 18:47:03 -04:00
@@ -25,7 +25,6 @@
|
||||
#include "freeze_util.h"
|
||||
#include "hilog_tag_wrapper.h"
|
||||
#include "hitrace_meter.h"
|
||||
#include "hisysevent.h"
|
||||
#include "parameter.h"
|
||||
#include "xcollie/watchdog.h"
|
||||
#include "time_util.h"
|
||||
@@ -112,7 +111,6 @@ void AppfreezeInner::ChangeFaultDateInfo(FaultData& faultData, const std::string
|
||||
faultData.waitSaveState = AppRecovery::GetInstance().IsEnabled();
|
||||
AAFwk::ExitReason exitReason = {REASON_APP_FREEZE, "Kill Reason:" + faultData.errorObject.name};
|
||||
AbilityManagerClient::GetInstance()->RecordAppExitReason(exitReason);
|
||||
SendProcessKillEvent("Kill Reason:" + faultData.errorObject.name);
|
||||
}
|
||||
NotifyANR(faultData);
|
||||
if (isExit) {
|
||||
@@ -177,21 +175,6 @@ bool AppfreezeInner::IsExitApp(const std::string& name)
|
||||
return false;
|
||||
}
|
||||
|
||||
void AppfreezeInner::SendProcessKillEvent(const std::string& killReason)
|
||||
{
|
||||
auto applicationInfo = applicationInfo_.lock();
|
||||
if (applicationInfo != nullptr) {
|
||||
int32_t pid = static_cast<int32_t>(getpid());
|
||||
std::string processName = applicationInfo->process;
|
||||
int result = HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::FRAMEWORK, "PROCESS_KILL",
|
||||
HiviewDFX::HiSysEvent::EventType::FAULT, EVENT_PID, pid,
|
||||
EVENT_PROCESS_NAME, processName, EVENT_MESSAGE, killReason);
|
||||
TAG_LOGW(AAFwkTag::APPDFR, "hisysevent write result=%{public}d, send event [FRAMEWORK,PROCESS_KILL],"
|
||||
" pid=%{public}d, processName=%{public}s, msg=%{public}s", result, pid, processName.c_str(),
|
||||
killReason.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
int AppfreezeInner::AcquireStack(const FaultData& info, bool onlyMainThread)
|
||||
{
|
||||
HITRACE_METER_FMT(HITRACE_TAG_APP, "AppfreezeInner::AcquireStack name:%s", info.errorObject.name.c_str());
|
||||
|
||||
@@ -51,7 +51,6 @@ private:
|
||||
static std::weak_ptr<EventHandler> appMainHandler_;
|
||||
std::weak_ptr<ApplicationInfo> applicationInfo_;
|
||||
void AppFreezeRecovery();
|
||||
void SendProcessKillEvent(const std::string& killReason);
|
||||
int NotifyANR(const FaultData& faultData);
|
||||
bool IsExitApp(const std::string& name);
|
||||
bool IsHandleAppfreeze();
|
||||
|
||||
@@ -5917,7 +5917,7 @@ int32_t AppMgrServiceInner::KillFaultApp(int32_t pid, const std::string &bundleN
|
||||
if (isNeedExit || (faultData.forceExit && !faultData.waitSaveState)) {
|
||||
TAG_LOGI(AAFwkTag::APPMGR, "faultData: %{public}s,pid: %{public}d will exit because %{public}s",
|
||||
bundleName.c_str(), pid, innerService->FaultTypeToString(faultData.faultType).c_str());
|
||||
innerService->KillProcessByPid(pid, "KillFaultApp");
|
||||
innerService->KillProcessByPid(pid, faultData.errorObject.name);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user