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_BEGIN = 0, 27 APP_STATE_CREATE = APP_STATE_BEGIN, 28 APP_STATE_READY, 29 APP_STATE_FOREGROUND, 30 APP_STATE_FOCUS, 31 APP_STATE_BACKGROUND, 32 APP_STATE_TERMINATED, 33 APP_STATE_END, 34 }; 35 36 enum class AbilityState { 37 ABILITY_STATE_BEGIN = 0, 38 ABILITY_STATE_CREATE = ABILITY_STATE_BEGIN, 39 ABILITY_STATE_READY, 40 ABILITY_STATE_FOREGROUND, 41 ABILITY_STATE_FOCUS, 42 ABILITY_STATE_BACKGROUND, 43 ABILITY_STATE_TERMINATED, 44 ABILITY_STATE_END, 45 ABILITY_STATE_CONNECTED, 46 ABILITY_STATE_DISCONNECTED, 47 }; 48 49 enum class ExtensionState { 50 EXTENSION_STATE_CREATE = 0, 51 EXTENSION_STATE_READY, 52 EXTENSION_STATE_CONNECTED, 53 EXTENSION_STATE_DISCONNECTED, 54 EXTENSION_STATE_TERMINATED, 55 }; 56 57 enum AppMgrResultCode { 58 RESULT_OK = 0, 59 ERROR_SERVICE_NOT_READY, 60 ERROR_SERVICE_NOT_CONNECTED, 61 ERROR_KILL_APPLICATION 62 }; 63 64 enum class ProcessChangeReason { 65 REASON_NONE = 0, 66 REASON_REMOTE_DIED, 67 REASON_APP_TERMINATED, 68 REASON_APP_TERMINATED_TIMEOUT, 69 }; 70 } // namespace AppExecFwk 71 } // namespace OHOS 72 #endif // OHOS_ABILITY_RUNTIME_APP_MGR_CONSTANTS_H 73