1 /* 2 * Copyright (c) 2021 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_APP_MGR_CONSTANTS_H 17 #define OHOS_ABILITY_RUNTIME_APP_MGR_CONSTANTS_H 18 19 namespace OHOS { 20 namespace AppExecFwk { 21 namespace Constants { 22 const std::string APP_MGR_SERVICE_NAME = "AppMgrService"; 23 } // namespace Constants 24 25 enum class ApplicationState { 26 APP_STATE_CREATE = 0, 27 APP_STATE_READY, 28 APP_STATE_FOREGROUND, 29 APP_STATE_FOCUS, 30 APP_STATE_BACKGROUND, 31 APP_STATE_TERMINATED, 32 APP_STATE_END, 33 }; 34 35 enum class AbilityState { 36 ABILITY_STATE_CREATE = 0, 37 ABILITY_STATE_READY, 38 ABILITY_STATE_FOREGROUND, 39 ABILITY_STATE_FOCUS, 40 ABILITY_STATE_BACKGROUND, 41 ABILITY_STATE_TERMINATED, 42 ABILITY_STATE_END, 43 ABILITY_STATE_CONNECTED, 44 ABILITY_STATE_DISCONNECTED, 45 }; 46 47 enum class ExtensionState { 48 EXTENSION_STATE_CREATE = 0, 49 EXTENSION_STATE_READY, 50 EXTENSION_STATE_CONNECTED, 51 EXTENSION_STATE_DISCONNECTED, 52 EXTENSION_STATE_TERMINATED, 53 }; 54 55 enum AppMgrResultCode { 56 RESULT_OK = 0, 57 ERROR_SERVICE_NOT_READY, 58 ERROR_SERVICE_NOT_CONNECTED, 59 ERROR_KILL_APPLICATION 60 }; 61 62 enum class ProcessChangeReason { 63 REASON_NONE = 0, 64 REASON_REMOTE_DIED, 65 REASON_APP_TERMINATED, 66 REASON_APP_TERMINATED_TIMEOUT, 67 }; 68 69 enum class ProcessType { 70 NORMAL = 0, 71 EXTENSION, 72 RENDER, 73 }; 74 75 enum class AppStartType { 76 COLD = 0, 77 HOT, 78 }; 79 } // namespace AppExecFwk 80 } // namespace OHOS 81 #endif // OHOS_ABILITY_RUNTIME_APP_MGR_CONSTANTS_H 82