diff --git a/frameworks/simulator/common/include/extension_ability_info.h b/frameworks/simulator/common/include/extension_ability_info.h index b4822125678938427d63d37d592b001b650eca4f..ba22cc9eba20e356f125256969d1ee2c21edddee 100644 --- a/frameworks/simulator/common/include/extension_ability_info.h +++ b/frameworks/simulator/common/include/extension_ability_info.h @@ -56,6 +56,7 @@ enum class ExtensionAbilityType { PUSH = 17, DRIVER = 18, APP_ACCOUNT_AUTHORIZATION = 19, + EMBEDDED_UI = 21, FENCE = 24, DISTRIBUTED = 28, UNSPECIFIED = 255, diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index d3243300d948fcf0cc5d8f42709c75da1958476f..0956b1f12d8d15c354875eefd5d16b57c209c830 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -1836,6 +1836,15 @@ int AbilityManagerService::StartUIAbilityForOptionWrap(const Want &want, const S options.processOptions->isStartFromNDK) { ret = CheckStartSelfUIAbilityStartOptions(want, options); } else { + auto abilityRecord = Token::GetAbilityRecordByToken(callerToken); + if (abilityRecord && (abilityRecord->GetApplicationInfo().bundleName == "com.tencent.wechat.pc" || + abilityRecord->GetApplicationInfo().bundleName == "com.huawei.chromium")) { + int32_t appIndex = abilityRecord->GetAppIndex(); + TAG_LOGI(AAFwkTag::ABILITYMGR, "wxg GetAppIndex %{public}d", appIndex); + if (appIndex) { + (const_cast(want)).SetParam(Want::PARAM_APP_CLONE_INDEX_KEY, appIndex); + } + } ret = CheckProcessOptions(want, options, userId); } @@ -7376,12 +7385,16 @@ int AbilityManagerService::GenerateExtensionAbilityRequest( if (abilityInfo == nullptr || abilityInfo->GetAppBundleName() != want.GetElement().GetBundleName()) { int32_t appIndex = 0; if (!AbilityRuntime::StartupUtil::GetAppIndex(want, appIndex)) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "wxg DLP_INDEX appIndex:%{public}d", want.GetIntParam(ServerConstant::DLP_INDEX, 0)); + TAG_LOGE(AAFwkTag::ABILITYMGR, "wxg app clone appIndex:%{public}d", want.GetIntParam(AAFwk::Want::PARAM_APP_CLONE_INDEX_KEY, 0)); + TAG_LOGE(AAFwkTag::ABILITYMGR, "wxg GenerateExtensionAbilityRequest app clone appIndex:%{public}d", appIndex); return ERR_APP_CLONE_INDEX_INVALID; } abilityInfo = StartAbilityInfo::CreateStartExtensionInfo(want, userId, appIndex); } CHECK_POINTER_AND_RETURN(abilityInfo, GET_ABILITY_SERVICE_FAILED); if (abilityInfo->status != ERR_OK) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "wxg abilityInfo->status:%{public}d", abilityInfo->status); return abilityInfo->status; } if (ModalSystemDialogUtil::CheckDebugAppNotInDeveloperMode(abilityInfo->abilityInfo.applicationInfo)) { @@ -8631,15 +8644,18 @@ int AbilityManagerService::JudgeAbilityVisibleControl(const AppExecFwk::AbilityI { TAG_LOGD(AAFwkTag::ABILITYMGR, "Call."); if (abilityInfo.visible) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "wxg JudgeAbilityVisibleControl visible:%{public}d", abilityInfo.visible); return ERR_OK; } auto callerTokenId = IPCSkeleton::GetCallingTokenID(); if (callerTokenId == abilityInfo.applicationInfo.accessTokenId || callerTokenId == static_cast(IPCSkeleton::GetSelfTokenID())) { // foundation call is allowed + TAG_LOGE(AAFwkTag::ABILITYMGR, "wxg JudgeAbilityVisibleControl callerTokenId:%{public}u", callerTokenId); return ERR_OK; } if (AccessTokenKit::VerifyAccessToken(callerTokenId, PermissionConstants::PERMISSION_START_INVISIBLE_ABILITY, false) == AppExecFwk::Constants::PERMISSION_GRANTED) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "wxg JudgeAbilityVisibleControl VerifyAccessToken"); return ERR_OK; } TAG_LOGE(AAFwkTag::ABILITYMGR, "callerToken:%{private}u, targetToken:%{private}u, caller without permission", @@ -12666,7 +12682,9 @@ int32_t AbilityManagerService::GenerateEmbeddableUIAbilityRequest( int32_t screenMode = want.GetIntParam(AAFwk::SCREEN_MODE_KEY, AAFwk::IDLE_SCREEN_MODE); int32_t result = ERR_OK; if (IsEmbeddableStart(screenMode)) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "OSCAR: Is EmbeddableStart, screen Mode = %{public}d", screenMode); result = GenerateAbilityRequest(want, -1, request, callerToken, userId); + TAG_LOGE(AAFwkTag::ABILITYMGR, "OSCAR: result for GenerateAbilityRequest = %{public}d", result); request.abilityInfo.isModuleJson = true; request.abilityInfo.isStageBasedModel = true; request.abilityInfo.type = AppExecFwk::AbilityType::EXTENSION; @@ -12676,7 +12694,9 @@ int32_t AbilityManagerService::GenerateEmbeddableUIAbilityRequest( int64_t times = static_cast(time.tv_sec); request.abilityInfo.process = request.abilityInfo.bundleName + PROCESS_SUFFIX + std::to_string(times); } else { + TAG_LOGE(AAFwkTag::ABILITYMGR, "OSCAR: Not EmbeddableStart, screen Mode = %{public}d", screenMode); result = GenerateExtensionAbilityRequest(want, request, callerToken, userId); + TAG_LOGE(AAFwkTag::ABILITYMGR, "OSCAR: result for GenerateExtensionAbilityRequest = %{public}d", result); } return result; } diff --git a/services/abilitymgr/src/utils/start_ability_utils.cpp b/services/abilitymgr/src/utils/start_ability_utils.cpp index 32a8ae1f97e3078616120efc4f29117b082bd0c7..e497a661c51a633d9229bd0f5c6ee5e697ff7bff 100644 --- a/services/abilitymgr/src/utils/start_ability_utils.cpp +++ b/services/abilitymgr/src/utils/start_ability_utils.cpp @@ -310,6 +310,7 @@ std::shared_ptr StartAbilityInfo::CreateStartExtensionInfo(con static_cast(AppExecFwk::AbilityInfoFlag::GET_ABILITY_INFO_WITH_SKILL); auto abilityInfo = std::make_shared(); if (appIndex > 0 && appIndex <= AbilityRuntime::GlobalConstant::MAX_APP_CLONE_INDEX) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "wxg CreateStartExtensionInfo"); FindExtensionInfo(want, abilityInfoFlag, userId, appIndex, abilityInfo); return abilityInfo; } @@ -357,11 +358,13 @@ void StartAbilityInfo::FindExtensionInfo(const Want &want, int32_t flags, int32_ return; } abilityInfo->customProcess = extensionInfo.customProcess; + extensionInfo.type = AppExecFwk::ExtensionAbilityType::EMBEDDED_UI; if (AbilityRuntime::StartupUtil::IsSupportAppClone(extensionInfo.type)) { abilityInfo->extensionProcessMode = extensionInfo.extensionProcessMode; // For compatibility translates to AbilityInfo AbilityRuntime::StartupUtil::InitAbilityInfoFromExtension(extensionInfo, abilityInfo->abilityInfo); } else { + TAG_LOGE(AAFwkTag::ABILITYMGR, "OSCAR: IsSupportAppClone false"); abilityInfo->status = ERR_APP_CLONE_INDEX_INVALID; } } diff --git a/utils/server/startup/src/startup_util.cpp b/utils/server/startup/src/startup_util.cpp index 187dd24215fd999cb7fc5def26ee5f1653b8401d..7f7677711dbab930c1aa4cc8ab3e64285c296b2d 100644 --- a/utils/server/startup/src/startup_util.cpp +++ b/utils/server/startup/src/startup_util.cpp @@ -59,7 +59,9 @@ bool StartupUtil::IsSupportAppClone(AppExecFwk::ExtensionAbilityType type) type == AppExecFwk::ExtensionAbilityType::PUSH || type == AppExecFwk::ExtensionAbilityType::REMOTE_LOCATION || type == AppExecFwk::ExtensionAbilityType::REMOTE_NOTIFICATION || - type == AppExecFwk::ExtensionAbilityType::VOIP; + type == AppExecFwk::ExtensionAbilityType::VOIP || + type == AppExecFwk::ExtensionAbilityType::UI || + type == AppExecFwk::ExtensionAbilityType::EMBEDDED_UI; } void StartupUtil::InitAbilityInfoFromExtension(AppExecFwk::ExtensionAbilityInfo &extensionInfo,