mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-11-23 23:30:44 +00:00
commit
15b305a747
@ -71,11 +71,11 @@ ErrCode TaskExecutor::DoWorks(const std::shared_ptr<WorkerThread> &worker)
|
||||
while (((task != nullptr && done == false) || ((task = GetTask(worker)) != nullptr))) {
|
||||
HILOG_INFO("TaskExecutor::DoWorks loop tasks.");
|
||||
|
||||
BeforeRun(task);
|
||||
|
||||
task->Run();
|
||||
|
||||
AfterRun(task);
|
||||
if (task) {
|
||||
BeforeRun(task);
|
||||
task->Run();
|
||||
AfterRun(task);
|
||||
}
|
||||
|
||||
worker->IncTaskCount();
|
||||
IncrementAndGet(taskCounter_);
|
||||
|
@ -1600,6 +1600,10 @@ std::shared_ptr<AbilityRuntime::AbilityContext> AbilityThread::BuildAbilityConte
|
||||
void AbilityThread::DumpAbilityInfo(const std::vector<std::string> ¶ms, std::vector<std::string> &info)
|
||||
{
|
||||
HILOG_INFO("%{public}s begin.", __func__);
|
||||
if (!currentAbility_) {
|
||||
HILOG_ERROR("currentAbility is nullptr.");
|
||||
return;
|
||||
}
|
||||
if (!params.empty()) {
|
||||
if (abilityImpl_->IsStageBasedModel()) {
|
||||
auto scene = currentAbility_->GetScene();
|
||||
@ -1636,11 +1640,6 @@ void AbilityThread::DumpAbilityInfo(const std::vector<std::string> ¶ms, std:
|
||||
runner->DumpRunnerInfo(dumpInfo);
|
||||
info.push_back(dumpInfo);
|
||||
|
||||
if (!currentAbility_) {
|
||||
HILOG_INFO("currentAbility is nullptr.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto ablityContext = currentAbility_->GetAbilityContext();
|
||||
if (!ablityContext) {
|
||||
HILOG_INFO("current ability context is nullptr.");
|
||||
@ -1664,7 +1663,7 @@ sptr<IRemoteObject> AbilityThread::CallRequest()
|
||||
HILOG_INFO("AbilityThread::CallRequest begin");
|
||||
|
||||
if (!currentAbility_) {
|
||||
HILOG_INFO("ability is nullptr.");
|
||||
HILOG_ERROR("ability is nullptr.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -2579,10 +2579,19 @@ int AbilityManagerService::GenerateAbilityRequest(
|
||||
AppExecFwk::AbilityInfoFlag::GET_ABILITY_INFO_WITH_METADATA);
|
||||
HILOG_DEBUG("%{public}s, QueryAbilityInfo, userId is %{public}d", __func__, userId);
|
||||
IN_PROCESS_CALL_WITHOUT_RET(bms->QueryAbilityInfo(want, abilityInfoFlag, userId, request.abilityInfo));
|
||||
if (request.abilityInfo.name.empty() || request.abilityInfo.bundleName.empty()) {
|
||||
HILOG_WARN("%{public}s, QueryAbilityInfo again, userId is 0", __func__);
|
||||
IN_PROCESS_CALL_WITHOUT_RET(bms->QueryAbilityInfo(want, abilityInfoFlag, U0_USER_ID, request.abilityInfo));
|
||||
}
|
||||
if (request.abilityInfo.name.empty() || request.abilityInfo.bundleName.empty()) {
|
||||
// try to find extension
|
||||
std::vector<AppExecFwk::ExtensionAbilityInfo> extensionInfos;
|
||||
IN_PROCESS_CALL_WITHOUT_RET(bms->QueryExtensionAbilityInfos(want, abilityInfoFlag, userId, extensionInfos));
|
||||
if (extensionInfos.size() <= 0) {
|
||||
HILOG_WARN("%{public}s, QueryExtensionAbilityInfos again, userId is 0", __func__);
|
||||
IN_PROCESS_CALL_WITHOUT_RET(bms->QueryExtensionAbilityInfos(want, abilityInfoFlag,
|
||||
U0_USER_ID, extensionInfos));
|
||||
}
|
||||
if (extensionInfos.size() <= 0) {
|
||||
HILOG_ERROR("Get extension info failed.");
|
||||
return RESOLVE_ABILITY_ERR;
|
||||
@ -3259,8 +3268,8 @@ void AbilityManagerService::RestartAbility(const sptr<IRemoteObject> &token)
|
||||
}
|
||||
|
||||
auto abilityRecord = Token::GetAbilityRecordByToken(token);
|
||||
auto userId = abilityRecord->GetApplicationInfo().uid / BASE_USER_RANGE;
|
||||
CHECK_POINTER(abilityRecord);
|
||||
auto userId = abilityRecord->GetApplicationInfo().uid / BASE_USER_RANGE;
|
||||
|
||||
auto stackManager = GetStackManagerByUserId(userId);
|
||||
if (!stackManager) {
|
||||
|
Loading…
Reference in New Issue
Block a user