1eace7efcSopenharmony_ci/* 2eace7efcSopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 3eace7efcSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4eace7efcSopenharmony_ci * you may not use this file except in compliance with the License. 5eace7efcSopenharmony_ci * You may obtain a copy of the License at 6eace7efcSopenharmony_ci * 7eace7efcSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8eace7efcSopenharmony_ci * 9eace7efcSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10eace7efcSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11eace7efcSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12eace7efcSopenharmony_ci * See the License for the specific language governing permissions and 13eace7efcSopenharmony_ci * limitations under the License. 14eace7efcSopenharmony_ci */ 15eace7efcSopenharmony_ci 16eace7efcSopenharmony_ci#ifndef OHOS_ABILITY_RUNTIME_GLOBAL_CONSTANT_H 17eace7efcSopenharmony_ci#define OHOS_ABILITY_RUNTIME_GLOBAL_CONSTANT_H 18eace7efcSopenharmony_ci 19eace7efcSopenharmony_cinamespace OHOS::AbilityRuntime { 20eace7efcSopenharmony_cinamespace GlobalConstant { 21eace7efcSopenharmony_ciconstexpr int32_t MAX_APP_CLONE_INDEX = 1000; 22eace7efcSopenharmony_ci 23eace7efcSopenharmony_ciconstexpr int32_t TIMEOUT_UNIT_TIME = 1000; 24eace7efcSopenharmony_ci 25eace7efcSopenharmony_ciconstexpr int32_t PREPARE_TERMINATE_TIMEOUT_TIME = 10000; 26eace7efcSopenharmony_ci 27eace7efcSopenharmony_ci#ifdef SUPPORT_ASAN 28eace7efcSopenharmony_ciconstexpr int32_t COLDSTART_TIMEOUT_MULTIPLE = 15000; 29eace7efcSopenharmony_ciconstexpr int32_t LOAD_TIMEOUT_MULTIPLE = 15000; 30eace7efcSopenharmony_ciconstexpr int32_t FOREGROUND_TIMEOUT_MULTIPLE = 7500; 31eace7efcSopenharmony_ciconstexpr int32_t BACKGROUND_TIMEOUT_MULTIPLE = 4500; 32eace7efcSopenharmony_ciconstexpr int32_t ACTIVE_TIMEOUT_MULTIPLE = 7500; 33eace7efcSopenharmony_ciconstexpr int32_t TERMINATE_TIMEOUT_MULTIPLE = 15000; 34eace7efcSopenharmony_ciconstexpr int32_t INACTIVE_TIMEOUT_MULTIPLE = 800; 35eace7efcSopenharmony_ciconstexpr int32_t DUMP_TIMEOUT_MULTIPLE = 1500; 36eace7efcSopenharmony_ciconstexpr int32_t SHAREDATA_TIMEOUT_MULTIPLE = 7500; 37eace7efcSopenharmony_ci#else 38eace7efcSopenharmony_ciconstexpr int32_t COLDSTART_TIMEOUT_MULTIPLE = 10; 39eace7efcSopenharmony_ciconstexpr int32_t LOAD_TIMEOUT_MULTIPLE = 10; 40eace7efcSopenharmony_ciconstexpr int32_t FOREGROUND_TIMEOUT_MULTIPLE = 5; 41eace7efcSopenharmony_ciconstexpr int32_t BACKGROUND_TIMEOUT_MULTIPLE = 3; 42eace7efcSopenharmony_ciconstexpr int32_t ACTIVE_TIMEOUT_MULTIPLE = 5; 43eace7efcSopenharmony_ciconstexpr int32_t TERMINATE_TIMEOUT_MULTIPLE = 10; 44eace7efcSopenharmony_ciconstexpr int32_t INACTIVE_TIMEOUT_MULTIPLE = 1; 45eace7efcSopenharmony_ciconstexpr int32_t DUMP_TIMEOUT_MULTIPLE = 1000; 46eace7efcSopenharmony_ciconstexpr int32_t SHAREDATA_TIMEOUT_MULTIPLE = 5; 47eace7efcSopenharmony_ciconstexpr int32_t TYPE_RESERVE = 1; 48eace7efcSopenharmony_ciconstexpr int32_t TYPE_OTHERS = 2; 49eace7efcSopenharmony_ci#endif 50eace7efcSopenharmony_ci 51eace7efcSopenharmony_ciconstexpr int32_t MIGRATE_CLIENT_TIMEOUT_MULTIPLE = 3; 52eace7efcSopenharmony_ci 53eace7efcSopenharmony_ciconstexpr int32_t GetLoadTimeOutBase() 54eace7efcSopenharmony_ci{ 55eace7efcSopenharmony_ci return TIMEOUT_UNIT_TIME * LOAD_TIMEOUT_MULTIPLE; 56eace7efcSopenharmony_ci} 57eace7efcSopenharmony_ci} // namespace GlobalConstant 58eace7efcSopenharmony_ci} // namespace OHOS::AbilityRuntime 59eace7efcSopenharmony_ci#endif // OHOS_ABILITY_RUNTIME_GLOBAL_CONSTANT_H