1 /* 2 * Copyright (c) 2025 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 #include "utils/timeout_state_utils.h" 17 #include "ability_manager_service.h" 18 19 namespace OHOS { 20 namespace AAFwk { 21 MsgId2FreezeTimeOutState(uint32_t msgId)22AbilityRuntime::FreezeUtil::TimeoutState TimeoutStateUtils::MsgId2FreezeTimeOutState(uint32_t msgId) 23 { 24 switch (msgId) { 25 case AbilityManagerService::LOAD_TIMEOUT_MSG: 26 return AbilityRuntime::FreezeUtil::TimeoutState::LOAD; 27 case AbilityManagerService::FOREGROUND_TIMEOUT_MSG: 28 return AbilityRuntime::FreezeUtil::TimeoutState::FOREGROUND; 29 case AbilityManagerService::BACKGROUND_TIMEOUT_MSG: 30 return AbilityRuntime::FreezeUtil::TimeoutState::BACKGROUND; 31 case AbilityManagerService::CONNECT_TIMEOUT_MSG: 32 return AbilityRuntime::FreezeUtil::TimeoutState::CONNECT; 33 default: 34 return AbilityRuntime::FreezeUtil::TimeoutState::UNKNOWN; 35 } 36 return AbilityRuntime::FreezeUtil::TimeoutState::UNKNOWN; 37 } 38 } // namespace AAFwk 39 } // namespace OHOS 40