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 #ifdef SUPPORT_ASAN 26 constexpr int32_t COLDSTART_TIMEOUT_MULTIPLE = 15000; 27 constexpr int32_t LOAD_TIMEOUT_MULTIPLE = 15000; 28 constexpr int32_t FOREGROUND_TIMEOUT_MULTIPLE = 7500; 29 constexpr int32_t BACKGROUND_TIMEOUT_MULTIPLE = 4500; 30 constexpr int32_t INSIGHT_INTENT_TIMEOUT_MULTIPLE = 15000; 31 constexpr int32_t ACTIVE_TIMEOUT_MULTIPLE = 7500; 32 constexpr int32_t TERMINATE_TIMEOUT_MULTIPLE = 15000; 33 constexpr int32_t INACTIVE_TIMEOUT_MULTIPLE = 800; 34 constexpr int32_t DUMP_TIMEOUT_MULTIPLE = 1500; 35 constexpr int32_t SHAREDATA_TIMEOUT_MULTIPLE = 7500; 36 #else 37 constexpr int32_t COLDSTART_TIMEOUT_MULTIPLE = 10; 38 constexpr int32_t LOAD_TIMEOUT_MULTIPLE = 10; 39 constexpr int32_t FOREGROUND_TIMEOUT_MULTIPLE = 5; 40 constexpr int32_t BACKGROUND_TIMEOUT_MULTIPLE = 3; 41 constexpr int32_t INSIGHT_INTENT_TIMEOUT_MULTIPLE = 10; 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 GetLoadTimeOutBase()51constexpr int32_t GetLoadTimeOutBase() 52 { 53 return TIMEOUT_UNIT_TIME * LOAD_TIMEOUT_MULTIPLE; 54 } 55 GetLoadAndInactiveTimeout()56constexpr int32_t GetLoadAndInactiveTimeout() 57 { 58 return TIMEOUT_UNIT_TIME * (LOAD_TIMEOUT_MULTIPLE + INACTIVE_TIMEOUT_MULTIPLE); 59 } 60 61 } // namespace GlobalConstant 62 } // namespace OHOS::AbilityRuntime 63 #endif // OHOS_ABILITY_RUNTIME_GLOBAL_CONSTANT_H