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 ApplicationPendingState { 36 READY = 0, 37 FOREGROUNDING, 38 BACKGROUNDING, 39 }; 40 41 enum class AbilityState { 42 ABILITY_STATE_CREATE = 0, 43 ABILITY_STATE_READY, 44 ABILITY_STATE_FOREGROUND, 45 ABILITY_STATE_FOCUS, 46 ABILITY_STATE_BACKGROUND, 47 ABILITY_STATE_TERMINATED, 48 ABILITY_STATE_END, 49 ABILITY_STATE_CONNECTED, 50 ABILITY_STATE_DISCONNECTED, 51 }; 52 53 enum class ExtensionState { 54 EXTENSION_STATE_CREATE = 0, 55 EXTENSION_STATE_READY, 56 EXTENSION_STATE_CONNECTED, 57 EXTENSION_STATE_DISCONNECTED, 58 EXTENSION_STATE_TERMINATED, 59 }; 60 61 enum AppMgrResultCode { 62 RESULT_OK = 0, 63 ERROR_SERVICE_NOT_READY, 64 ERROR_SERVICE_NOT_CONNECTED, 65 ERROR_KILL_APPLICATION 66 }; 67 68 enum class ProcessChangeReason { 69 REASON_NONE = 0, 70 REASON_REMOTE_DIED, 71 REASON_APP_TERMINATED, 72 REASON_APP_TERMINATED_TIMEOUT, 73 }; 74 75 enum class ProcessType { 76 NORMAL = 0, 77 EXTENSION, 78 RENDER, 79 }; 80 81 enum class AppStartType { 82 COLD = 0, 83 HOT, 84 MULTI_INSTANCE, 85 }; 86 } // namespace AppExecFwk 87 } // namespace OHOS 88 #endif // OHOS_ABILITY_RUNTIME_APP_MGR_CONSTANTS_H 89