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