• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022-2024 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/**
17 * @file
18 * @kit AbilityKit
19 */
20
21/**
22 * The context of an application. It allows access to application-specific resources.
23 *
24 * @namespace contextConstant
25 * @syscap SystemCapability.Ability.AbilityRuntime.Core
26 * @StageModelOnly
27 * @since 9
28 */
29/**
30 * The context of an application. It allows access to application-specific resources.
31 *
32 * @namespace contextConstant
33 * @syscap SystemCapability.Ability.AbilityRuntime.Core
34 * @StageModelOnly
35 * @atomicservice
36 * @since 11
37 */
38declare namespace contextConstant {
39  /**
40   * File area mode
41   *
42   * @enum { number }
43   * @syscap SystemCapability.Ability.AbilityRuntime.Core
44   * @StageModelOnly
45   * @since 9
46   */
47  /**
48   * File area mode
49   *
50   * @enum { number }
51   * @syscap SystemCapability.Ability.AbilityRuntime.Core
52   * @StageModelOnly
53   * @atomicservice
54   * @since 11
55   */
56  export enum AreaMode {
57    /**
58     * System level device encryption area
59     *
60     * @syscap SystemCapability.Ability.AbilityRuntime.Core
61     * @StageModelOnly
62     * @since 9
63     */
64    /**
65     * System level device encryption area
66     *
67     * @syscap SystemCapability.Ability.AbilityRuntime.Core
68     * @StageModelOnly
69     * @atomicservice
70     * @since 11
71     */
72    EL1 = 0,
73
74    /**
75     * User credential encryption area
76     *
77     * @syscap SystemCapability.Ability.AbilityRuntime.Core
78     * @StageModelOnly
79     * @since 9
80     */
81    /**
82     * User credential encryption area
83     *
84     * @syscap SystemCapability.Ability.AbilityRuntime.Core
85     * @StageModelOnly
86     * @atomicservice
87     * @since 11
88     */
89    EL2 = 1,
90
91    /**
92     * User credential encryption area
93     * when screen locked, can read/write, and create file
94     *
95     * @syscap SystemCapability.Ability.AbilityRuntime.Core
96     * @stagemodelonly
97     * @atomicservice
98     * @since 11
99     */
100    EL3 = 2,
101
102    /**
103     * User credential encryption area
104     * when screen locked, FEB2.0 can read/write, FEB3.0 can't
105     * read/write, and all can't create file
106     *
107     * @syscap SystemCapability.Ability.AbilityRuntime.Core
108     * @stagemodelonly
109     * @atomicservice
110     * @since 11
111     */
112    EL4 = 3,
113
114    /**
115     * User privacy sensitive encryption area
116     * when the screen locked, a closed file cannot be opened, read, or written,
117     * a file can be created and then opened, read, or written.
118     *
119     * @syscap SystemCapability.Ability.AbilityRuntime.Core
120     * @stagemodelonly
121     * @atomicservice
122     * @since 12
123     */
124    EL5 = 4
125  }
126
127  /**
128   * Process mode
129   *
130   * @enum { number }
131   * @syscap SystemCapability.Ability.AbilityRuntime.Core
132   * @stagemodelonly
133   * @since 12
134   */
135  export enum ProcessMode {
136    /**
137     * Indicates the ability started in a new process, and the process lifecycle follows the parent process.
138     * When using this mode, the target ability needs to have the same bundle name as the caller.
139     *
140     * @syscap SystemCapability.Ability.AbilityRuntime.Core
141     * @stagemodelonly
142     * @since 12
143     */
144    NEW_PROCESS_ATTACH_TO_PARENT = 1,
145
146    /**
147     * Indicates the ability started in a new process.
148     * When using this mode, the caller needs to add item to status bar first,
149     * and the target ability needs to have the same bundle name as the caller.
150     *
151     * @syscap SystemCapability.Ability.AbilityRuntime.Core
152     * @stagemodelonly
153     * @since 12
154     */
155    NEW_PROCESS_ATTACH_TO_STATUS_BAR_ITEM = 2,
156
157    /**
158     * Indicates the ability started without forcing the creation of a new process.
159     * When using this mode, the caller needs to add item to status bar first,
160     * and the target ability needs to have the same bundle name as the caller.
161     *
162     * @syscap SystemCapability.Ability.AbilityRuntime.Core
163     * @stagemodelonly
164     * @since 12
165     */
166    ATTACH_TO_STATUS_BAR_ITEM = 3
167  }
168
169  /**
170   * Startup visibility
171   *
172   * @enum { number }
173   * @syscap SystemCapability.Ability.AbilityRuntime.Core
174   * @stagemodelonly
175   * @since 12
176   */
177  export enum StartupVisibility {
178    /**
179     * Indicates that the ability will hide after process startup.
180     *
181     * @syscap SystemCapability.Ability.AbilityRuntime.Core
182     * @stagemodelonly
183     * @since 12
184     */
185    STARTUP_HIDE = 0,
186
187    /**
188     * Indicates that the ability will show after process startup.
189     *
190     * @syscap SystemCapability.Ability.AbilityRuntime.Core
191     * @stagemodelonly
192     * @since 12
193     */
194    STARTUP_SHOW = 1
195  }
196}
197
198export default contextConstant;
199