refactor: DeviceID

Signed-off-by: Nathan Yang <yangxuguang3@huawei.com>
This commit is contained in:
Nathan Yang
2025-09-25 11:07:30 +08:00
committed by yangxuguang-huawei
parent ea617cc6f8
commit 3851623adb
12 changed files with 100 additions and 71 deletions
@@ -234,7 +234,8 @@ bool JsNapiCommon::CreateConnectionAndConnectAbilityLocked(
sptr<NAPIAbilityConnection> JsNapiCommon::FindConnectionLocked(const Want &want, int64_t &id)
{
TAG_LOGD(AAFwkTag::JSNAPI, "uri:%{public}s", want.GetElement().GetURI().c_str());
TAG_LOGD(AAFwkTag::JSNAPI, "bundle/ability:%{public}s/%{public}s", want.GetElement().GetBundleName().c_str(),
want.GetElement().GetAbilityName().c_str());
std::string deviceId = want.GetElement().GetDeviceID();
std::string bundleName = want.GetBundle();
std::string abilityName = want.GetElement().GetAbilityName();
@@ -663,8 +663,9 @@ bool JsUIExtension::HandleSessionCreate(const AAFwk::Want &want, const sptr<AAFw
return false;
}
std::lock_guard<std::mutex> lock(uiWindowMutex_);
TAG_LOGD(AAFwkTag::UI_EXT, "UIExtension component id: %{public}" PRId64 ", element: %{public}s",
sessionInfo->uiExtensionComponentId, want.GetElement().GetURI().c_str());
TAG_LOGD(AAFwkTag::UI_EXT, "UIExtension component id: %{public}" PRId64 ", bundle/ability: %{public}s/%{public}s",
sessionInfo->uiExtensionComponentId, want.GetElement().GetBundleName().c_str(),
want.GetElement().GetAbilityName().c_str());
std::shared_ptr<AAFwk::Want> sharedWant = std::make_shared<AAFwk::Want>(want);
auto compId = sessionInfo->uiExtensionComponentId;
if (uiWindowMap_.find(compId) == uiWindowMap_.end()) {
@@ -770,8 +770,9 @@ bool JsUIExtensionBase::HandleSessionCreate(const AAFwk::Want &want, const sptr<
TAG_LOGE(AAFwkTag::UI_EXT, "Invalid sessionInfo");
return false;
}
TAG_LOGD(AAFwkTag::UI_EXT, "UIExtension component id: %{public}" PRId64 ", element: %{public}s",
sessionInfo->uiExtensionComponentId, want.GetElement().GetURI().c_str());
TAG_LOGD(AAFwkTag::UI_EXT, "UIExtension component id: %{public}" PRId64 ", bundle/ability:%{public}s/%{public}s",
sessionInfo->uiExtensionComponentId, want.GetElement().GetBundleName().c_str(),
want.GetElement().GetAbilityName().c_str());
if (sessionInfo == nullptr || sessionInfo->uiExtensionComponentId == 0) {
TAG_LOGE(AAFwkTag::UI_EXT, "Invalid sessionInfo");
return false;
@@ -126,8 +126,8 @@ ErrCode UIExtensionContext::DisconnectAbility(
ErrCode UIExtensionContext::StartServiceExtensionAbility(const AAFwk::Want& want, int32_t accountId)
{
TAG_LOGI(AAFwkTag::UI_EXT, "Start service extension %{public}s, accountId: %{public}d",
want.GetElement().GetURI().c_str(), accountId);
TAG_LOGI(AAFwkTag::UI_EXT, "Start service extension %{public}s/%{public}s, accountId: %{public}d",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(), accountId);
auto ret = AAFwk::AbilityManagerClient::GetInstance()->StartExtensionAbility(
want, token_, accountId, AppExecFwk::ExtensionAbilityType::SERVICE);
if (ret != ERR_OK) {
@@ -128,8 +128,9 @@ ErrCode ServiceExtensionContext::StartAbilityWithAccount(const AAFwk::Want &want
if (GetAbilityInfo() != nullptr) {
callerName = GetAbilityInfo()->name;
}
TAG_LOGI(AAFwkTag::APPKIT, "accountId: %{public}d, ability: %{public}s, caller: %{public}s",
accountId, want.GetElement().GetURI().c_str(), callerName.c_str());
TAG_LOGI(AAFwkTag::APPKIT, "accountId: %{public}d, ability: %{public}s/%{public}s, caller: %{public}s",
accountId, want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(),
callerName.c_str());
(const_cast<Want &>(want)).SetParam(START_ABILITY_TYPE, true);
ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(
want, token_, ILLEGAL_REQUEST_CODE, accountId);
@@ -170,7 +170,9 @@ int AbilityConnectManager::StartAbilityLocked(const AbilityRequest &abilityReque
return INNER_ERR;
}
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
TAG_LOGD(AAFwkTag::EXT, "ability_name:%{public}s", abilityRequest.want.GetElement().GetURI().c_str());
TAG_LOGD(AAFwkTag::EXT, "bundle/ability:%{public}s/%{public}s",
abilityRequest.want.GetElement().GetBundleName().c_str(),
abilityRequest.want.GetElement().GetAbilityName().c_str());
int32_t ret = AbilityPermissionUtil::GetInstance().CheckMultiInstanceKeyForExtension(abilityRequest);
if (ret != ERR_OK) {
@@ -144,8 +144,9 @@ ErrCode AbilityManagerClient::StartAbility(const Want &want, int requestCode, in
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbility ability:%{public}s, userId:%{public}d, appCloneIndex:%{public}d",
want.GetElement().GetURI().c_str(), userId, want.GetIntParam(Want::PARAM_APP_CLONE_INDEX_KEY, -1));
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbility ability:%{public}s/%{public}s, userId:%{public}d, "
"appCloneIndex:%{public}d", want.GetElement().GetBundleName().c_str(),
want.GetElement().GetAbilityName().c_str(), userId, want.GetIntParam(Want::PARAM_APP_CLONE_INDEX_KEY, -1));
HandleDlpApp(const_cast<Want &>(want));
return abms->StartAbility(want, userId, requestCode);
@@ -169,8 +170,9 @@ ErrCode AbilityManagerClient::StartAbility(
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbility ability:%{public}s, userId:%{public}d, appCloneIndex:%{public}d",
want.GetElement().GetURI().c_str(), userId, want.GetIntParam(Want::PARAM_APP_CLONE_INDEX_KEY, -1));
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbility ability:%{public}s/%{public}s, userId:%{public}d, "
"appCloneIndex:%{public}d", want.GetElement().GetBundleName().c_str(),
want.GetElement().GetAbilityName().c_str(), userId, want.GetIntParam(Want::PARAM_APP_CLONE_INDEX_KEY, -1));
HandleDlpApp(const_cast<Want &>(want));
return abms->StartAbility(want, callerToken, userId, requestCode);
}
@@ -193,8 +195,9 @@ ErrCode AbilityManagerClient::StartAbility(const Want &want, const AbilityStartS
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbility ability:%{public}s, userId:%{public}d, appCloneIndex:%{public}d",
want.GetElement().GetURI().c_str(), userId, want.GetIntParam(Want::PARAM_APP_CLONE_INDEX_KEY, -1));
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbility ability:%{public}s/%{public}s, userId:%{public}d, "
"appCloneIndex:%{public}d", want.GetElement().GetBundleName().c_str(),
want.GetElement().GetAbilityName().c_str(), userId, want.GetIntParam(Want::PARAM_APP_CLONE_INDEX_KEY, -1));
HandleDlpApp(const_cast<Want &>(want));
return abms->StartAbility(want, abilityStartSetting, callerToken, userId, requestCode);
}
@@ -205,8 +208,9 @@ ErrCode AbilityManagerClient::StartAbility(const Want &want, const StartOptions
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "start ability, ability:%{public}s, userId:%{public}d,appCloneIndex:%{public}d",
want.GetElement().GetURI().c_str(), userId, want.GetIntParam(Want::PARAM_APP_CLONE_INDEX_KEY, -1));
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbility ability:%{public}s/%{public}s, userId:%{public}d, "
"appCloneIndex:%{public}d", want.GetElement().GetBundleName().c_str(),
want.GetElement().GetAbilityName().c_str(), userId, want.GetIntParam(Want::PARAM_APP_CLONE_INDEX_KEY, -1));
HandleDlpApp(const_cast<Want &>(want));
return abms->StartAbility(want, startOptions, callerToken, userId, requestCode);
}
@@ -218,8 +222,8 @@ ErrCode AbilityManagerClient::StartAbilityAsCaller(
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbilityAsCaller ability:%{public}s, userId:%{public}d.",
want.GetElement().GetURI().c_str(), userId);
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbilityAsCaller ability:%{public}s/%{public}s, userId:%{public}d",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(), userId);
HandleDlpApp(const_cast<Want &>(want));
return abms->StartAbilityAsCaller(want, callerToken, asCallerSourceToken, userId, requestCode);
}
@@ -231,8 +235,8 @@ ErrCode AbilityManagerClient::StartAbilityAsCaller(const Want &want, const Start
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "abilityName:%{public}s, userId:%{public}d",
want.GetElement().GetURI().c_str(), userId);
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbilityAsCaller ability:%{public}s/%{public}s, userId:%{public}d",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(), userId);
HandleDlpApp(const_cast<Want &>(want));
return abms->StartAbilityAsCaller(want, startOptions, callerToken, asCallerSourceToken, userId, requestCode);
}
@@ -243,8 +247,8 @@ ErrCode AbilityManagerClient::StartAbilityForResultAsCaller(
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbilityForResultAsCaller, The abilityName:%{public}s, userId:%{public}d",
want.GetElement().GetURI().c_str(), userId);
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbilityForResultAsCaller ability:%{public}s/%{public}s, userId:%{public}d",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(), userId);
HandleDlpApp(const_cast<Want &>(want));
return abms->StartAbilityForResultAsCaller(want, callerToken, requestCode, userId);
}
@@ -255,8 +259,8 @@ ErrCode AbilityManagerClient::StartAbilityForResultAsCaller(const Want &want, co
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "The abilityName:%{public}s, userId:%{public}d",
want.GetElement().GetURI().c_str(), userId);
TAG_LOGI(AAFwkTag::ABILITYMGR, "StartAbilityForResultAsCaller ability:%{public}s/%{public}s, userId:%{public}d",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(), userId);
HandleDlpApp(const_cast<Want &>(want));
return abms->StartAbilityForResultAsCaller(want, startOptions, callerToken, requestCode, userId);
}
@@ -342,8 +346,8 @@ ErrCode AbilityManagerClient::PreloadUIExtensionAbility(const Want &want, std::s
{
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGD(AAFwkTag::ABILITYMGR, "elementName:%{public}s, hostBundleName:%{public}s.",
want.GetElement().GetURI().c_str(), hostBundleName.c_str());
TAG_LOGI(AAFwkTag::ABILITYMGR, "elementName:%{public}s/%{public}s, hostBundleName:%{public}s",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(), hostBundleName.c_str());
return abms->PreloadUIExtensionAbility(want, hostBundleName, userId, hostPid);
}
@@ -390,8 +394,9 @@ ErrCode AbilityManagerClient::StartUIAbilityBySCB(sptr<SessionInfo> sessionInfo,
}
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "scb call, StartUIAbilityBySCB target: %{public}s, persistentId: %{public}d.",
sessionInfo->want.GetElement().GetURI().c_str(), sessionInfo->persistentId);
TAG_LOGI(AAFwkTag::ABILITYMGR, "scb call, StartUIAbilityBySCB target: %{public}s/%{public}s, "
"persistentId: %{public}d", sessionInfo->want.GetElement().GetBundleName().c_str(),
sessionInfo->want.GetElement().GetAbilityName().c_str(), sessionInfo->persistentId);
return abms->StartUIAbilityBySCB(sessionInfo, isColdStart, sceneFlag);
}
@@ -540,8 +545,9 @@ ErrCode AbilityManagerClient::MinimizeUIAbilityBySCB(sptr<SessionInfo> sessionIn
}
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "scb call, MinimizeUIAbilityBySCB target: %{public}s, persistentId: %{public}d",
sessionInfo->want.GetElement().GetURI().c_str(), sessionInfo->persistentId);
TAG_LOGI(AAFwkTag::ABILITYMGR, "scb call, MinimizeUIAbilityBySCB target: %{public}s/%{public}s, "
"persistentId: %{public}d", sessionInfo->want.GetElement().GetBundleName().c_str(),
sessionInfo->want.GetElement().GetAbilityName().c_str(), sessionInfo->persistentId);
return abms->MinimizeUIAbilityBySCB(sessionInfo, fromUser, sceneFlag);
}
@@ -1119,8 +1125,8 @@ ErrCode AbilityManagerClient::StartAbilityByCall(const Want &want, sptr<IAbility
{
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s, isSilent::%{public}d",
want.GetElement().GetURI().c_str(), isSilent);
TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s/%{public}s, isSilent:%{public}d",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(), isSilent);
return abms->StartAbilityByCall(want, connect, nullptr, DEFAULT_INVAL_VALUE, isSilent);
}
@@ -1129,8 +1135,8 @@ ErrCode AbilityManagerClient::StartAbilityByCall(const Want &want, sptr<IAbility
{
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s, userId:%{public}d, isSilent::%{public}d",
want.GetElement().GetURI().c_str(), accountId, isSilent);
TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s/%{public}s, userId:%{public}d, isSilent:%{public}d",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(), accountId, isSilent);
return abms->StartAbilityByCall(want, connect, callToken, accountId, isSilent);
}
@@ -1139,8 +1145,8 @@ ErrCode AbilityManagerClient::StartAbilityByCallWithErrMsg(const Want &want, spt
{
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s, userId:%{public}d, isSilent::%{public}d",
want.GetElement().GetURI().c_str(), accountId, isSilent);
TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s/%{public}s, userId:%{public}d, isSilent:%{public}d",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str(), accountId, isSilent);
return abms->StartAbilityByCallWithErrMsg(want, connect, callToken, accountId, errMsg, isSilent);
}
@@ -1202,7 +1208,8 @@ ErrCode AbilityManagerClient::RequestDialogService(
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "request:%{public}s", want.GetElement().GetURI().c_str());
TAG_LOGI(AAFwkTag::ABILITYMGR, "request:%{public}s/%{public}s", want.GetElement().GetBundleName().c_str(),
want.GetElement().GetAbilityName().c_str());
HandleDlpApp(const_cast<Want &>(want));
return abms->RequestDialogService(want, callerToken);
}
@@ -1744,8 +1751,9 @@ void AbilityManagerClient::CallUIAbilityBySCB(sptr<SessionInfo> sessionInfo, boo
{
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "scb call, CallUIAbilityBySCB target: %{public}s",
sessionInfo->want.GetElement().GetURI().c_str());
TAG_LOGI(AAFwkTag::ABILITYMGR, "scb call, CallUIAbilityBySCB target: %{public}s/%{public}s",
sessionInfo->want.GetElement().GetBundleName().c_str(),
sessionInfo->want.GetElement().GetAbilityName().c_str());
abms->CallUIAbilityBySCB(sessionInfo, isColdStart);
TAG_LOGD(AAFwkTag::ABILITYMGR, "scb call, CallUIAbilityBySCB, isColdStart: %{public}d", isColdStart);
}
@@ -1754,8 +1762,8 @@ int32_t AbilityManagerClient::StartSpecifiedAbilityBySCB(const Want &want)
{
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
TAG_LOGI(AAFwkTag::ABILITYMGR, "scb call, StartSpecifiedAbilityBySCB, target: %{public}s",
want.GetElement().GetURI().c_str());
TAG_LOGI(AAFwkTag::ABILITYMGR, "scb call, StartSpecifiedAbilityBySCB, target: %{public}s/%{public}s",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str());
return abms->StartSpecifiedAbilityBySCB(want);
}
@@ -2535,7 +2535,8 @@ int32_t AbilityManagerService::RequestDialogService(const Want &want, const sptr
return ERR_INVALID_CONTINUATION_FLAG;
}
TAG_LOGI(AAFwkTag::ABILITYMGR, "request dialog service, target:%{public}s", want.GetElement().GetURI().c_str());
TAG_LOGI(AAFwkTag::ABILITYMGR, "request dialog service, target:%{public}s/%{public}s",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str());
return RequestDialogServiceInner(want, callerToken, -1, -1);
}
@@ -3435,8 +3436,8 @@ int AbilityManagerService::PreloadUIExtensionAbility(const Want &want, std::stri
int AbilityManagerService::PreloadUIExtensionAbilityInner(const Want &want, std::string &hostBundleName,
int32_t userId, int32_t hostPid)
{
TAG_LOGD(AAFwkTag::UI_EXT, "PreloadUIExtension called, elementName: %{public}s.",
want.GetElement().GetURI().c_str());
TAG_LOGD(AAFwkTag::UI_EXT, "PreloadUIExtension called, elementName: %{public}s/%{public}s",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str());
int32_t validUserId = GetValidUserId(userId);
AbilityRequest abilityRequest;
ErrCode result = ERR_OK;
@@ -4035,8 +4036,9 @@ int AbilityManagerService::StartUIExtensionAbility(const sptr<SessionInfo> &exte
abilityRequest.sessionInfo->uiExtensionComponentId = (
static_cast<uint64_t>(callerRecord->GetRecordId()) << OFFSET) |
static_cast<uint64_t>(abilityRequest.sessionInfo->persistentId);
TAG_LOGI(AAFwkTag::UI_EXT, "StartUIExtension: persistentId: %{public}d, element: %{public}s.",
abilityRequest.sessionInfo->persistentId, extensionSessionInfo->want.GetElement().GetURI().c_str());
TAG_LOGI(AAFwkTag::UI_EXT, "StartUIExtension: persistentId: %{public}d, element: %{public}s/%{public}s",
abilityRequest.sessionInfo->persistentId, extensionSessionInfo->want.GetElement().GetBundleName().c_str(),
extensionSessionInfo->want.GetElement().GetAbilityName().c_str());
if (result != ERR_OK) {
TAG_LOGE(AAFwkTag::UI_EXT, "generate ability request local error");
eventInfo.errReason = "generate ability request local error";
@@ -4491,8 +4493,9 @@ int AbilityManagerService::TerminateUIExtensionAbility(const sptr<SessionInfo> &
return ERR_WRONG_INTERFACE_CALL;
}
TAG_LOGD(AAFwkTag::ABILITYMGR, "UIExtension persistentId: %{public}d, element: %{public}s.",
extensionSessionInfo->persistentId, extensionSessionInfo->want.GetElement().GetURI().c_str());
TAG_LOGD(AAFwkTag::ABILITYMGR, "UIExtension persistentId: %{public}d, element: %{public}s/%{public}s",
extensionSessionInfo->persistentId, extensionSessionInfo->want.GetElement().GetBundleName().c_str(),
extensionSessionInfo->want.GetElement().GetAbilityName().c_str());
connectManager->TerminateAbilityWindowLocked(targetRecord, extensionSessionInfo);
return ERR_OK;
}
@@ -4805,8 +4808,9 @@ int AbilityManagerService::MinimizeUIExtensionAbility(const sptr<SessionInfo> &e
extensionSessionInfo->uiExtensionComponentId = (
static_cast<uint64_t>(abilityRecord->GetRecordId()) << OFFSET) |
static_cast<uint64_t>(extensionSessionInfo->persistentId);
TAG_LOGD(AAFwkTag::ABILITYMGR, "UIExtension component id: %{public}" PRId64 ", element: %{public}s.",
extensionSessionInfo->uiExtensionComponentId, extensionSessionInfo->want.GetElement().GetURI().c_str());
TAG_LOGD(AAFwkTag::ABILITYMGR, "UIExtension component id: %{public}" PRId64 ", element: %{public}s/%{public}s",
extensionSessionInfo->uiExtensionComponentId, extensionSessionInfo->want.GetElement().GetBundleName().c_str(),
extensionSessionInfo->want.GetElement().GetAbilityName().c_str());
connectManager->BackgroundAbilityWindowLocked(targetRecord, extensionSessionInfo);
return ERR_OK;
}
@@ -4900,8 +4904,8 @@ int32_t AbilityManagerService::ConnectAbilityCommon(
}
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
XCOLLIE_TIMER_LESS_IGNORE(__PRETTY_FUNCTION__, !want.GetElement().GetDeviceID().empty());
TAG_LOGI(AAFwkTag::SERVICE_EXT,
"elementUri:%{public}s", want.GetElement().GetURI().c_str());
TAG_LOGI(AAFwkTag::SERVICE_EXT, "element: %{public}s/%{public}s",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str());
CheckExtensionRateLimit();
CHECK_POINTER_AND_RETURN(connect, ERR_INVALID_VALUE);
CHECK_POINTER_AND_RETURN(connect->AsObject(), ERR_INVALID_VALUE);
@@ -11064,8 +11068,9 @@ bool AbilityManagerService::CheckUIExtensionCallerIsForeground(const AbilityRequ
return true;
}
TAG_LOGE(AAFwkTag::ABILITYMGR, "caller app not foreground, can't start %{public}s",
abilityRequest.want.GetElement().GetURI().c_str());
TAG_LOGE(AAFwkTag::ABILITYMGR, "caller app not foreground, can't start %{public}s/%{public}s",
abilityRequest.want.GetElement().GetBundleName().c_str(),
abilityRequest.want.GetElement().GetAbilityName().c_str());
return false;
}
@@ -11559,8 +11564,9 @@ int AbilityManagerService::CheckUIExtensionIsFocused(uint32_t uiExtensionTokenId
auto topAbility = Token::GetAbilityRecordByToken(token);
if (topAbility != nullptr) {
TAG_LOGD(AAFwkTag::ABILITYMGR, "top ability: %{public}s, pid: %{public}d, tokenId: %{public}d",
topAbility->GetWant().GetElement().GetURI().c_str(), topAbility->GetPid(),
TAG_LOGD(AAFwkTag::ABILITYMGR, "top ability: %{public}s/%{public}s, pid: %{public}d, tokenId: %{public}d",
topAbility->GetWant().GetElement().GetBundleName().c_str(),
topAbility->GetWant().GetElement().GetAbilityName().c_str(), topAbility->GetPid(),
topAbility->GetApplicationInfo().accessTokenId);
}
@@ -316,8 +316,9 @@ int32_t ExtensionRecordManager::AddPreloadUIExtensionRecord(const std::shared_pt
auto preLoadUIExtensionInfo = std::make_tuple(abilityRecord->GetWant().GetElement().GetAbilityName(),
abilityRecord->GetWant().GetElement().GetBundleName(),
abilityRecord->GetWant().GetElement().GetModuleName(), hostBundleName);
TAG_LOGD(AAFwkTag::ABILITYMGR, "hostBundleName: %{public}s, elementName:%{public}s ",
hostBundleName.c_str(), abilityRecord->GetWant().GetElement().GetURI().c_str());
TAG_LOGD(AAFwkTag::ABILITYMGR, "hostBundleName: %{public}s, elementName:%{public}s/%{public}s",
hostBundleName.c_str(), abilityRecord->GetWant().GetElement().GetBundleName().c_str(),
abilityRecord->GetWant().GetElement().GetAbilityName().c_str());
std::lock_guard<std::mutex> lock(preloadUIExtensionMapMutex_);
preloadUIExtensionMap_[preLoadUIExtensionInfo].push_back(extensionRecord);
return ERR_OK;
@@ -740,8 +741,9 @@ void ExtensionRecordManager::GetCallerTokenList(
return;
}
TAG_LOGD(AAFwkTag::ABILITYMGR, "ability: %{public}s, pid: %{public}d, tokenId: %{public}d",
callerAbilityRecord->GetWant().GetElement().GetURI().c_str(), callerAbilityRecord->GetPid(),
TAG_LOGD(AAFwkTag::ABILITYMGR, "ability:%{public}s/%{public}s, pid: %{public}d, tokenId: %{public}d",
callerAbilityRecord->GetWant().GetElement().GetBundleName().c_str(),
callerAbilityRecord->GetWant().GetElement().GetAbilityName().c_str(), callerAbilityRecord->GetPid(),
callerAbilityRecord->GetApplicationInfo().accessTokenId);
auto callerExtensionRecordId = callerAbilityRecord->GetUIExtensionAbilityId();
@@ -777,8 +779,9 @@ bool ExtensionRecordManager::IsFocused(
return false;
}
TAG_LOGD(AAFwkTag::ABILITYMGR, "ability: %{public}s, pid: %{public}d, tokenId: %{public}d",
abilityRecord->GetWant().GetElement().GetURI().c_str(), abilityRecord->GetPid(),
TAG_LOGD(AAFwkTag::ABILITYMGR, "ability:%{public}s/%{public}s, pid: %{public}d, tokenId: %{public}d",
abilityRecord->GetWant().GetElement().GetBundleName().c_str(),
abilityRecord->GetWant().GetElement().GetAbilityName().c_str(), abilityRecord->GetPid(),
abilityRecord->GetApplicationInfo().accessTokenId);
if (!AAFwk::UIExtensionUtils::IsUIExtension(abilityRecord->GetAbilityInfo().extensionAbilityType)) {
@@ -39,8 +39,8 @@ ErrCode ScreenUnlockInterceptor::DoProcess(AbilityInterceptorParam param)
QueryTargetAbilityInfo(param, targetAbilityInfo);
if (targetAbilityInfo.applicationInfo.name.empty() ||
targetAbilityInfo.applicationInfo.bundleName.empty()) {
TAG_LOGD(AAFwkTag::ABILITYMGR, "Cannot find targetAbilityInfo, element uri: %{public}s",
param.want.GetElement().GetURI().c_str());
TAG_LOGD(AAFwkTag::ABILITYMGR, "Cannot find targetAbilityInfo, element uri: %{public}s/%{public}s",
param.want.GetElement().GetBundleName().c_str(), param.want.GetElement().GetAbilityName().c_str());
return ERR_OK;
}
}
@@ -3319,7 +3319,9 @@ void MissionListManager::DumpMission(int missionId, std::vector<std::string> &in
int MissionListManager::ResolveLocked(const AbilityRequest &abilityRequest)
{
TAG_LOGI(AAFwkTag::ABILITYMGR, "ability_name:%{public}s", abilityRequest.want.GetElement().GetURI().c_str());
TAG_LOGI(AAFwkTag::ABILITYMGR, "ability_name:%{public}s/%{public}s",
abilityRequest.want.GetElement().GetBundleName().c_str(),
abilityRequest.want.GetElement().GetAbilityName().c_str());
if (!abilityRequest.IsCallType(AbilityCallType::CALL_REQUEST_TYPE)) {
TAG_LOGE(AAFwkTag::ABILITYMGR, "%{public}s, resolve ability_name:", __func__);
@@ -1321,7 +1321,9 @@ void UIAbilityLifecycleManager::MoveToBackground(const std::shared_ptr<AbilityRe
int UIAbilityLifecycleManager::ResolveLocked(const AbilityRequest &abilityRequest, std::string &errMsg)
{
TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s", abilityRequest.want.GetElement().GetURI().c_str());
TAG_LOGI(AAFwkTag::ABILITYMGR, "ByCall, ability:%{public}s/%{public}s",
abilityRequest.want.GetElement().GetBundleName().c_str(),
abilityRequest.want.GetElement().GetAbilityName().c_str());
if (!abilityRequest.IsCallType(AbilityCallType::CALL_REQUEST_TYPE)) {
TAG_LOGE(AAFwkTag::ABILITYMGR, "%{public}s, resolve ability_name:", __func__);
@@ -2322,7 +2324,8 @@ void UIAbilityLifecycleManager::OnAcceptWantResponse(const AAFwk::Want &want, co
void UIAbilityLifecycleManager::HandleLegacyAcceptWantDone(SpecifiedRequest &specifiedRequest,
const std::string &flag, const AAFwk::Want &want)
{
TAG_LOGI(AAFwkTag::ABILITYMGR, "%{public}s", want.GetElement().GetURI().c_str());
TAG_LOGI(AAFwkTag::ABILITYMGR, "HandleLegacyAcceptWantDone, ability:%{public}s/%{public}s",
want.GetElement().GetBundleName().c_str(), want.GetElement().GetAbilityName().c_str());
auto &abilityRequest = specifiedRequest.abilityRequest;
auto callerAbility = GetAbilityRecordByToken(abilityRequest.callerToken);
abilityRequest.specifiedFlag = flag;
@@ -3716,8 +3719,9 @@ void UIAbilityLifecycleManager::AddSpecifiedRequest(std::shared_ptr<SpecifiedReq
}
auto &abilityRequest = request->abilityRequest;
TAG_LOGI(AAFwkTag::ABILITYMGR, "AddSpecifiedRequest: %{public}d, %{public}s", request->requestId,
abilityRequest.want.GetElement().GetURI().c_str());
TAG_LOGI(AAFwkTag::ABILITYMGR, "AddSpecifiedRequest: %{public}d, %{public}s/%{public}s", request->requestId,
abilityRequest.want.GetElement().GetBundleName().c_str(),
abilityRequest.want.GetElement().GetAbilityName().c_str());
auto instanceKey = abilityRequest.want.GetStringParam(Want::APP_INSTANCE_KEY);
auto accessTokenIdStr = std::to_string(abilityRequest.abilityInfo.applicationInfo.accessTokenId);
auto &list = specifiedRequestList_[accessTokenIdStr + instanceKey];