mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-12-04 05:22:25 +00:00
commit
53b48907e1
@ -18,6 +18,7 @@ ohos_shared_library("autostartupcallback") {
|
||||
include_dirs = [
|
||||
"./",
|
||||
"${ability_runtime_napi_path}/inner/napi_common/",
|
||||
"${ability_runtime_utils_path}/global/constant",
|
||||
]
|
||||
|
||||
sources = [
|
||||
|
@ -14,6 +14,8 @@
|
||||
*/
|
||||
|
||||
#include "js_ability_auto_startup_manager_utils.h"
|
||||
|
||||
#include "global_constant.h"
|
||||
#include "hilog_tag_wrapper.h"
|
||||
#include "napi_common_util.h"
|
||||
|
||||
@ -127,7 +129,7 @@ napi_value CreateJsAutoStartupInfo(napi_env env, const AutoStartupInfo &info)
|
||||
TAG_LOGE(AAFwkTag::AUTO_STARTUP, "Create js AutoStartupInfo failed.");
|
||||
return nullptr;
|
||||
}
|
||||
if (info.appCloneIndex != -1) {
|
||||
if (info.appCloneIndex >= 0 && info.appCloneIndex < GlobalConstant::MAX_APP_CLONE_INDEX) {
|
||||
napi_value appCloneIndex = AppExecFwk::WrapInt32ToJS(env, info.appCloneIndex);
|
||||
if (appCloneIndex == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::AUTO_STARTUP, "Convert ability type name failed.");
|
||||
|
@ -948,6 +948,8 @@ int UIAbilityLifecycleManager::NotifySCBPendingActivation(sptr<SessionInfo> &ses
|
||||
(sessionInfo->want).GetIntParam(Want::PARAM_RESV_WINDOW_HEIGHT, 0),
|
||||
(sessionInfo->want).GetIntParam(Want::PARAM_RESV_WINDOW_WIDTH, 0),
|
||||
(sessionInfo->want).GetIntParam(Want::PARAM_RESV_WINDOW_MODE, 0));
|
||||
TAG_LOGI(AAFwkTag::ABILITYMGR, "appCloneIndex: %{public}d.",
|
||||
(sessionInfo->want).GetIntParam(Want::PARAM_APP_CLONE_INDEX_KEY, 0));
|
||||
auto abilityRecord = GetAbilityRecordByToken(abilityRequest.callerToken);
|
||||
if (abilityRecord != nullptr && !abilityRecord->GetRestartAppFlag()) {
|
||||
auto callerSessionInfo = abilityRecord->GetSessionInfo();
|
||||
|
@ -50,6 +50,7 @@ bool StartAbilityUtils::GetAppIndex(const Want &want, sptr<IRemoteObject> caller
|
||||
appIndex = abilityRecord->GetAppIndex();
|
||||
return true;
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::ABILITYMGR, "appCloneIndex: %{public}d.", want.GetIntParam(Want::PARAM_APP_CLONE_INDEX_KEY, 0));
|
||||
return AbilityRuntime::StartupUtil::GetAppIndex(want, appIndex);
|
||||
}
|
||||
|
||||
|
@ -25,13 +25,17 @@ namespace OHOS::AbilityRuntime {
|
||||
bool StartupUtil::GetAppIndex(const AAFwk::Want &want, int32_t &appIndex)
|
||||
{
|
||||
appIndex = want.GetIntParam(ServerConstant::DLP_INDEX, 0);
|
||||
if (appIndex > GlobalConstant::MAX_APP_CLONE_INDEX) {
|
||||
return true;
|
||||
}
|
||||
if (appIndex == 0) {
|
||||
appIndex = want.GetIntParam(AAFwk::Want::PARAM_APP_CLONE_INDEX_KEY, 0);
|
||||
if (appIndex < 0 || appIndex > GlobalConstant::MAX_APP_CLONE_INDEX) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t StartupUtil::BuildAbilityInfoFlag()
|
||||
|
Loading…
Reference in New Issue
Block a user