• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
16import { AbilityInfo } from './abilityInfo';
17import { ApplicationInfo } from './applicationInfo';
18import { HapModuleInfo } from './hapModuleInfo';
19
20/**
21 * @name The scene which is used
22 * @since 7
23 * @SysCap SystemCapability.Appexecfwk
24 * @permission NA
25 * @devices phone, tablet, tv, wearable, car
26 */
27export interface UsedScene {
28  /**
29    * @default Indicates the abilities that need the permission
30    * @since 7
31    * @SysCap SystemCapability.Appexecfwk
32    */
33  abilities: Array<string>;
34
35  /**
36    * @default Indicates the time when the permission is used
37    * @since 7
38    * @SysCap SystemCapability.Appexecfwk
39    */
40  when: string;
41}
42
43/**
44 * @name Indicates the required permissions details defined in file config.json
45 * @since 7
46 * @SysCap SystemCapability.Appexecfwk
47 * @permission NA
48 * @devices phone, tablet, tv, wearable, car
49 */
50export interface ReqPermissionDetail {
51  /**
52    * @default Indicates the name of this required permissions
53    * @since 7
54    * @SysCap SystemCapability.Appexecfwk
55    */
56  name: string;
57
58  /**
59    * @default Indicates the reason of this required permissions
60    * @since 7
61    * @SysCap SystemCapability.Appexecfwk
62    */
63  reason: string;
64
65  /**
66    * @default Indicates the used scene of this required permissions
67    * @since 7
68    * @SysCap SystemCapability.Appexecfwk
69    */
70  usedScene: UsedScene;
71}
72
73/**
74 * @name Obtains configuration information about a bundle
75 * @since 7
76 * @SysCap SystemCapability.Appexecfwk
77 * @permission NA
78 * @devices phone, tablet, tv, wearable, car
79 */
80export interface BundleInfo {
81  /**
82    * @default Indicates the name of this bundle
83    * @since 7
84    * @SysCap SystemCapability.Appexecfwk
85    */
86  readonly name: string;
87
88  /**
89    * @default Indicates the name of this original bundle
90    * @since 7
91    * @SysCap SystemCapability.Appexecfwk
92    */
93  readonly type: string;
94
95  /**
96    * @default Indicates the ID of the application to which this bundle belongs
97    * The application ID uniquely identifies an application. It is determined by the bundle name and signature
98    * @since 7
99    * @SysCap SystemCapability.Appexecfwk
100    */
101  readonly appId: string;
102
103  /**
104    * @default Indicates the UID of the application to which this bundle belongs
105    * The UID uniquely identifies an application. It is determined by the process and user IDs of the application
106    * After an application is installed, its UID remains unchanged unless it is uninstalled and then reinstalled
107    * @since 7
108    * @SysCap SystemCapability.Appexecfwk
109    */
110  readonly uid: number;
111
112  /**
113    * @default Indicates the hap install time
114    * @since 7
115    * @SysCap SystemCapability.Appexecfwk
116    */
117  readonly installTime: number;
118
119  /**
120    * @default Indicates the hap update time
121    * @since 7
122    * @SysCap SystemCapability.Appexecfwk
123    */
124  readonly updateTime: number;
125
126  /**
127    * @default Obtains configuration information about an application
128    * @since 7
129    * @SysCap SystemCapability.Appexecfwk
130    */
131  readonly appInfo: ApplicationInfo;
132
133  /**
134    * @default Obtains configuration information about an ability
135    * @since 7
136    * @SysCap SystemCapability.Appexecfwk
137    */
138  readonly abilityInfo: Array<AbilityInfo>;
139
140  /**
141    * @default Indicates the required permissions name defined in file config.json
142    * @since 7
143    * @SysCap SystemCapability.Appexecfwk
144    */
145  readonly reqPermissions: Array<string>;
146
147  /**
148    * @default Indicates the required permissions details defined in file config.json
149    * @since 7
150    * @SysCap SystemCapability.Appexecfwk
151    */
152  readonly reqPermissionDetails: Array<ReqPermissionDetail>;
153
154  /**
155    * @default Describes the bundle vendor
156    * @since 7
157    * @SysCap SystemCapability.Appexecfwk
158    */
159  readonly vendor: string;
160
161  /**
162    * @default Indicates the version number of the bundle
163    * @since 7
164    * @SysCap SystemCapability.Appexecfwk
165    */
166  readonly versionCode: number;
167
168  /**
169    * @default Indicates the text description of the bundle version
170    * @since 7
171    * @SysCap SystemCapability.Appexecfwk
172    */
173  readonly versionName: string;
174
175  /**
176    * @default Indicates the compatible version number of the bundle
177    * @since 7
178    * @SysCap SystemCapability.Appexecfwk
179    */
180  readonly compatibleVersion: number;
181
182  /**
183    * @default Indicates the target version number of the bundle
184    * @since 7
185    * @SysCap SystemCapability.Appexecfwk
186    */
187  readonly targetVersion: number;
188
189  /**
190    * @default Indicates is compress native libs
191    * @since 7
192    * @SysCap SystemCapability.Appexecfwk
193    */
194  readonly isCompressNativeLibs: boolean;
195
196  /**
197    * @default Obtains configuration information about an module
198    * @since 7
199    * @SysCap SystemCapability.Appexecfwk
200    */
201  readonly hapModuleInfo: Array<HapModuleInfo>;
202
203  /**
204    * @default Indicates entry module name
205    * @since 7
206    * @SysCap SystemCapability.Appexecfwk
207    */
208  readonly entryModuleName: string;
209
210  /**
211    * @default Indicates the cpuAbi information of this bundle.
212    * @since 7
213    * @SysCap SystemCapability.Appexecfwk
214    */
215  readonly cpuAbi: string;
216
217  /**
218    * @default Indicates is silent installation
219    * @since 7
220    * @SysCap SystemCapability.Appexecfwk
221    */
222  readonly isSilentInstallation: string;
223
224  /**
225    * @default Indicates the earliest historical version compatible with the bundle
226    * @since 7
227    * @SysCap SystemCapability.Appexecfwk
228    */
229  readonly minCompatibleVersionCode: number;
230
231  /**
232    * @default Indicates whether free installation of the entry is supported
233    * @since 7
234    * @SysCap SystemCapability.Appexecfwk
235    */
236  readonly entryInstallationFree: boolean;
237}
238