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 19 namespace OHOS::AbilityRuntime { 20 namespace GlobalConstant { 21 constexpr int32_t MAX_APP_CLONE_INDEX = 1000; 22 23 constexpr int32_t TIMEOUT_UNIT_TIME = 1000; 24 25 constexpr int32_t PREPARE_TERMINATE_TIMEOUT_TIME = 10000; 26 27 #ifdef SUPPORT_ASAN 28 constexpr int32_t COLDSTART_TIMEOUT_MULTIPLE = 15000; 29 constexpr int32_t LOAD_TIMEOUT_MULTIPLE = 15000; 30 constexpr int32_t FOREGROUND_TIMEOUT_MULTIPLE = 7500; 31 constexpr int32_t BACKGROUND_TIMEOUT_MULTIPLE = 4500; 32 constexpr int32_t ACTIVE_TIMEOUT_MULTIPLE = 7500; 33 constexpr int32_t TERMINATE_TIMEOUT_MULTIPLE = 15000; 34 constexpr int32_t INACTIVE_TIMEOUT_MULTIPLE = 800; 35 constexpr int32_t DUMP_TIMEOUT_MULTIPLE = 1500; 36 constexpr int32_t SHAREDATA_TIMEOUT_MULTIPLE = 7500; 37 #else 38 constexpr int32_t COLDSTART_TIMEOUT_MULTIPLE = 10; 39 constexpr int32_t LOAD_TIMEOUT_MULTIPLE = 10; 40 constexpr int32_t FOREGROUND_TIMEOUT_MULTIPLE = 5; 41 constexpr int32_t BACKGROUND_TIMEOUT_MULTIPLE = 3; 42 constexpr int32_t ACTIVE_TIMEOUT_MULTIPLE = 5; 43 constexpr int32_t TERMINATE_TIMEOUT_MULTIPLE = 10; 44 constexpr int32_t INACTIVE_TIMEOUT_MULTIPLE = 1; 45 constexpr int32_t DUMP_TIMEOUT_MULTIPLE = 1000; 46 constexpr int32_t SHAREDATA_TIMEOUT_MULTIPLE = 5; 47 constexpr int32_t TYPE_RESERVE = 1; 48 constexpr int32_t TYPE_OTHERS = 2; 49 #endif 50 51 constexpr int32_t MIGRATE_CLIENT_TIMEOUT_MULTIPLE = 3; 52 GetLoadTimeOutBase()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