mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-24 12:43:16 -04:00
IssueNo:#I4W1B7
Description: Fix crash caused by SetANRMissionByProcessID Sig:SIG_ApplicationFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: jsj <jinsenjun@huawei.com> Change-Id: Id11a89bfea73b9c1e9a8a5f15480bac461321ce8
This commit is contained in:
@@ -4422,20 +4422,30 @@ bool AbilityManagerService::VerifyUriPermisson(const AbilityRequest &abilityRequ
|
||||
|
||||
bool AbilityManagerService::SetANRMissionByProcessID(int pid)
|
||||
{
|
||||
HILOG_INFO("start.");
|
||||
if (appScheduler_ == nullptr || currentMissionListManager_ == nullptr) {
|
||||
HILOG_ERROR("null point.");
|
||||
return false;
|
||||
}
|
||||
std::vector<sptr<IRemoteObject>> tokens;
|
||||
if (appScheduler_->GetAbilityRecordsByProcessID(pid, tokens) != ERR_OK) {
|
||||
HILOG_ERROR("Get ability record failed.");
|
||||
return false;
|
||||
}
|
||||
if (appScheduler_) {
|
||||
for (auto &item : tokens) {
|
||||
auto abilityRecord = currentMissionListManager_->GetAbilityRecordByToken(item);
|
||||
auto mission = abilityRecord->GetMission();
|
||||
mission->SetANRState();
|
||||
for (auto &item : tokens) {
|
||||
auto abilityRecord = currentMissionListManager_->GetAbilityRecordByToken(item);
|
||||
if (abilityRecord == nullptr) {
|
||||
HILOG_WARN("abilityRecord is nullptr.");
|
||||
continue;
|
||||
}
|
||||
return true;
|
||||
auto mission = abilityRecord->GetMission();
|
||||
if (mission == nullptr) {
|
||||
HILOG_WARN("mission is nullptr.");
|
||||
continue;
|
||||
}
|
||||
mission->SetANRState();
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void AbilityManagerService::StartupResidentProcess(int userId)
|
||||
|
||||
Reference in New Issue
Block a user