• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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_ABILITY_RECOVERY_PARAM_H
17 #define OHOS_ABILITY_RUNTIME_ABILITY_RECOVERY_PARAM_H
18 
19 namespace OHOS {
20 namespace AppExecFwk {
21 /**
22  * @enum OnSaveResult
23  * OnSaveResult defines the reason of Save data mode.
24  */
25 enum OnSaveResult {
26     ALL_AGREE = 0,
27     CONTINUATION_REJECT,
28     CONTINUATION_MISMATCH,
29     RECOVERY_AGREE,
30     RECOVERY_REJECT,
31     ALL_REJECT
32 };
33 
34 /**
35  * @enum StateType
36  * StateType defines the reason of state type.
37  */
38 enum StateType {
39     CONTINUATION = 0,
40     APP_RECOVERY,
41 };
42 
43 enum RestartFlag {
44     ALWAYS_RESTART = 0,
45     RESTART_WHEN_JS_CRASH = 0x0001,
46     RESTART_WHEN_APP_FREEZE = 0x0002,
47     NO_RESTART = 0xFFFF,
48 };
49 
50 enum SaveOccasionFlag {
51     NO_SAVE = 0,
52     SAVE_WHEN_ERROR = 1,
53     SAVE_WHEN_BACKGROUND = 2,
54     SAVE_ALL = 0xFF,
55 };
56 
57 enum SaveModeFlag {
58     SAVE_WITH_FILE = 1,
59     SAVE_WITH_SHARED_MEMORY = 2,
60 };
61 
62 enum StateReason {
63     DEVELOPER_REQUEST,
64     LIFECYCLE,
65     CPP_CRASH,
66     JS_ERROR,
67     APP_FREEZE,
68 };
69 
70 }  // namespace AAFwk
71 }  // namespace OHOS
72 #endif  // OHOS_ABILITY_RUNTIME_ABILITY_RECOVERY_PARAM_H