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 constexpr const char* LOW_MEMORY_KILL = "LowMemoryKill"; 28 29 #ifdef SUPPORT_ASAN 30 constexpr int32_t COLDSTART_TIMEOUT_MULTIPLE = 15000; 31 constexpr int32_t LOAD_TIMEOUT_MULTIPLE = 15000; 32 constexpr int32_t FOREGROUND_TIMEOUT_MULTIPLE = 7500; 33 constexpr int32_t BACKGROUND_TIMEOUT_MULTIPLE = 4500; 34 constexpr int32_t INSIGHT_INTENT_TIMEOUT_MULTIPLE = 15000; 35 constexpr int32_t ACTIVE_TIMEOUT_MULTIPLE = 7500; 36 constexpr int32_t TERMINATE_TIMEOUT_MULTIPLE = 15000; 37 constexpr int32_t INACTIVE_TIMEOUT_MULTIPLE = 800; 38 constexpr int32_t INACTIVE_TIMEOUT_MULTIPLE_NEW = 800; 39 constexpr int32_t DUMP_TIMEOUT_MULTIPLE = 1500; 40 constexpr int32_t SHAREDATA_TIMEOUT_MULTIPLE = 7500; 41 constexpr int32_t CONCURRENT_START_TIMEOUT = 10; 42 #else 43 constexpr int32_t COLDSTART_TIMEOUT_MULTIPLE = 10; 44 constexpr int32_t LOAD_TIMEOUT_MULTIPLE = 10; 45 constexpr int32_t FOREGROUND_TIMEOUT_MULTIPLE = 5; 46 constexpr int32_t BACKGROUND_TIMEOUT_MULTIPLE = 3; 47 constexpr int32_t INSIGHT_INTENT_TIMEOUT_MULTIPLE = 10; 48 constexpr int32_t ACTIVE_TIMEOUT_MULTIPLE = 5; 49 constexpr int32_t TERMINATE_TIMEOUT_MULTIPLE = 10; 50 constexpr int32_t INACTIVE_TIMEOUT_MULTIPLE = 1; 51 constexpr int32_t INACTIVE_TIMEOUT_MULTIPLE_NEW = 21; 52 constexpr int32_t DUMP_TIMEOUT_MULTIPLE = 1000; 53 constexpr int32_t SHAREDATA_TIMEOUT_MULTIPLE = 5; 54 constexpr int32_t CONCURRENT_START_TIMEOUT = 1; 55 constexpr int32_t TYPE_RESERVE = 1; 56 constexpr int32_t TYPE_OTHERS = 2; 57 #endif 58 59 constexpr int32_t MIGRATE_CLIENT_TIMEOUT_MULTIPLE = 3; 60 GetLoadTimeOutBase()61constexpr int32_t GetLoadTimeOutBase() 62 { 63 return TIMEOUT_UNIT_TIME * LOAD_TIMEOUT_MULTIPLE; 64 } 65 GetLoadAndInactiveTimeout()66constexpr int32_t GetLoadAndInactiveTimeout() 67 { 68 return TIMEOUT_UNIT_TIME * (LOAD_TIMEOUT_MULTIPLE + INACTIVE_TIMEOUT_MULTIPLE); 69 } 70 71 } // namespace GlobalConstant 72 } // namespace OHOS::AbilityRuntime 73 #endif // OHOS_ABILITY_RUNTIME_GLOBAL_CONSTANT_H